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

Side by Side Diff: content/browser/devtools/devtools_frame_trace_recorder.cc

Issue 2359503002: Let TRACE_EVENT_XXX_WITH_TIMESTAMP accept TimeTicks instead of int64_t (Closed)
Patch Set: Rebase Created 4 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/browser/devtools/devtools_frame_trace_recorder.h" 5 #include "content/browser/devtools/devtools_frame_trace_recorder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (response != READBACK_SUCCESS) 70 if (response != READBACK_SUCCESS)
71 return; 71 return;
72 int current_frame_count = base::subtle::NoBarrier_Load(&frame_data_count); 72 int current_frame_count = base::subtle::NoBarrier_Load(&frame_data_count);
73 if (current_frame_count >= kMaximumFrameDataCount) 73 if (current_frame_count >= kMaximumFrameDataCount)
74 return; 74 return;
75 if (bitmap.drawsNothing()) 75 if (bitmap.drawsNothing())
76 return; 76 return;
77 base::subtle::NoBarrier_AtomicIncrement(&frame_data_count, 1); 77 base::subtle::NoBarrier_AtomicIncrement(&frame_data_count, 1);
78 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID_AND_TIMESTAMP( 78 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID_AND_TIMESTAMP(
79 TRACE_DISABLED_BY_DEFAULT("devtools.screenshot"), "Screenshot", 1, 79 TRACE_DISABLED_BY_DEFAULT("devtools.screenshot"), "Screenshot", 1,
80 timestamp.ToInternalValue(), 80 timestamp,
81 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>( 81 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>(
82 new TraceableDevToolsScreenshot(bitmap))); 82 new TraceableDevToolsScreenshot(bitmap)));
83 } 83 }
84 84
85 void CaptureFrame(RenderFrameHostImpl* host, 85 void CaptureFrame(RenderFrameHostImpl* host,
86 const cc::CompositorFrameMetadata& metadata) { 86 const cc::CompositorFrameMetadata& metadata) {
87 RenderWidgetHostViewBase* view = 87 RenderWidgetHostViewBase* view =
88 static_cast<RenderWidgetHostViewBase*>(host->GetView()); 88 static_cast<RenderWidgetHostViewBase*>(host->GetView());
89 if (!view) 89 if (!view)
90 return; 90 return;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 bool is_new_trace; 141 bool is_new_trace;
142 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); 142 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace);
143 if (!is_new_trace && last_metadata_) 143 if (!is_new_trace && last_metadata_)
144 CaptureFrame(host, *last_metadata_); 144 CaptureFrame(host, *last_metadata_);
145 last_metadata_.reset(new cc::CompositorFrameMetadata); 145 last_metadata_.reset(new cc::CompositorFrameMetadata);
146 *last_metadata_ = frame_metadata.Clone(); 146 *last_metadata_ = frame_metadata.Clone();
147 } 147 }
148 148
149 } // namespace content 149 } // namespace content
OLDNEW
« no previous file with comments | « components/startup_metric_utils/browser/startup_metric_utils.cc ('k') | content/browser/frame_host/navigation_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698