Chromium Code Reviews

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

Issue 1924663006: [DevTools] Move API methods from V8RuntimeAgent to V8InspectorSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@debugger-into-session
Patch Set: rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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/V8Console.h" 5 #include "platform/v8_inspector/V8Console.h"
6 6
7 #include "platform/inspector_protocol/String16.h" 7 #include "platform/inspector_protocol/String16.h"
8 #include "platform/v8_inspector/InjectedScript.h" 8 #include "platform/v8_inspector/InjectedScript.h"
9 #include "platform/v8_inspector/InspectedContext.h" 9 #include "platform/v8_inspector/InspectedContext.h"
10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" 10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h"
(...skipping 605 matching lines...)
616 void V8Console::copyCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 616 void V8Console::copyCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
617 { 617 {
618 inspectImpl(info, true); 618 inspectImpl(info, true);
619 } 619 }
620 620
621 void V8Console::inspectedObject(const v8::FunctionCallbackInfo<v8::Value>& info, unsigned num) 621 void V8Console::inspectedObject(const v8::FunctionCallbackInfo<v8::Value>& info, unsigned num)
622 { 622 {
623 ASSERT(num < V8InspectorSessionImpl::kInspectedObjectBufferSize); 623 ASSERT(num < V8InspectorSessionImpl::kInspectedObjectBufferSize);
624 ConsoleHelper helper(info); 624 ConsoleHelper helper(info);
625 if (V8InspectorSessionImpl* session = helper.currentSession()) { 625 if (V8InspectorSessionImpl* session = helper.currentSession()) {
626 V8RuntimeAgent::Inspectable* object = session->inspectedObject(num); 626 V8InspectorSession::Inspectable* object = session->inspectedObject(num);
627 v8::Isolate* isolate = info.GetIsolate(); 627 v8::Isolate* isolate = info.GetIsolate();
628 if (object) 628 if (object)
629 info.GetReturnValue().Set(object->get(isolate->GetCurrentContext())) ; 629 info.GetReturnValue().Set(object->get(isolate->GetCurrentContext())) ;
630 else 630 else
631 info.GetReturnValue().Set(v8::Undefined(isolate)); 631 info.GetReturnValue().Set(v8::Undefined(isolate));
632 } 632 }
633 } 633 }
634 634
635 v8::MaybeLocal<v8::Object> V8Console::createConsole(InspectedContext* inspectedC ontext, bool hasMemoryAttribute) 635 v8::MaybeLocal<v8::Object> V8Console::createConsole(InspectedContext* inspectedC ontext, bool hasMemoryAttribute)
636 { 636 {
(...skipping 101 matching lines...)
738 DEFINE_STATIC_LOCAL(protocol::HashSet<String16>, getters, ()); 738 DEFINE_STATIC_LOCAL(protocol::HashSet<String16>, getters, ());
739 if (getters.size() == 0) { 739 if (getters.size() == 0) {
740 const char* members[] = { "$0", "$1", "$2", "$3", "$4", "$_" }; 740 const char* members[] = { "$0", "$1", "$2", "$3", "$4", "$_" };
741 for (size_t i = 0; i < WTF_ARRAY_LENGTH(members); ++i) 741 for (size_t i = 0; i < WTF_ARRAY_LENGTH(members); ++i)
742 getters.add(members[i]); 742 getters.add(members[i]);
743 } 743 }
744 return getters.find(name) != getters.end(); 744 return getters.find(name) != getters.end();
745 } 745 }
746 746
747 } // namespace blink 747 } // namespace blink
OLDNEW

Powered by Google App Engine