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/V8InspectorImpl.h" | 9 #include "platform/v8_inspector/V8InspectorImpl.h" |
10 #include "platform/v8_inspector/V8StringUtil.h" | 10 #include "platform/v8_inspector/V8StringUtil.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 void InspectedContext::consoleWeakCallback(const v8::WeakCallbackInfo<InspectedC
ontext>& data) | 27 void InspectedContext::consoleWeakCallback(const v8::WeakCallbackInfo<InspectedC
ontext>& data) |
28 { | 28 { |
29 data.GetParameter()->m_console.Reset(); | 29 data.GetParameter()->m_console.Reset(); |
30 } | 30 } |
31 | 31 |
32 InspectedContext::InspectedContext(V8InspectorImpl* inspector, const V8ContextIn
fo& info, int contextId) | 32 InspectedContext::InspectedContext(V8InspectorImpl* inspector, const V8ContextIn
fo& info, int contextId) |
33 : m_inspector(inspector) | 33 : m_inspector(inspector) |
34 , m_context(info.context->GetIsolate(), info.context) | 34 , m_context(info.context->GetIsolate(), info.context) |
35 , m_contextId(contextId) | 35 , m_contextId(contextId) |
36 , m_contextGroupId(info.contextGroupId) | 36 , m_contextGroupId(info.contextGroupId) |
37 , m_isDefault(info.isDefault) | |
38 , m_origin(info.origin) | 37 , m_origin(info.origin) |
39 , m_humanReadableName(info.humanReadableName) | 38 , m_humanReadableName(info.humanReadableName) |
40 , m_frameId(info.frameId) | 39 , m_auxData(info.auxData) |
41 , m_reported(false) | 40 , m_reported(false) |
42 { | 41 { |
43 m_context.SetWeak(this, &InspectedContext::weakCallback, v8::WeakCallbackTyp
e::kParameter); | 42 m_context.SetWeak(this, &InspectedContext::weakCallback, v8::WeakCallbackTyp
e::kParameter); |
44 | 43 |
45 v8::Isolate* isolate = m_inspector->isolate(); | 44 v8::Isolate* isolate = m_inspector->isolate(); |
46 v8::Local<v8::Object> global = info.context->Global(); | 45 v8::Local<v8::Object> global = info.context->Global(); |
47 v8::Local<v8::Object> console = V8Console::createConsole(this, info.hasMemor
yOnConsole); | 46 v8::Local<v8::Object> console = V8Console::createConsole(this, info.hasMemor
yOnConsole); |
48 if (!global->Set(info.context, toV8StringInternalized(isolate, "console"), c
onsole).FromMaybe(false)) | 47 if (!global->Set(info.context, toV8StringInternalized(isolate, "console"), c
onsole).FromMaybe(false)) |
49 return; | 48 return; |
50 m_console.Reset(isolate, console); | 49 m_console.Reset(isolate, console); |
(...skipping 23 matching lines...) Expand all Loading... |
74 DCHECK(!m_injectedScript); | 73 DCHECK(!m_injectedScript); |
75 m_injectedScript = InjectedScript::create(this); | 74 m_injectedScript = InjectedScript::create(this); |
76 } | 75 } |
77 | 76 |
78 void InspectedContext::discardInjectedScript() | 77 void InspectedContext::discardInjectedScript() |
79 { | 78 { |
80 m_injectedScript.reset(); | 79 m_injectedScript.reset(); |
81 } | 80 } |
82 | 81 |
83 } // namespace blink | 82 } // namespace blink |
OLD | NEW |