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

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

Issue 8669014: Fix a bug where redirect chain gets lost on process swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/renderer_host/render_view_host_notification_task.h
diff --git a/content/browser/renderer_host/render_view_host_notification_task.h b/content/browser/renderer_host/render_view_host_notification_task.h
index 2629353310cc4be08b99455e3f328f3c125d5a04..2b686e698559b73c202f8859e1411c78af8f15ed 100644
--- a/content/browser/renderer_host/render_view_host_notification_task.h
+++ b/content/browser/renderer_host/render_view_host_notification_task.h
@@ -70,6 +70,30 @@ inline void CallRenderViewHostHelper(int render_process_id, int render_view_id,
method,
params));
}
+
+class RenderViewHostToDelegate {
+ public:
+ typedef RenderViewHostDelegate MappedType;
+ static MappedType* Map(RenderViewHost* rvh) {
+ return rvh ? rvh->delegate() : NULL;
+ }
+};
+
+template <typename Method, typename Params>
+inline void CallRenderViewHostDelegateHelper(
+ int render_process_id,
+ int render_view_id,
+ Method method,
+ const Params& params) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ new RenderViewHostNotificationTask<
+ Method, Params, RenderViewHostToDelegate>(
+ render_process_id,
+ render_view_id,
+ method,
+ params));
+}
Matt Perry 2011/11/23 02:51:20 this stuff is only necessary for step 1 of the hac
// For proxying calls to RenderViewHostDelegate::RendererManagement
@@ -135,7 +159,69 @@ inline void CallRenderViewHost(int render_process_id,
method,
MakeTuple(a, b));
}
-
+
+// ----------------------------------------------------------------------------
+// Proxy calls to the specified RenderViewHostDelegate.
+
+template <typename Method>
+inline void CallRenderViewHostDelegate(int render_process_id,
+ int render_view_id,
+ Method method) {
+ internal::CallRenderViewHostDelegateHelper(render_process_id,
+ render_view_id,
+ method,
+ MakeTuple());
+}
+
+template <typename Method, typename A>
+inline void CallRenderViewHostDelegate(int render_process_id,
+ int render_view_id,
+ Method method,
+ const A& a) {
+ internal::CallRenderViewHostDelegateHelper(render_process_id,
+ render_view_id,
+ method,
+ MakeTuple(a));
+}
+
+template <typename Method, typename A, typename B>
+inline void CallRenderViewHostDelegate(int render_process_id,
+ int render_view_id,
+ Method method,
+ const A& a,
+ const B& b) {
+ internal::CallRenderViewHostDelegateHelper(render_process_id,
+ render_view_id,
+ method,
+ MakeTuple(a, b));
+}
+
+template <typename Method, typename A, typename B, typename C>
+inline void CallRenderViewHostDelegate(int render_process_id,
+ int render_view_id,
+ Method method,
+ const A& a,
+ const B& b,
+ const C& c) {
+ internal::CallRenderViewHostDelegateHelper(render_process_id,
+ render_view_id,
+ method,
+ MakeTuple(a, b, c));
+}
+
+template <typename Method, typename A, typename B, typename C, typename D>
+inline void CallRenderViewHostDelegate(int render_process_id,
+ int render_view_id,
+ Method method,
+ const A& a,
+ const B& b,
+ const C& c,
+ const D& d) {
+ internal::CallRenderViewHostDelegateHelper(render_process_id,
+ render_view_id,
+ method,
+ MakeTuple(a, b, c, d));
+}
// ----------------------------------------------------------------------------
// Proxy calls to the specified RenderViewHost's RendererManagement delegate.

Powered by Google App Engine
This is Rietveld 408576698