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

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 yuki's 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/wtf/Allocator.h"
10 #include "v8/include/v8.h"
11
12 namespace blink {
13
14 class Document;
15 class DOMWrapperWorld;
16 struct WrapperTypeInfo;
17
18 // V8SnapshotUtil supports handling V8 snapshots.
19 class CORE_EXPORT V8SnapshotUtil {
20 STATIC_ONLY(V8SnapshotUtil);
21
22 public:
23 static v8::Local<v8::Context> CreateContext(
24 v8::Isolate*,
25 const DOMWrapperWorld&,
26 v8::ExtensionConfiguration*,
27 v8::Local<v8::Object> global_proxy,
28 Document*);
29
30 static void EnsureInterfaceTemplates(v8::Isolate*);
31 static v8::Local<v8::FunctionTemplate> InterfaceTemplateFromSnapshot(
32 v8::Isolate*,
33 const DOMWrapperWorld&,
34 const WrapperTypeInfo*);
35
36 // Install runtime enabled features on some v8::Objects in a context
37 // created with a snapshot.
38 static void SetupContext(v8::Local<v8::Context>, Document*);
39
40 static void SetReferenceTable(intptr_t* table);
41 static intptr_t* GetReferenceTable();
42
43 // Do not call this in browsers.
Yuki 2017/06/23 15:20:45 s/browsers/production/ This could read that it's
peria 2017/06/27 09:52:37 Done.
44 static v8::StartupData TakeSnapshot();
45
46 private:
47 static v8::StartupData SerializeInternalField(v8::Local<v8::Object> holder,
48 int index,
49 void* data);
50
51 static void DeserializeInternalField(v8::Local<v8::Object> holder,
52 int index,
53 v8::StartupData payload,
54 void* data);
55
56 static void TakeSnapshotForWorld(v8::SnapshotCreator*,
57 const DOMWrapperWorld&);
58 static void EnsureInterfaceTemplatesForWorld(v8::Isolate*,
59 const DOMWrapperWorld&);
60 };
61
62 } // namespace blink
63
64 #endif // V8SnapshotUtil_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698