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

Unified Diff: content/renderer/skia_benchmarking_extension.h

Issue 142143005: Convert the SkiaBenchmarkingExtension to a gin::Wrappable class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
Index: content/renderer/skia_benchmarking_extension.h
diff --git a/content/renderer/skia_benchmarking_extension.h b/content/renderer/skia_benchmarking_extension.h
index 73d5f83dddf5d5cead64ad5a51bea638ec9d10d9..5be3a55cf324728d9b0e2612de621c7b2d457495 100644
--- a/content/renderer/skia_benchmarking_extension.h
+++ b/content/renderer/skia_benchmarking_extension.h
@@ -5,17 +5,48 @@
#ifndef CONTENT_RENDERER_SKIA_BENCHMARKING_EXTENSION_H_
#define CONTENT_RENDERER_SKIA_BENCHMARKING_EXTENSION_H_
-namespace v8 {
-class Extension;
+#include "base/basictypes.h"
+#include "gin/wrappable.h"
+
+namespace blink {
+class WebFrame;
+}
+
+namespace gin {
+class Arguments;
}
namespace content {
-// V8 extension for Skia benchmarking
-class SkiaBenchmarkingExtension {
+class SkiaBenchmarking : public gin::Wrappable<SkiaBenchmarking> {
public:
- static v8::Extension* Get();
- static void InitSkGraphics();
+ static gin::WrapperInfo kWrapperInfo;
+ static void Install(blink::WebFrame* frame);
+
+ // Wrapper around SkGraphics::Init that can be invoked multiple times.
+ static void Initialize();
+
+ private:
+ SkiaBenchmarking();
+ virtual ~SkiaBenchmarking();
+
+ // gin::Wrappable.
+ virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
+ v8::Isolate* isolate) OVERRIDE;
+
+ // Rasterizes a Picture JSON-encoded by cc::Picture::AsValue().
+ void Rasterize(gin::Arguments* args);
+
+ // Extracts the Skia draw commands from a JSON-encoded cc::Picture.
+ void GetOps(gin::Arguments* args);
+
+ // Returns timing information for the given picture.
+ void GetOpTimings(gin::Arguments* args);
+
+ // Returns meta information for the given picture.
+ void GetInfo(gin::Arguments* args);
+
+ DISALLOW_COPY_AND_ASSIGN(SkiaBenchmarking);
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698