| 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/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...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |