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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptModule.h

Issue 2566513002: Create bare-bones ScriptModule class (Closed)
Patch Set: Update copyrights Created 3 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: third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
new file mode 100644
index 0000000000000000000000000000000000000000..951117d667d78cc97d075f8d54c4598567204b18
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
@@ -0,0 +1,41 @@
+// Copyright 2017 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 ScriptModule_h
+#define ScriptModule_h
+
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/SharedPersistent.h"
+#include "core/CoreExport.h"
+#include "wtf/Allocator.h"
+#include "wtf/text/WTFString.h"
+#include <v8.h>
+
+namespace blink {
+
+class CORE_EXPORT ScriptModule final {
+ DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
+
+ public:
+ static ScriptModule compile(v8::Isolate*,
+ const String& source,
+ const String& fileName);
+
+ ScriptModule(const ScriptModule& module) : m_module(module.m_module) {}
+ ~ScriptModule();
+
+ bool instantiate(ScriptState*);
+ void evaluate(ScriptState*);
+
+ bool isNull() const { return m_module->isEmpty(); }
+
+ private:
+ ScriptModule(v8::Isolate*, v8::Local<v8::Module>);
+
+ RefPtr<SharedPersistent<v8::Module>> m_module;
+};
+
+} // namespace blink
+
+#endif // ScriptModule_h
« no previous file with comments | « third_party/WebKit/Source/bindings/bindings.gni ('k') | third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698