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

Side by Side Diff: cc/debug/traced_display_item_list.h

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_ 5 #ifndef CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_
6 #define CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_ 6 #define CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/trace_event/trace_event.h" 12 #include "base/trace_event/trace_event.h"
13 #include "cc/debug/traced_value.h" 13 #include "cc/debug/traced_value.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 class DisplayItemList; 17 class DisplayItemList;
18 18
19 class TracedDisplayItemList 19 class TracedDisplayItemList
20 : public base::trace_event::ConvertableToTraceFormat { 20 : public base::trace_event::ConvertableToTraceFormat {
21 public: 21 public:
22 static scoped_refptr<ConvertableToTraceFormat> AsTraceableDisplayItemList( 22 static scoped_ptr<ConvertableToTraceFormat> AsTraceableDisplayItemList(
23 scoped_refptr<const DisplayItemList> list, 23 scoped_refptr<const DisplayItemList> list,
24 bool include_items) { 24 bool include_items) {
25 return scoped_refptr<ConvertableToTraceFormat>( 25 return scoped_ptr<ConvertableToTraceFormat>(
26 new TracedDisplayItemList(list, include_items)); 26 new TracedDisplayItemList(list, include_items));
27 } 27 }
28 void AppendAsTraceFormat(std::string* out) const override; 28 void AppendAsTraceFormat(std::string* out) const override;
29 29
30 private: 30 private:
31 explicit TracedDisplayItemList(scoped_refptr<const DisplayItemList> list, 31 explicit TracedDisplayItemList(scoped_refptr<const DisplayItemList> list,
32 bool include_items); 32 bool include_items);
33 ~TracedDisplayItemList() override; 33 ~TracedDisplayItemList() override;
34 34
35 scoped_refptr<const DisplayItemList> display_item_list_; 35 scoped_refptr<const DisplayItemList> display_item_list_;
36 bool include_items_; 36 bool include_items_;
37 37
38 DISALLOW_COPY_AND_ASSIGN(TracedDisplayItemList); 38 DISALLOW_COPY_AND_ASSIGN(TracedDisplayItemList);
39 }; 39 };
40 40
41 } // namespace cc 41 } // namespace cc
42 42
43 #endif // CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_ 43 #endif // CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698