OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/extensions/extension_dispatcher.h" | 5 #include "chrome/renderer/extensions/extension_dispatcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/common/child_process_logging.h" | 8 #include "chrome/common/child_process_logging.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 // --enable-experimental-extension-apis changes at runtime, which happens | 146 // --enable-experimental-extension-apis changes at runtime, which happens |
147 // during browser tests. Existing renderers won't know about the change. | 147 // during browser tests. Existing renderers won't know about the change. |
148 return; | 148 return; |
149 } | 149 } |
150 | 150 |
151 extensions_.Insert(extension); | 151 extensions_.Insert(extension); |
152 } | 152 } |
153 | 153 |
154 void ExtensionDispatcher::OnUnloaded(const std::string& id) { | 154 void ExtensionDispatcher::OnUnloaded(const std::string& id) { |
155 extensions_.Remove(id); | 155 extensions_.Remove(id); |
156 UserScriptSlave::RemoveIsolatedWorld(id); | |
Matt Perry
2011/05/27 22:14:35
Could you add a comment here explaining that we do
| |
156 } | 157 } |
157 | 158 |
158 void ExtensionDispatcher::OnSetScriptingWhitelist( | 159 void ExtensionDispatcher::OnSetScriptingWhitelist( |
159 const Extension::ScriptingWhitelist& extension_ids) { | 160 const Extension::ScriptingWhitelist& extension_ids) { |
160 Extension::SetScriptingWhitelist(extension_ids); | 161 Extension::SetScriptingWhitelist(extension_ids); |
161 } | 162 } |
162 | 163 |
163 bool ExtensionDispatcher::IsExtensionActive(const std::string& extension_id) { | 164 bool ExtensionDispatcher::IsExtensionActive(const std::string& extension_id) { |
164 return active_extension_ids_.find(extension_id) != | 165 return active_extension_ids_.find(extension_id) != |
165 active_extension_ids_.end(); | 166 active_extension_ids_.end(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 child_process_logging::SetActiveExtensions(active_extensions); | 265 child_process_logging::SetActiveExtensions(active_extensions); |
265 } | 266 } |
266 | 267 |
267 void ExtensionDispatcher::RegisterExtension(v8::Extension* extension, | 268 void ExtensionDispatcher::RegisterExtension(v8::Extension* extension, |
268 bool restrict_to_extensions) { | 269 bool restrict_to_extensions) { |
269 if (restrict_to_extensions) | 270 if (restrict_to_extensions) |
270 restricted_v8_extensions_.insert(extension->name()); | 271 restricted_v8_extensions_.insert(extension->name()); |
271 | 272 |
272 RenderThread::current()->RegisterExtension(extension); | 273 RenderThread::current()->RegisterExtension(extension); |
273 } | 274 } |
OLD | NEW |