diff options
22 files changed, 132 insertions, 222 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index fb1fa98..04cea10 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -1037,7 +1037,6 @@ def _CommonChecks(input_api, output_api): results.extend(_CheckForAnonymousVariables(input_api, output_api)) results.extend(_CheckCygwinShell(input_api, output_api)) results.extend(_CheckJavaStyle(input_api, output_api)) - results.extend(_CheckForString16(input_api, output_api)) if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): results.extend(input_api.canned_checks.RunUnitTestsInDirectory( @@ -1180,55 +1179,6 @@ def _CheckForInvalidOSMacros(input_api, output_api): 'or add your macro to src/PRESUBMIT.py.', bad_macros)] -def _CheckForString16InFile(input_api, f): - """Check for string16 without base:: in front.""" - reg = input_api.re.compile(r'\b(?<!base::)string16\b') - use = 'using base::string16;' - include = '#include "base/strings/string16.h"' - results = [] - for lnum, line in f.ChangedContents(): - if reg.search(line) and not include in line and not use in f.NewContents(): - results.append(' %s:%d' % (f.LocalPath(), lnum)) - return results - - -def _CheckForString16(input_api, output_api): - file_filter = lambda f: input_api.FilterSourceFile(f, - white_list=( - r'^android_webview[\\\/]', - r'^apps[\\\/]', - r'^ash[\\\/]', - r'^chrome[\\\/]', - r'^chrome_frame[\\\/]', - r'^chromeos[\\\/]', - r'^components[\\\/]', - r'^content[\\\/]', - r'^device[\\\/]', - r'^ipc[\\\/]', - r'^net[\\\/]', - r'^ppapi[\\\/]', - r'^printing[\\\/]', - r'^rlz[\\\/]', - r'^skia[\\\/]', - r'^tools[\\\/]', - r'^ui[\\\/]', - r'^webkit[\\\/]', - r'^win8[\\\/]', - ), - black_list=(_EXCLUDED_PATHS + _TEST_CODE_EXCLUDED_PATHS + - input_api.DEFAULT_BLACK_LIST)) - - unprefixed = [] - for f in input_api.AffectedFiles(file_filter=file_filter): - unprefixed.extend(_CheckForString16InFile(input_api, f)) - - if not unprefixed: - return [] - - return [output_api.PresubmitPromptWarning( - 'string16 should be prefixed with base:: namespace.', unprefixed)] - - def CheckChangeOnUpload(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index 9c455e9..1c7990c 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py @@ -393,46 +393,6 @@ class InvalidOSMacroNamesTest(unittest.TestCase): self.assertEqual(0, len(errors)) -class String16Test(unittest.TestCase): - def testUnprefixedGivesWarnings(self): - lines = ['string16 GetName() const;', - 'void SetName(const string16& name) OVERRIDE {}', - 'const string16& GetNameRef() const = 0;', - 'string16 name;', - 'string16 foo = ASCIIToUTF16("bar");', - 'string16 blah(ASCIIToUTF16("blee"));', - 'std::vector<string16> names;', - 'string16 var_with_string16_in_name;'] - warnings = PRESUBMIT._CheckForString16InFile( - MockInputApi(), MockFile('chrome/browser/name_getter_bad.cc', lines)) - self.assertEqual(len(lines), len(warnings)) - - def testPrefixedSkipped(self): - lines = ['#include "base/strings/string16.h"', - 'void SetName(const base::string16& name) OVERRIDE {}', - 'const base::string16& GetNameRef() const = 0;', - 'base::string16 name;', - 'base::string16 foo = ASCIIToUTF16("bar");', - 'base::string16 blah(ASCIIToUTF16("blee"));', - 'std::vector<base::string16> names;', - 'base::string16 var_with_string16_in_name;'] - warnings = PRESUBMIT._CheckForString16InFile( - MockInputApi(), MockFile('chrome/browser/name_getter_good.cc', lines)) - self.assertEqual(0, len(warnings)) - - def testUsingYieldsNoWarnings(self): - lines = ['#include "base/strings/string16.h', - 'namespace {', - 'using base::string16;', - 'string16 SayHiOnlyToEd(const string16& name) {', - ' string16 first = name.substr(0, 2); // Only "Ed" gets a "Hi".', - ' return first == "Ed" ? first : string16();', - '}'] - warnings = PRESUBMIT._CheckForString16InFile( - MockInputApi(), MockFile('chrome/browser/say_hi_to_ed.cc', lines)) - self.assertEqual(0, len(warnings)) - - class CheckAddedDepsHaveTetsApprovalsTest(unittest.TestCase): def testDepsFilesToCheck(self): changed_lines = [ diff --git a/base/file_version_info_mac.h b/base/file_version_info_mac.h index f488cce..f0edb3a 100644 --- a/base/file_version_info_mac.h +++ b/base/file_version_info_mac.h @@ -23,27 +23,27 @@ class FileVersionInfoMac : public FileVersionInfo { // Accessors to the different version properties. // Returns an empty string if the property is not found. - virtual string16 company_name() OVERRIDE; - virtual string16 company_short_name() OVERRIDE; - virtual string16 product_name() OVERRIDE; - virtual string16 product_short_name() OVERRIDE; - virtual string16 internal_name() OVERRIDE; - virtual string16 product_version() OVERRIDE; - virtual string16 private_build() OVERRIDE; - virtual string16 special_build() OVERRIDE; - virtual string16 comments() OVERRIDE; - virtual string16 original_filename() OVERRIDE; - virtual string16 file_description() OVERRIDE; - virtual string16 file_version() OVERRIDE; - virtual string16 legal_copyright() OVERRIDE; - virtual string16 legal_trademarks() OVERRIDE; - virtual string16 last_change() OVERRIDE; + virtual base::string16 company_name() OVERRIDE; + virtual base::string16 company_short_name() OVERRIDE; + virtual base::string16 product_name() OVERRIDE; + virtual base::string16 product_short_name() OVERRIDE; + virtual base::string16 internal_name() OVERRIDE; + virtual base::string16 product_version() OVERRIDE; + virtual base::string16 private_build() OVERRIDE; + virtual base::string16 special_build() OVERRIDE; + virtual base::string16 comments() OVERRIDE; + virtual base::string16 original_filename() OVERRIDE; + virtual base::string16 file_description() OVERRIDE; + virtual base::string16 file_version() OVERRIDE; + virtual base::string16 legal_copyright() OVERRIDE; + virtual base::string16 legal_trademarks() OVERRIDE; + virtual base::string16 last_change() OVERRIDE; virtual bool is_official_build() OVERRIDE; private: - // Returns a string16 value for a property name. + // Returns a base::string16 value for a property name. // Returns the empty string if the property does not exist. - string16 GetString16Value(CFStringRef name); + base::string16 GetString16Value(CFStringRef name); base::scoped_nsobject<NSBundle> bundle_; diff --git a/base/file_version_info_mac.mm b/base/file_version_info_mac.mm index 0c6f8d4..3b5a8ba 100644 --- a/base/file_version_info_mac.mm +++ b/base/file_version_info_mac.mm @@ -31,35 +31,35 @@ FileVersionInfo* FileVersionInfo::CreateFileVersionInfo( return new FileVersionInfoMac(bundle); } -string16 FileVersionInfoMac::company_name() { - return string16(); +base::string16 FileVersionInfoMac::company_name() { + return base::string16(); } -string16 FileVersionInfoMac::company_short_name() { - return string16(); +base::string16 FileVersionInfoMac::company_short_name() { + return base::string16(); } -string16 FileVersionInfoMac::internal_name() { - return string16(); +base::string16 FileVersionInfoMac::internal_name() { + return base::string16(); } -string16 FileVersionInfoMac::product_name() { +base::string16 FileVersionInfoMac::product_name() { return GetString16Value(kCFBundleNameKey); } -string16 FileVersionInfoMac::product_short_name() { +base::string16 FileVersionInfoMac::product_short_name() { return GetString16Value(kCFBundleNameKey); } -string16 FileVersionInfoMac::comments() { - return string16(); +base::string16 FileVersionInfoMac::comments() { + return base::string16(); } -string16 FileVersionInfoMac::legal_copyright() { +base::string16 FileVersionInfoMac::legal_copyright() { return GetString16Value(CFSTR("CFBundleGetInfoString")); } -string16 FileVersionInfoMac::product_version() { +base::string16 FileVersionInfoMac::product_version() { // On OS X, CFBundleVersion is used by LaunchServices, and must follow // specific formatting rules, so the four-part Chrome version is in // CFBundleShortVersionString. On iOS, however, CFBundleVersion can be the @@ -72,31 +72,31 @@ string16 FileVersionInfoMac::product_version() { #endif // defined(OS_IOS) } -string16 FileVersionInfoMac::file_description() { - return string16(); +base::string16 FileVersionInfoMac::file_description() { + return base::string16(); } -string16 FileVersionInfoMac::legal_trademarks() { - return string16(); +base::string16 FileVersionInfoMac::legal_trademarks() { + return base::string16(); } -string16 FileVersionInfoMac::private_build() { - return string16(); +base::string16 FileVersionInfoMac::private_build() { + return base::string16(); } -string16 FileVersionInfoMac::file_version() { +base::string16 FileVersionInfoMac::file_version() { return product_version(); } -string16 FileVersionInfoMac::original_filename() { +base::string16 FileVersionInfoMac::original_filename() { return GetString16Value(kCFBundleNameKey); } -string16 FileVersionInfoMac::special_build() { - return string16(); +base::string16 FileVersionInfoMac::special_build() { + return base::string16(); } -string16 FileVersionInfoMac::last_change() { +base::string16 FileVersionInfoMac::last_change() { return GetString16Value(CFSTR("SCMRevision")); } @@ -108,7 +108,7 @@ bool FileVersionInfoMac::is_official_build() { #endif } -string16 FileVersionInfoMac::GetString16Value(CFStringRef name) { +base::string16 FileVersionInfoMac::GetString16Value(CFStringRef name) { if (bundle_) { NSString *ns_name = base::mac::CFToNSCast(name); NSString* value = [bundle_ objectForInfoDictionaryKey:ns_name]; @@ -116,5 +116,5 @@ string16 FileVersionInfoMac::GetString16Value(CFStringRef name) { return base::SysNSStringToUTF16(value); } } - return string16(); + return base::string16(); } diff --git a/base/file_version_info_win.cc b/base/file_version_info_win.cc index 80dbaea..5f33d14 100644 --- a/base/file_version_info_win.cc +++ b/base/file_version_info_win.cc @@ -81,63 +81,63 @@ FileVersionInfo* FileVersionInfo::CreateFileVersionInfo( } } -string16 FileVersionInfoWin::company_name() { +base::string16 FileVersionInfoWin::company_name() { return GetStringValue(L"CompanyName"); } -string16 FileVersionInfoWin::company_short_name() { +base::string16 FileVersionInfoWin::company_short_name() { return GetStringValue(L"CompanyShortName"); } -string16 FileVersionInfoWin::internal_name() { +base::string16 FileVersionInfoWin::internal_name() { return GetStringValue(L"InternalName"); } -string16 FileVersionInfoWin::product_name() { +base::string16 FileVersionInfoWin::product_name() { return GetStringValue(L"ProductName"); } -string16 FileVersionInfoWin::product_short_name() { +base::string16 FileVersionInfoWin::product_short_name() { return GetStringValue(L"ProductShortName"); } -string16 FileVersionInfoWin::comments() { +base::string16 FileVersionInfoWin::comments() { return GetStringValue(L"Comments"); } -string16 FileVersionInfoWin::legal_copyright() { +base::string16 FileVersionInfoWin::legal_copyright() { return GetStringValue(L"LegalCopyright"); } -string16 FileVersionInfoWin::product_version() { +base::string16 FileVersionInfoWin::product_version() { return GetStringValue(L"ProductVersion"); } -string16 FileVersionInfoWin::file_description() { +base::string16 FileVersionInfoWin::file_description() { return GetStringValue(L"FileDescription"); } -string16 FileVersionInfoWin::legal_trademarks() { +base::string16 FileVersionInfoWin::legal_trademarks() { return GetStringValue(L"LegalTrademarks"); } -string16 FileVersionInfoWin::private_build() { +base::string16 FileVersionInfoWin::private_build() { return GetStringValue(L"PrivateBuild"); } -string16 FileVersionInfoWin::file_version() { +base::string16 FileVersionInfoWin::file_version() { return GetStringValue(L"FileVersion"); } -string16 FileVersionInfoWin::original_filename() { +base::string16 FileVersionInfoWin::original_filename() { return GetStringValue(L"OriginalFilename"); } -string16 FileVersionInfoWin::special_build() { +base::string16 FileVersionInfoWin::special_build() { return GetStringValue(L"SpecialBuild"); } -string16 FileVersionInfoWin::last_change() { +base::string16 FileVersionInfoWin::last_change() { return GetStringValue(L"LastChange"); } diff --git a/base/file_version_info_win.h b/base/file_version_info_win.h index a378577..faacaa2 100644 --- a/base/file_version_info_win.h +++ b/base/file_version_info_win.h @@ -22,21 +22,21 @@ class FileVersionInfoWin : public FileVersionInfo { // Accessors to the different version properties. // Returns an empty string if the property is not found. - virtual string16 company_name() OVERRIDE; - virtual string16 company_short_name() OVERRIDE; - virtual string16 product_name() OVERRIDE; - virtual string16 product_short_name() OVERRIDE; - virtual string16 internal_name() OVERRIDE; - virtual string16 product_version() OVERRIDE; - virtual string16 private_build() OVERRIDE; - virtual string16 special_build() OVERRIDE; - virtual string16 comments() OVERRIDE; - virtual string16 original_filename() OVERRIDE; - virtual string16 file_description() OVERRIDE; - virtual string16 file_version() OVERRIDE; - virtual string16 legal_copyright() OVERRIDE; - virtual string16 legal_trademarks() OVERRIDE; - virtual string16 last_change() OVERRIDE; + virtual base::string16 company_name() OVERRIDE; + virtual base::string16 company_short_name() OVERRIDE; + virtual base::string16 product_name() OVERRIDE; + virtual base::string16 product_short_name() OVERRIDE; + virtual base::string16 internal_name() OVERRIDE; + virtual base::string16 product_version() OVERRIDE; + virtual base::string16 private_build() OVERRIDE; + virtual base::string16 special_build() OVERRIDE; + virtual base::string16 comments() OVERRIDE; + virtual base::string16 original_filename() OVERRIDE; + virtual base::string16 file_description() OVERRIDE; + virtual base::string16 file_version() OVERRIDE; + virtual base::string16 legal_copyright() OVERRIDE; + virtual base::string16 legal_trademarks() OVERRIDE; + virtual base::string16 last_change() OVERRIDE; virtual bool is_official_build() OVERRIDE; // Lets you access other properties not covered above. diff --git a/base/strings/string16.h b/base/strings/string16.h index 59b2a05..804dca4 100644 --- a/base/strings/string16.h +++ b/base/strings/string16.h @@ -181,8 +181,4 @@ class BASE_EXPORT std::basic_string<base::char16, base::string16_char_traits>; #endif // WCHAR_T_IS_UTF32 -// TODO(brettw) update users of string16 to use the namespace and remove -// this "using". -using base::string16; - #endif // BASE_STRINGS_STRING16_H_ diff --git a/base/test/test_process_killer_win.cc b/base/test/test_process_killer_win.cc index 5e9cc52..bb73251 100644 --- a/base/test/test_process_killer_win.cc +++ b/base/test/test_process_killer_win.cc @@ -38,7 +38,7 @@ static bool GetQIP(NtQueryInformationProcess** qip_func_ptr) { } // Get the command line of a process -bool GetCommandLineForProcess(uint32 process_id, string16* cmd_line) { +bool GetCommandLineForProcess(uint32 process_id, base::string16* cmd_line) { DCHECK(process_id != 0); DCHECK(cmd_line); @@ -93,7 +93,7 @@ bool GetCommandLineForProcess(uint32 process_id, string16* cmd_line) { // Copy all the process parameters into a buffer. bool success = false; - string16 buffer; + base::string16 buffer; if (process_params_address) { SIZE_T bytes_read; RTL_USER_PROCESS_PARAMETERS params = { 0 }; @@ -130,28 +130,28 @@ bool GetCommandLineForProcess(uint32 process_id, string16* cmd_line) { // Used to filter processes by process ID. class ArgumentFilter : public base::ProcessFilter { public: - explicit ArgumentFilter(const string16& argument) + explicit ArgumentFilter(const base::string16& argument) : argument_to_find_(argument) {} // Returns true to indicate set-inclusion and false otherwise. This method // should not have side-effects and should be idempotent. virtual bool Includes(const base::ProcessEntry& entry) const { bool found = false; - string16 command_line; + base::string16 command_line; if (GetCommandLineForProcess(entry.pid(), &command_line)) { - string16::const_iterator it = + base::string16::const_iterator it = std::search(command_line.begin(), command_line.end(), argument_to_find_.begin(), argument_to_find_.end(), - base::CaseInsensitiveCompareASCII<wchar_t>()); + base::CaseInsensitiveCompareASCII<wchar_t>()); found = (it != command_line.end()); } return found; } protected: - string16 argument_to_find_; + base::string16 argument_to_find_; }; } // namespace diff --git a/base/test/test_reg_util_win.cc b/base/test/test_reg_util_win.cc index f33fa61..3c5753e 100644 --- a/base/test/test_reg_util_win.cc +++ b/base/test/test_reg_util_win.cc @@ -18,7 +18,8 @@ namespace { const wchar_t kTimestampDelimiter[] = L"$"; const wchar_t kTempTestKeyPath[] = L"Software\\Chromium\\TempTestKeys"; -void DeleteStaleTestKeys(const base::Time& now, const string16& test_key_root) { +void DeleteStaleTestKeys(const base::Time& now, + const base::string16& test_key_root) { base::win::RegKey test_root_key; if (test_root_key.Open(HKEY_CURRENT_USER, test_key_root.c_str(), @@ -30,9 +31,9 @@ void DeleteStaleTestKeys(const base::Time& now, const string16& test_key_root) { base::win::RegistryKeyIterator iterator_test_root_key(HKEY_CURRENT_USER, test_key_root.c_str()); for (; iterator_test_root_key.Valid(); ++iterator_test_root_key) { - string16 key_name = iterator_test_root_key.Name(); - std::vector<string16> tokens; - Tokenize(key_name, string16(kTimestampDelimiter), &tokens); + base::string16 key_name = iterator_test_root_key.Name(); + std::vector<base::string16> tokens; + Tokenize(key_name, base::string16(kTimestampDelimiter), &tokens); int64 key_name_as_number = 0; if (!base::StringToInt64(tokens[0], &key_name_as_number)) { @@ -48,9 +49,9 @@ void DeleteStaleTestKeys(const base::Time& now, const string16& test_key_root) { } } -string16 GenerateTempKeyPath(const string16& test_key_root, - const base::Time& timestamp) { - string16 key_path = test_key_root; +base::string16 GenerateTempKeyPath(const base::string16& test_key_root, + const base::Time& timestamp) { + base::string16 key_path = test_key_root; key_path += L"\\" + base::Int64ToString16(timestamp.ToInternalValue()); key_path += kTimestampDelimiter + base::ASCIIToWide(base::GenerateGUID()); @@ -61,7 +62,7 @@ string16 GenerateTempKeyPath(const string16& test_key_root, RegistryOverrideManager::ScopedRegistryKeyOverride::ScopedRegistryKeyOverride( HKEY override, - const string16& key_path) + const base::string16& key_path) : override_(override) { EXPECT_EQ( ERROR_SUCCESS, @@ -81,8 +82,9 @@ RegistryOverrideManager::RegistryOverrideManager() DeleteStaleTestKeys(timestamp_, test_key_root_); } -RegistryOverrideManager::RegistryOverrideManager(const base::Time& timestamp, - const string16& test_key_root) +RegistryOverrideManager::RegistryOverrideManager( + const base::Time& timestamp, + const base::string16& test_key_root) : timestamp_(timestamp), test_key_root_(test_key_root) { DeleteStaleTestKeys(timestamp_, test_key_root_); } @@ -91,13 +93,14 @@ RegistryOverrideManager::~RegistryOverrideManager() {} void RegistryOverrideManager::OverrideRegistry( HKEY override, - const string16& /*override_name*/) { - string16 key_path = GenerateTempKeyPath(test_key_root_, timestamp_); + const base::string16& /*override_name*/) { + base::string16 key_path = GenerateTempKeyPath(test_key_root_, timestamp_); overrides_.push_back(new ScopedRegistryKeyOverride(override, key_path)); } -string16 GenerateTempKeyPath() { - return GenerateTempKeyPath(string16(kTempTestKeyPath), base::Time::Now()); +base::string16 GenerateTempKeyPath() { + return GenerateTempKeyPath(base::string16(kTempTestKeyPath), + base::Time::Now()); } } // namespace registry_util diff --git a/base/test/test_reg_util_win.h b/base/test/test_reg_util_win.h index 5315b66..6ef6096 100644 --- a/base/test/test_reg_util_win.h +++ b/base/test/test_reg_util_win.h @@ -38,7 +38,7 @@ class RegistryOverrideManager { // under the temporary test key path. There is no need to randomize // |override_name|, as a random parent key is generated. Multiple overrides to // the same hive are not supported and lead to undefined behavior. - void OverrideRegistry(HKEY override, const string16& override_name); + void OverrideRegistry(HKEY override, const base::string16& override_name); private: friend class RegistryOverrideManagerTest; @@ -46,7 +46,7 @@ class RegistryOverrideManager { // Keeps track of one override. class ScopedRegistryKeyOverride { public: - ScopedRegistryKeyOverride(HKEY override, const string16& key_path); + ScopedRegistryKeyOverride(HKEY override, const base::string16& key_path); ~ScopedRegistryKeyOverride(); private: @@ -58,12 +58,12 @@ class RegistryOverrideManager { // Used for testing only. RegistryOverrideManager(const base::Time& timestamp, - const string16& test_key_root); + const base::string16& test_key_root); base::Time timestamp_; - string16 guid_; + base::string16 guid_; - string16 test_key_root_; + base::string16 test_key_root_; ScopedVector<ScopedRegistryKeyOverride> overrides_; DISALLOW_COPY_AND_ASSIGN(RegistryOverrideManager); @@ -71,7 +71,7 @@ class RegistryOverrideManager { // Generates a temporary key path that will be eventually deleted // automatically if the process crashes. -string16 GenerateTempKeyPath(); +base::string16 GenerateTempKeyPath(); } // namespace registry_util diff --git a/base/test/test_reg_util_win_unittest.cc b/base/test/test_reg_util_win_unittest.cc index 25f341f..6f2e3fe 100644 --- a/base/test/test_reg_util_win_unittest.cc +++ b/base/test/test_reg_util_win_unittest.cc @@ -37,27 +37,27 @@ class RegistryOverrideManagerTest : public testing::Test { key.DeleteKey(fake_test_key_root_.c_str()); } - void AssertKeyExists(const string16& key_path) { + void AssertKeyExists(const base::string16& key_path) { base::win::RegKey key; ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_READ)) << key_path << " does not exist."; } - void AssertKeyAbsent(const string16& key_path) { + void AssertKeyAbsent(const base::string16& key_path) { base::win::RegKey key; ASSERT_NE(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_READ)) << key_path << " exists but it should not."; } - void CreateKey(const string16& key_path) { + void CreateKey(const base::string16& key_path) { base::win::RegKey key; EXPECT_EQ(ERROR_SUCCESS, key.Create(HKEY_CURRENT_USER, key_path.c_str(), KEY_ALL_ACCESS)); } - string16 FakeOverrideManagerPath(const base::Time& time) { + base::string16 FakeOverrideManagerPath(const base::Time& time) { return fake_test_key_root_ + L"\\" + base::Int64ToString16(time.ToInternalValue()); } @@ -67,7 +67,7 @@ class RegistryOverrideManagerTest : public testing::Test { manager_->OverrideRegistry(HKEY_CURRENT_USER, L"override_manager_unittest"); } - string16 fake_test_key_root_; + base::string16 fake_test_key_root_; scoped_ptr<RegistryOverrideManager> manager_; }; @@ -101,14 +101,14 @@ TEST_F(RegistryOverrideManagerTest, DeleteStaleKeys) { base::Time::Exploded kTestTimeExploded = {2013, 11, 1, 4, 0, 0, 0, 0}; base::Time kTestTime = base::Time::FromUTCExploded(kTestTimeExploded); - string16 path_garbage = fake_test_key_root_ + L"\\Blah"; - string16 path_very_stale = + base::string16 path_garbage = fake_test_key_root_ + L"\\Blah"; + base::string16 path_very_stale = FakeOverrideManagerPath(kTestTime - base::TimeDelta::FromDays(100)); - string16 path_stale = + base::string16 path_stale = FakeOverrideManagerPath(kTestTime - base::TimeDelta::FromDays(5)); - string16 path_current = + base::string16 path_current = FakeOverrideManagerPath(kTestTime - base::TimeDelta::FromMinutes(1)); - string16 path_future = + base::string16 path_future = FakeOverrideManagerPath(kTestTime + base::TimeDelta::FromMinutes(1)); CreateKey(path_garbage); diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc index a5f63b3..0188ed1 100644 --- a/chrome/browser/autocomplete/history_url_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc @@ -1006,7 +1006,7 @@ TEST_F(HistoryURLProviderTest, HUPScoringExperiment) { autocomplete_->scoring_params_.experimental_scoring_enabled = false; ASSERT_NO_FATAL_FAILURE( RunTest(ASCIIToUTF16(test_cases[i].input), - string16(), false, output, max_matches)); + base::string16(), false, output, max_matches)); for (int j = 0; j < max_matches; ++j) { EXPECT_EQ(test_cases[i].matches[j].control_relevance, matches_[j].relevance); @@ -1016,7 +1016,7 @@ TEST_F(HistoryURLProviderTest, HUPScoringExperiment) { autocomplete_->scoring_params_.experimental_scoring_enabled = true; ASSERT_NO_FATAL_FAILURE( RunTest(ASCIIToUTF16(test_cases[i].input), - string16(), false, output, max_matches)); + base::string16(), false, output, max_matches)); for (int j = 0; j < max_matches; ++j) { EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, matches_[j].relevance); diff --git a/chrome/browser/chromeos/login/oauth2_browsertest.cc b/chrome/browser/chromeos/login/oauth2_browsertest.cc index d2b0171..100a402 100644 --- a/chrome/browser/chromeos/login/oauth2_browsertest.cc +++ b/chrome/browser/chromeos/login/oauth2_browsertest.cc @@ -587,7 +587,7 @@ IN_PROC_BROWSER_TEST_F(MergeSessionTest, MergeSessionThrottle) { ASSERT_FALSE(fake_google_.was_page_sent()); // Check that throttle page is displayed instead. - string16 title; + base::string16 title; ui_test_utils::GetCurrentTabTitle(browser, &title); LOG(WARNING) << "Loaded page at the start : " << title; // ui_test_utils::GetCurrentTabTitle(browser, &title); diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc index 5b9ab48..00b3442 100644 --- a/content/browser/android/content_view_core_impl.cc +++ b/content/browser/android/content_view_core_impl.cc @@ -1659,7 +1659,8 @@ void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env, GetWebContents()->GetRoutingID(), rect)); } -void ContentViewCoreImpl::OnSmartClipDataExtracted(const string16& result) { +void ContentViewCoreImpl::OnSmartClipDataExtracted( + const base::string16& result) { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) diff --git a/content/browser/android/content_view_core_impl.h b/content/browser/android/content_view_core_impl.h index 0ef9070..d6b7a1a5 100644 --- a/content/browser/android/content_view_core_impl.h +++ b/content/browser/android/content_view_core_impl.h @@ -238,7 +238,7 @@ class ContentViewCoreImpl : public ContentViewCore, // Public methods that call to Java via JNI // -------------------------------------------------------------------------- - void OnSmartClipDataExtracted(const string16& result); + void OnSmartClipDataExtracted(const base::string16& result); // Creates a popup menu with |items|. // |multiple| defines if it should support multi-select. diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index c311d2d..8e641cc 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc @@ -511,7 +511,7 @@ void RenderWidgetHostViewAndroid::OnStartContentIntent( } void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( - const string16& result) { + const base::string16& result) { // Custom serialization over IPC isn't allowed normally for security reasons. // Since this feature is only used in (single-process) WebView, there are no // security issues. Enforce that it's only called in single process mode. diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h index 45e3451..15213ee 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.h +++ b/content/browser/renderer_host/render_widget_host_view_android.h @@ -215,7 +215,7 @@ class RenderWidgetHostViewAndroid void OnDidChangeBodyBackgroundColor(SkColor color); void OnStartContentIntent(const GURL& content_url); void OnSetNeedsBeginFrame(bool enabled); - void OnSmartClipDataExtracted(const string16& result); + void OnSmartClipDataExtracted(const base::string16& result); void LockResources(); void UnlockResources(); diff --git a/content/common/view_messages.h b/content/common/view_messages.h index 791920a..561928f 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -1953,7 +1953,8 @@ IPC_MESSAGE_ROUTED0(ViewHostMsg_SelectRange_ACK) IPC_MESSAGE_ROUTED0(ViewHostMsg_MoveCaret_ACK) // Notification that the text selection has changed. -// Note: The secound parameter is the character based offset of the string16 +// Note: The secound parameter is the character based offset of the +// base::string16 // text in the document. IPC_MESSAGE_ROUTED3(ViewHostMsg_SelectionChanged, base::string16 /* text covers the selection range */, @@ -2308,8 +2309,7 @@ IPC_MESSAGE_ROUTED1(ViewHostMsg_SetNeedsBeginFrame, // instead of encoding the data as a string which is not allowed normally. Since // ths is only used in Android WebView, it's allowed temporarily. // http://crbug.com/330872 -IPC_MESSAGE_ROUTED1(ViewHostMsg_SmartClipDataExtracted, - string16) +IPC_MESSAGE_ROUTED1(ViewHostMsg_SmartClipDataExtracted, base::string16) #elif defined(OS_MACOSX) // Request that the browser load a font into shared memory for us. diff --git a/sandbox/win/src/handle_closer_agent.cc b/sandbox/win/src/handle_closer_agent.cc index 97dfb17..be0ffc1 100644 --- a/sandbox/win/src/handle_closer_agent.cc +++ b/sandbox/win/src/handle_closer_agent.cc @@ -88,7 +88,7 @@ bool HandleCloserAgent::CloseHandles() { 32 * sizeof(wchar_t)); OBJECT_TYPE_INFORMATION* type_info = reinterpret_cast<OBJECT_TYPE_INFORMATION*>(&(type_info_buffer[0])); - string16 handle_name; + base::string16 handle_name; HANDLE handle = NULL; int invalid_count = 0; diff --git a/ui/base/cocoa/menu_controller.h b/ui/base/cocoa/menu_controller.h index 2082ab3..b8d8ed0 100644 --- a/ui/base/cocoa/menu_controller.h +++ b/ui/base/cocoa/menu_controller.h @@ -35,8 +35,8 @@ UI_EXPORT // |-initWithModel:useWithPopUpButtonCell:| or after the first call to |-menu|. @property(nonatomic) BOOL useWithPopUpButtonCell; -+ (string16)elideMenuTitle:(const base::string16&)title - toWidth:(int)width; ++ (base::string16)elideMenuTitle:(const base::string16&)title + toWidth:(int)width; // NIB-based initializer. This does not create a menu. Clients can set the // properties of the object and the menu will be created upon the first call to diff --git a/ui/base/cocoa/menu_controller.mm b/ui/base/cocoa/menu_controller.mm index 787f171..8f03d0f 100644 --- a/ui/base/cocoa/menu_controller.mm +++ b/ui/base/cocoa/menu_controller.mm @@ -25,8 +25,8 @@ @synthesize model = model_; @synthesize useWithPopUpButtonCell = useWithPopUpButtonCell_; -+ (string16)elideMenuTitle:(const base::string16&)title - toWidth:(int)width { ++ (base::string16)elideMenuTitle:(const base::string16&)title + toWidth:(int)width { NSFont* nsfont = [NSFont menuBarFontOfSize:0]; // 0 means "default" return gfx::ElideText(title, gfx::FontList(gfx::Font(nsfont)), width, gfx::ELIDE_AT_END); diff --git a/ui/message_center/cocoa/notification_controller.mm b/ui/message_center/cocoa/notification_controller.mm index a2e8141..ade983f 100644 --- a/ui/message_center/cocoa/notification_controller.mm +++ b/ui/message_center/cocoa/notification_controller.mm @@ -227,8 +227,8 @@ // more than the given number of lines. The wrapped text would be painted using // the given font. The Ellipsis could be added at the end of the last line if // it is too long. -- (string16)wrapText:(const base::string16&)text - forFont:(NSFont*)font +- (base::string16)wrapText:(const base::string16&)text + forFont:(NSFont*)font maxNumberOfLines:(size_t)lines; @end @@ -724,8 +724,8 @@ return contentFrame; } -- (string16)wrapText:(const base::string16&)text - forFont:(NSFont*)nsfont +- (base::string16)wrapText:(const base::string16&)text + forFont:(NSFont*)nsfont maxNumberOfLines:(size_t)lines { if (text.empty()) return text; |