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

Side by Side 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: Plumb script_injection_instance_id from WebViewGuest to script injection. 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 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 return is_active; 227 return is_active;
228 } 228 }
229 229
230 const Extension* Dispatcher::GetExtensionFromFrameAndWorld( 230 const Extension* Dispatcher::GetExtensionFromFrameAndWorld(
231 const WebFrame* frame, 231 const WebFrame* frame,
232 int world_id, 232 int world_id,
233 bool use_effective_url) { 233 bool use_effective_url) {
234 std::string extension_id; 234 std::string extension_id;
235 if (world_id != 0) { 235 if (world_id != 0) {
236 // Isolated worlds (content script). 236 // Isolated worlds (content script).
237 extension_id = ScriptInjection::GetExtensionIdForIsolatedWorld(world_id); 237 extension_id =
238 ScriptInjection::GetHostIdForIsolatedWorld(world_id).id();
238 } else if (!frame->document().securityOrigin().isUnique()) { 239 } else if (!frame->document().securityOrigin().isUnique()) {
239 // TODO(kalman): Delete the above check. 240 // TODO(kalman): Delete the above check.
240 241
241 // Extension pages (chrome-extension:// URLs). 242 // Extension pages (chrome-extension:// URLs).
242 GURL frame_url = ScriptContext::GetDataSourceURLForFrame(frame); 243 GURL frame_url = ScriptContext::GetDataSourceURLForFrame(frame);
243 frame_url = ScriptContext::GetEffectiveDocumentURL( 244 frame_url = ScriptContext::GetEffectiveDocumentURL(
244 frame, frame_url, use_effective_url); 245 frame, frame_url, use_effective_url);
245 extension_id = extensions_.GetExtensionOrAppIDByURL(frame_url); 246 extension_id = extensions_.GetExtensionOrAppIDByURL(frame_url);
246 } 247 }
247 248
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 return v8::Handle<v8::Object>(); 1479 return v8::Handle<v8::Object>();
1479 1480
1480 if (bind_name) 1481 if (bind_name)
1481 *bind_name = split.back(); 1482 *bind_name = split.back();
1482 1483
1483 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1484 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1484 : bind_object; 1485 : bind_object;
1485 } 1486 }
1486 1487
1487 } // namespace extensions 1488 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698