Skip to content

Commit

Permalink
Delete a few unused constants
Browse files Browse the repository at this point in the history
llvm/llvm-project#66576 makes std::string's ctor
constexpr if it's short enough to fit in the short-string optimization.

This allows the compiler to realize that these are unused. Deleting them
is necessary to be able to update libc++.

(Relying on std::string's ctor to be constexpr for storage isn't allowed
per standard, see discussion on the pull request above.)

Bug: none
Change-Id: I860e1c67a7c15342901814dafbab262672c0d45a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4935335
Reviewed-by: Hans Wennborg <hans@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1208958}
  • Loading branch information
nico authored and Chromium LUCI CQ committed Oct 12, 2023
1 parent 49427de commit 879cb86
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 15 deletions.
3 changes: 3 additions & 0 deletions base/command_line_unittest.cc
Expand Up @@ -34,12 +34,15 @@

namespace base {

#if BUILDFLAG(IS_WIN)
// To test Windows quoting behavior, we use a string that has some backslashes
// and quotes.
// Consider the command-line argument: q\"bs1\bs2\\bs3q\\\"
// Here it is with C-style escapes.
static const CommandLine::StringType kTrickyQuoted =
FILE_PATH_LITERAL("q\\\"bs1\\bs2\\\\bs3q\\\\\\\"");
#endif

// It should be parsed by Windows as: q"bs1\bs2\\bs3q\"
// Here that is with C-style escapes.
static const CommandLine::StringType kTricky =
Expand Down
Expand Up @@ -53,7 +53,6 @@ const std::string kExpectedStopTrackingPostData =
const std::string kTestTrackingUrl = "www.foo.com";
const std::string kTestTrackingId = "xyz";
const std::string kTestSourcePageDomain = "www.abc.com";
const std::string kDeleteHttpMethod = "DELETE";

std::vector<commerce::ParcelIdentifier> GetTestParcelIdentifiers() {
commerce::ParcelIdentifier identifier;
Expand Down
Expand Up @@ -23,7 +23,6 @@ namespace leveldb_proto {
namespace {

const std::string kDefaultClientName = "client";
const std::string kDefaultClientName2 = "client_2";

// Example struct defined by clients that can be used instead of protos.
struct ClientStruct {
Expand Down
11 changes: 0 additions & 11 deletions components/omnibox/browser/autocomplete_result_unittest.cc
Expand Up @@ -70,17 +70,6 @@ struct AutocompleteMatchTestData {
AutocompleteMatch::Type type;
};

const AutocompleteMatchTestData kVerbatimMatches[] = {
{"http://search-what-you-typed/",
AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED},
{"http://url-what-you-typed/", AutocompleteMatchType::URL_WHAT_YOU_TYPED},
};

const AutocompleteMatchTestData kNonVerbatimMatches[] = {
{"http://search-history/", AutocompleteMatchType::SEARCH_HISTORY},
{"http://history-title/", AutocompleteMatchType::HISTORY_TITLE},
};

// Adds |count| AutocompleteMatches to |matches|.
template <typename T>
void PopulateAutocompleteMatchesFromTestData(const T* data,
Expand Down
1 change: 0 additions & 1 deletion net/url_request/url_request_unittest.cc
Expand Up @@ -195,7 +195,6 @@ namespace test_default {
#include "net/http/transport_security_state_static_unittest_default.h"
}

const std::u16string kChrome(u"chrome");
const std::u16string kSecret(u"secret");
const std::u16string kUser(u"user");

Expand Down
1 change: 0 additions & 1 deletion storage/browser/blob/blob_memory_controller_unittest.cc
Expand Up @@ -27,7 +27,6 @@ using base::TestSimpleTaskRunner;
using ItemState = ShareableBlobDataItem::State;
using QuotaAllocationTask = BlobMemoryController::QuotaAllocationTask;

const std::string kBlobStorageDirectory = "blob_storage";
const size_t kTestBlobStorageIPCThresholdBytes = 20;
const size_t kTestBlobStorageMaxSharedMemoryBytes = 50;
const size_t kTestBlobStorageMaxBlobMemorySize = 500;
Expand Down

0 comments on commit 879cb86

Please sign in to comment.