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

Unified Diff: content/renderer/render_view_impl.cc

Issue 208793005: Remove JavaScript execution from RenderViewHost. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index ec6cb60b2b097f63321cf20f60479905acd164a2..5e2e3167a2b395a04338e0743b261ce2ac676e3a 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1093,7 +1093,6 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding)
IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault,
OnResetPageEncodingToDefault)
- IPC_MESSAGE_HANDLER(ViewMsg_ScriptEvalRequest, OnScriptEvalRequest)
IPC_MESSAGE_HANDLER(ViewMsg_PostMessageEvent, OnPostMessageEvent)
IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter)
IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver)
@@ -3054,56 +3053,6 @@ bool RenderViewImpl::IsEditableNode(const WebNode& node) const {
return false;
}
-void RenderViewImpl::EvaluateScript(const base::string16& frame_xpath,
- const base::string16& jscript,
- int id,
- bool notify_result) {
- v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
- v8::Handle<v8::Value> result;
-
- WebFrame* web_frame;
- if (frame_xpath.empty()) {
- web_frame = webview()->mainFrame();
- } else {
- // The |frame_xpath| string can represent a frame deep down the tree (across
- // multiple frame DOMs).
- //
- // For example,
- // /html/body/table/tbody/tr/td/iframe\n/frameset/frame[0]
- // should break into 2 xpaths:
- // /html/body/table/tbody/tr/td/iframe
- // /frameset/frame[0]
- std::vector<base::string16> xpaths;
- base::SplitString(frame_xpath, '\n', &xpaths);
-
- WebFrame* frame = webview()->mainFrame();
- for (std::vector<base::string16>::const_iterator i = xpaths.begin();
- frame && i != xpaths.end(); ++i) {
- frame = frame->findChildByExpression(*i);
- }
-
- web_frame = frame;
- }
-
- if (web_frame)
- result = web_frame->executeScriptAndReturnValue(WebScriptSource(jscript));
- if (notify_result) {
- base::ListValue list;
- if (!result.IsEmpty() && web_frame) {
- v8::Local<v8::Context> context = web_frame->mainWorldScriptContext();
- v8::Context::Scope context_scope(context);
- V8ValueConverterImpl converter;
- converter.SetDateAllowed(true);
- converter.SetRegExpAllowed(true);
- base::Value* result_value = converter.FromV8Value(result, context);
- list.Set(0, result_value ? result_value : base::Value::CreateNullValue());
- } else {
- list.Set(0, base::Value::CreateNullValue());
- }
- Send(new ViewHostMsg_ScriptEvalResponse(routing_id_, id, list));
- }
-}
-
bool RenderViewImpl::ShouldDisplayScrollbars(int width, int height) const {
return (!send_preferred_size_changes_ ||
(disable_scrollbars_size_limit_.width() <= width ||
@@ -3447,15 +3396,6 @@ void RenderViewImpl::OnResetPageEncodingToDefault() {
webview()->setPageEncoding(no_encoding);
}
-void RenderViewImpl::OnScriptEvalRequest(const base::string16& frame_xpath,
- const base::string16& jscript,
- int id,
- bool notify_result) {
- TRACE_EVENT_INSTANT0("test_tracing", "OnScriptEvalRequest",
- TRACE_EVENT_SCOPE_THREAD);
- EvaluateScript(frame_xpath, jscript, id, notify_result);
-}
-
void RenderViewImpl::OnPostMessageEvent(
const ViewMsg_PostMessage_Params& params) {
// TODO(nasko): Support sending to subframes.
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698