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

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

Issue 11858007: Splits SmoothGestureController from RenderWidgetHostImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Single smooth scroll Created 7 years, 10 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
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_path.h" 10 #include "base/file_path.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 !args[4]->IsNumber()) 298 !args[4]->IsNumber())
299 return v8::False(); 299 return v8::False();
300 300
301 mouse_event_x = args[3]->IntegerValue(); 301 mouse_event_x = args[3]->IntegerValue();
302 mouse_event_y = args[4]->IntegerValue(); 302 mouse_event_y = args[4]->IntegerValue();
303 } 303 }
304 304
305 // TODO(nduca): If the render_view_impl is destroyed while the gesture is in 305 // TODO(nduca): If the render_view_impl is destroyed while the gesture is in
306 // progress, we will leak the callback and context. This needs to be fixed, 306 // progress, we will leak the callback and context. This needs to be fixed,
307 // somehow. 307 // somehow.
308 render_view_impl->BeginSmoothScroll( 308 return render_view_impl->BeginSmoothScroll(
309 scroll_down, 309 scroll_down,
310 base::Bind(&OnSmoothScrollCompleted, 310 base::Bind(&OnSmoothScrollCompleted,
311 callback, 311 callback,
312 context), 312 context),
313 pixels_to_scroll, 313 pixels_to_scroll,
314 mouse_event_x, 314 mouse_event_x,
315 mouse_event_y); 315 mouse_event_y) ? v8::True() : v8::False();
316
317 return v8::True();
318 } 316 }
319 317
320 static v8::Handle<v8::Value> RunRenderingBenchmarks( 318 static v8::Handle<v8::Value> RunRenderingBenchmarks(
321 const v8::Arguments& args) { 319 const v8::Arguments& args) {
322 // For our name filter, the argument can be undefined or null to run 320 // For our name filter, the argument can be undefined or null to run
323 // all benchmarks, or a string for filtering by name. 321 // all benchmarks, or a string for filtering by name.
324 if (!args.Length() || 322 if (!args.Length() ||
325 (!args[0]->IsString() && 323 (!args[0]->IsString() &&
326 !(args[0]->IsNull() || args[0]->IsUndefined()))) { 324 !(args[0]->IsNull() || args[0]->IsUndefined()))) {
327 return v8::Undefined(); 325 return v8::Undefined();
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 447
450 return v8::Undefined(); 448 return v8::Undefined();
451 } 449 }
452 }; 450 };
453 451
454 v8::Extension* GpuBenchmarkingExtension::Get() { 452 v8::Extension* GpuBenchmarkingExtension::Get() {
455 return new GpuBenchmarkingWrapper(); 453 return new GpuBenchmarkingWrapper();
456 } 454 }
457 455
458 } // namespace content 456 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698