OLD | NEW |
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 Loading... |
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); | |
93 return stats_object; | 81 return stats_object; |
94 } | 82 } |
95 | 83 |
96 static v8::Handle<v8::Value> BeginSmoothScroll(const v8::Arguments& args) { | 84 static v8::Handle<v8::Value> BeginSmoothScroll(const v8::Arguments& args) { |
97 WebFrame* web_frame = WebFrame::frameForEnteredContext(); | 85 WebFrame* web_frame = WebFrame::frameForEnteredContext(); |
98 if (!web_frame) | 86 if (!web_frame) |
99 return v8::Undefined(); | 87 return v8::Undefined(); |
100 | 88 |
101 WebView* web_view = web_frame->view(); | 89 WebView* web_view = web_frame->view(); |
102 if (!web_view) | 90 if (!web_view) |
(...skipping 12 matching lines...) Expand all Loading... |
115 render_view_impl->BeginSmoothScroll(scroll_down, scroll_far); | 103 render_view_impl->BeginSmoothScroll(scroll_down, scroll_far); |
116 return v8::True(); | 104 return v8::True(); |
117 } | 105 } |
118 }; | 106 }; |
119 | 107 |
120 v8::Extension* GpuBenchmarkingExtension::Get() { | 108 v8::Extension* GpuBenchmarkingExtension::Get() { |
121 return new GpuBenchmarkingWrapper(); | 109 return new GpuBenchmarkingWrapper(); |
122 } | 110 } |
123 | 111 |
124 } // namespace content | 112 } // namespace content |
OLD | NEW |