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

Unified Diff: extensions/renderer/script_injection.cc

Issue 594043002: Change ScriptInjection to work with WebLocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « extensions/renderer/script_injection.h ('k') | extensions/renderer/script_injection_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/script_injection.cc
diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc
index 2a68720c9e43da2ba1d25ce59e6ef7c5a489c804..ea588fe90a47b20b2353411dc9ede8a463d6fc84 100644
--- a/extensions/renderer/script_injection.cc
+++ b/extensions/renderer/script_injection.cc
@@ -21,7 +21,7 @@
#include "extensions/renderer/extensions_renderer_client.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebDocument.h"
-#include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebScopedUserGesture.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
#include "third_party/WebKit/public/web/WebSecurityOrigin.h"
@@ -59,7 +59,7 @@ void AppendAllChildFrames(blink::WebFrame* parent_frame,
// |frame|. If no isolated world has been created for that extension,
// one will be created and initialized.
int GetIsolatedWorldIdForExtension(const Extension* extension,
- blink::WebFrame* frame) {
+ blink::WebLocalFrame* frame) {
static int g_next_isolated_world_id =
ExtensionsRendererClient::Get()->GetLowestIsolatedWorldId();
@@ -114,7 +114,7 @@ void ScriptInjection::RemoveIsolatedWorld(const std::string& extension_id) {
ScriptInjection::ScriptInjection(
scoped_ptr<ScriptInjector> injector,
- blink::WebFrame* web_frame,
+ blink::WebLocalFrame* web_frame,
const std::string& extension_id,
UserScript::RunLocation run_location,
int tab_id)
@@ -223,7 +223,9 @@ void ScriptInjection::Inject(const Extension* extension,
for (std::vector<blink::WebFrame*>::iterator iter = frame_vector.begin();
iter != frame_vector.end();
++iter) {
- blink::WebFrame* frame = *iter;
+ // TODO(dcheng): Unfortunately, the code as written won't work in an OOPI
+ // world. This is just a temporary hack to make things compile.
+ blink::WebLocalFrame* frame = (*iter)->toWebLocalFrame();
// We recheck access here in the renderer for extra safety against races
// with navigation, but different frames can have different URLs, and the
@@ -251,7 +253,7 @@ void ScriptInjection::Inject(const Extension* extension,
}
void ScriptInjection::InjectJs(const Extension* extension,
- blink::WebFrame* frame,
+ blink::WebLocalFrame* frame,
base::ListValue* execution_results) {
std::vector<blink::WebScriptSource> sources =
injector_->GetJsSources(run_location_);
@@ -307,7 +309,7 @@ void ScriptInjection::InjectJs(const Extension* extension,
}
}
-void ScriptInjection::InjectCss(blink::WebFrame* frame) {
+void ScriptInjection::InjectCss(blink::WebLocalFrame* frame) {
std::vector<std::string> css_sources =
injector_->GetCssSources(run_location_);
for (std::vector<std::string>::const_iterator iter = css_sources.begin();
« no previous file with comments | « extensions/renderer/script_injection.h ('k') | extensions/renderer/script_injection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698