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

Side by Side Diff: cc/debug/frame_timing_tracker.cc

Issue 1411663002: cc: Split Proxy to eliminate unnecessary dependencies on the impl side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update perf tests. Created 5 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/cc_tests.gyp ('k') | cc/debug/frame_timing_tracker_unittest.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 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 #include "cc/debug/frame_timing_tracker.h" 5 #include "cc/debug/frame_timing_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 26 matching lines...) Expand all
37 37
38 // static 38 // static
39 scoped_ptr<FrameTimingTracker> FrameTimingTracker::Create( 39 scoped_ptr<FrameTimingTracker> FrameTimingTracker::Create(
40 LayerTreeHostImpl* layer_tree_host_impl) { 40 LayerTreeHostImpl* layer_tree_host_impl) {
41 return make_scoped_ptr(new FrameTimingTracker(layer_tree_host_impl)); 41 return make_scoped_ptr(new FrameTimingTracker(layer_tree_host_impl));
42 } 42 }
43 43
44 FrameTimingTracker::FrameTimingTracker(LayerTreeHostImpl* layer_tree_host_impl) 44 FrameTimingTracker::FrameTimingTracker(LayerTreeHostImpl* layer_tree_host_impl)
45 : layer_tree_host_impl_(layer_tree_host_impl), 45 : layer_tree_host_impl_(layer_tree_host_impl),
46 post_events_notifier_( 46 post_events_notifier_(
47 layer_tree_host_impl_->proxy()->HasImplThread() 47 layer_tree_host_impl_->GetTaskRunner(),
48 ? layer_tree_host_impl_->proxy()->ImplThreadTaskRunner()
49 : layer_tree_host_impl_->proxy()->MainThreadTaskRunner(),
50 base::Bind(&FrameTimingTracker::PostEvents, base::Unretained(this)), 48 base::Bind(&FrameTimingTracker::PostEvents, base::Unretained(this)),
51 base::TimeDelta::FromMilliseconds(kSendTimingIntervalMS)) { 49 base::TimeDelta::FromMilliseconds(kSendTimingIntervalMS)) {}
52 }
53 50
54 FrameTimingTracker::~FrameTimingTracker() { 51 FrameTimingTracker::~FrameTimingTracker() {
55 } 52 }
56 53
57 void FrameTimingTracker::SaveTimeStamps( 54 void FrameTimingTracker::SaveTimeStamps(
58 base::TimeTicks timestamp, 55 base::TimeTicks timestamp,
59 const std::vector<FrameAndRectIds>& frame_ids) { 56 const std::vector<FrameAndRectIds>& frame_ids) {
60 if (!composite_events_) 57 if (!composite_events_)
61 composite_events_.reset(new CompositeTimingSet); 58 composite_events_.reset(new CompositeTimingSet);
62 for (const auto& pair : frame_ids) { 59 for (const auto& pair : frame_ids) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 107 }
111 return main_frame_events_.Pass(); 108 return main_frame_events_.Pass();
112 } 109 }
113 110
114 void FrameTimingTracker::PostEvents() { 111 void FrameTimingTracker::PostEvents() {
115 layer_tree_host_impl_->PostFrameTimingEvents(GroupCompositeCountsByRectId(), 112 layer_tree_host_impl_->PostFrameTimingEvents(GroupCompositeCountsByRectId(),
116 GroupMainFrameCountsByRectId()); 113 GroupMainFrameCountsByRectId());
117 } 114 }
118 115
119 } // namespace cc 116 } // namespace cc
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/debug/frame_timing_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698