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

Unified Diff: content/renderer/render_widget.h

Issue 2483593002: RenderWidget: hoist synchronous IPC out of Init methods. (Closed)
Patch Set: Handle IPC failure Created 4 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
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.h
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 87866408934b1d6e9a731f74ebec8a9637f40a4c..280ca7dc392cb710cf92df36f5e1c17f68c3665e 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -33,6 +33,7 @@
#include "content/renderer/mouse_lock_dispatcher.h"
#include "content/renderer/render_widget_mouse_lock_dispatcher.h"
#include "ipc/ipc_listener.h"
+#include "ipc/ipc_message.h"
#include "ipc/ipc_sender.h"
#include "third_party/WebKit/public/platform/WebDisplayMode.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
@@ -128,7 +129,7 @@ class CONTENT_EXPORT RenderWidget
const ScreenInfo& screen_info);
// Creates a new RenderWidget that will be attached to a RenderFrame.
- static RenderWidget* CreateForFrame(int routing_id,
+ static RenderWidget* CreateForFrame(int widget_routing_id,
bool hidden,
const ScreenInfo& screen_info,
CompositorDependencies* compositor_deps,
@@ -153,8 +154,10 @@ class CONTENT_EXPORT RenderWidget
// https://crbug.com/545684
virtual void CloseForFrame();
- int32_t routing_id() const { return routing_id_; }
- void SetRoutingID(int32_t routing_id);
+ int32_t routing_id() const {
+ DCHECK(routing_id_ != MSG_ROUTING_NONE);
+ return routing_id_;
+ }
CompositorDependencies* compositor_deps() const { return compositor_deps_; }
virtual blink::WebWidget* GetWebWidget() const;
@@ -403,8 +406,6 @@ class CONTENT_EXPORT RenderWidget
// For unit tests.
friend class RenderWidgetTest;
- using CreateWidgetCallback = base::OnceCallback<bool()>;
-
enum ResizeAck {
SEND_RESIZE_ACK,
NO_RESIZE_ACK,
@@ -426,13 +427,12 @@ class CONTENT_EXPORT RenderWidget
// Creates a WebWidget based on the popup type.
static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget);
- // Initializes this view with the given opener.
- bool Init(int32_t opener_id);
+ // Called by Create() functions and subclasses, after the routing_id is
+ // available. Must be called before Init().
+ void InitRoutingID(int32_t routing_id);
- // Called by Init and subclasses to perform initialization.
- bool DoInit(int32_t opener_id,
- blink::WebWidget* web_widget,
- CreateWidgetCallback create_widget_callback);
+ // Called by Create() functions and subclasses to finish initialization.
+ void Init(int32_t opener_id, blink::WebWidget* web_widget);
// Allows the process to exit once the unload handler has finished, if there
// are no other active RenderWidgets.
@@ -793,10 +793,6 @@ class CONTENT_EXPORT RenderWidget
void ScreenRectToEmulatedIfNeeded(blink::WebRect* window_rect) const;
void EmulatedToScreenRectIfNeeded(blink::WebRect* window_rect) const;
- bool CreateWidget(int32_t opener_id,
- blink::WebPopupType popup_type,
- int32_t* routing_id);
-
// Indicates whether this widget has focus.
bool has_focus_;
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698