Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Side by Side Diff: chrome/browser/browsing_data/browsing_data_database_helper.cc

Issue 546663003: Remove Clone() from CannedBrowsingData*Helper classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" 5 #include "chrome/browser/browsing_data/browsing_data_database_helper.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 bool CannedBrowsingDataDatabaseHelper::PendingDatabaseInfo::operator<( 141 bool CannedBrowsingDataDatabaseHelper::PendingDatabaseInfo::operator<(
142 const PendingDatabaseInfo& other) const { 142 const PendingDatabaseInfo& other) const {
143 if (origin == other.origin) 143 if (origin == other.origin)
144 return name < other.name; 144 return name < other.name;
145 return origin < other.origin; 145 return origin < other.origin;
146 } 146 }
147 147
148 CannedBrowsingDataDatabaseHelper::CannedBrowsingDataDatabaseHelper( 148 CannedBrowsingDataDatabaseHelper::CannedBrowsingDataDatabaseHelper(
149 Profile* profile) 149 Profile* profile)
150 : BrowsingDataDatabaseHelper(profile), 150 : BrowsingDataDatabaseHelper(profile) {
151 profile_(profile) {
152 }
153
154 CannedBrowsingDataDatabaseHelper* CannedBrowsingDataDatabaseHelper::Clone() {
155 DCHECK_CURRENTLY_ON(BrowserThread::UI);
156 CannedBrowsingDataDatabaseHelper* clone =
157 new CannedBrowsingDataDatabaseHelper(profile_);
158
159 clone->pending_database_info_ = pending_database_info_;
160 return clone;
161 } 151 }
162 152
163 void CannedBrowsingDataDatabaseHelper::AddDatabase( 153 void CannedBrowsingDataDatabaseHelper::AddDatabase(
164 const GURL& origin, 154 const GURL& origin,
165 const std::string& name, 155 const std::string& name,
166 const std::string& description) { 156 const std::string& description) {
167 DCHECK_CURRENTLY_ON(BrowserThread::UI); 157 DCHECK_CURRENTLY_ON(BrowserThread::UI);
168 if (BrowsingDataHelper::HasWebScheme(origin)) { 158 if (BrowsingDataHelper::HasWebScheme(origin)) {
169 pending_database_info_.insert(PendingDatabaseInfo( 159 pending_database_info_.insert(PendingDatabaseInfo(
170 origin, name, description)); 160 origin, name, description));
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 ++it) { 216 ++it) {
227 if (it->origin == origin && it->name == name) { 217 if (it->origin == origin && it->name == name) {
228 pending_database_info_.erase(it); 218 pending_database_info_.erase(it);
229 break; 219 break;
230 } 220 }
231 } 221 }
232 BrowsingDataDatabaseHelper::DeleteDatabase(origin_identifier, name); 222 BrowsingDataDatabaseHelper::DeleteDatabase(origin_identifier, name);
233 } 223 }
234 224
235 CannedBrowsingDataDatabaseHelper::~CannedBrowsingDataDatabaseHelper() {} 225 CannedBrowsingDataDatabaseHelper::~CannedBrowsingDataDatabaseHelper() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698