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

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

Issue 1622213002: DevTools: make InjectedScript heap-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed protocol tests. Created 4 years, 10 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 "bindings/core/v8/ScopedPersistent.h" 8 #include "bindings/core/v8/ScopedPersistent.h"
9 #include "bindings/core/v8/V8PerContextData.h" 9 #include "bindings/core/v8/V8PerContextData.h"
10 #include "core/CoreExport.h" 10 #include "core/CoreExport.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // These methods can return nullptr if the context associated with the 82 // These methods can return nullptr if the context associated with the
83 // ScriptState has already been detached. 83 // ScriptState has already been detached.
84 static ScriptState* forMainWorld(LocalFrame*); 84 static ScriptState* forMainWorld(LocalFrame*);
85 static ScriptState* forWorld(LocalFrame*, DOMWrapperWorld&); 85 static ScriptState* forWorld(LocalFrame*, DOMWrapperWorld&);
86 86
87 v8::Isolate* isolate() const { return m_isolate; } 87 v8::Isolate* isolate() const { return m_isolate; }
88 DOMWrapperWorld& world() const { return *m_world; } 88 DOMWrapperWorld& world() const { return *m_world; }
89 LocalDOMWindow* domWindow() const; 89 LocalDOMWindow* domWindow() const;
90 virtual ExecutionContext* executionContext() const; 90 virtual ExecutionContext* executionContext() const;
91 virtual void setExecutionContext(ExecutionContext*); 91 virtual void setExecutionContext(ExecutionContext*);
92 int contextIdInDebugger();
92 93
93 // This can return an empty handle if the v8::Context is gone. 94 // This can return an empty handle if the v8::Context is gone.
94 v8::Local<v8::Context> context() const { return m_context.newLocal(m_isolate ); } 95 v8::Local<v8::Context> context() const { return m_context.newLocal(m_isolate ); }
95 bool contextIsValid() const { return !m_context.isEmpty() && m_perContextDat a; } 96 bool contextIsValid() const { return !m_context.isEmpty() && m_perContextDat a; }
96 void detachGlobalObject(); 97 void detachGlobalObject();
97 void clearContext() { return m_context.clear(); } 98 void clearContext() { return m_context.clear(); }
98 #if ENABLE(ASSERT) 99 #if ENABLE(ASSERT)
99 bool isGlobalObjectDetached() const { return m_globalObjectDetached; } 100 bool isGlobalObjectDetached() const { return m_globalObjectDetached; }
100 #endif 101 #endif
101 102
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 161 }
161 162
162 private: 163 private:
163 RefPtr<ScriptState> m_scriptState; 164 RefPtr<ScriptState> m_scriptState;
164 ScopedPersistent<v8::Context> m_context; 165 ScopedPersistent<v8::Context> m_context;
165 }; 166 };
166 167
167 } // namespace blink 168 } // namespace blink
168 169
169 #endif // ScriptState_h 170 #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