diff options
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/history.cc | 4 | ||||
-rw-r--r-- | chrome/browser/history/history_backend.cc | 18 | ||||
-rw-r--r-- | chrome/browser/history/history_backend.h | 10 | ||||
-rw-r--r-- | chrome/browser/history/history_backend_unittest.cc | 26 | ||||
-rw-r--r-- | chrome/browser/history/page_usage_data.cc | 2 | ||||
-rw-r--r-- | chrome/browser/history/page_usage_data.h | 4 | ||||
-rw-r--r-- | chrome/browser/history/thumbnail_database.cc | 4 | ||||
-rw-r--r-- | chrome/browser/history/thumbnail_database.h | 4 | ||||
-rw-r--r-- | chrome/browser/history/thumbnail_database_unittest.cc | 30 |
9 files changed, 51 insertions, 51 deletions
diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index c0d7f12..1b3a6e0 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -475,7 +475,7 @@ void HistoryService::SetFavicon(const GURL& page_url, if (!CanAddURL(page_url)) return; - ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavIcon, + ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetFavicon, page_url, icon_url, scoped_refptr<RefCountedMemory>(new RefCountedBytes(image_data)), history::FAV_ICON); @@ -483,7 +483,7 @@ void HistoryService::SetFavicon(const GURL& page_url, void HistoryService::SetFaviconOutOfDateForPage(const GURL& page_url) { ScheduleAndForget(PRIORITY_NORMAL, - &HistoryBackend::SetFavIconOutOfDateForPage, page_url); + &HistoryBackend::SetFaviconOutOfDateForPage, page_url); } void HistoryService::SetImportedFavicons( diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 5951ef6..716cb34 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -1614,7 +1614,7 @@ void HistoryBackend::UpdateFavIconMappingAndFetch( UpdateFavIconMappingAndFetchImpl(&page_url, icon_url, request, icon_type); } -void HistoryBackend::SetFavIconOutOfDateForPage(const GURL& page_url) { +void HistoryBackend::SetFaviconOutOfDateForPage(const GURL& page_url) { std::vector<IconMapping> icon_mappings; if (!thumbnail_db_.get() || @@ -1624,7 +1624,7 @@ void HistoryBackend::SetFavIconOutOfDateForPage(const GURL& page_url) { for (std::vector<IconMapping>::iterator m = icon_mappings.begin(); m != icon_mappings.end(); ++m) { - thumbnail_db_->SetFavIconLastUpdateTime(m->icon_id, Time()); + thumbnail_db_->SetFaviconLastUpdateTime(m->icon_id, Time()); } ScheduleCommit(); } @@ -1648,7 +1648,7 @@ void HistoryBackend::SetImportedFavicons( history::FAV_ICON); if (!favicon_id) continue; // Unable to add the favicon. - thumbnail_db_->SetFavIcon(favicon_id, + thumbnail_db_->SetFavicon(favicon_id, new RefCountedBytes(favicon_usage[i].png_data), now); } @@ -1724,10 +1724,10 @@ void HistoryBackend::UpdateFavIconMappingAndFetchImpl( } if (page_url) - SetFavIconMapping(*page_url, favicon_id, returned_icon_type); + SetFaviconMapping(*page_url, favicon_id, returned_icon_type); } // else case, haven't cached entry yet. Caller is responsible for - // downloading the favicon and invoking SetFavIcon. + // downloading the favicon and invoking SetFavicon. } request->ForwardResult(GetFavIconRequest::TupleType( request->handle(), know_favicon, data, expired, @@ -1772,7 +1772,7 @@ void HistoryBackend::GetFavIconForURL( expired, icon_url)); } -void HistoryBackend::SetFavIcon( +void HistoryBackend::SetFavicon( const GURL& page_url, const GURL& icon_url, scoped_refptr<RefCountedMemory> data, @@ -1787,12 +1787,12 @@ void HistoryBackend::SetFavIcon( id = thumbnail_db_->AddFavIcon(icon_url, icon_type); // Set the image data. - thumbnail_db_->SetFavIcon(id, data, Time::Now()); + thumbnail_db_->SetFavicon(id, data, Time::Now()); - SetFavIconMapping(page_url, id, icon_type); + SetFaviconMapping(page_url, id, icon_type); } -void HistoryBackend::SetFavIconMapping(const GURL& page_url, +void HistoryBackend::SetFaviconMapping(const GURL& page_url, FavIconID id, IconType icon_type) { if (!thumbnail_db_.get()) diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index 3d9dd80..21ec989 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -217,7 +217,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, const GURL& page_url, int icon_types); - void SetFavIcon(const GURL& page_url, + void SetFavicon(const GURL& page_url, const GURL& icon_url, scoped_refptr<RefCountedMemory> data, IconType icon_type); @@ -227,7 +227,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, const GURL& icon_url, IconType icon_type); - void SetFavIconOutOfDateForPage(const GURL& page_url); + void SetFaviconOutOfDateForPage(const GURL& page_url); void SetImportedFavicons( const std::vector<ImportedFavIconUsage>& favicon_usage); @@ -342,7 +342,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, RemoveVisitsSource); FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MigrationVisitSource); FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MigrationIconMapping); - FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFavIconMapping); + FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconMapping); FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddOrUpdateIconMapping); friend class ::TestingProfile; @@ -444,7 +444,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // Favicons ------------------------------------------------------------------ // Used by both UpdateFavIconMappingAndFetch and GetFavicon. - // If page_url is non-null and SetFavIcon has previously been invoked for + // If page_url is non-null and SetFavicon has previously been invoked for // icon_url the favicon url for page_url (and all redirects) is set to // icon_url. // Only a single type can be given in icon_type when page_url is specified. @@ -456,7 +456,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // Sets the favicon url id for page_url to id. This will also broadcast // notifications as necessary. - void SetFavIconMapping(const GURL& page_url, + void SetFaviconMapping(const GURL& page_url, FavIconID id, IconType icon_type); diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc index 3e0ac18..ad1c869 100644 --- a/chrome/browser/history/history_backend_unittest.cc +++ b/chrome/browser/history/history_backend_unittest.cc @@ -223,11 +223,11 @@ TEST_F(HistoryBackendTest, DeleteAll) { std::vector<unsigned char> data; data.push_back('1'); - EXPECT_TRUE(backend_->thumbnail_db_->SetFavIcon(favicon1, + EXPECT_TRUE(backend_->thumbnail_db_->SetFavicon(favicon1, new RefCountedBytes(data), Time::Now())); data[0] = '2'; - EXPECT_TRUE(backend_->thumbnail_db_->SetFavIcon( + EXPECT_TRUE(backend_->thumbnail_db_->SetFavicon( favicon2, new RefCountedBytes(data), Time::Now())); // First visit two URLs. @@ -356,11 +356,11 @@ TEST_F(HistoryBackendTest, URLsNoLongerBookmarked) { std::vector<unsigned char> data; data.push_back('1'); - EXPECT_TRUE(backend_->thumbnail_db_->SetFavIcon( + EXPECT_TRUE(backend_->thumbnail_db_->SetFavicon( favicon1, new RefCountedBytes(data), Time::Now())); data[0] = '2'; - EXPECT_TRUE(backend_->thumbnail_db_->SetFavIcon( + EXPECT_TRUE(backend_->thumbnail_db_->SetFavicon( favicon2, new RefCountedBytes(data), Time::Now())); // First visit two URLs. @@ -526,7 +526,7 @@ TEST_F(HistoryBackendTest, ImportedFaviconsTest) { FAV_ICON); std::vector<unsigned char> data; data.push_back('1'); - EXPECT_TRUE(backend_->thumbnail_db_->SetFavIcon(favicon1, + EXPECT_TRUE(backend_->thumbnail_db_->SetFavicon(favicon1, RefCountedBytes::TakeVector(&data), Time::Now())); URLRow row1(GURL("http://www.google.com/")); row1.set_visit_count(1); @@ -820,7 +820,7 @@ TEST_F(HistoryBackendTest, MigrationVisitSource) { EXPECT_FALSE(s.Step()); } -TEST_F(HistoryBackendTest, SetFavIconMapping) { +TEST_F(HistoryBackendTest, SetFaviconMapping) { // Init recent_redirects_ const GURL url1("http://www.google.com"); const GURL url2("http://www.google.com/m"); @@ -846,7 +846,7 @@ TEST_F(HistoryBackendTest, SetFavIconMapping) { const GURL icon_url("http://www.google.com/icon"); std::vector<unsigned char> data(blob1, blob1 + sizeof(blob1)); // Add a favicon - backend_->SetFavIcon( + backend_->SetFavicon( url1, icon_url, RefCountedBytes::TakeVector(&data), FAV_ICON); EXPECT_TRUE(backend_->thumbnail_db_->GetIconMappingForPageURL( url1, FAV_ICON, NULL)); @@ -854,7 +854,7 @@ TEST_F(HistoryBackendTest, SetFavIconMapping) { url2, FAV_ICON, NULL)); // Add a touch_icon - backend_->SetFavIcon( + backend_->SetFavicon( url1, icon_url, RefCountedBytes::TakeVector(&data), TOUCH_ICON); EXPECT_TRUE(backend_->thumbnail_db_->GetIconMappingForPageURL( url1, TOUCH_ICON, NULL)); @@ -864,7 +864,7 @@ TEST_F(HistoryBackendTest, SetFavIconMapping) { url1, FAV_ICON, NULL)); // Add a TOUCH_PRECOMPOSED_ICON - backend_->SetFavIcon(url1, + backend_->SetFavicon(url1, icon_url, RefCountedBytes::TakeVector(&data), TOUCH_PRECOMPOSED_ICON); @@ -879,7 +879,7 @@ TEST_F(HistoryBackendTest, SetFavIconMapping) { url2, TOUCH_PRECOMPOSED_ICON, NULL)); // Add a touch_icon - backend_->SetFavIcon( + backend_->SetFavicon( url1, icon_url, RefCountedBytes::TakeVector(&data), TOUCH_ICON); EXPECT_TRUE(backend_->thumbnail_db_->GetIconMappingForPageURL( url1, TOUCH_ICON, NULL)); @@ -891,7 +891,7 @@ TEST_F(HistoryBackendTest, SetFavIconMapping) { // Add a fav_icon const GURL icon_url2("http://www.google.com/icon2"); - backend_->SetFavIcon( + backend_->SetFavicon( url1, icon_url2, RefCountedBytes::TakeVector(&data), FAV_ICON); FavIconID icon_id = backend_->thumbnail_db_->GetFavIconIDForFavIconURL( icon_url2, FAV_ICON, NULL); @@ -906,12 +906,12 @@ TEST_F(HistoryBackendTest, SetFavIconMapping) { TEST_F(HistoryBackendTest, AddOrUpdateIconMapping) { // Test the same icon and page mapping will not be added twice. other case - // should be covered in TEST_F(HistoryBackendTest, SetFavIconMapping) + // should be covered in TEST_F(HistoryBackendTest, SetFaviconMapping) const GURL url("http://www.google.com/"); const GURL icon_url("http://www.google.com/icon"); std::vector<unsigned char> data(blob1, blob1 + sizeof(blob1)); - backend_->SetFavIcon( + backend_->SetFavicon( url, icon_url, RefCountedBytes::TakeVector(&data), FAV_ICON); FavIconID icon_id = backend_->thumbnail_db_->GetFavIconIDForFavIconURL( icon_url, FAV_ICON, NULL); diff --git a/chrome/browser/history/page_usage_data.cc b/chrome/browser/history/page_usage_data.cc index 8fc2d8b..adfd8d9 100644 --- a/chrome/browser/history/page_usage_data.cc +++ b/chrome/browser/history/page_usage_data.cc @@ -32,7 +32,7 @@ void PageUsageData::SetThumbnail(SkBitmap* img) { thumbnail_set_ = true; } -void PageUsageData::SetFavIcon(SkBitmap* img) { +void PageUsageData::SetFavicon(SkBitmap* img) { if (favicon_ && favicon_ != img) delete favicon_; favicon_ = img; diff --git a/chrome/browser/history/page_usage_data.h b/chrome/browser/history/page_usage_data.h index 3c6c3c7..dece788 100644 --- a/chrome/browser/history/page_usage_data.h +++ b/chrome/browser/history/page_usage_data.h @@ -79,11 +79,11 @@ class PageUsageData { thumbnail_pending_ = pending; } - void SetFavIconMissing() { + void SetFaviconMissing() { favicon_set_ = true; } - void SetFavIcon(SkBitmap* img); + void SetFavicon(SkBitmap* img); bool HasFavIcon() const { return favicon_set_; diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc index edb9ca9..2ec82ed 100644 --- a/chrome/browser/history/thumbnail_database.cc +++ b/chrome/browser/history/thumbnail_database.cc @@ -360,7 +360,7 @@ bool ThumbnailDatabase::ThumbnailScoreForId(URLID id, return false; } -bool ThumbnailDatabase::SetFavIcon(URLID icon_id, +bool ThumbnailDatabase::SetFavicon(URLID icon_id, scoped_refptr<RefCountedMemory> icon_data, base::Time time) { DCHECK(icon_id); @@ -387,7 +387,7 @@ bool ThumbnailDatabase::SetFavIcon(URLID icon_id, } } -bool ThumbnailDatabase::SetFavIconLastUpdateTime(FavIconID icon_id, +bool ThumbnailDatabase::SetFaviconLastUpdateTime(FavIconID icon_id, base::Time time) { sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE, "UPDATE favicons SET last_updated=? WHERE id=?")); diff --git a/chrome/browser/history/thumbnail_database.h b/chrome/browser/history/thumbnail_database.h index 210d97f..2842b34 100644 --- a/chrome/browser/history/thumbnail_database.h +++ b/chrome/browser/history/thumbnail_database.h @@ -98,12 +98,12 @@ class ThumbnailDatabase { // Sets the bits for a favicon. This should be png encoded data. // The time indicates the access time, and is used to detect when the favicon // should be refreshed. - bool SetFavIcon(FavIconID icon_id, + bool SetFavicon(FavIconID icon_id, scoped_refptr<RefCountedMemory> icon_data, base::Time time); // Sets the time the favicon was last updated. - bool SetFavIconLastUpdateTime(FavIconID icon_id, base::Time time); + bool SetFaviconLastUpdateTime(FavIconID icon_id, base::Time time); // Returns the id of the entry in the favicon database with the specified url // and icon type. If |required_icon_type| contains multiple icon types and diff --git a/chrome/browser/history/thumbnail_database_unittest.cc b/chrome/browser/history/thumbnail_database_unittest.cc index 910b5a6..ecce8d2 100644 --- a/chrome/browser/history/thumbnail_database_unittest.cc +++ b/chrome/browser/history/thumbnail_database_unittest.cc @@ -121,7 +121,7 @@ TEST_F(ThumbnailDatabaseTest, GetFaviconAfterMigrationToTopSites) { GURL url("http://google.com"); FavIconID id = db.AddFavIcon(url, FAV_ICON); base::Time time = base::Time::Now(); - db.SetFavIcon(id, favicon, time); + db.SetFavicon(id, favicon, time); EXPECT_TRUE(db.RenameAndDropThumbnails(file_name_, new_file_name_)); base::Time time_out; @@ -148,7 +148,7 @@ TEST_F(ThumbnailDatabaseTest, AddIconMapping) { FavIconID id = db.AddFavIcon(url, TOUCH_ICON); EXPECT_NE(0, id); base::Time time = base::Time::Now(); - db.SetFavIcon(id, favicon, time); + db.SetFavicon(id, favicon, time); EXPECT_NE(0, db.AddIconMapping(url, id)); std::vector<IconMapping> icon_mapping; @@ -169,7 +169,7 @@ TEST_F(ThumbnailDatabaseTest, UpdateIconMapping) { GURL url("http://google.com"); FavIconID id = db.AddFavIcon(url, TOUCH_ICON); base::Time time = base::Time::Now(); - db.SetFavIcon(id, favicon, time); + db.SetFavicon(id, favicon, time); EXPECT_TRUE(0 < db.AddIconMapping(url, id)); std::vector<IconMapping> icon_mapping; @@ -201,11 +201,11 @@ TEST_F(ThumbnailDatabaseTest, DeleteIconMappings) { GURL url("http://google.com"); FavIconID id = db.AddFavIcon(url, TOUCH_ICON); base::Time time = base::Time::Now(); - db.SetFavIcon(id, favicon, time); + db.SetFavicon(id, favicon, time); EXPECT_TRUE(0 < db.AddIconMapping(url, id)); FavIconID id2 = db.AddFavIcon(url, FAV_ICON); - db.SetFavIcon(id2, favicon, time); + db.SetFavicon(id2, favicon, time); EXPECT_TRUE(0 < db.AddIconMapping(url, id2)); ASSERT_NE(id, id2); @@ -233,12 +233,12 @@ TEST_F(ThumbnailDatabaseTest, GetIconMappingsForPageURL) { FavIconID id1 = db.AddFavIcon(url, TOUCH_ICON); base::Time time = base::Time::Now(); - db.SetFavIcon(id1, favicon, time); + db.SetFavicon(id1, favicon, time); EXPECT_TRUE(0 < db.AddIconMapping(url, id1)); FavIconID id2 = db.AddFavIcon(url, FAV_ICON); EXPECT_NE(id1, id2); - db.SetFavIcon(id2, favicon, time); + db.SetFavicon(id2, favicon, time); EXPECT_TRUE(0 < db.AddIconMapping(url, id2)); std::vector<IconMapping> icon_mapping; @@ -277,7 +277,7 @@ TEST_F(ThumbnailDatabaseTest, UpgradeToVersion4) { GURL url("http://google.com"); FavIconID id = db.AddFavIcon(url, TOUCH_ICON); base::Time time = base::Time::Now(); - db.SetFavIcon(id, favicon, time); + db.SetFavicon(id, favicon, time); EXPECT_TRUE(0 < db.AddIconMapping(url, id)); IconMapping icon_mapping; @@ -301,7 +301,7 @@ TEST_F(ThumbnailDatabaseTest, TemporayIconMapping) { GURL url("http://google.com"); FavIconID id = db.AddFavIcon(url, FAV_ICON); base::Time time = base::Time::Now(); - db.SetFavIcon(id, favicon, time); + db.SetFavicon(id, favicon, time); db.AddToTemporaryIconMappingTable(url, id); db.CommitTemporaryIconMappingTable(); @@ -323,7 +323,7 @@ TEST_F(ThumbnailDatabaseTest, GetIconMappingsForPageURLForReturnOrder) { GURL url("http://google.com"); FavIconID id = db.AddFavIcon(url, FAV_ICON); base::Time time = base::Time::Now(); - db.SetFavIcon(id, favicon, time); + db.SetFavicon(id, favicon, time); EXPECT_NE(0, db.AddIconMapping(url, id)); std::vector<IconMapping> icon_mapping; @@ -338,7 +338,7 @@ TEST_F(ThumbnailDatabaseTest, GetIconMappingsForPageURLForReturnOrder) { scoped_refptr<RefCountedBytes> favicon2(new RefCountedBytes(data)); FavIconID id2 = db.AddFavIcon(url, TOUCH_ICON); - db.SetFavIcon(id2, favicon2, time); + db.SetFavicon(id2, favicon2, time); EXPECT_NE(0, db.AddIconMapping(url, id2)); icon_mapping.clear(); @@ -352,7 +352,7 @@ TEST_F(ThumbnailDatabaseTest, GetIconMappingsForPageURLForReturnOrder) { scoped_refptr<RefCountedBytes> favicon3(new RefCountedBytes(data2)); FavIconID id3 = db.AddFavIcon(url, TOUCH_PRECOMPOSED_ICON); - db.SetFavIcon(id3, favicon3, time); + db.SetFavicon(id3, favicon3, time); EXPECT_NE(0, db.AddIconMapping(url, id3)); icon_mapping.clear(); @@ -375,19 +375,19 @@ TEST_F(ThumbnailDatabaseTest, HasMappingFor) { FavIconID id1 = db.AddFavIcon(GURL("http://google.com"), FAV_ICON); EXPECT_NE(id1, 0); base::Time time = base::Time::Now(); - db.SetFavIcon(id1, favicon, time); + db.SetFavicon(id1, favicon, time); // Add another type of favicon FavIconID id2 = db.AddFavIcon(GURL("http://www.google.com/icon"), TOUCH_ICON); EXPECT_NE(id2, 0); time = base::Time::Now(); - db.SetFavIcon(id2, favicon, time); + db.SetFavicon(id2, favicon, time); // Add 3rd favicon FavIconID id3 = db.AddFavIcon(GURL("http://www.google.com/icon"), TOUCH_ICON); EXPECT_NE(id3, 0); time = base::Time::Now(); - db.SetFavIcon(id3, favicon, time); + db.SetFavicon(id3, favicon, time); // Add 2 icon mapping GURL page_url("http://www.google.com"); |