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

Unified Diff: content/renderer/gpu/gpu_benchmarking_extension.cc

Issue 10532058: added gpu_benchmarking_extension boilerplate and hooked it up to a new switch. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed merge conflict Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/gpu_benchmarking_extension.cc
diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc
new file mode 100644
index 0000000000000000000000000000000000000000..06bf1938a799b9a018da1edfee39e79355ddbdb3
--- /dev/null
+++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/renderer/gpu/gpu_benchmarking_extension.h"
+
+#include "v8/include/v8.h"
+
+const char kGpuBenchmarkingExtensionName[] = "v8/GpuBenchmarking";
+
+namespace content {
+
+class GpuBenchmarkingWrapper : public v8::Extension {
+ public:
+ GpuBenchmarkingWrapper() :
+ v8::Extension(kGpuBenchmarkingExtensionName,
+ "if (typeof(chrome) == 'undefined') {"
+ " chrome = {};"
+ "};"
+ "if (typeof(chrome.gpuBenchmarking) == 'undefined') {"
+ " chrome.gpuBenchmarking = {};"
+ "};") {}
+
+ virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
+ v8::Handle<v8::String> name) {
+ return v8::Handle<v8::FunctionTemplate>();
+ }
+};
+
+v8::Extension* GpuBenchmarkingExtension::Get() {
+ return new GpuBenchmarkingWrapper();
+}
+
+} // namespace content
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698