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