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

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

Issue 9302022: WebWidgetClient::screenInfo() no longer does a synchronous IPC. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Refreshed patch to merge with tip of tree Created 8 years, 9 months 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 | Annotate | Revision Log
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 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <vector> 10 #include <vector>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // a RenderWidgetHost, the latter of which lives in a different process. 69 // a RenderWidgetHost, the latter of which lives in a different process.
70 class CONTENT_EXPORT RenderWidget 70 class CONTENT_EXPORT RenderWidget
71 : public IPC::Channel::Listener, 71 : public IPC::Channel::Listener,
72 public IPC::Message::Sender, 72 public IPC::Message::Sender,
73 NON_EXPORTED_BASE(virtual public WebKit::WebWidgetClient), 73 NON_EXPORTED_BASE(virtual public WebKit::WebWidgetClient),
74 public base::RefCounted<RenderWidget> { 74 public base::RefCounted<RenderWidget> {
75 public: 75 public:
76 // Creates a new RenderWidget. The opener_id is the routing ID of the 76 // Creates a new RenderWidget. The opener_id is the routing ID of the
77 // RenderView that this widget lives inside. 77 // RenderView that this widget lives inside.
78 static RenderWidget* Create(int32 opener_id, 78 static RenderWidget* Create(int32 opener_id,
79 WebKit::WebPopupType popup_type); 79 WebKit::WebPopupType popup_type,
80 const WebKit::WebScreenInfo& screen_info);
80 81
81 // Creates a WebWidget based on the popup type. 82 // Creates a WebWidget based on the popup type.
82 static WebKit::WebWidget* CreateWebWidget(RenderWidget* render_widget); 83 static WebKit::WebWidget* CreateWebWidget(RenderWidget* render_widget);
83 84
84 // The compositing surface assigned by the RenderWidgetHost 85 // The compositing surface assigned by the RenderWidgetHost
85 // (or RenderViewHost). Will be gfx::kNullPluginWindow if not assigned yet, 86 // (or RenderViewHost). Will be gfx::kNullPluginWindow if not assigned yet,
86 // in which case we should not create any GPU command buffers with it. 87 // in which case we should not create any GPU command buffers with it.
87 // The routing ID assigned by the RenderProcess. Will be MSG_ROUTING_NONE if 88 // The routing ID assigned by the RenderProcess. Will be MSG_ROUTING_NONE if
88 // not yet assigned a view ID, in which case, the process MUST NOT send 89 // not yet assigned a view ID, in which case, the process MUST NOT send
89 // messages with this ID to the parent. 90 // messages with this ID to the parent.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return filtered_time_per_frame_; 151 return filtered_time_per_frame_;
151 } 152 }
152 153
153 protected: 154 protected:
154 // Friend RefCounted so that the dtor can be non-public. Using this class 155 // Friend RefCounted so that the dtor can be non-public. Using this class
155 // without ref-counting is an error. 156 // without ref-counting is an error.
156 friend class base::RefCounted<RenderWidget>; 157 friend class base::RefCounted<RenderWidget>;
157 // For unit tests. 158 // For unit tests.
158 friend class RenderWidgetTest; 159 friend class RenderWidgetTest;
159 160
160 explicit RenderWidget(WebKit::WebPopupType popup_type); 161 explicit RenderWidget(WebKit::WebPopupType popup_type,
jam 2012/02/29 23:41:17 nit: no need for explicit
Fady Samuel 2012/03/01 00:52:25 True, thanks.
162 const WebKit::WebScreenInfo& screen_info);
161 virtual ~RenderWidget(); 163 virtual ~RenderWidget();
162 164
163 // Initializes this view with the given opener. CompleteInit must be called 165 // Initializes this view with the given opener. CompleteInit must be called
164 // later. 166 // later.
165 void Init(int32 opener_id); 167 void Init(int32 opener_id);
166 168
167 // Called by Init and subclasses to perform initialization. 169 // Called by Init and subclasses to perform initialization.
168 void DoInit(int32 opener_id, 170 void DoInit(int32 opener_id,
169 WebKit::WebWidget* web_widget, 171 WebKit::WebWidget* web_widget,
170 IPC::SyncMessage* create_widget_message); 172 IPC::SyncMessage* create_widget_message);
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 // pass state between DoDeferredUpdate and OnSwapBuffersPosted. 491 // pass state between DoDeferredUpdate and OnSwapBuffersPosted.
490 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; 492 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_;
491 493
492 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to 494 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to
493 // delay sending of UpdateRect until the corresponding SwapBuffers has been 495 // delay sending of UpdateRect until the corresponding SwapBuffers has been
494 // executed. Since we can have several in flight, we need to keep them in a 496 // executed. Since we can have several in flight, we need to keep them in a
495 // queue. Note: some SwapBuffers may not correspond to an update, in which 497 // queue. Note: some SwapBuffers may not correspond to an update, in which
496 // case NULL is added to the queue. 498 // case NULL is added to the queue.
497 std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_; 499 std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_;
498 500
501 // Properties of the screen hosting this RenderWidget instance.
502 WebKit::WebScreenInfo screen_info_;
503
499 // Set to true if we should invert all pixels. 504 // Set to true if we should invert all pixels.
500 bool invert_; 505 bool invert_;
501 506
502 // The Skia paint object for inverting. 507 // The Skia paint object for inverting.
503 scoped_ptr<SkPaint> invert_paint_; 508 scoped_ptr<SkPaint> invert_paint_;
504 509
505 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 510 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
506 }; 511 };
507 512
508 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 513 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698