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

Unified Diff: content/browser/renderer_host/render_view_host_impl.h

Issue 11746019: Introduce callback interface for running Javascript asynchronously in the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: .insert Created 7 years, 12 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 | « no previous file | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host_impl.h
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index 930597e3782812f5ff5fc072879d02651f963fd1..c21530472326f20a16765e9d29a5b23eee9cc8d8 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
#define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_
+#include <map>
#include <string>
#include <vector>
@@ -42,6 +43,7 @@ struct ViewMsg_StopFinding_Params;
namespace base {
class ListValue;
+class Value;
}
namespace ui {
@@ -79,11 +81,11 @@ class ExecuteNotificationObserver : public NotificationObserver {
int id() const { return id_; }
- Value* value() const { return value_.get(); }
+ base::Value* value() const { return value_.get(); }
private:
int id_;
- scoped_ptr<Value> value_;
+ scoped_ptr<base::Value> value_;
DISALLOW_COPY_AND_ASSIGN(ExecuteNotificationObserver);
};
@@ -193,8 +195,13 @@ class CONTENT_EXPORT RenderViewHostImpl
virtual int ExecuteJavascriptInWebFrameNotifyResult(
const string16& frame_xpath,
const string16& jscript) OVERRIDE;
- virtual Value* ExecuteJavascriptAndGetValue(const string16& frame_xpath,
- const string16& jscript) OVERRIDE;
+ virtual void ExecuteJavascriptInWebFrameCallbackResult(
+ const string16& frame_xpath,
+ const string16& jscript,
+ const JavascriptResultCallback& callback) OVERRIDE;
+ virtual base::Value* ExecuteJavascriptAndGetValue(
+ const string16& frame_xpath,
+ const string16& jscript) OVERRIDE;
virtual void ExecutePluginActionAtLocation(
const gfx::Point& location,
const WebKit::WebPluginAction& action) OVERRIDE;
@@ -657,6 +664,11 @@ class CONTENT_EXPORT RenderViewHostImpl
bool are_javascript_messages_suppressed_;
+ // The mapping of pending javascript calls created by
+ // ExecuteJavascriptInWebFrameCallbackResult and their corresponding
+ // callbacks.
+ std::map<int, JavascriptResultCallback> javascript_callbacks_;
+
// True if the render view can be shut down suddenly.
bool sudden_termination_allowed_;
« no previous file with comments | « no previous file | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698