diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 09:53:29 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 09:53:29 +0000 |
commit | f272970905d631af495244a06ab770be24afaed9 (patch) | |
tree | b45f42305dabca1195d075a7ef5b48a0bb1af614 /chrome/browser/browsing_data_database_helper.cc | |
parent | 6bf710d8db08e7be62d618cd1788dcabec334200 (diff) | |
download | chromium_src-f272970905d631af495244a06ab770be24afaed9.zip chromium_src-f272970905d631af495244a06ab770be24afaed9.tar.gz chromium_src-f272970905d631af495244a06ab770be24afaed9.tar.bz2 |
Only store unique entries in the canned browsing data helpers.
BUG=45230
TEST=Canned*.Unique
Review URL: http://codereview.chromium.org/2854045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data_database_helper.cc')
-rw-r--r-- | chrome/browser/browsing_data_database_helper.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/browsing_data_database_helper.cc b/chrome/browser/browsing_data_database_helper.cc index 0530225..09db4c8 100644 --- a/chrome/browser/browsing_data_database_helper.cc +++ b/chrome/browser/browsing_data_database_helper.cc @@ -122,10 +122,20 @@ void CannedBrowsingDataDatabaseHelper::AddDatabase( WebKit::WebSecurityOrigin web_security_origin = WebKit::WebSecurityOrigin::createFromString( UTF8ToUTF16(origin.spec())); + std::string origin_identifier = + web_security_origin.databaseIdentifier().utf8(); + + for (std::vector<DatabaseInfo>::iterator database = database_info_.begin(); + database != database_info_.end(); ++database) { + if (database->origin_identifier == origin_identifier && + database->database_name == name) + return; + } + database_info_.push_back(DatabaseInfo( web_security_origin.host().utf8(), name, - web_security_origin.databaseIdentifier().utf8(), + origin_identifier, description, 0, base::Time())); |