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

Side by Side Diff: third_party/WebKit/Source/platform/bindings/ScriptWrappable.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
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 bool ContainsWrapper() const { return !main_world_wrapper_.IsEmpty(); } 150 bool ContainsWrapper() const { return !main_world_wrapper_.IsEmpty(); }
151 151
152 // Mark wrapper of this ScriptWrappable as alive in V8. Only marks 152 // Mark wrapper of this ScriptWrappable as alive in V8. Only marks
153 // wrapper in the main world. To mark wrappers in all worlds call 153 // wrapper in the main world. To mark wrappers in all worlds call
154 // ScriptWrappableVisitor::markWrapper(ScriptWrappable*, v8::Isolate*) 154 // ScriptWrappableVisitor::markWrapper(ScriptWrappable*, v8::Isolate*)
155 void MarkWrapper(const WrapperVisitor*) const; 155 void MarkWrapper(const WrapperVisitor*) const;
156 156
157 private: 157 private:
158 // These classes are exceptionally allowed to use mainWorldWrapper(). 158 // These classes are exceptionally allowed to use MainWorldWrapper().
159 friend class DOMDataStore; 159 friend class DOMDataStore;
160 friend class HeapSnaphotWrapperVisitor; 160 friend class HeapSnaphotWrapperVisitor;
161 friend class V8HiddenValue; 161 friend class V8HiddenValue;
162 friend class V8PrivateProperty; 162 friend class V8PrivateProperty;
163 friend class V8SnapshotUtil;
Yuki 2017/06/20 14:20:11 Add TODO(peria): Remove V8SnapshotUtil from a list
peria 2017/06/21 07:19:16 Done.
163 164
164 v8::Local<v8::Object> MainWorldWrapper(v8::Isolate* isolate) const { 165 v8::Local<v8::Object> MainWorldWrapper(v8::Isolate* isolate) const {
165 return v8::Local<v8::Object>::New(isolate, main_world_wrapper_); 166 return v8::Local<v8::Object>::New(isolate, main_world_wrapper_);
166 } 167 }
167 168
168 // Only use when really necessary, i.e., when passing over this 169 // Only use when really necessary, i.e., when passing over this
169 // ScriptWrappable's reference to V8. Should only be needed by GC 170 // ScriptWrappable's reference to V8. Should only be needed by GC
170 // infrastructure. 171 // infrastructure.
171 const v8::Persistent<v8::Object>* RawMainWorldWrapper() const { 172 const v8::Persistent<v8::Object>* RawMainWorldWrapper() const {
172 return &main_world_wrapper_; 173 return &main_world_wrapper_;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 #define DECLARE_WRAPPERTYPEINFO() \ 205 #define DECLARE_WRAPPERTYPEINFO() \
205 public: \ 206 public: \
206 const WrapperTypeInfo* GetWrapperTypeInfo() const override; \ 207 const WrapperTypeInfo* GetWrapperTypeInfo() const override; \
207 \ 208 \
208 private: \ 209 private: \
209 typedef void end_of_define_wrappertypeinfo_not_reached_t 210 typedef void end_of_define_wrappertypeinfo_not_reached_t
210 211
211 } // namespace blink 212 } // namespace blink
212 213
213 #endif // ScriptWrappable_h 214 #endif // ScriptWrappable_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698