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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8SnapshotUtil.h

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Work for all comments Created 3 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 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 V8SnapshotUtil_h
6 #define V8SnapshotUtil_h
7
8 #include "core/CoreExport.h"
9 #include "platform/bindings/V8Binding.h"
Yuki 2017/06/20 14:20:11 Just curious. What makes you need this header? cl
peria 2017/06/21 07:19:16 It supported - STATIC_ONLY() - DOMWrapperWorld - W
10 #include "v8/include/v8.h"
11
12 namespace blink {
13
14 class Document;
15
16 // V8SnapshotUtil supports handling V8 snapshots.
17 class CORE_EXPORT V8SnapshotUtil {
18 STATIC_ONLY(V8SnapshotUtil);
19
20 public:
21 static v8::Local<v8::Context> CreateContext(
22 v8::Isolate*,
23 const DOMWrapperWorld&,
24 v8::ExtensionConfiguration*,
25 v8::Local<v8::Object> global_proxy,
26 Document*);
27
28 static void EnsureInterfaceTemplates(v8::Isolate*);
29 static v8::Local<v8::FunctionTemplate> InterfaceTemplateFromSnapshot(
30 v8::Isolate*,
31 const DOMWrapperWorld&,
32 WrapperTypeInfo*);
33
34 // Install runtime enabled features on some v8::Objects in a context
35 // created with a snapshot.
36 static void SetupContext(v8::Local<v8::Context>);
37
38 static void SetReferenceTable(intptr_t* table);
39 static intptr_t* GetReferenceTable();
40
41 // Do not call this in browsers.
42 static v8::StartupData TakeSnapshot();
43
44 private:
45 static v8::StartupData SerializeInternalField(v8::Local<v8::Object> holder,
46 int index,
47 void* data);
48
49 static void DeserializeInternalField(v8::Local<v8::Object> holder,
50 int index,
51 v8::StartupData payload,
52 void* data);
53
54 static void TakeSnapshotForWorld(v8::SnapshotCreator*,
55 const DOMWrapperWorld&);
56 static void EnsureInterfaceTemplatesForWorld(v8::Isolate*,
57 const DOMWrapperWorld&);
58 };
59
60 } // namespace blink
61
62 #endif // V8SnapshotUtil_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698