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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_service_worker_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
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_service_worker_helper.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_service_worker_helper.h" 5 #include "chrome/browser/browsing_data/browsing_data_service_worker_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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 CannedBrowsingDataServiceWorkerHelper::CannedBrowsingDataServiceWorkerHelper( 116 CannedBrowsingDataServiceWorkerHelper::CannedBrowsingDataServiceWorkerHelper(
117 content::ServiceWorkerContext* context) 117 content::ServiceWorkerContext* context)
118 : BrowsingDataServiceWorkerHelper(context) { 118 : BrowsingDataServiceWorkerHelper(context) {
119 } 119 }
120 120
121 CannedBrowsingDataServiceWorkerHelper:: 121 CannedBrowsingDataServiceWorkerHelper::
122 ~CannedBrowsingDataServiceWorkerHelper() { 122 ~CannedBrowsingDataServiceWorkerHelper() {
123 } 123 }
124 124
125 CannedBrowsingDataServiceWorkerHelper*
126 CannedBrowsingDataServiceWorkerHelper::Clone() {
127 DCHECK_CURRENTLY_ON(BrowserThread::UI);
128 CannedBrowsingDataServiceWorkerHelper* clone =
129 new CannedBrowsingDataServiceWorkerHelper(service_worker_context_);
130
131 clone->pending_service_worker_info_ = pending_service_worker_info_;
132 clone->service_worker_info_ = service_worker_info_;
133 return clone;
134 }
135
136 void CannedBrowsingDataServiceWorkerHelper::AddServiceWorker( 125 void CannedBrowsingDataServiceWorkerHelper::AddServiceWorker(
137 const GURL& origin, const std::vector<GURL>& scopes) { 126 const GURL& origin, const std::vector<GURL>& scopes) {
138 if (!BrowsingDataHelper::HasWebScheme(origin)) 127 if (!BrowsingDataHelper::HasWebScheme(origin))
139 return; // Non-websafe state is not considered browsing data. 128 return; // Non-websafe state is not considered browsing data.
140 129
141 pending_service_worker_info_.insert( 130 pending_service_worker_info_.insert(
142 PendingServiceWorkerUsageInfo(origin, scopes)); 131 PendingServiceWorkerUsageInfo(origin, scopes));
143 } 132 }
144 133
145 void CannedBrowsingDataServiceWorkerHelper::Reset() { 134 void CannedBrowsingDataServiceWorkerHelper::Reset() {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 for (std::set<PendingServiceWorkerUsageInfo>::iterator it = 174 for (std::set<PendingServiceWorkerUsageInfo>::iterator it =
186 pending_service_worker_info_.begin(); 175 pending_service_worker_info_.begin();
187 it != pending_service_worker_info_.end();) { 176 it != pending_service_worker_info_.end();) {
188 if (it->origin == origin) 177 if (it->origin == origin)
189 pending_service_worker_info_.erase(it++); 178 pending_service_worker_info_.erase(it++);
190 else 179 else
191 ++it; 180 ++it;
192 } 181 }
193 BrowsingDataServiceWorkerHelper::DeleteServiceWorkers(origin); 182 BrowsingDataServiceWorkerHelper::DeleteServiceWorkers(origin);
194 } 183 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_service_worker_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698