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

Side by Side Diff: content/renderer/gpu/gpu_benchmarking_extension.cc

Issue 14931012: Add support for latency measurement to Telemetry smoothness benchmarks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/content_common.gypi ('k') | content/renderer/render_widget.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/gpu/gpu_benchmarking_extension.h" 5 #include "content/renderer/gpu/gpu_benchmarking_extension.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_vector.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "content/common/browser_rendering_stats.h"
14 #include "content/common/gpu/gpu_rendering_stats.h" 15 #include "content/common/gpu/gpu_rendering_stats.h"
15 #include "content/public/renderer/render_thread.h" 16 #include "content/public/renderer/render_thread.h"
16 #include "content/renderer/all_rendering_benchmarks.h" 17 #include "content/renderer/all_rendering_benchmarks.h"
17 #include "content/renderer/gpu/render_widget_compositor.h" 18 #include "content/renderer/gpu/render_widget_compositor.h"
18 #include "content/renderer/render_view_impl.h" 19 #include "content/renderer/render_view_impl.h"
19 #include "content/renderer/rendering_benchmark.h" 20 #include "content/renderer/rendering_benchmark.h"
20 #include "content/renderer/skia_benchmarking_extension.h" 21 #include "content/renderer/skia_benchmarking_extension.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewBenchmarkSuppo rt.h" 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewBenchmarkSuppo rt.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 254
254 RenderViewImpl* render_view_impl = RenderViewImpl::FromWebView(web_view); 255 RenderViewImpl* render_view_impl = RenderViewImpl::FromWebView(web_view);
255 if (!render_view_impl) 256 if (!render_view_impl)
256 return v8::Undefined(); 257 return v8::Undefined();
257 258
258 WebRenderingStatsImpl stats; 259 WebRenderingStatsImpl stats;
259 render_view_impl->GetRenderingStats(stats); 260 render_view_impl->GetRenderingStats(stats);
260 261
261 content::GpuRenderingStats gpu_stats; 262 content::GpuRenderingStats gpu_stats;
262 render_view_impl->GetGpuRenderingStats(&gpu_stats); 263 render_view_impl->GetGpuRenderingStats(&gpu_stats);
264 BrowserRenderingStats browser_stats;
265 render_view_impl->GetBrowserRenderingStats(&browser_stats);
263 v8::Handle<v8::Object> stats_object = v8::Object::New(); 266 v8::Handle<v8::Object> stats_object = v8::Object::New();
264 267
265 RenderingStatsEnumerator enumerator(stats_object); 268 RenderingStatsEnumerator enumerator(stats_object);
266 stats.rendering_stats.EnumerateFields(&enumerator); 269 stats.rendering_stats.EnumerateFields(&enumerator);
267 gpu_stats.EnumerateFields(&enumerator); 270 gpu_stats.EnumerateFields(&enumerator);
271 browser_stats.EnumerateFields(&enumerator);
268 272
269 return stats_object; 273 return stats_object;
270 } 274 }
271 275
272 static v8::Handle<v8::Value> PrintToSkPicture(const v8::Arguments& args) { 276 static v8::Handle<v8::Value> PrintToSkPicture(const v8::Arguments& args) {
273 if (args.Length() != 1) 277 if (args.Length() != 1)
274 return v8::Undefined(); 278 return v8::Undefined();
275 279
276 v8::String::AsciiValue dirname(args[0]); 280 v8::String::AsciiValue dirname(args[0]);
277 if (dirname.length() == 0) 281 if (dirname.length() == 0)
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 518
515 return v8::Undefined(); 519 return v8::Undefined();
516 } 520 }
517 }; 521 };
518 522
519 v8::Extension* GpuBenchmarkingExtension::Get() { 523 v8::Extension* GpuBenchmarkingExtension::Get() {
520 return new GpuBenchmarkingWrapper(); 524 return new GpuBenchmarkingWrapper();
521 } 525 }
522 526
523 } // namespace content 527 } // namespace content
OLDNEW
« no previous file with comments | « content/content_common.gypi ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698