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

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

Issue 10823023: Add new fields to GPU benchmarking API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | 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 #include "content/renderer/render_view_impl.h" 6 #include "content/renderer/render_view_impl.h"
7 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h " 7 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h "
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 v8::Handle<v8::Object> stats_object = v8::Object::New(); 72 v8::Handle<v8::Object> stats_object = v8::Object::New();
73 if (stats.numAnimationFrames) 73 if (stats.numAnimationFrames)
74 stats_object->Set(v8::String::New("numAnimationFrames"), 74 stats_object->Set(v8::String::New("numAnimationFrames"),
75 v8::Integer::New(stats.numAnimationFrames), 75 v8::Integer::New(stats.numAnimationFrames),
76 v8::ReadOnly); 76 v8::ReadOnly);
77 if (stats.numFramesSentToScreen) 77 if (stats.numFramesSentToScreen)
78 stats_object->Set(v8::String::New("numFramesSentToScreen"), 78 stats_object->Set(v8::String::New("numFramesSentToScreen"),
79 v8::Integer::New(stats.numFramesSentToScreen), 79 v8::Integer::New(stats.numFramesSentToScreen),
80 v8::ReadOnly); 80 v8::ReadOnly);
81 if (stats.droppedFrameCount)
82 stats_object->Set(v8::String::New("droppedFrameCount"),
83 v8::Integer::New(stats.droppedFrameCount),
84 v8::ReadOnly);
85 if (stats.totalPaintTimeInSeconds)
86 stats_object->Set(v8::String::New("totalPaintTimeInSeconds"),
87 v8::Number::New(stats.totalPaintTimeInSeconds),
88 v8::ReadOnly);
89 if (stats.totalRasterizeTimeInSeconds)
90 stats_object->Set(v8::String::New("totalRasterizeTimeInSeconds"),
91 v8::Number::New(stats.totalRasterizeTimeInSeconds),
92 v8::ReadOnly);
81 return stats_object; 93 return stats_object;
82 } 94 }
83 95
84 static v8::Handle<v8::Value> BeginSmoothScroll(const v8::Arguments& args) { 96 static v8::Handle<v8::Value> BeginSmoothScroll(const v8::Arguments& args) {
85 WebFrame* web_frame = WebFrame::frameForEnteredContext(); 97 WebFrame* web_frame = WebFrame::frameForEnteredContext();
86 if (!web_frame) 98 if (!web_frame)
87 return v8::Undefined(); 99 return v8::Undefined();
88 100
89 WebView* web_view = web_frame->view(); 101 WebView* web_view = web_frame->view();
90 if (!web_view) 102 if (!web_view)
(...skipping 12 matching lines...) Expand all
103 render_view_impl->BeginSmoothScroll(scroll_down, scroll_far); 115 render_view_impl->BeginSmoothScroll(scroll_down, scroll_far);
104 return v8::True(); 116 return v8::True();
105 } 117 }
106 }; 118 };
107 119
108 v8::Extension* GpuBenchmarkingExtension::Get() { 120 v8::Extension* GpuBenchmarkingExtension::Get() {
109 return new GpuBenchmarkingWrapper(); 121 return new GpuBenchmarkingWrapper();
110 } 122 }
111 123
112 } // namespace content 124 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698