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

Side by Side Diff: cc/base/swap_promise_monitor.h

Issue 632613002: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « cc/base/scoped_ptr_vector_unittest.cc ('k') | cc/base/tiling_data.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CC_BASE_SWAP_PROMISE_MONITOR_H_ 5 #ifndef CC_BASE_SWAP_PROMISE_MONITOR_H_
6 #define CC_BASE_SWAP_PROMISE_MONITOR_H_ 6 #define CC_BASE_SWAP_PROMISE_MONITOR_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 9
10 namespace cc { 10 namespace cc {
11 11
12 class LayerTreeHost; 12 class LayerTreeHost;
13 class LayerTreeHostImpl; 13 class LayerTreeHostImpl;
14 14
15 // A SwapPromiseMonitor is used to monitor compositor state change that 15 // A SwapPromiseMonitor is used to monitor compositor state change that
16 // should be associated with a SwapPromise, e.g. SetNeedsCommit() is 16 // should be associated with a SwapPromise, e.g. SetNeedsCommit() is
17 // called on main thread or SetNeedsRedraw() is called on impl thread. 17 // called on main thread or SetNeedsRedraw() is called on impl thread.
18 // Creating a SwapPromiseMonitor will insert itself into a LayerTreeHost 18 // Creating a SwapPromiseMonitor will insert itself into a LayerTreeHost
19 // or LayerTreeHostImpl. You must provide a pointer to the appropriate 19 // or LayerTreeHostImpl. You must provide a pointer to the appropriate
20 // structure to the monitor (and only one of the two). Notification of 20 // structure to the monitor (and only one of the two). Notification of
21 // compositor state change will be sent through OnSetNeedsCommitOnMain() 21 // compositor state change will be sent through OnSetNeedsCommitOnMain()
22 // or OnSetNeedsRedrawOnImpl(). When SwapPromiseMonitor is destroyed, it 22 // or OnSetNeedsRedrawOnImpl(). When SwapPromiseMonitor is destroyed, it
23 // will unregister itself from LayerTreeHost or LayerTreeHostImpl. 23 // will unregister itself from LayerTreeHost or LayerTreeHostImpl.
24 class CC_EXPORT SwapPromiseMonitor { 24 class CC_EXPORT SwapPromiseMonitor {
25 public: 25 public:
26 // If the monitor lives on the main thread, pass in layer_tree_host 26 // If the monitor lives on the main thread, pass in layer_tree_host
27 // and set layer_tree_host_impl to NULL. 27 // and set layer_tree_host_impl to nullptr.
28 // If the monitor lives on the impl thread, pass in layer_tree_host_impl 28 // If the monitor lives on the impl thread, pass in layer_tree_host_impl
29 // and set layer_tree_host to NULL. 29 // and set layer_tree_host to nullptr.
30 SwapPromiseMonitor(LayerTreeHost* layer_tree_host, 30 SwapPromiseMonitor(LayerTreeHost* layer_tree_host,
31 LayerTreeHostImpl* layer_tree_host_impl); 31 LayerTreeHostImpl* layer_tree_host_impl);
32 virtual ~SwapPromiseMonitor(); 32 virtual ~SwapPromiseMonitor();
33 33
34 virtual void OnSetNeedsCommitOnMain() = 0; 34 virtual void OnSetNeedsCommitOnMain() = 0;
35 virtual void OnSetNeedsRedrawOnImpl() = 0; 35 virtual void OnSetNeedsRedrawOnImpl() = 0;
36 virtual void OnForwardScrollUpdateToMainThreadOnImpl() = 0; 36 virtual void OnForwardScrollUpdateToMainThreadOnImpl() = 0;
37 37
38 protected: 38 protected:
39 LayerTreeHost* layer_tree_host_; 39 LayerTreeHost* layer_tree_host_;
40 LayerTreeHostImpl* layer_tree_host_impl_; 40 LayerTreeHostImpl* layer_tree_host_impl_;
41 }; 41 };
42 42
43 } // namespace cc 43 } // namespace cc
44 44
45 #endif // CC_BASE_SWAP_PROMISE_MONITOR_H_ 45 #endif // CC_BASE_SWAP_PROMISE_MONITOR_H_
OLDNEW
« no previous file with comments | « cc/base/scoped_ptr_vector_unittest.cc ('k') | cc/base/tiling_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698