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

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: Created 7 years, 3 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 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 10
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 virtual void InstrumentWillBeginFrame() {} 206 virtual void InstrumentWillBeginFrame() {}
207 virtual void InstrumentDidBeginFrame() {} 207 virtual void InstrumentDidBeginFrame() {}
208 virtual void InstrumentDidCancelFrame() {} 208 virtual void InstrumentDidCancelFrame() {}
209 virtual void InstrumentWillComposite() {} 209 virtual void InstrumentWillComposite() {}
210 210
211 virtual bool AllowPartialSwap() const; 211 virtual bool AllowPartialSwap() const;
212 bool UsingSynchronousRendererCompositor() const; 212 bool UsingSynchronousRendererCompositor() const;
213 213
214 bool is_swapped_out() { return is_swapped_out_; } 214 bool is_swapped_out() { return is_swapped_out_; }
215 215
216 void ScheduleCompositeWithForcedRedraw();
217
216 protected: 218 protected:
217 // Friend RefCounted so that the dtor can be non-public. Using this class 219 // Friend RefCounted so that the dtor can be non-public. Using this class
218 // without ref-counting is an error. 220 // without ref-counting is an error.
219 friend class base::RefCounted<RenderWidget>; 221 friend class base::RefCounted<RenderWidget>;
220 // For unit tests. 222 // For unit tests.
221 friend class RenderWidgetTest; 223 friend class RenderWidgetTest;
222 224
223 enum ResizeAck { 225 enum ResizeAck {
224 SEND_RESIZE_ACK, 226 SEND_RESIZE_ACK,
225 NO_RESIZE_ACK, 227 NO_RESIZE_ACK,
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 512
511 // Check whether the WebWidget has any touch event handlers registered. 513 // Check whether the WebWidget has any touch event handlers registered.
512 virtual void hasTouchEventHandlers(bool has_handlers); 514 virtual void hasTouchEventHandlers(bool has_handlers);
513 515
514 // Creates a 3D context associated with this view. 516 // Creates a 3D context associated with this view.
515 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D( 517 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D(
516 const WebKit::WebGraphicsContext3D::Attributes& attributes); 518 const WebKit::WebGraphicsContext3D::Attributes& attributes);
517 519
518 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); 520 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap);
519 521
522 void ScheduleCompositeImpl(bool force_redraw);
523
520 // Routing ID that allows us to communicate to the parent browser process 524 // Routing ID that allows us to communicate to the parent browser process
521 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. 525 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent.
522 int32 routing_id_; 526 int32 routing_id_;
523 527
524 int32 surface_id_; 528 int32 surface_id_;
525 529
526 // We are responsible for destroying this object via its Close method. 530 // We are responsible for destroying this object via its Close method.
527 WebKit::WebWidget* webwidget_; 531 WebKit::WebWidget* webwidget_;
528 532
529 // This is lazily constructed and must not outlive webwidget_. 533 // This is lazily constructed and must not outlive webwidget_.
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 #endif 743 #endif
740 744
741 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; 745 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_;
742 746
743 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 747 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
744 }; 748 };
745 749
746 } // namespace content 750 } // namespace content
747 751
748 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 752 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698