| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ScriptState_h | 5 #ifndef ScriptState_h |
| 6 #define ScriptState_h | 6 #define ScriptState_h |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "bindings/core/v8/ScopedPersistent.h" | 10 #include "bindings/core/v8/ScopedPersistent.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 bool ContextIsValid() const { | 143 bool ContextIsValid() const { |
| 144 return !context_.IsEmpty() && per_context_data_; | 144 return !context_.IsEmpty() && per_context_data_; |
| 145 } | 145 } |
| 146 void DetachGlobalObject(); | 146 void DetachGlobalObject(); |
| 147 void ClearContext() { return context_.Clear(); } | 147 void ClearContext() { return context_.Clear(); } |
| 148 | 148 |
| 149 V8PerContextData* PerContextData() const { return per_context_data_.get(); } | 149 V8PerContextData* PerContextData() const { return per_context_data_.get(); } |
| 150 void DisposePerContextData(); | 150 void DisposePerContextData(); |
| 151 | 151 |
| 152 ScriptValue GetFromExtrasExports(const char* name); | |
| 153 | |
| 154 protected: | 152 protected: |
| 155 ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); | 153 ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); |
| 156 | 154 |
| 157 private: | 155 private: |
| 158 v8::Isolate* isolate_; | 156 v8::Isolate* isolate_; |
| 159 // This persistent handle is weak. | 157 // This persistent handle is weak. |
| 160 ScopedPersistent<v8::Context> context_; | 158 ScopedPersistent<v8::Context> context_; |
| 161 | 159 |
| 162 // This RefPtr doesn't cause a cycle because all persistent handles that | 160 // This RefPtr doesn't cause a cycle because all persistent handles that |
| 163 // DOMWrapperWorld holds are weak. | 161 // DOMWrapperWorld holds are weak. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 194 } | 192 } |
| 195 | 193 |
| 196 private: | 194 private: |
| 197 RefPtr<ScriptState> script_state_; | 195 RefPtr<ScriptState> script_state_; |
| 198 ScopedPersistent<v8::Context> context_; | 196 ScopedPersistent<v8::Context> context_; |
| 199 }; | 197 }; |
| 200 | 198 |
| 201 } // namespace blink | 199 } // namespace blink |
| 202 | 200 |
| 203 #endif // ScriptState_h | 201 #endif // ScriptState_h |
| OLD | NEW |