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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1257603003: Revert of Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index c7314b4ad4b5645f75fe126caa498a8326fe197f..81aa7c30c1a561f5f76398b39242903972e2dcac 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -92,10 +92,6 @@
// The next value to use for the javascript callback id.
int g_next_javascript_callback_id = 1;
-// Whether to allow injecting javascript into any kind of frame (for Android
-// WebView).
-bool g_allow_injecting_javascript = false;
-
// The (process id, routing id) pair that identifies one RenderFrame.
typedef std::pair<int32, int32> RenderFrameHostID;
typedef base::hash_map<RenderFrameHostID, RenderFrameHostImpl*>
@@ -128,11 +124,6 @@
RenderFrameHost* RenderFrameHost::FromID(int render_process_id,
int render_frame_id) {
return RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
-}
-
-// static
-void RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView() {
- g_allow_injecting_javascript = true;
}
// static
@@ -281,7 +272,6 @@
void RenderFrameHostImpl::ExecuteJavaScript(
const base::string16& javascript) {
- CHECK(CanExecuteJavaScript());
Send(new FrameMsg_JavaScriptExecuteRequest(routing_id_,
javascript,
0, false));
@@ -290,30 +280,12 @@
void RenderFrameHostImpl::ExecuteJavaScript(
const base::string16& javascript,
const JavaScriptResultCallback& callback) {
- CHECK(CanExecuteJavaScript());
int key = g_next_javascript_callback_id++;
Send(new FrameMsg_JavaScriptExecuteRequest(routing_id_,
javascript,
key, true));
javascript_callbacks_.insert(std::make_pair(key, callback));
}
-
-void RenderFrameHostImpl::ExecuteJavaScriptForTests(
- const base::string16& javascript) {
- Send(new FrameMsg_JavaScriptExecuteRequestForTests(routing_id_,
- javascript,
- 0, false, false));
-}
-
-void RenderFrameHostImpl::ExecuteJavaScriptForTests(
- const base::string16& javascript,
- const JavaScriptResultCallback& callback) {
- int key = g_next_javascript_callback_id++;
- Send(new FrameMsg_JavaScriptExecuteRequestForTests(routing_id_, javascript,
- key, true, false));
- javascript_callbacks_.insert(std::make_pair(key, callback));
-}
-
void RenderFrameHostImpl::ExecuteJavaScriptWithUserGestureForTests(
const base::string16& javascript) {
@@ -2160,16 +2132,4 @@
}
}
-bool RenderFrameHostImpl::CanExecuteJavaScript() {
- return g_allow_injecting_javascript ||
- frame_tree_node_->current_url().SchemeIs(kChromeDevToolsScheme) ||
- ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
- GetProcess()->GetID()) ||
- // It's possible to load about:blank in a Web UI renderer.
- // See http://crbug.com/42547
- (frame_tree_node_->current_url().spec() == url::kAboutBlankURL) ||
- // InterstitialPageImpl should be the only case matching this.
- (delegate_->GetAsWebContents() == nullptr);
-}
-
} // namespace content
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/web_contents/web_contents_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698