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

Unified Diff: content/renderer/render_widget.h

Issue 2496633004: Revert of RenderWidget: hoist synchronous IPC out of Init methods. (Closed)
Patch Set: 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 280ca7dc392cb710cf92df36f5e1c17f68c3665e..87866408934b1d6e9a731f74ebec8a9637f40a4c 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -33,7 +33,6 @@
#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"
@@ -129,7 +128,7 @@
const ScreenInfo& screen_info);
// Creates a new RenderWidget that will be attached to a RenderFrame.
- static RenderWidget* CreateForFrame(int widget_routing_id,
+ static RenderWidget* CreateForFrame(int routing_id,
bool hidden,
const ScreenInfo& screen_info,
CompositorDependencies* compositor_deps,
@@ -154,10 +153,8 @@
// https://crbug.com/545684
virtual void CloseForFrame();
- int32_t routing_id() const {
- DCHECK(routing_id_ != MSG_ROUTING_NONE);
- return routing_id_;
- }
+ int32_t routing_id() const { return routing_id_; }
+ void SetRoutingID(int32_t routing_id);
CompositorDependencies* compositor_deps() const { return compositor_deps_; }
virtual blink::WebWidget* GetWebWidget() const;
@@ -406,6 +403,8 @@
// For unit tests.
friend class RenderWidgetTest;
+ using CreateWidgetCallback = base::OnceCallback<bool()>;
+
enum ResizeAck {
SEND_RESIZE_ACK,
NO_RESIZE_ACK,
@@ -427,12 +426,13 @@
// Creates a WebWidget based on the popup type.
static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget);
- // 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 Create() functions and subclasses to finish initialization.
- void Init(int32_t opener_id, blink::WebWidget* web_widget);
+ // Initializes this view with the given opener.
+ bool Init(int32_t opener_id);
+
+ // Called by Init and subclasses to perform initialization.
+ bool DoInit(int32_t opener_id,
+ blink::WebWidget* web_widget,
+ CreateWidgetCallback create_widget_callback);
// Allows the process to exit once the unload handler has finished, if there
// are no other active RenderWidgets.
@@ -793,6 +793,10 @@
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