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

Side by Side Diff: extensions/browser/info_map.cc

Issue 468033002: Remove worker process related codes from ContentBrowserClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 4 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 | « extensions/browser/info_map.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/info_map.h" 5 #include "extensions/browser/info_map.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "extensions/browser/content_verifier.h" 9 #include "extensions/browser/content_verifier.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 if (!process_map_.Remove(extension_id, process_id, site_instance_id)) { 122 if (!process_map_.Remove(extension_id, process_id, site_instance_id)) {
123 NOTREACHED() << "Unknown extension process registration for: " 123 NOTREACHED() << "Unknown extension process registration for: "
124 << extension_id << "," << process_id << "."; 124 << extension_id << "," << process_id << ".";
125 } 125 }
126 } 126 }
127 127
128 void InfoMap::UnregisterAllExtensionsInProcess(int process_id) { 128 void InfoMap::UnregisterAllExtensionsInProcess(int process_id) {
129 process_map_.RemoveAllFromProcess(process_id); 129 process_map_.RemoveAllFromProcess(process_id);
130 } 130 }
131 131
132 void InfoMap::RegisterExtensionWorkerProcess(const std::string& extension_id,
133 int process_id,
134 int site_instance_id) {
135 if (!worker_process_map_.Insert(extension_id, process_id, site_instance_id)) {
136 NOTREACHED() << "Duplicate extension worker process registration for: "
137 << extension_id << "," << process_id << ".";
138 }
139 }
140
141 void InfoMap::UnregisterExtensionWorkerProcess(int process_id) {
142 worker_process_map_.RemoveAllFromProcess(process_id);
143 }
144
145 void InfoMap::GetExtensionsWithAPIPermissionForSecurityOrigin( 132 void InfoMap::GetExtensionsWithAPIPermissionForSecurityOrigin(
146 const GURL& origin, 133 const GURL& origin,
147 int process_id, 134 int process_id,
148 APIPermission::ID permission, 135 APIPermission::ID permission,
149 ExtensionSet* extensions) const { 136 ExtensionSet* extensions) const {
150 DCHECK(extensions); 137 DCHECK(extensions);
151 138
152 if (origin.SchemeIs(kExtensionScheme)) { 139 if (origin.SchemeIs(kExtensionScheme)) {
153 const std::string& id = origin.host(); 140 const std::string& id = origin.host();
154 const Extension* extension = extensions_.GetByID(id); 141 const Extension* extension = extensions_.GetByID(id);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 263 }
277 264
278 InfoMap::~InfoMap() { 265 InfoMap::~InfoMap() {
279 if (quota_service_) { 266 if (quota_service_) {
280 BrowserThread::DeleteSoon( 267 BrowserThread::DeleteSoon(
281 BrowserThread::IO, FROM_HERE, quota_service_.release()); 268 BrowserThread::IO, FROM_HERE, quota_service_.release());
282 } 269 }
283 } 270 }
284 271
285 } // namespace extensions 272 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/info_map.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698