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 #include "platform/v8_inspector/InspectedContext.h" | 5 #include "platform/v8_inspector/InspectedContext.h" |
6 | 6 |
7 #include "platform/v8_inspector/InjectedScript.h" | 7 #include "platform/v8_inspector/InjectedScript.h" |
8 #include "platform/v8_inspector/V8Console.h" | 8 #include "platform/v8_inspector/V8Console.h" |
9 #include "platform/v8_inspector/V8DebuggerImpl.h" | 9 #include "platform/v8_inspector/V8DebuggerImpl.h" |
10 #include "platform/v8_inspector/V8StringUtil.h" | 10 #include "platform/v8_inspector/V8StringUtil.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 v8::Isolate* InspectedContext::isolate() const | 67 v8::Isolate* InspectedContext::isolate() const |
68 { | 68 { |
69 return m_debugger->isolate(); | 69 return m_debugger->isolate(); |
70 } | 70 } |
71 | 71 |
72 void InspectedContext::createInjectedScript() | 72 void InspectedContext::createInjectedScript() |
73 { | 73 { |
74 DCHECK(!m_injectedScript); | 74 DCHECK(!m_injectedScript); |
75 v8::HandleScope handles(isolate()); | 75 v8::HandleScope handles(isolate()); |
76 v8::Local<v8::Context> localContext = context(); | 76 v8::Local<v8::Context> localContext = context(); |
77 v8::Local<v8::Context> callingContext = isolate()->GetCallingContext(); | 77 v8::Local<v8::Context> callingContext; |
haraken
2016/06/07 14:07:30
Ditto.
| |
78 if (!callingContext.IsEmpty() && !m_debugger->client()->callingContextCanAcc essContext(callingContext, localContext)) | 78 if (!v8::Debug::GetDebuggedContext(isolate()).ToLocal(&callingContext)) |
pfeldman
2016/06/07 14:39:29
We should not need calling context here - injected
jochen (gone - plz use gerrit)
2016/06/07 14:52:13
so just delete this check?
kozy
2016/06/08 19:28:23
I'm worried here about V8DebuggerAgent::currentCal
dgozman
2016/06/09 08:53:45
I think we'd better keep it for this call:
https:/
| |
79 return; | |
80 if (!m_debugger->client()->callingContextCanAccessContext(callingContext, lo calContext)) | |
79 return; | 81 return; |
80 m_injectedScript = InjectedScript::create(this); | 82 m_injectedScript = InjectedScript::create(this); |
81 } | 83 } |
82 | 84 |
83 void InspectedContext::discardInjectedScript() | 85 void InspectedContext::discardInjectedScript() |
84 { | 86 { |
85 m_injectedScript.reset(); | 87 m_injectedScript.reset(); |
86 } | 88 } |
87 | 89 |
88 } // namespace blink | 90 } // namespace blink |
OLD | NEW |