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

Unified Diff: extensions/renderer/dispatcher.cc

Issue 885493007: Refactoring: de-couple Extensions from "script injection System" [render side] : 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Devlin's comments. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/dispatcher.cc
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index fe8073a87594236d9a9451320fc519109aeff19c..16543cf6fbd4f4310330f6fd68ec0a4d0af15143 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -235,7 +235,8 @@ const Extension* Dispatcher::GetExtensionFromFrameAndWorld(
std::string extension_id;
if (world_id != 0) {
// Isolated worlds (content script).
- extension_id = ScriptInjection::GetExtensionIdForIsolatedWorld(world_id);
+ extension_id =
+ ScriptInjection::GetHostIdForIsolatedWorld(world_id).id();
} else if (!frame->document().securityOrigin().isUnique()) {
// TODO(kalman): Delete the above check.
@@ -1031,7 +1032,7 @@ void Dispatcher::OnUnloaded(const std::string& id) {
// If the extension is later reloaded with a different set of permissions,
// we'd like it to get a new isolated world ID, so that it can pick up the
// changed origin whitelist.
- ScriptInjection::RemoveIsolatedWorld(id);
+ ScriptInjection::RemoveIsolatedWorld(HostID(HostID::EXTENSIONS, id));
// Invalidate all of the contexts that were removed.
// TODO(kalman): add an invalidation observer interface to ScriptContext.

Powered by Google App Engine
This is Rietveld 408576698