| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |