| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8PrivateProperty_h | 5 #ifndef V8PrivateProperty_h |
| 6 #define V8PrivateProperty_h | 6 #define V8PrivateProperty_h |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "bindings/core/v8/ScriptPromiseProperties.h" | 10 #include "bindings/core/v8/ScriptPromiseProperties.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return object->DeletePrivate(GetContext(), private_symbol_).ToChecked(); | 129 return object->DeletePrivate(GetContext(), private_symbol_).ToChecked(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 v8::Local<v8::Private> GetPrivate() const { return private_symbol_; } | 132 v8::Local<v8::Private> GetPrivate() const { return private_symbol_; } |
| 133 | 133 |
| 134 private: | 134 private: |
| 135 friend class V8PrivateProperty; | 135 friend class V8PrivateProperty; |
| 136 // The following classes are exceptionally allowed to call to | 136 // The following classes are exceptionally allowed to call to |
| 137 // getFromMainWorld. | 137 // getFromMainWorld. |
| 138 friend class V8CustomEvent; | 138 friend class V8CustomEvent; |
| 139 friend class V8ServiceWorkerMessageEventInternal; | 139 friend class V8ExtendableMessageEvent; |
| 140 | 140 |
| 141 Symbol(v8::Isolate* isolate, v8::Local<v8::Private> private_symbol) | 141 Symbol(v8::Isolate* isolate, v8::Local<v8::Private> private_symbol) |
| 142 : private_symbol_(private_symbol), isolate_(isolate) {} | 142 : private_symbol_(private_symbol), isolate_(isolate) {} |
| 143 | 143 |
| 144 // To get/set private property, we should use the current context. | 144 // To get/set private property, we should use the current context. |
| 145 v8::Local<v8::Context> GetContext() const { | 145 v8::Local<v8::Context> GetContext() const { |
| 146 return isolate_->GetCurrentContext(); | 146 return isolate_->GetCurrentContext(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 // Only friend classes are allowed to use this API. | 149 // Only friend classes are allowed to use this API. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // TODO(peria): Do not use this specialized hack for | 215 // TODO(peria): Do not use this specialized hack for |
| 216 // Window#DocumentCachedAccessor. This is required to put v8::Private key in | 216 // Window#DocumentCachedAccessor. This is required to put v8::Private key in |
| 217 // a snapshot, and it cannot be a v8::Eternal<> due to V8 serializer's | 217 // a snapshot, and it cannot be a v8::Eternal<> due to V8 serializer's |
| 218 // requirement. | 218 // requirement. |
| 219 ScopedPersistent<v8::Private> symbol_window_document_cached_accessor_; | 219 ScopedPersistent<v8::Private> symbol_window_document_cached_accessor_; |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 } // namespace blink | 222 } // namespace blink |
| 223 | 223 |
| 224 #endif // V8PrivateProperty_h | 224 #endif // V8PrivateProperty_h |
| OLD | NEW |