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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ScriptModule_h
6 #define ScriptModule_h
7
8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/SharedPersistent.h"
10 #include "core/CoreExport.h"
11 #include "wtf/Allocator.h"
12 #include "wtf/text/WTFString.h"
13 #include <v8.h>
14
15 namespace blink {
16
17 class CORE_EXPORT ScriptModule final {
18 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
19
20 public:
21 static ScriptModule compile(v8::Isolate*,
22 const String& source,
23 const String& fileName);
24
25 ScriptModule(const ScriptModule& module) : m_module(module.m_module) {}
26 ~ScriptModule();
27
28 bool instantiate(ScriptState*);
29 void evaluate(ScriptState*);
30
31 bool isNull() const { return m_module->isEmpty(); }
32
33 private:
34 ScriptModule(v8::Isolate*, v8::Local<v8::Module>);
35
36 RefPtr<SharedPersistent<v8::Module>> m_module;
37 };
38
39 } // namespace blink
40
41 #endif // ScriptModule_h
OLDNEW
« 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