diff options
| author | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 14:22:07 +0000 |
|---|---|---|
| committer | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 14:22:07 +0000 |
| commit | 7e49ad360632304e1890082e1605b2239956afdb (patch) | |
| tree | 1e3451b1a1af73cc5996c218a2888e35f1337709 | |
| parent | facd6e7bd32c811fa8be9a065505f465396cd92e (diff) | |
| download | chromium_src-7e49ad360632304e1890082e1605b2239956afdb.zip chromium_src-7e49ad360632304e1890082e1605b2239956afdb.tar.gz chromium_src-7e49ad360632304e1890082e1605b2239956afdb.tar.bz2 | |
Move guid generation from chrome/common/ to base/.
It will be needed in webkit/dom_storage/.
BUG=NONE
TEST=Existing tests.
Review URL: https://chromiumcodereview.appspot.com/10540003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142142 0039d316-1c4b-4281-b951-d872f2087c98
42 files changed, 117 insertions, 122 deletions
diff --git a/base/base.gyp b/base/base.gyp index 08630a8..2a55f17 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -382,6 +382,7 @@ 'file_util_unittest.cc', 'file_version_info_unittest.cc', 'gmock_unittest.cc', + 'guid_unittest.cc', 'hi_res_timer_manager_unittest.cc', 'id_map_unittest.cc', 'i18n/break_iterator_unittest.cc', diff --git a/base/base.gypi b/base/base.gypi index c1962e1..2f01f53 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -139,6 +139,10 @@ 'global_descriptors_posix.cc', 'global_descriptors_posix.h', 'gtest_prod_util.h', + 'guid.cc', + 'guid.h', + 'guid_posix.cc', + 'guid_win.cc', 'hash_tables.h', 'hi_res_timer_manager_posix.cc', 'hi_res_timer_manager_win.cc', diff --git a/chrome/common/guid.cc b/base/guid.cc index a6b4b09..920dae5 100644 --- a/chrome/common/guid.cc +++ b/base/guid.cc @@ -1,13 +1,13 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/guid.h" +#include "base/guid.h" #include "base/rand_util.h" #include "base/stringprintf.h" -namespace guid { +namespace base { bool IsValidGUID(const std::string& guid) { const size_t kGUIDLength = 36U; diff --git a/chrome/common/guid.h b/base/guid.h index 9121c9e..20f7706 100644 --- a/chrome/common/guid.h +++ b/base/guid.h @@ -1,32 +1,33 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_GUID_H_ -#define CHROME_COMMON_GUID_H_ +#ifndef BASE_GUID_H_ +#define BASE_GUID_H_ #pragma once #include <string> +#include "base/base_export.h" #include "base/basictypes.h" #include "build/build_config.h" -namespace guid { +namespace base { // Generate a 128-bit random GUID of the form: "%08X-%04X-%04X-%04X-%012llX". // If GUID generation fails an empty string is returned. // The POSIX implementation uses psuedo random number generation to create // the GUID. The Windows implementation uses system services. -std::string GenerateGUID(); +BASE_EXPORT std::string GenerateGUID(); // Returns true if the input string conforms to the GUID format. -bool IsValidGUID(const std::string& guid); +BASE_EXPORT bool IsValidGUID(const std::string& guid); #if defined(OS_POSIX) // For unit testing purposes only. Do not use outside of tests. -std::string RandomDataToGUIDString(const uint64 bytes[2]); +BASE_EXPORT std::string RandomDataToGUIDString(const uint64 bytes[2]); #endif } // namespace guid -#endif // CHROME_COMMON_GUID_H_ +#endif // BASE_GUID_H_ diff --git a/chrome/common/guid_posix.cc b/base/guid_posix.cc index f21788b..89811d0 100644 --- a/chrome/common/guid_posix.cc +++ b/base/guid_posix.cc @@ -1,13 +1,13 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/guid.h" +#include "base/guid.h" #include "base/rand_util.h" #include "base/stringprintf.h" -namespace guid { +namespace base { std::string GenerateGUID() { uint64 sixteen_bytes[2] = { base::RandUint64(), base::RandUint64() }; diff --git a/chrome/common/guid_unittest.cc b/base/guid_unittest.cc index 628bafc..18c04a9 100644 --- a/chrome/common/guid_unittest.cc +++ b/base/guid_unittest.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/guid.h" +#include "base/guid.h" #include <limits> @@ -11,13 +11,13 @@ #if defined(OS_POSIX) TEST(GUIDTest, GUIDGeneratesAllZeroes) { uint64 bytes[] = { 0, 0 }; - std::string clientid = guid::RandomDataToGUIDString(bytes); + std::string clientid = base::RandomDataToGUIDString(bytes); EXPECT_EQ("00000000-0000-0000-0000-000000000000", clientid); } TEST(GUIDTest, GUIDGeneratesCorrectly) { uint64 bytes[] = { 0x0123456789ABCDEFULL, 0xFEDCBA9876543210ULL }; - std::string clientid = guid::RandomDataToGUIDString(bytes); + std::string clientid = base::RandomDataToGUIDString(bytes); EXPECT_EQ("01234567-89AB-CDEF-FEDC-BA9876543210", clientid); } #endif @@ -25,16 +25,16 @@ TEST(GUIDTest, GUIDGeneratesCorrectly) { TEST(GUIDTest, GUIDCorrectlyFormatted) { const int kIterations = 10; for (int it = 0; it < kIterations; ++it) { - std::string guid = guid::GenerateGUID(); - EXPECT_TRUE(guid::IsValidGUID(guid)); + std::string guid = base::GenerateGUID(); + EXPECT_TRUE(base::IsValidGUID(guid)); } } TEST(GUIDTest, GUIDBasicUniqueness) { const int kIterations = 10; for (int it = 0; it < kIterations; ++it) { - std::string guid1 = guid::GenerateGUID(); - std::string guid2 = guid::GenerateGUID(); + std::string guid1 = base::GenerateGUID(); + std::string guid2 = base::GenerateGUID(); EXPECT_EQ(36U, guid1.length()); EXPECT_EQ(36U, guid2.length()); EXPECT_NE(guid1, guid2); diff --git a/chrome/common/guid_win.cc b/base/guid_win.cc index 0d95cd6..1cddff8 100644 --- a/chrome/common/guid_win.cc +++ b/base/guid_win.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/guid.h" +#include "base/guid.h" #include <stdlib.h> @@ -14,7 +14,7 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" -namespace guid { +namespace base { std::string GenerateGUID() { const int kGUIDSize = 39; diff --git a/chrome/browser/autocomplete/shortcuts_provider.cc b/chrome/browser/autocomplete/shortcuts_provider.cc index 8b059d4..e9dd5a5 100644 --- a/chrome/browser/autocomplete/shortcuts_provider.cc +++ b/chrome/browser/autocomplete/shortcuts_provider.cc @@ -22,7 +22,6 @@ #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/guid.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "googleurl/src/url_parse.h" diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index 107fe64..280980b 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -13,6 +13,7 @@ #include "base/bind.h" #include "base/command_line.h" +#include "base/guid.h" #include "base/logging.h" #include "base/string16.h" #include "base/string_util.h" @@ -47,7 +48,6 @@ #include "chrome/common/autofill_messages.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/guid.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" @@ -950,11 +950,11 @@ bool AutofillManager::GetProfileOrCreditCard( GUIDPair credit_card_guid; GUIDPair profile_guid; UnpackGUIDs(unique_id, &credit_card_guid, &profile_guid); - DCHECK(!guid::IsValidGUID(credit_card_guid.first) || - !guid::IsValidGUID(profile_guid.first)); + DCHECK(!base::IsValidGUID(credit_card_guid.first) || + !base::IsValidGUID(profile_guid.first)); // Find the profile that matches the |profile_guid|, if one is specified. - if (guid::IsValidGUID(profile_guid.first)) { + if (base::IsValidGUID(profile_guid.first)) { for (std::vector<AutofillProfile*>::const_iterator iter = profiles.begin(); iter != profiles.end(); ++iter) { if ((*iter)->guid() == profile_guid.first) { @@ -968,7 +968,7 @@ bool AutofillManager::GetProfileOrCreditCard( } // Find the credit card that matches the |credit_card_guid|, if specified. - if (guid::IsValidGUID(credit_card_guid.first)) { + if (base::IsValidGUID(credit_card_guid.first)) { for (std::vector<CreditCard*>::const_iterator iter = credit_cards.begin(); iter != credit_cards.end(); ++iter) { if ((*iter)->guid() == credit_card_guid.first) { @@ -1345,7 +1345,7 @@ void AutofillManager::ParseForms(const std::vector<FormData>& forms) { } int AutofillManager::GUIDToID(const GUIDPair& guid) const { - if (!guid::IsValidGUID(guid.first)) + if (!base::IsValidGUID(guid.first)) return 0; std::map<GUIDPair, int>::const_iterator iter = guid_id_map_.find(guid); diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc index e5ffaa2..662ebe5 100644 --- a/chrome/browser/autofill/autofill_profile.cc +++ b/chrome/browser/autofill/autofill_profile.cc @@ -11,6 +11,7 @@ #include <set> #include "base/basictypes.h" +#include "base/guid.h" #include "base/logging.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -19,7 +20,6 @@ #include "chrome/browser/autofill/contact_info.h" #include "chrome/browser/autofill/phone_number.h" #include "chrome/browser/autofill/phone_number_i18n.h" -#include "chrome/common/guid.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -214,7 +214,7 @@ AutofillProfile::AutofillProfile(const std::string& guid) } AutofillProfile::AutofillProfile() - : guid_(guid::GenerateGUID()), + : guid_(base::GenerateGUID()), name_(1), email_(1), home_number_(1, PhoneNumber(this)) { diff --git a/chrome/browser/autofill/autofill_profile_unittest.cc b/chrome/browser/autofill/autofill_profile_unittest.cc index db7e81ade8..0cdef1f 100644 --- a/chrome/browser/autofill/autofill_profile_unittest.cc +++ b/chrome/browser/autofill/autofill_profile_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/basictypes.h" +#include "base/guid.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/stl_util.h" @@ -10,7 +11,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/autofill/autofill_common_test.h" #include "chrome/browser/autofill/autofill_profile.h" -#include "chrome/common/guid.h" #include "grit/generated_resources.h" #include "testing/gtest/include/gtest/gtest.h" @@ -567,8 +567,8 @@ TEST_F(AutofillProfileTest, Compare) { EXPECT_EQ(0, a.Compare(b)); // GUIDs don't count. - a.set_guid(guid::GenerateGUID()); - b.set_guid(guid::GenerateGUID()); + a.set_guid(base::GenerateGUID()); + b.set_guid(base::GenerateGUID()); EXPECT_EQ(0, a.Compare(b)); // Different values produce non-zero results. diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc index cc49682..25b9e7c 100644 --- a/chrome/browser/autofill/credit_card.cc +++ b/chrome/browser/autofill/credit_card.cc @@ -10,6 +10,7 @@ #include <string> #include "base/basictypes.h" +#include "base/guid.h" #include "base/logging.h" #include "base/string16.h" #include "base/string_number_conversions.h" @@ -20,7 +21,6 @@ #include "chrome/browser/autofill/autofill_regexes.h" #include "chrome/browser/autofill/autofill_type.h" #include "chrome/browser/autofill/field_types.h" -#include "chrome/common/guid.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "unicode/dtfmtsym.h" @@ -205,7 +205,7 @@ CreditCard::CreditCard() : type_(kGenericCard), expiration_month_(0), expiration_year_(0), - guid_(guid::GenerateGUID()) { + guid_(base::GenerateGUID()) { } CreditCard::CreditCard(const CreditCard& credit_card) : FormGroup() { diff --git a/chrome/browser/autofill/personal_data_manager_mac.mm b/chrome/browser/autofill/personal_data_manager_mac.mm index ea36e60..a4a0824 100644 --- a/chrome/browser/autofill/personal_data_manager_mac.mm +++ b/chrome/browser/autofill/personal_data_manager_mac.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,6 +9,7 @@ #import <AddressBook/AddressBook.h> #include "base/format_macros.h" +#include "base/guid.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" @@ -16,7 +17,6 @@ #include "base/sys_string_conversions.h" #include "chrome/browser/autofill/autofill_profile.h" #include "chrome/browser/autofill/phone_number.h" -#include "chrome/common/guid.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util_mac.h" @@ -107,7 +107,7 @@ void AuxiliaryProfilesImpl::GetAddressBookMeCard() { DCHECK_EQ(kGUIDLength, guid.size()); scoped_ptr<AutofillProfile> profile(new AutofillProfile(guid)); - DCHECK(guid::IsValidGUID(profile->guid())); + DCHECK(base::IsValidGUID(profile->guid())); // Fill in name and company information. GetAddressBookNames(me, addressLabelRaw, profile.get()); diff --git a/chrome/browser/autofill/personal_data_manager_unittest.cc b/chrome/browser/autofill/personal_data_manager_unittest.cc index 73700d3..01dacca 100644 --- a/chrome/browser/autofill/personal_data_manager_unittest.cc +++ b/chrome/browser/autofill/personal_data_manager_unittest.cc @@ -5,6 +5,7 @@ #include <string> #include "base/basictypes.h" +#include "base/guid.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/utf_string_conversions.h" @@ -15,7 +16,6 @@ #include "chrome/browser/autofill/personal_data_manager_observer.h" #include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/webdata/web_data_service_factory.h" -#include "chrome/common/guid.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/notification_details.h" @@ -112,7 +112,7 @@ TEST_F(PersonalDataManagerTest, AddProfile) { // Add profile with identical values. Duplicates should not get saved. AutofillProfile profile0a = profile0; - profile0a.set_guid(guid::GenerateGUID()); + profile0a.set_guid(base::GenerateGUID()); personal_data_->AddProfile(profile0a); // Reload the database. @@ -125,7 +125,7 @@ TEST_F(PersonalDataManagerTest, AddProfile) { // New profile with different email. AutofillProfile profile1 = profile0; - profile1.set_guid(guid::GenerateGUID()); + profile1.set_guid(base::GenerateGUID()); profile1.SetInfo(EMAIL_ADDRESS, ASCIIToUTF16("john@smith.com")); // Add the different profile. This should save as a separate profile. @@ -353,8 +353,8 @@ TEST_F(PersonalDataManagerTest, PopulateUniqueIDsOnLoad) { const std::vector<AutofillProfile*>& results3 = personal_data_->profiles(); ASSERT_EQ(2U, results3.size()); EXPECT_NE(results3[0]->guid(), results3[1]->guid()); - EXPECT_TRUE(guid::IsValidGUID(results3[0]->guid())); - EXPECT_TRUE(guid::IsValidGUID(results3[1]->guid())); + EXPECT_TRUE(base::IsValidGUID(results3[0]->guid())); + EXPECT_TRUE(base::IsValidGUID(results3[1]->guid())); } TEST_F(PersonalDataManagerTest, SetEmptyProfile) { diff --git a/chrome/browser/chrome_to_mobile_service.cc b/chrome/browser/chrome_to_mobile_service.cc index 433d04f..3c39354 100644 --- a/chrome/browser/chrome_to_mobile_service.cc +++ b/chrome/browser/chrome_to_mobile_service.cc @@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/command_line.h" #include "base/file_util.h" +#include "base/guid.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/metrics/histogram.h" @@ -24,7 +25,6 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/cloud_print/cloud_print_helpers.h" -#include "chrome/common/guid.h" #include "chrome/common/net/gaia/gaia_constants.h" #include "chrome/common/net/gaia/gaia_urls.h" #include "chrome/common/net/gaia/oauth2_access_token_fetcher.h" @@ -250,7 +250,7 @@ void ChromeToMobileService::SendToMobile(const string16& mobile_id, data.title = web_contents->GetTitle(); data.snapshot_path = snapshot; bool send_snapshot = !snapshot.empty(); - data.snapshot_id = send_snapshot ? guid::GenerateGUID() : std::string(); + data.snapshot_id = send_snapshot ? base::GenerateGUID() : std::string(); data.type = send_snapshot ? DELAYED_SNAPSHOT : URL; net::URLFetcher* submit_url = CreateRequest(data); @@ -383,7 +383,7 @@ void ChromeToMobileService::RequestAccountInfo() { return; std::string url_string = StringPrintf(kAccountInfoURL, - guid::GenerateGUID().c_str(), kChromeToMobileRequestor); + base::GenerateGUID().c_str(), kChromeToMobileRequestor); GURL url(url_string); // Account information is read from the profile's cookie. If cookies are diff --git a/chrome/browser/extensions/app_notification.cc b/chrome/browser/extensions/app_notification.cc index fe0d1a0..f89353e 100644 --- a/chrome/browser/extensions/app_notification.cc +++ b/chrome/browser/extensions/app_notification.cc @@ -4,10 +4,10 @@ #include "chrome/browser/extensions/app_notification.h" +#include "base/guid.h" #include "base/json/json_writer.h" #include "base/string_number_conversions.h" #include "base/memory/scoped_ptr.h" -#include "chrome/common/guid.h" namespace { @@ -33,7 +33,7 @@ AppNotification::AppNotification(bool is_local, extension_id_(extension_id), title_(title), body_(body) { - guid_ = guid.empty() ? guid::GenerateGUID() : guid; + guid_ = guid.empty() ? base::GenerateGUID() : guid; } AppNotification::~AppNotification() {} diff --git a/chrome/browser/history/shortcuts_backend.cc b/chrome/browser/history/shortcuts_backend.cc index ea9b90b..f230579 100644 --- a/chrome/browser/history/shortcuts_backend.cc +++ b/chrome/browser/history/shortcuts_backend.cc @@ -10,6 +10,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/guid.h" #include "base/i18n/case_conversion.h" #include "base/string_util.h" #include "chrome/browser/autocomplete/autocomplete.h" @@ -19,7 +20,6 @@ #include "chrome/browser/history/shortcuts_database.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_notification_types.h" -#include "chrome/common/guid.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" @@ -259,7 +259,7 @@ void ShortcutsBackend::Observe(int type, return; } } - AddShortcut(Shortcut(guid::GenerateGUID(), log->text, match.destination_url, + AddShortcut(Shortcut(base::GenerateGUID(), log->text, match.destination_url, match.contents, match.contents_class, match.description, match.description_class, base::Time::Now(), 1)); } diff --git a/chrome/browser/history/shortcuts_backend_unittest.cc b/chrome/browser/history/shortcuts_backend_unittest.cc index 2851795..5e737fc 100644 --- a/chrome/browser/history/shortcuts_backend_unittest.cc +++ b/chrome/browser/history/shortcuts_backend_unittest.cc @@ -11,7 +11,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/history/shortcuts_backend.h" #include "chrome/browser/history/shortcuts_database.h" -#include "chrome/common/guid.h" #include "content/public/test/test_browser_thread.h" #include "sql/statement.h" diff --git a/chrome/browser/history/shortcuts_database.cc b/chrome/browser/history/shortcuts_database.cc index dc1da07..d5dfa06 100644 --- a/chrome/browser/history/shortcuts_database.cc +++ b/chrome/browser/history/shortcuts_database.cc @@ -8,10 +8,10 @@ #include <string> #include <vector> +#include "base/guid.h" #include "base/logging.h" #include "base/stringprintf.h" #include "base/time.h" -#include "chrome/common/guid.h" #include "sql/statement.h" namespace { @@ -22,7 +22,7 @@ namespace { void BindShortcutToStatement( const history::ShortcutsBackend::Shortcut& shortcut, sql::Statement* s) { - DCHECK(guid::IsValidGUID(shortcut.id)); + DCHECK(base::IsValidGUID(shortcut.id)); s->BindString(0, shortcut.id); s->BindString16(1, shortcut.text); s->BindString(2, shortcut.url.spec()); diff --git a/chrome/browser/history/shortcuts_database_unittest.cc b/chrome/browser/history/shortcuts_database_unittest.cc index 135ee19..7f88642 100644 --- a/chrome/browser/history/shortcuts_database_unittest.cc +++ b/chrome/browser/history/shortcuts_database_unittest.cc @@ -9,7 +9,6 @@ #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/browser/history/shortcuts_database.h" -#include "chrome/common/guid.h" #include "sql/statement.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index 32d0211..ed7af63 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -145,6 +145,7 @@ #include "chrome/browser/metrics/metrics_service.h" #include "base/bind.h" +#include "base/guid.h" #include "base/callback.h" #include "base/command_line.h" #include "base/md5.h" @@ -178,7 +179,6 @@ #include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/guid.h" #include "chrome/common/metrics/metrics_log_manager.h" #include "chrome/common/net/test_server_locations.h" #include "chrome/common/pref_names.h" @@ -914,7 +914,7 @@ int MetricsService::GetLowEntropySource() { // static std::string MetricsService::GenerateClientID() { - return guid::GenerateGUID(); + return base::GenerateGUID(); } //------------------------------------------------------------------------------ diff --git a/chrome/browser/policy/auto_enrollment_client.cc b/chrome/browser/policy/auto_enrollment_client.cc index d0ffb6a..eabe10e 100644 --- a/chrome/browser/policy/auto_enrollment_client.cc +++ b/chrome/browser/policy/auto_enrollment_client.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/command_line.h" +#include "base/guid.h" #include "base/location.h" #include "base/logging.h" #include "base/message_loop_proxy.h" @@ -16,7 +17,6 @@ #include "chrome/browser/policy/device_management_service.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/guid.h" #include "chrome/common/pref_names.h" #include "crypto/sha2.h" @@ -77,7 +77,7 @@ AutoEnrollmentClient::AutoEnrollmentClient(const base::Closure& callback, int power_limit) : completion_callback_(callback), should_auto_enroll_(false), - device_id_(guid::GenerateGUID()), + device_id_(base::GenerateGUID()), power_initial_(power_initial), power_limit_(power_limit), requests_sent_(0), diff --git a/chrome/browser/policy/cloud_policy_client.cc b/chrome/browser/policy/cloud_policy_client.cc index ea15682..c34adac 100644 --- a/chrome/browser/policy/cloud_policy_client.cc +++ b/chrome/browser/policy/cloud_policy_client.cc @@ -5,10 +5,10 @@ #include "chrome/browser/policy/cloud_policy_client.h" #include "base/bind.h" +#include "base/guid.h" #include "base/logging.h" #include "chrome/browser/policy/device_management_service.h" #include "chrome/browser/policy/proto/device_management_backend.pb.h" -#include "chrome/common/guid.h" namespace em = enterprise_management; @@ -58,7 +58,7 @@ void CloudPolicyClient::Register(const std::string& auth_token) { // Generate a new client ID. This is intentionally done on each new // registration request in order to preserve privacy. Reusing IDs would mean // the server could track clients by their registration attempts. - client_id_ = guid::GenerateGUID(); + client_id_ = base::GenerateGUID(); request_job_.reset( service_->CreateJob(DeviceManagementRequestJob::TYPE_REGISTRATION)); diff --git a/chrome/browser/policy/cloud_policy_controller.cc b/chrome/browser/policy/cloud_policy_controller.cc index 83bde4a..4eb9a7f 100644 --- a/chrome/browser/policy/cloud_policy_controller.cc +++ b/chrome/browser/policy/cloud_policy_controller.cc @@ -8,6 +8,7 @@ #include <string> #include "base/bind.h" +#include "base/guid.h" #include "base/logging.h" #include "base/metrics/histogram.h" #include "base/rand_util.h" @@ -20,7 +21,6 @@ #include "chrome/browser/policy/device_token_fetcher.h" #include "chrome/browser/policy/enterprise_metrics.h" #include "chrome/browser/policy/policy_notifier.h" -#include "chrome/common/guid.h" namespace policy { @@ -319,7 +319,7 @@ void CloudPolicyController::FetchToken() { if (CanBeInManagedDomain(data_store_->user_name())) { // Generate a new random device id. (It'll only be kept if registration // succeeds.) - data_store_->set_device_id(guid::GenerateGUID()); + data_store_->set_device_id(base::GenerateGUID()); token_fetcher_->FetchToken(); } else { SetState(STATE_TOKEN_UNMANAGED); diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc index 799bfda..3311906 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor.cc @@ -9,6 +9,7 @@ #include <vector> #include "base/bind.h" +#include "base/guid.h" #include "base/i18n/case_conversion.h" #include "base/metrics/histogram.h" #include "base/string_util.h" @@ -27,7 +28,6 @@ #include "chrome/browser/prerender/prerender_manager_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_notification_types.h" -#include "chrome/common/guid.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_service.h" @@ -342,7 +342,7 @@ void AutocompleteActionPredictor::OnOmniboxOpenedUrl( DBCacheMap::iterator it = db_cache_.find(key); if (it == db_cache_.end()) { - row.id = guid::GenerateGUID(); + row.id = base::GenerateGUID(); row.number_of_hits = is_hit ? 1 : 0; row.number_of_misses = is_hit ? 0 : 1; diff --git a/chrome/browser/predictors/autocomplete_action_predictor_table.cc b/chrome/browser/predictors/autocomplete_action_predictor_table.cc index 37b30f2..b460c33 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_table.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor_table.cc @@ -4,11 +4,11 @@ #include "chrome/browser/predictors/autocomplete_action_predictor_table.h" +#include "base/guid.h" #include "base/logging.h" #include "base/metrics/histogram.h" #include "base/stringprintf.h" #include "base/utf_string_conversions.h" -#include "chrome/common/guid.h" #include "content/public/browser/browser_thread.h" #include "sql/statement.h" @@ -23,7 +23,7 @@ const size_t kMaxDataLength = 2048; void BindRowToStatement( const predictors::AutocompleteActionPredictorTable::Row& row, sql::Statement* statement) { - DCHECK(guid::IsValidGUID(row.id)); + DCHECK(base::IsValidGUID(row.id)); statement->BindString(0, row.id); statement->BindString16(1, row.user_text.substr(0, kMaxDataLength)); statement->BindString(2, row.url.spec().substr(0, kMaxDataLength)); diff --git a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc index 17c94c1..7c76bc3 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc @@ -6,6 +6,7 @@ #include "base/auto_reset.h" #include "base/command_line.h" +#include "base/guid.h" #include "base/memory/ref_counted.h" #include "base/message_loop.h" #include "base/string_util.h" @@ -17,7 +18,6 @@ #include "chrome/browser/history/url_database.h" #include "chrome/browser/prerender/prerender_field_trial.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/guid.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -138,7 +138,7 @@ class AutocompleteActionPredictorTest : public testing::Test { AutocompleteActionPredictorTable::Row CreateRowFromTestUrlInfo( const TestUrlInfo& test_row) const { AutocompleteActionPredictorTable::Row row; - row.id = guid::GenerateGUID(); + row.id = base::GenerateGUID(); row.user_text = test_row.user_text; row.url = test_row.url; row.number_of_hits = test_row.number_of_hits; diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc index 41d2675..1d438e1 100644 --- a/chrome/browser/search_engines/template_url.cc +++ b/chrome/browser/search_engines/template_url.cc @@ -4,6 +4,7 @@ #include "chrome/browser/search_engines/template_url.h" +#include "base/guid.h" #include "base/i18n/case_conversion.h" #include "base/i18n/icu_string_conversions.h" #include "base/i18n/rtl.h" @@ -16,7 +17,6 @@ #include "chrome/browser/google/google_util.h" #include "chrome/browser/search_engines/search_terms_data.h" #include "chrome/browser/search_engines/template_url_service.h" -#include "chrome/common/guid.h" #include "chrome/common/url_constants.h" #include "net/base/escape.h" #include "ui/base/l10n/l10n_util.h" @@ -558,7 +558,7 @@ TemplateURLData::TemplateURLData() created_by_policy(false), usage_count(0), prepopulate_id(0), - sync_guid(guid::GenerateGUID()), + sync_guid(base::GenerateGUID()), keyword_(ASCIIToUTF16("dummy")), url_("x") { } diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index e461098..98afd94 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -7,6 +7,7 @@ #include "base/auto_reset.h" #include "base/command_line.h" #include "base/environment.h" +#include "base/guid.h" #include "base/i18n/case_conversion.h" #include "base/metrics/histogram.h" #include "base/stl_util.h" @@ -38,7 +39,6 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/env_vars.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/guid.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/notification_service.h" @@ -2371,7 +2371,7 @@ void TemplateURLService::PatchMissingSyncGUIDs( // should be persisted to disk and synced. if (template_url->sync_guid().empty() && !template_url->IsExtensionKeyword()) { - template_url->data_.sync_guid = guid::GenerateGUID(); + template_url->data_.sync_guid = base::GenerateGUID(); if (service_.get()) service_->UpdateKeyword(template_url->data()); } diff --git a/chrome/browser/ui/webui/options2/autofill_options_handler2.cc b/chrome/browser/ui/webui/options2/autofill_options_handler2.cc index 96e1470..1b3fe5c 100644 --- a/chrome/browser/ui/webui/options2/autofill_options_handler2.cc +++ b/chrome/browser/ui/webui/options2/autofill_options_handler2.cc @@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/guid.h" #include "base/logging.h" #include "base/string16.h" #include "base/string_number_conversions.h" @@ -21,7 +22,6 @@ #include "chrome/browser/autofill/phone_number_i18n.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/web_ui_util.h" -#include "chrome/common/guid.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" #include "grit/generated_resources.h" @@ -572,8 +572,8 @@ void AutofillOptionsHandler::SetAddress(const ListValue* args) { if (args->GetList(10, &list_value)) SetValueList(list_value, EMAIL_ADDRESS, &profile); - if (!guid::IsValidGUID(profile.guid())) { - profile.set_guid(guid::GenerateGUID()); + if (!base::IsValidGUID(profile.guid())) { + profile.set_guid(base::GenerateGUID()); personal_data_->AddProfile(profile); } else { personal_data_->UpdateProfile(profile); @@ -602,8 +602,8 @@ void AutofillOptionsHandler::SetCreditCard(const ListValue* args) { if (args->GetString(4, &value)) credit_card.SetInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, value); - if (!guid::IsValidGUID(credit_card.guid())) { - credit_card.set_guid(guid::GenerateGUID()); + if (!base::IsValidGUID(credit_card.guid())) { + credit_card.set_guid(base::GenerateGUID()); personal_data_->AddCreditCard(credit_card); } else { personal_data_->UpdateCreditCard(credit_card); diff --git a/chrome/browser/webdata/autocomplete_syncable_service.cc b/chrome/browser/webdata/autocomplete_syncable_service.cc index 0110c3e..5b44e65 100644 --- a/chrome/browser/webdata/autocomplete_syncable_service.cc +++ b/chrome/browser/webdata/autocomplete_syncable_service.cc @@ -13,7 +13,6 @@ #include "chrome/browser/webdata/web_data_service.h" #include "chrome/browser/webdata/web_database.h" #include "chrome/common/chrome_notification_types.h" -#include "chrome/common/guid.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "net/base/escape.h" diff --git a/chrome/browser/webdata/autofill_profile_syncable_service.cc b/chrome/browser/webdata/autofill_profile_syncable_service.cc index 8b352d5..9716f1f 100644 --- a/chrome/browser/webdata/autofill_profile_syncable_service.cc +++ b/chrome/browser/webdata/autofill_profile_syncable_service.cc @@ -4,6 +4,7 @@ #include "chrome/browser/webdata/autofill_profile_syncable_service.h" +#include "base/guid.h" #include "base/location.h" #include "base/logging.h" #include "base/utf_string_conversions.h" @@ -14,7 +15,6 @@ #include "chrome/browser/webdata/web_data_service.h" #include "chrome/browser/webdata/web_database.h" #include "chrome/common/chrome_notification_types.h" -#include "chrome/common/guid.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" @@ -315,7 +315,7 @@ void AutofillProfileSyncableService::WriteAutofillProfile( sync_pb::AutofillProfileSpecifics* specifics = profile_specifics->mutable_autofill_profile(); - DCHECK(guid::IsValidGUID(profile.guid())); + DCHECK(base::IsValidGUID(profile.guid())); // Reset all multi-valued fields in the protobuf. specifics->clear_name_first(); diff --git a/chrome/browser/webdata/autofill_table.cc b/chrome/browser/webdata/autofill_table.cc index aa4c225..a1023b0 100644 --- a/chrome/browser/webdata/autofill_table.cc +++ b/chrome/browser/webdata/autofill_table.cc @@ -11,6 +11,7 @@ #include <string> #include <vector> +#include "base/guid.h" #include "base/i18n/case_conversion.h" #include "base/logging.h" #include "base/string_number_conversions.h" @@ -24,7 +25,6 @@ #include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/webdata/autofill_change.h" #include "chrome/browser/webdata/autofill_entry.h" -#include "chrome/common/guid.h" #include "sql/statement.h" #include "ui/base/l10n/l10n_util.h" #include "webkit/forms/form_field.h" @@ -52,7 +52,7 @@ string16 LimitDataSize(const string16& data) { void BindAutofillProfileToStatement(const AutofillProfile& profile, sql::Statement* s) { - DCHECK(guid::IsValidGUID(profile.guid())); + DCHECK(base::IsValidGUID(profile.guid())); s->BindString(0, profile.guid()); string16 text = profile.GetInfo(COMPANY_NAME); @@ -77,7 +77,7 @@ void BindAutofillProfileToStatement(const AutofillProfile& profile, AutofillProfile* AutofillProfileFromStatement(const sql::Statement& s) { AutofillProfile* profile = new AutofillProfile; profile->set_guid(s.ColumnString(0)); - DCHECK(guid::IsValidGUID(profile->guid())); + DCHECK(base::IsValidGUID(profile->guid())); profile->SetInfo(COMPANY_NAME, s.ColumnString16(1)); profile->SetInfo(ADDRESS_HOME_LINE1, s.ColumnString16(2)); @@ -94,7 +94,7 @@ AutofillProfile* AutofillProfileFromStatement(const sql::Statement& s) { void BindCreditCardToStatement(const CreditCard& credit_card, sql::Statement* s) { - DCHECK(guid::IsValidGUID(credit_card.guid())); + DCHECK(base::IsValidGUID(credit_card.guid())); s->BindString(0, credit_card.guid()); string16 text = credit_card.GetInfo(CREDIT_CARD_NAME); @@ -115,7 +115,7 @@ CreditCard* CreditCardFromStatement(const sql::Statement& s) { CreditCard* credit_card = new CreditCard; credit_card->set_guid(s.ColumnString(0)); - DCHECK(guid::IsValidGUID(credit_card->guid())); + DCHECK(base::IsValidGUID(credit_card->guid())); credit_card->SetInfo(CREDIT_CARD_NAME, s.ColumnString16(1)); credit_card->SetInfo(CREDIT_CARD_EXP_MONTH, s.ColumnString16(2)); @@ -882,7 +882,7 @@ bool AutofillTable::AddAutofillProfile(const AutofillProfile& profile) { bool AutofillTable::GetAutofillProfile(const std::string& guid, AutofillProfile** profile) { - DCHECK(guid::IsValidGUID(guid)); + DCHECK(base::IsValidGUID(guid)); DCHECK(profile); sql::Statement s(db_->GetUniqueStatement( "SELECT guid, company_name, address_line_1, address_line_2, city, state," @@ -930,7 +930,7 @@ bool AutofillTable::GetAutofillProfiles( } bool AutofillTable::UpdateAutofillProfile(const AutofillProfile& profile) { - DCHECK(guid::IsValidGUID(profile.guid())); + DCHECK(base::IsValidGUID(profile.guid())); // Don't update anything until the trash has been emptied. There may be // pending modifications to process. @@ -965,7 +965,7 @@ bool AutofillTable::UpdateAutofillProfile(const AutofillProfile& profile) { } bool AutofillTable::UpdateAutofillProfileMulti(const AutofillProfile& profile) { - DCHECK(guid::IsValidGUID(profile.guid())); + DCHECK(base::IsValidGUID(profile.guid())); // Don't update anything until the trash has been emptied. There may be // pending modifications to process. @@ -1003,7 +1003,7 @@ bool AutofillTable::UpdateAutofillProfileMulti(const AutofillProfile& profile) { } bool AutofillTable::RemoveAutofillProfile(const std::string& guid) { - DCHECK(guid::IsValidGUID(guid)); + DCHECK(base::IsValidGUID(guid)); if (IsAutofillGUIDInTrash(guid)) { sql::Statement s_trash(db_->GetUniqueStatement( @@ -1067,7 +1067,7 @@ bool AutofillTable::AddCreditCard(const CreditCard& credit_card) { bool AutofillTable::GetCreditCard(const std::string& guid, CreditCard** credit_card) { - DCHECK(guid::IsValidGUID(guid)); + DCHECK(base::IsValidGUID(guid)); sql::Statement s(db_->GetUniqueStatement( "SELECT guid, name_on_card, expiration_month, expiration_year, " "card_number_encrypted, date_modified " @@ -1103,7 +1103,7 @@ bool AutofillTable::GetCreditCards( } bool AutofillTable::UpdateCreditCard(const CreditCard& credit_card) { - DCHECK(guid::IsValidGUID(credit_card.guid())); + DCHECK(base::IsValidGUID(credit_card.guid())); CreditCard* tmp_credit_card = NULL; if (!GetCreditCard(credit_card.guid(), &tmp_credit_card)) @@ -1128,7 +1128,7 @@ bool AutofillTable::UpdateCreditCard(const CreditCard& credit_card) { } bool AutofillTable::RemoveCreditCard(const std::string& guid) { - DCHECK(guid::IsValidGUID(guid)); + DCHECK(base::IsValidGUID(guid)); sql::Statement s(db_->GetUniqueStatement( "DELETE FROM credit_cards WHERE guid = ?")); s.BindString(0, guid); @@ -1641,7 +1641,7 @@ bool AutofillTable::MigrateToVersion31AddGUIDToCreditCardsAndProfiles() { sql::Statement update_s( db_->GetUniqueStatement("UPDATE autofill_profiles " "SET guid=? WHERE unique_id=?")); - update_s.BindString(0, guid::GenerateGUID()); + update_s.BindString(0, base::GenerateGUID()); update_s.BindInt(1, s.ColumnInt(0)); if (!update_s.Run()) @@ -1669,7 +1669,7 @@ bool AutofillTable::MigrateToVersion31AddGUIDToCreditCardsAndProfiles() { sql::Statement update_s( db_->GetUniqueStatement("UPDATE credit_cards " "set guid=? WHERE unique_id=?")); - update_s.BindString(0, guid::GenerateGUID()); + update_s.BindString(0, base::GenerateGUID()); update_s.BindInt(1, s.ColumnInt(0)); if (!update_s.Run()) @@ -1782,7 +1782,7 @@ bool AutofillTable::MigrateToVersion33ProfilesBasedOnFirstName() { while (s.Step()) { AutofillProfile profile; profile.set_guid(s.ColumnString(0)); - DCHECK(guid::IsValidGUID(profile.guid())); + DCHECK(base::IsValidGUID(profile.guid())); profile.SetInfo(NAME_FIRST, s.ColumnString16(1)); profile.SetInfo(NAME_MIDDLE, s.ColumnString16(2)); diff --git a/chrome/browser/webdata/autofill_table_unittest.cc b/chrome/browser/webdata/autofill_table_unittest.cc index bdff3c5..23a520e 100644 --- a/chrome/browser/webdata/autofill_table_unittest.cc +++ b/chrome/browser/webdata/autofill_table_unittest.cc @@ -5,6 +5,7 @@ #include <vector> #include "base/file_util.h" +#include "base/guid.h" #include "base/path_service.h" #include "base/scoped_temp_dir.h" #include "base/string_number_conversions.h" @@ -19,7 +20,6 @@ #include "chrome/browser/webdata/autofill_table.h" #include "chrome/browser/webdata/web_database.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/guid.h" #include "sql/statement.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/forms/form_field.h" @@ -581,7 +581,7 @@ TEST_F(AutofillTableTest, AutofillProfile) { // Add a 'Billing' profile. AutofillProfile billing_profile = home_profile; - billing_profile.set_guid(guid::GenerateGUID()); + billing_profile.set_guid(base::GenerateGUID()); billing_profile.SetInfo(ADDRESS_HOME_LINE1, ASCIIToUTF16("5678 Bottom Street")); billing_profile.SetInfo(ADDRESS_HOME_LINE2, ASCIIToUTF16("suite 3")); diff --git a/chrome/browser/webdata/web_data_service_unittest.cc b/chrome/browser/webdata/web_data_service_unittest.cc index d69cefa..7bdad72 100644 --- a/chrome/browser/webdata/web_data_service_unittest.cc +++ b/chrome/browser/webdata/web_data_service_unittest.cc @@ -27,7 +27,6 @@ #include "chrome/browser/webdata/web_intents_table.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/guid.h" #include "chrome/test/base/thread_observer_helper.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_service.h" diff --git a/chrome/browser/webdata/web_database_migration_unittest.cc b/chrome/browser/webdata/web_database_migration_unittest.cc index c6e123c..1744099 100644 --- a/chrome/browser/webdata/web_database_migration_unittest.cc +++ b/chrome/browser/webdata/web_database_migration_unittest.cc @@ -5,6 +5,7 @@ #include <string> #include "base/file_util.h" +#include "base/guid.h" #include "base/message_loop.h" #include "base/scoped_temp_dir.h" #include "base/stl_util.h" @@ -22,7 +23,6 @@ #include "chrome/browser/webdata/web_database.h" #include "chrome/browser/webdata/web_intents_table.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/guid.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/test/test_browser_thread.h" #include "sql/statement.h" @@ -58,7 +58,7 @@ void AutofillProfile31FromStatement(const sql::Statement& s, profile->SetInfo(PHONE_HOME_WHOLE_NUMBER, s.ColumnString16(13)); *date_modified = s.ColumnInt64(15); profile->set_guid(s.ColumnString(16)); - EXPECT_TRUE(guid::IsValidGUID(profile->guid())); + EXPECT_TRUE(base::IsValidGUID(profile->guid())); } void AutofillProfile33FromStatement(const sql::Statement& s, @@ -67,7 +67,7 @@ void AutofillProfile33FromStatement(const sql::Statement& s, DCHECK(profile); DCHECK(date_modified); profile->set_guid(s.ColumnString(0)); - EXPECT_TRUE(guid::IsValidGUID(profile->guid())); + EXPECT_TRUE(base::IsValidGUID(profile->guid())); profile->SetInfo(COMPANY_NAME, s.ColumnString16(1)); profile->SetInfo(ADDRESS_HOME_LINE1, s.ColumnString16(2)); profile->SetInfo(ADDRESS_HOME_LINE2, s.ColumnString16(3)); @@ -102,7 +102,7 @@ void CreditCard31FromStatement(const sql::Statement& s, } *date_modified = s.ColumnInt64(12); credit_card->set_guid(s.ColumnString(13)); - EXPECT_TRUE(guid::IsValidGUID(credit_card->guid())); + EXPECT_TRUE(base::IsValidGUID(credit_card->guid())); } void CreditCard32FromStatement(const sql::Statement& s, @@ -113,7 +113,7 @@ void CreditCard32FromStatement(const sql::Statement& s, DCHECK(encrypted_number); DCHECK(date_modified); credit_card->set_guid(s.ColumnString(0)); - EXPECT_TRUE(guid::IsValidGUID(credit_card->guid())); + EXPECT_TRUE(base::IsValidGUID(credit_card->guid())); credit_card->SetInfo(CREDIT_CARD_NAME, s.ColumnString16(1)); credit_card->SetInfo(CREDIT_CARD_EXP_MONTH, s.ColumnString16(2)); credit_card->SetInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, s.ColumnString16(3)); @@ -693,11 +693,11 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion30ToCurrent) { ASSERT_TRUE(s.Step()); std::string guid1 = s.ColumnString(0); - EXPECT_TRUE(guid::IsValidGUID(guid1)); + EXPECT_TRUE(base::IsValidGUID(guid1)); ASSERT_TRUE(s.Step()); std::string guid2 = s.ColumnString(0); - EXPECT_TRUE(guid::IsValidGUID(guid2)); + EXPECT_TRUE(base::IsValidGUID(guid2)); EXPECT_NE(guid1, guid2); } diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index eb2d65e..48021e0 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -191,10 +191,6 @@ 'common/external_ipc_fuzzer.cc', 'common/favicon_url.cc', 'common/favicon_url.h', - 'common/guid.cc', - 'common/guid.h', - 'common/guid_posix.cc', - 'common/guid_win.cc', 'common/icon_messages.h', 'common/important_file_writer.cc', 'common/important_file_writer.h', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index d9aa24e..eaaeeae 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1919,7 +1919,6 @@ 'common/extensions/url_pattern_unittest.cc', 'common/extensions/user_script_unittest.cc', 'common/extensions/api/extension_api_unittest.cc', - 'common/guid_unittest.cc', 'common/important_file_writer_unittest.cc', 'common/json_pref_store_unittest.cc', 'common/json_schema_validator_unittest.cc', diff --git a/chrome/common/cloud_print/cloud_print_helpers.cc b/chrome/common/cloud_print/cloud_print_helpers.cc index e8f7650..dbe7544 100644 --- a/chrome/common/cloud_print/cloud_print_helpers.cc +++ b/chrome/common/cloud_print/cloud_print_helpers.cc @@ -10,7 +10,6 @@ #include "base/rand_util.h" #include "base/stringprintf.h" #include "base/values.h" -#include "chrome/common/guid.h" #include "googleurl/src/gurl.h" namespace cloud_print { diff --git a/chrome/installer/gcapi/gcapi_last_run_test.cc b/chrome/installer/gcapi/gcapi_last_run_test.cc index e0f3b4e..b2e330a 100644 --- a/chrome/installer/gcapi/gcapi_last_run_test.cc +++ b/chrome/installer/gcapi/gcapi_last_run_test.cc @@ -6,13 +6,13 @@ #include <string> #include "base/basictypes.h" +#include "base/guid.h" #include "base/string_number_conversions.h" #include "base/stringprintf.h" #include "base/test/test_reg_util_win.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "base/win/registry.h" -#include "chrome/common/guid.h" #include "chrome/installer/gcapi/gcapi.h" #include "chrome/installer/util/google_update_constants.h" #include "testing/gtest/include/gtest/gtest.h" @@ -27,7 +27,7 @@ class GCAPILastRunTest : public ::testing::Test { void SetUp() { // Override keys - this is undone during destruction. std::wstring hkcu_override = base::StringPrintf( - L"hkcu_override\\%ls", ASCIIToWide(guid::GenerateGUID())); + L"hkcu_override\\%ls", ASCIIToWide(base::GenerateGUID())); override_manager_.OverrideRegistry(HKEY_CURRENT_USER, hkcu_override); // Create the client state key in the right places. diff --git a/chrome/installer/gcapi/gcapi_reactivation_test.cc b/chrome/installer/gcapi/gcapi_reactivation_test.cc index cd55f04..7f4a142 100644 --- a/chrome/installer/gcapi/gcapi_reactivation_test.cc +++ b/chrome/installer/gcapi/gcapi_reactivation_test.cc @@ -5,13 +5,13 @@ #include <string> #include "base/basictypes.h" +#include "base/guid.h" #include "base/string_number_conversions.h" #include "base/stringprintf.h" #include "base/test/test_reg_util_win.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "base/win/registry.h" -#include "chrome/common/guid.h" #include "chrome/installer/gcapi/gcapi.h" #include "chrome/installer/gcapi/gcapi_omaha_experiment.h" #include "chrome/installer/gcapi/gcapi_reactivation.h" @@ -38,10 +38,10 @@ class GCAPIReactivationTest : public ::testing::Test { void SetUp() { // Override keys - this is undone during destruction. std::wstring hkcu_override = base::StringPrintf( - L"hkcu_override\\%ls", ASCIIToWide(guid::GenerateGUID())); + L"hkcu_override\\%ls", ASCIIToWide(base::GenerateGUID())); override_manager_.OverrideRegistry(HKEY_CURRENT_USER, hkcu_override); std::wstring hklm_override = base::StringPrintf( - L"hklm_override\\%ls", ASCIIToWide(guid::GenerateGUID())); + L"hklm_override\\%ls", ASCIIToWide(base::GenerateGUID())); override_manager_.OverrideRegistry(HKEY_LOCAL_MACHINE, hklm_override); } diff --git a/chrome_frame/find_dialog.cc b/chrome_frame/find_dialog.cc index 2c10866..249fadb 100644 --- a/chrome_frame/find_dialog.cc +++ b/chrome_frame/find_dialog.cc @@ -6,8 +6,8 @@ #include <richedit.h> +#include "base/guid.h" #include "base/utf_string_conversions.h" -#include "chrome/common/guid.h" #include "chrome_frame/chrome_frame_automation.h" const int kMaxFindChars = 1024; @@ -26,7 +26,7 @@ LRESULT CFFindDialog::OnDestroy(UINT msg, WPARAM wparam, LPARAM lparam, // do a fake search for a string that is unlikely to appear on the page. // TODO(robertshield): Change this to plumb through a StopFinding automation // message that triggers a ViewMsg_StopFinding. - std::string guid(guid::GenerateGUID()); + std::string guid(base::GenerateGUID()); automation_client_->FindInPage(ASCIIToWide(guid), FWD, CASE_SENSITIVE, false); UninstallMessageHook(); |
