| 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 22 matching lines...) Expand all Loading... |
| 33 , m_origin(info.origin) | 33 , m_origin(info.origin) |
| 34 , m_humanReadableName(info.humanReadableName) | 34 , m_humanReadableName(info.humanReadableName) |
| 35 , m_frameId(info.frameId) | 35 , m_frameId(info.frameId) |
| 36 , m_reported(false) | 36 , m_reported(false) |
| 37 { | 37 { |
| 38 m_context.SetWeak(this, &InspectedContext::weakCallback, v8::WeakCallbackTyp
e::kParameter); | 38 m_context.SetWeak(this, &InspectedContext::weakCallback, v8::WeakCallbackTyp
e::kParameter); |
| 39 | 39 |
| 40 v8::Isolate* isolate = m_debugger->isolate(); | 40 v8::Isolate* isolate = m_debugger->isolate(); |
| 41 v8::Local<v8::Object> global = info.context->Global(); | 41 v8::Local<v8::Object> global = info.context->Global(); |
| 42 v8::Local<v8::Object> console; | 42 v8::Local<v8::Object> console; |
| 43 if (!V8Console::create(info.context, this, info.hasMemoryOnConsole).ToLocal(
&console)) | 43 if (!V8Console::createConsole(info.context, this, info.hasMemoryOnConsole).T
oLocal(&console)) |
| 44 return; | 44 return; |
| 45 if (!global->Set(info.context, toV8StringInternalized(isolate, "console"), c
onsole).FromMaybe(false)) | 45 if (!global->Set(info.context, toV8StringInternalized(isolate, "console"), c
onsole).FromMaybe(false)) |
| 46 return; | 46 return; |
| 47 m_console.Reset(isolate, console); | 47 m_console.Reset(isolate, console); |
| 48 m_console.SetWeak(this, &InspectedContext::consoleWeakCallback, v8::WeakCall
backType::kFinalizer); | 48 m_console.SetWeak(this, &InspectedContext::consoleWeakCallback, v8::WeakCall
backType::kFinalizer); |
| 49 } | 49 } |
| 50 | 50 |
| 51 InspectedContext::~InspectedContext() | 51 InspectedContext::~InspectedContext() |
| 52 { | 52 { |
| 53 if (!m_context.IsEmpty() && !m_console.IsEmpty()) { | 53 if (!m_context.IsEmpty() && !m_console.IsEmpty()) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 76 return; | 76 return; |
| 77 m_injectedScript = InjectedScript::create(this, injectedScriptHost); | 77 m_injectedScript = InjectedScript::create(this, injectedScriptHost); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void InspectedContext::discardInjectedScript() | 80 void InspectedContext::discardInjectedScript() |
| 81 { | 81 { |
| 82 m_injectedScript.clear(); | 82 m_injectedScript.clear(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace blink | 85 } // namespace blink |
| OLD | NEW |