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

Side by Side Diff: chrome/renderer/extensions/extension_dispatcher.cc

Issue 7619011: Simplify ExtensionMsg_Loaded_Params message interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension_messages.cc ('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 (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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 scoped_refptr<const Extension> extension(params.ConvertToExtension()); 144 scoped_refptr<const Extension> extension(params.ConvertToExtension());
145 if (!extension) { 145 if (!extension) {
146 // This can happen if extension parsing fails for any reason. One reason 146 // This can happen if extension parsing fails for any reason. One reason
147 // this can legitimately happen is if the 147 // this can legitimately happen is if the
148 // --enable-experimental-extension-apis changes at runtime, which happens 148 // --enable-experimental-extension-apis changes at runtime, which happens
149 // during browser tests. Existing renderers won't know about the change. 149 // during browser tests. Existing renderers won't know about the change.
150 return; 150 return;
151 } 151 }
152 152
153 extensions_.Insert(extension); 153 extensions_.Insert(extension);
154 extension->SetActivePermissions(params.GetActivePermissions());
155 } 154 }
156 155
157 void ExtensionDispatcher::OnUnloaded(const std::string& id) { 156 void ExtensionDispatcher::OnUnloaded(const std::string& id) {
158 extensions_.Remove(id); 157 extensions_.Remove(id);
159 // If the extension is later reloaded with a different set of permissions, 158 // If the extension is later reloaded with a different set of permissions,
160 // we'd like it to get a new isolated world ID, so that it can pick up the 159 // we'd like it to get a new isolated world ID, so that it can pick up the
161 // changed origin whitelist. 160 // changed origin whitelist.
162 UserScriptSlave::RemoveIsolatedWorld(id); 161 UserScriptSlave::RemoveIsolatedWorld(id);
163 } 162 }
164 163
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 child_process_logging::SetActiveExtensions(active_extensions); 325 child_process_logging::SetActiveExtensions(active_extensions);
327 } 326 }
328 327
329 void ExtensionDispatcher::RegisterExtension(v8::Extension* extension, 328 void ExtensionDispatcher::RegisterExtension(v8::Extension* extension,
330 bool restrict_to_extensions) { 329 bool restrict_to_extensions) {
331 if (restrict_to_extensions) 330 if (restrict_to_extensions)
332 restricted_v8_extensions_.insert(extension->name()); 331 restricted_v8_extensions_.insert(extension->name());
333 332
334 RenderThread::current()->RegisterExtension(extension); 333 RenderThread::current()->RegisterExtension(extension);
335 } 334 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_messages.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698