diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-01 01:02:07 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-01 01:02:07 +0000 |
commit | fb534c949f92bec8c6312b58ffcc04c5dc488f2d (patch) | |
tree | 84384bdb8b06e62662ce1a5e9619ae455e9a69a8 /chrome/browser/web_resource | |
parent | efeb669b05db99c54309771e4884b1a17d604a37 (diff) | |
download | chromium_src-fb534c949f92bec8c6312b58ffcc04c5dc488f2d.zip chromium_src-fb534c949f92bec8c6312b58ffcc04c5dc488f2d.tar.gz chromium_src-fb534c949f92bec8c6312b58ffcc04c5dc488f2d.tar.bz2 |
Rename Real* to Double* in values.* and dependent files
BUG=None
TEST=Compiles and passes all tests
Review URL: http://codereview.chromium.org/6248026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_resource')
-rw-r--r-- | chrome/browser/web_resource/web_resource_service.cc | 28 | ||||
-rw-r--r-- | chrome/browser/web_resource/web_resource_service_unittest.cc | 14 |
2 files changed, 21 insertions, 21 deletions
diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc index 3225b92..ab060a8 100644 --- a/chrome/browser/web_resource/web_resource_service.cc +++ b/chrome/browser/web_resource/web_resource_service.cc @@ -242,10 +242,10 @@ void WebResourceService::Init() { resource_dispatcher_host_ = g_browser_process->resource_dispatcher_host(); web_resource_fetcher_.reset(new WebResourceFetcher(this)); prefs_->RegisterStringPref(prefs::kNTPWebResourceCacheUpdate, "0"); - prefs_->RegisterRealPref(prefs::kNTPCustomLogoStart, 0); - prefs_->RegisterRealPref(prefs::kNTPCustomLogoEnd, 0); - prefs_->RegisterRealPref(prefs::kNTPPromoStart, 0); - prefs_->RegisterRealPref(prefs::kNTPPromoEnd, 0); + prefs_->RegisterDoublePref(prefs::kNTPCustomLogoStart, 0); + prefs_->RegisterDoublePref(prefs::kNTPCustomLogoEnd, 0); + prefs_->RegisterDoublePref(prefs::kNTPPromoStart, 0); + prefs_->RegisterDoublePref(prefs::kNTPPromoEnd, 0); prefs_->RegisterStringPref(prefs::kNTPPromoLine, std::string()); prefs_->RegisterBooleanPref(prefs::kNTPPromoClosed, false); prefs_->RegisterIntegerPref(prefs::kNTPPromoGroup, -1); @@ -255,8 +255,8 @@ void WebResourceService::Init() { // If the promo start is in the future, set a notification task to invalidate // the NTP cache at the time of the promo start. - double promo_start = prefs_->GetReal(prefs::kNTPPromoStart); - double promo_end = prefs_->GetReal(prefs::kNTPPromoEnd); + double promo_start = prefs_->GetDouble(prefs::kNTPPromoStart); + double promo_end = prefs_->GetDouble(prefs::kNTPPromoEnd); ScheduleNotification(promo_start, promo_end); } @@ -391,8 +391,8 @@ void WebResourceService::UnpackPromoSignal(const DictionaryValue& parsed_json) { // Check for preexisting start and end values. if (prefs_->HasPrefPath(prefs::kNTPPromoStart) && prefs_->HasPrefPath(prefs::kNTPPromoEnd)) { - old_promo_start = prefs_->GetReal(prefs::kNTPPromoStart); - old_promo_end = prefs_->GetReal(prefs::kNTPPromoEnd); + old_promo_start = prefs_->GetDouble(prefs::kNTPPromoStart); + old_promo_end = prefs_->GetDouble(prefs::kNTPPromoEnd); } // Check for newly received start and end values. @@ -473,8 +473,8 @@ void WebResourceService::UnpackPromoSignal(const DictionaryValue& parsed_json) { // Also reset the promo closed preference, to signal a new promo. if (!(old_promo_start == promo_start) || !(old_promo_end == promo_end)) { - prefs_->SetReal(prefs::kNTPPromoStart, promo_start); - prefs_->SetReal(prefs::kNTPPromoEnd, promo_end); + prefs_->SetDouble(prefs::kNTPPromoStart, promo_start); + prefs_->SetDouble(prefs::kNTPPromoEnd, promo_end); prefs_->SetBoolean(prefs::kNTPPromoClosed, false); ScheduleNotification(promo_start, promo_end); } @@ -491,8 +491,8 @@ void WebResourceService::UnpackLogoSignal(const DictionaryValue& parsed_json) { // Check for preexisting start and end values. if (prefs_->HasPrefPath(prefs::kNTPCustomLogoStart) && prefs_->HasPrefPath(prefs::kNTPCustomLogoEnd)) { - old_logo_start = prefs_->GetReal(prefs::kNTPCustomLogoStart); - old_logo_end = prefs_->GetReal(prefs::kNTPCustomLogoEnd); + old_logo_start = prefs_->GetDouble(prefs::kNTPCustomLogoStart); + old_logo_end = prefs_->GetDouble(prefs::kNTPCustomLogoEnd); } // Check for newly received start and end values. @@ -538,8 +538,8 @@ void WebResourceService::UnpackLogoSignal(const DictionaryValue& parsed_json) { // dates counts as a triggering change if there were dates before. if (!(old_logo_start == logo_start) || !(old_logo_end == logo_end)) { - prefs_->SetReal(prefs::kNTPCustomLogoStart, logo_start); - prefs_->SetReal(prefs::kNTPCustomLogoEnd, logo_end); + prefs_->SetDouble(prefs::kNTPCustomLogoStart, logo_start); + prefs_->SetDouble(prefs::kNTPCustomLogoEnd, logo_end); NotificationService* service = NotificationService::current(); service->Notify(NotificationType::WEB_RESOURCE_STATE_CHANGED, Source<WebResourceService>(this), diff --git a/chrome/browser/web_resource/web_resource_service_unittest.cc b/chrome/browser/web_resource/web_resource_service_unittest.cc index 4127a6e..cb51d9f 100644 --- a/chrome/browser/web_resource/web_resource_service_unittest.cc +++ b/chrome/browser/web_resource/web_resource_service_unittest.cc @@ -57,10 +57,10 @@ TEST_F(WebResourceServiceTest, UnpackLogoSignal) { ASSERT_TRUE(prefs != NULL); double logo_start = - prefs->GetReal(prefs::kNTPCustomLogoStart); + prefs->GetDouble(prefs::kNTPCustomLogoStart); EXPECT_EQ(logo_start, 1264899600); // unix epoch for Jan 31 2010 0100 GMT. double logo_end = - prefs->GetReal(prefs::kNTPCustomLogoEnd); + prefs->GetDouble(prefs::kNTPCustomLogoEnd); EXPECT_EQ(logo_end, 1327971600); // unix epoch for Jan 31 2012 0100 GMT. // Change the start only and recheck. @@ -85,7 +85,7 @@ TEST_F(WebResourceServiceTest, UnpackLogoSignal) { // Check that prefs are set correctly. web_resource_service->UnpackLogoSignal(*(test_json.get())); - logo_start = prefs->GetReal(prefs::kNTPCustomLogoStart); + logo_start = prefs->GetDouble(prefs::kNTPCustomLogoStart); EXPECT_EQ(logo_start, 1267365600); // date changes to Feb 28 2010 1400 GMT. // If no date is included in the prefs, reset custom logo dates to 0. @@ -103,9 +103,9 @@ TEST_F(WebResourceServiceTest, UnpackLogoSignal) { // Check that prefs are set correctly. web_resource_service->UnpackLogoSignal(*(test_json.get())); - logo_start = prefs->GetReal(prefs::kNTPCustomLogoStart); + logo_start = prefs->GetDouble(prefs::kNTPCustomLogoStart); EXPECT_EQ(logo_start, 0); // date value reset to 0; - logo_end = prefs->GetReal(prefs::kNTPCustomLogoEnd); + logo_end = prefs->GetDouble(prefs::kNTPCustomLogoEnd); EXPECT_EQ(logo_end, 0); // date value reset to 0; } @@ -160,13 +160,13 @@ TEST_F(WebResourceServiceTest, UnpackPromoSignal) { EXPECT_EQ(promo_time_slice, 2); double promo_start = - prefs->GetReal(prefs::kNTPPromoStart); + prefs->GetDouble(prefs::kNTPPromoStart); int64 actual_start = 1264899600 + // unix epoch for Jan 31 2010 0100 GMT. promo_group * 2 * 60 * 60; EXPECT_EQ(promo_start, actual_start); double promo_end = - prefs->GetReal(prefs::kNTPPromoEnd); + prefs->GetDouble(prefs::kNTPPromoEnd); EXPECT_EQ(promo_end, 1327971600); // unix epoch for Jan 31 2012 0100 GMT. } |