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

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

Issue 2805333002: Move ScriptState::getExecutionContext (Part 1) (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 kV8ContextPerContextDataIndex)); 129 kV8ContextPerContextDataIndex));
130 // ScriptState::from() must not be called for a context that does not have 130 // ScriptState::from() must not be called for a context that does not have
131 // valid embedder data in the embedder field. 131 // valid embedder data in the embedder field.
132 SECURITY_CHECK(script_state); 132 SECURITY_CHECK(script_state);
133 SECURITY_CHECK(script_state->GetContext() == context); 133 SECURITY_CHECK(script_state->GetContext() == context);
134 return script_state; 134 return script_state;
135 } 135 }
136 136
137 v8::Isolate* GetIsolate() const { return isolate_; } 137 v8::Isolate* GetIsolate() const { return isolate_; }
138 DOMWrapperWorld& World() const { return *world_; } 138 DOMWrapperWorld& World() const { return *world_; }
139 // DEPRECATED: Use ExecutionContext::From instead
139 virtual ExecutionContext* GetExecutionContext() const; 140 virtual ExecutionContext* GetExecutionContext() const;
140 141
141 // This can return an empty handle if the v8::Context is gone. 142 // This can return an empty handle if the v8::Context is gone.
142 v8::Local<v8::Context> GetContext() const { 143 v8::Local<v8::Context> GetContext() const {
143 return context_.NewLocal(isolate_); 144 return context_.NewLocal(isolate_);
144 } 145 }
145 bool ContextIsValid() const { 146 bool ContextIsValid() const {
146 return !context_.IsEmpty() && per_context_data_; 147 return !context_.IsEmpty() && per_context_data_;
147 } 148 }
148 void DetachGlobalObject(); 149 void DetachGlobalObject();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 197 }
197 198
198 private: 199 private:
199 RefPtr<ScriptState> script_state_; 200 RefPtr<ScriptState> script_state_;
200 ScopedPersistent<v8::Context> context_; 201 ScopedPersistent<v8::Context> context_;
201 }; 202 };
202 203
203 } // namespace blink 204 } // namespace blink
204 205
205 #endif // ScriptState_h 206 #endif // ScriptState_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698