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

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

Issue 934763003: Refactoring: de-couple Extensions from "script injection System" [render side]:3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_brower_isolated_world_routingid_user_script_1
Patch Set: Rebase. Created 5 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 } 1029 }
1030 1030
1031 void Dispatcher::OnTransferBlobs(const std::vector<std::string>& blob_uuids) { 1031 void Dispatcher::OnTransferBlobs(const std::vector<std::string>& blob_uuids) {
1032 RenderThread::Get()->Send(new ExtensionHostMsg_TransferBlobsAck(blob_uuids)); 1032 RenderThread::Get()->Send(new ExtensionHostMsg_TransferBlobsAck(blob_uuids));
1033 } 1033 }
1034 1034
1035 void Dispatcher::OnUnloaded(const std::string& id) { 1035 void Dispatcher::OnUnloaded(const std::string& id) {
1036 extensions_.Remove(id); 1036 extensions_.Remove(id);
1037 active_extension_ids_.erase(id); 1037 active_extension_ids_.erase(id);
1038 1038
1039 script_injection_manager_->OnExtensionUnloaded(id);
1040
1039 // If the extension is later reloaded with a different set of permissions, 1041 // If the extension is later reloaded with a different set of permissions,
1040 // we'd like it to get a new isolated world ID, so that it can pick up the 1042 // we'd like it to get a new isolated world ID, so that it can pick up the
1041 // changed origin whitelist. 1043 // changed origin whitelist.
1042 ScriptInjection::RemoveIsolatedWorld(id); 1044 ScriptInjection::RemoveIsolatedWorld(id);
1043 1045
1044 // Invalidate all of the contexts that were removed. 1046 // Invalidate all of the contexts that were removed.
1045 // TODO(kalman): add an invalidation observer interface to ScriptContext. 1047 // TODO(kalman): add an invalidation observer interface to ScriptContext.
1046 ScriptContextSet::ContextSet removed_contexts = 1048 ScriptContextSet::ContextSet removed_contexts =
1047 script_context_set_.OnExtensionUnloaded(id); 1049 script_context_set_.OnExtensionUnloaded(id);
1048 for (ScriptContextSet::ContextSet::iterator it = removed_contexts.begin(); 1050 for (ScriptContextSet::ContextSet::iterator it = removed_contexts.begin();
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 return v8::Handle<v8::Object>(); 1551 return v8::Handle<v8::Object>();
1550 1552
1551 if (bind_name) 1553 if (bind_name)
1552 *bind_name = split.back(); 1554 *bind_name = split.back();
1553 1555
1554 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1556 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1555 : bind_object; 1557 : bind_object;
1556 } 1558 }
1557 1559
1558 } // namespace extensions 1560 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698