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

Side by Side Diff: content/renderer/render_widget.h

Issue 801973002: Introduce CompositorDependencies for RenderWidgetCompositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compdep: . Created 6 years 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_
6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 namespace cc { 63 namespace cc {
64 class OutputSurface; 64 class OutputSurface;
65 class SwapPromise; 65 class SwapPromise;
66 } 66 }
67 67
68 namespace gfx { 68 namespace gfx {
69 class Range; 69 class Range;
70 } 70 }
71 71
72 namespace content { 72 namespace content {
73 class CompositorDependencies;
73 class ExternalPopupMenu; 74 class ExternalPopupMenu;
74 class FrameSwapMessageQueue; 75 class FrameSwapMessageQueue;
75 class PepperPluginInstanceImpl; 76 class PepperPluginInstanceImpl;
76 class RenderFrameImpl; 77 class RenderFrameImpl;
77 class RenderFrameProxy; 78 class RenderFrameProxy;
78 class RenderWidgetCompositor; 79 class RenderWidgetCompositor;
79 class RenderWidgetTest; 80 class RenderWidgetTest;
80 class ResizingModeSelector; 81 class ResizingModeSelector;
81 struct ContextMenuParams; 82 struct ContextMenuParams;
82 struct WebPluginGeometry; 83 struct WebPluginGeometry;
83 84
84 // RenderWidget provides a communication bridge between a WebWidget and 85 // RenderWidget provides a communication bridge between a WebWidget and
85 // a RenderWidgetHost, the latter of which lives in a different process. 86 // a RenderWidgetHost, the latter of which lives in a different process.
86 class CONTENT_EXPORT RenderWidget 87 class CONTENT_EXPORT RenderWidget
87 : public IPC::Listener, 88 : public IPC::Listener,
88 public IPC::Sender, 89 public IPC::Sender,
89 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), 90 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient),
90 public base::RefCounted<RenderWidget> { 91 public base::RefCounted<RenderWidget> {
91 public: 92 public:
92 // Creates a new RenderWidget. The opener_id is the routing ID of the 93 // Creates a new RenderWidget. The opener_id is the routing ID of the
93 // RenderView that this widget lives inside. 94 // RenderView that this widget lives inside.
94 static RenderWidget* Create(int32 opener_id, 95 static RenderWidget* Create(int32 opener_id,
96 CompositorDependencies* compositor_deps,
95 blink::WebPopupType popup_type, 97 blink::WebPopupType popup_type,
96 const blink::WebScreenInfo& screen_info); 98 const blink::WebScreenInfo& screen_info);
97 99
98 // Creates a WebWidget based on the popup type. 100 // Creates a WebWidget based on the popup type.
99 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); 101 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget);
100 102
101 int32 routing_id() const { return routing_id_; } 103 int32 routing_id() const { return routing_id_; }
102 int32 surface_id() const { return surface_id_; } 104 int32 surface_id() const { return surface_id_; }
105 CompositorDependencies* compositor_deps() const { return compositor_deps_; }
103 blink::WebWidget* webwidget() const { return webwidget_; } 106 blink::WebWidget* webwidget() const { return webwidget_; }
104 gfx::Size size() const { return size_; } 107 gfx::Size size() const { return size_; }
105 bool has_focus() const { return has_focus_; } 108 bool has_focus() const { return has_focus_; }
106 bool is_fullscreen() const { return is_fullscreen_; } 109 bool is_fullscreen() const { return is_fullscreen_; }
107 bool is_hidden() const { return is_hidden_; } 110 bool is_hidden() const { return is_hidden_; }
108 bool handling_input_event() const { return handling_input_event_; } 111 bool handling_input_event() const { return handling_input_event_; }
109 // Temporary for debugging purposes... 112 // Temporary for debugging purposes...
110 bool closing() const { return closing_; } 113 bool closing() const { return closing_; }
111 bool is_swapped_out() { return is_swapped_out_; } 114 bool is_swapped_out() { return is_swapped_out_; }
112 ui::MenuSourceType context_menu_source_type() { 115 ui::MenuSourceType context_menu_source_type() {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 RenderWidget(blink::WebPopupType popup_type, 322 RenderWidget(blink::WebPopupType popup_type,
320 const blink::WebScreenInfo& screen_info, 323 const blink::WebScreenInfo& screen_info,
321 bool swapped_out, 324 bool swapped_out,
322 bool hidden, 325 bool hidden,
323 bool never_visible); 326 bool never_visible);
324 327
325 ~RenderWidget() override; 328 ~RenderWidget() override;
326 329
327 // Initializes this view with the given opener. CompleteInit must be called 330 // Initializes this view with the given opener. CompleteInit must be called
328 // later. 331 // later.
329 bool Init(int32 opener_id); 332 bool Init(int32 opener_id, CompositorDependencies* compositor_deps);
330 333
331 // Called by Init and subclasses to perform initialization. 334 // Called by Init and subclasses to perform initialization.
332 bool DoInit(int32 opener_id, 335 bool DoInit(int32 opener_id,
336 CompositorDependencies* compositor_deps,
333 blink::WebWidget* web_widget, 337 blink::WebWidget* web_widget,
334 IPC::SyncMessage* create_widget_message); 338 IPC::SyncMessage* create_widget_message);
335 339
336 // Finishes creation of a pending view started with Init. 340 // Finishes creation of a pending view started with Init.
337 void CompleteInit(); 341 void CompleteInit();
338 342
339 // Sets whether this RenderWidget has been swapped out to be displayed by 343 // Sets whether this RenderWidget has been swapped out to be displayed by
340 // a RenderWidget in a different process. If so, no new IPC messages will be 344 // a RenderWidget in a different process. If so, no new IPC messages will be
341 // sent (only ACKs) and the process is free to exit when there are no other 345 // sent (only ACKs) and the process is free to exit when there are no other
342 // active RenderWidgets. 346 // active RenderWidgets.
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 552
549 // Creates a 3D context associated with this view. 553 // Creates a 3D context associated with this view.
550 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D(); 554 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D();
551 555
552 // Routing ID that allows us to communicate to the parent browser process 556 // Routing ID that allows us to communicate to the parent browser process
553 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. 557 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
554 int32 routing_id_; 558 int32 routing_id_;
555 559
556 int32 surface_id_; 560 int32 surface_id_;
557 561
562 // Dependencies for initializing a compositor, including flags for optional
563 // features.
564 CompositorDependencies* compositor_deps_;
565
558 // We are responsible for destroying this object via its Close method. 566 // We are responsible for destroying this object via its Close method.
559 // May be NULL when the window is closing. 567 // May be NULL when the window is closing.
560 blink::WebWidget* webwidget_; 568 blink::WebWidget* webwidget_;
561 569
562 // This is lazily constructed and must not outlive webwidget_. 570 // This is lazily constructed and must not outlive webwidget_.
563 scoped_ptr<RenderWidgetCompositor> compositor_; 571 scoped_ptr<RenderWidgetCompositor> compositor_;
564 572
565 // Set to the ID of the view that initiated creating this view, if any. When 573 // Set to the ID of the view that initiated creating this view, if any. When
566 // the view was initiated by the browser (the common case), this will be 574 // the view was initiated by the browser (the common case), this will be
567 // MSG_ROUTING_NONE. This is used in determining ownership when opening 575 // MSG_ROUTING_NONE. This is used in determining ownership when opening
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 ui::MenuSourceType context_menu_source_type_; 772 ui::MenuSourceType context_menu_source_type_;
765 bool has_host_context_menu_location_; 773 bool has_host_context_menu_location_;
766 gfx::Point host_context_menu_location_; 774 gfx::Point host_context_menu_location_;
767 775
768 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 776 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
769 }; 777 };
770 778
771 } // namespace content 779 } // namespace content
772 780
773 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 781 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW
« 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