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

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

Issue 11882035: Stop sending events and messages to content script contexts after their (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/renderer/extensions/chrome_v8_context_set.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/dispatcher.h" 5 #include "chrome/renderer/extensions/dispatcher.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 void Dispatcher::OnUnloaded(const std::string& id) { 498 void Dispatcher::OnUnloaded(const std::string& id) {
499 extensions_.Remove(id); 499 extensions_.Remove(id);
500 active_extension_ids_.erase(id); 500 active_extension_ids_.erase(id);
501 501
502 // If the extension is later reloaded with a different set of permissions, 502 // If the extension is later reloaded with a different set of permissions,
503 // we'd like it to get a new isolated world ID, so that it can pick up the 503 // we'd like it to get a new isolated world ID, so that it can pick up the
504 // changed origin whitelist. 504 // changed origin whitelist.
505 user_script_slave_->RemoveIsolatedWorld(id); 505 user_script_slave_->RemoveIsolatedWorld(id);
506 506
507 v8_context_set_.OnExtensionUnloaded(id);
508
507 // We don't do anything with existing platform-app stylesheets. They will 509 // We don't do anything with existing platform-app stylesheets. They will
508 // stay resident, but the URL pattern corresponding to the unloaded 510 // stay resident, but the URL pattern corresponding to the unloaded
509 // extension's URL just won't match anything anymore. 511 // extension's URL just won't match anything anymore.
510 } 512 }
511 513
512 void Dispatcher::OnSetScriptingWhitelist( 514 void Dispatcher::OnSetScriptingWhitelist(
513 const Extension::ScriptingWhitelist& extension_ids) { 515 const Extension::ScriptingWhitelist& extension_ids) {
514 Extension::SetScriptingWhitelist(extension_ids); 516 Extension::SetScriptingWhitelist(extension_ids);
515 } 517 }
516 518
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); 1133 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str());
1132 v8::ThrowException( 1134 v8::ThrowException(
1133 v8::Exception::Error(v8::String::New(error_msg.c_str()))); 1135 v8::Exception::Error(v8::String::New(error_msg.c_str())));
1134 return false; 1136 return false;
1135 } 1137 }
1136 1138
1137 return true; 1139 return true;
1138 } 1140 }
1139 1141
1140 } // namespace extensions 1142 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/chrome_v8_context_set.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698