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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InspectedContext.cpp

Issue 1921143002: [DevTools] Align Console implementation with The JSey way (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-part-command-line-api-to-native
Patch Set: Created 4 years, 7 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
OLDNEW
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 26 matching lines...) Expand all
37 , m_isDefault(info.isDefault) 37 , m_isDefault(info.isDefault)
38 , m_origin(info.origin) 38 , m_origin(info.origin)
39 , m_humanReadableName(info.humanReadableName) 39 , m_humanReadableName(info.humanReadableName)
40 , m_frameId(info.frameId) 40 , m_frameId(info.frameId)
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_debugger->isolate(); 45 v8::Isolate* isolate = m_debugger->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; 47 v8::Local<v8::Object> console = V8Console::createConsole(this, info.hasMemor yOnConsole);
48 if (!V8Console::createConsole(this, info.hasMemoryOnConsole).ToLocal(&consol e))
49 return;
50 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))
51 return; 49 return;
52 m_console.Reset(isolate, console); 50 m_console.Reset(isolate, console);
53 m_console.SetWeak(this, &InspectedContext::consoleWeakCallback, v8::WeakCall backType::kParameter); 51 m_console.SetWeak(this, &InspectedContext::consoleWeakCallback, v8::WeakCall backType::kParameter);
54 } 52 }
55 53
56 InspectedContext::~InspectedContext() 54 InspectedContext::~InspectedContext()
57 { 55 {
58 if (!m_context.IsEmpty() && !m_console.IsEmpty()) { 56 if (!m_context.IsEmpty() && !m_console.IsEmpty()) {
59 v8::HandleScope scope(isolate()); 57 v8::HandleScope scope(isolate());
(...skipping 21 matching lines...) Expand all
81 return; 79 return;
82 m_injectedScript = InjectedScript::create(this); 80 m_injectedScript = InjectedScript::create(this);
83 } 81 }
84 82
85 void InspectedContext::discardInjectedScript() 83 void InspectedContext::discardInjectedScript()
86 { 84 {
87 m_injectedScript.clear(); 85 m_injectedScript.clear();
88 } 86 }
89 87
90 } // namespace blink 88 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698