summaryrefslogtreecommitdiffstats
path: root/cc/debug/traced_display_item_list.h
diff options
context:
space:
mode:
authorcaseq <caseq@chromium.org>2015-06-19 04:12:57 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-19 11:13:27 +0000
commit252613a7f48cdc127076cf936f26147002c383d2 (patch)
tree7ad30721e183977019ee408b7cabd6e0a552e24d /cc/debug/traced_display_item_list.h
parentfe10ec77ad100cace57e954d124604e15e96dea4 (diff)
downloadchromium_src-252613a7f48cdc127076cf936f26147002c383d2.zip
chromium_src-252613a7f48cdc127076cf936f26147002c383d2.tar.gz
chromium_src-252613a7f48cdc127076cf936f26147002c383d2.tar.bz2
cc: defer dumping display item lists till trace is stopped
Also, only trace individual display items if disabled-by-default-cc.debug.display_items is enabled, as these happen to result in HUGE traces. BUG=497796 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1151653005 Cr-Commit-Position: refs/heads/master@{#335244}
Diffstat (limited to 'cc/debug/traced_display_item_list.h')
-rw-r--r--cc/debug/traced_display_item_list.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/cc/debug/traced_display_item_list.h b/cc/debug/traced_display_item_list.h
new file mode 100644
index 0000000..f7caa04
--- /dev/null
+++ b/cc/debug/traced_display_item_list.h
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_
+#define CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_
+
+#include <string>
+
+#include "base/memory/ref_counted.h"
+#include "base/trace_event/trace_event.h"
+#include "cc/debug/traced_value.h"
+
+namespace cc {
+
+class DisplayItemList;
+
+class TracedDisplayItemList
+ : public base::trace_event::ConvertableToTraceFormat {
+ public:
+ static scoped_refptr<ConvertableToTraceFormat> AsTraceableDisplayItemList(
+ scoped_refptr<const DisplayItemList> list,
+ bool include_items) {
+ return scoped_refptr<ConvertableToTraceFormat>(
+ new TracedDisplayItemList(list, include_items));
+ }
+ void AppendAsTraceFormat(std::string* out) const override;
+
+ private:
+ explicit TracedDisplayItemList(scoped_refptr<const DisplayItemList> list,
+ bool include_items);
+ ~TracedDisplayItemList() override;
+
+ scoped_refptr<const DisplayItemList> display_item_list_;
+ bool include_items_;
+
+ DISALLOW_COPY_AND_ASSIGN(TracedDisplayItemList);
+};
+
+} // namespace cc
+
+#endif // CC_DEBUG_TRACED_DISPLAY_ITEM_LIST_H_