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

Unified Diff: content/renderer/render_widget.h

Issue 2483593002: RenderWidget: hoist synchronous IPC out of Init methods. (Closed)
Patch Set: Rework 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
Index: content/renderer/render_widget.h
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 46419374cc1837758d216c0018ab9de42e284699..8444af4327051138c4b07ef7b7ac0351ae0c2213 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -128,7 +128,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,
@@ -403,8 +403,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 +424,11 @@ 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 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, after the routing_id is
+ // available, to perform initialization.
+ void Init(int32_t routing_id,
+ 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.
@@ -801,15 +797,12 @@ class CONTENT_EXPORT RenderWidget
std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
private:
+
// Applies/Removes the DevTools device emulation transformation to/from a
// window rect.
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_;

Powered by Google App Engine
This is Rietveld 408576698