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

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

Issue 23694031: Fix race conditions in window snapshot code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Nit Created 7 years, 2 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
« 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // Emulates screen and widget metrics. Supplied values override everything 234 // Emulates screen and widget metrics. Supplied values override everything
235 // coming from host. 235 // coming from host.
236 void EnableScreenMetricsEmulation( 236 void EnableScreenMetricsEmulation(
237 const gfx::Size& device_size, 237 const gfx::Size& device_size,
238 const gfx::Rect& widget_rect, 238 const gfx::Rect& widget_rect,
239 float device_scale_factor, 239 float device_scale_factor,
240 bool fit_to_view); 240 bool fit_to_view);
241 void DisableScreenMetricsEmulation(); 241 void DisableScreenMetricsEmulation();
242 void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator); 242 void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator);
243 243
244 void ScheduleCompositeWithForcedRedraw();
245
244 protected: 246 protected:
245 // Friend RefCounted so that the dtor can be non-public. Using this class 247 // Friend RefCounted so that the dtor can be non-public. Using this class
246 // without ref-counting is an error. 248 // without ref-counting is an error.
247 friend class base::RefCounted<RenderWidget>; 249 friend class base::RefCounted<RenderWidget>;
248 // For unit tests. 250 // For unit tests.
249 friend class RenderWidgetTest; 251 friend class RenderWidgetTest;
250 252
251 enum ResizeAck { 253 enum ResizeAck {
252 SEND_RESIZE_ACK, 254 SEND_RESIZE_ACK,
253 NO_RESIZE_ACK, 255 NO_RESIZE_ACK,
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 542
541 // Check whether the WebWidget has any touch event handlers registered. 543 // Check whether the WebWidget has any touch event handlers registered.
542 virtual void hasTouchEventHandlers(bool has_handlers); 544 virtual void hasTouchEventHandlers(bool has_handlers);
543 545
544 // Creates a 3D context associated with this view. 546 // Creates a 3D context associated with this view.
545 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D( 547 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D(
546 const WebKit::WebGraphicsContext3D::Attributes& attributes); 548 const WebKit::WebGraphicsContext3D::Attributes& attributes);
547 549
548 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); 550 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap);
549 551
552 void ScheduleCompositeImpl(bool force_redraw);
553
550 // Routing ID that allows us to communicate to the parent browser process 554 // Routing ID that allows us to communicate to the parent browser process
551 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. 555 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
552 int32 routing_id_; 556 int32 routing_id_;
553 557
554 int32 surface_id_; 558 int32 surface_id_;
555 559
556 // We are responsible for destroying this object via its Close method. 560 // We are responsible for destroying this object via its Close method.
557 WebKit::WebWidget* webwidget_; 561 WebKit::WebWidget* webwidget_;
558 562
559 // This is lazily constructed and must not outlive webwidget_. 563 // This is lazily constructed and must not outlive webwidget_.
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 float popup_origin_scale_for_emulation_; 786 float popup_origin_scale_for_emulation_;
783 787
784 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; 788 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_;
785 789
786 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 790 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
787 }; 791 };
788 792
789 } // namespace content 793 } // namespace content
790 794
791 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 795 #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