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

Unified Diff: gin/public/v8_platform.h

Issue 225413004: [gin] Add a v8::Platform implementation to allow for v8 posting tasks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 6 years, 9 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 | « gin/per_isolate_data.cc ('k') | gin/v8_platform.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/public/v8_platform.h
diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h
new file mode 100644
index 0000000000000000000000000000000000000000..2df0f848e599e99ffd7ffd53511b4d8fc354d3ca
--- /dev/null
+++ b/gin/public/v8_platform.h
@@ -0,0 +1,38 @@
+// Copyright 2014 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.
+
+#ifndef GIN_PUBLIC_V8_PLATFORM_H_
+#define GIN_PUBLIC_V8_PLATFORM_H_
+
+#include "base/basictypes.h"
tfarina 2014/04/05 03:42:13 super-tiny-nit: this should have been base/macros.
+#include "base/compiler_specific.h"
+#include "base/lazy_instance.h"
+#include "gin/gin_export.h"
+#include "v8/include/v8-platform.h"
+
+namespace gin {
+
+// A v8::Platform implementation to use with gin.
+class GIN_EXPORT V8Platform : public NON_EXPORTED_BASE(v8::Platform) {
+ public:
+ static V8Platform* Get();
+
+ // v8::Platform implementation.
+ virtual void CallOnBackgroundThread(
+ v8::Task* task,
+ v8::Platform::ExpectedRuntime expected_runtime) OVERRIDE;
+ virtual void CallOnForegroundThread(v8::Isolate* isolate,
+ v8::Task* task) OVERRIDE;
+ private:
+ friend struct base::DefaultLazyInstanceTraits<V8Platform>;
+
+ V8Platform();
+ virtual ~V8Platform();
+
+ DISALLOW_COPY_AND_ASSIGN(V8Platform);
+};
+
+} // namespace gin
+
+#endif // GIN_PUBLIC_V8_PLATFORM_H_
« no previous file with comments | « gin/per_isolate_data.cc ('k') | gin/v8_platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698