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/V8Compat.h" | 10 #include "platform/v8_inspector/V8Compat.h" |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 { | 441 { |
442 ConsoleHelper helper(info); | 442 ConsoleHelper helper(info); |
443 if (V8DebuggerClient* client = helper.ensureDebuggerClient()) | 443 if (V8DebuggerClient* client = helper.ensureDebuggerClient()) |
444 client->consoleTimeStamp(helper.firstArgToString(String16())); | 444 client->consoleTimeStamp(helper.firstArgToString(String16())); |
445 } | 445 } |
446 | 446 |
447 void V8Console::memoryGetterCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 447 void V8Console::memoryGetterCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
448 { | 448 { |
449 if (V8DebuggerClient* client = ConsoleHelper(info).ensureDebuggerClient()) { | 449 if (V8DebuggerClient* client = ConsoleHelper(info).ensureDebuggerClient()) { |
450 v8::Local<v8::Value> memoryValue; | 450 v8::Local<v8::Value> memoryValue; |
451 if (!client->memoryInfo(info.GetIsolate(), info.GetIsolate()->GetCurrent
Context(), info.Holder()).ToLocal(&memoryValue)) | 451 if (!client->memoryInfo(info.GetIsolate(), info.GetIsolate()->GetCurrent
Context()).ToLocal(&memoryValue)) |
452 return; | 452 return; |
453 info.GetReturnValue().Set(memoryValue); | 453 info.GetReturnValue().Set(memoryValue); |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 void V8Console::memorySetterCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 457 void V8Console::memorySetterCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
458 { | 458 { |
459 // We can't make the attribute readonly as it breaks existing code that reli
es on being able to assign to console.memory in strict mode. Instead, the setter
just ignores the passed value. http://crbug.com/468611 | 459 // We can't make the attribute readonly as it breaks existing code that reli
es on being able to assign to console.memory in strict mode. Instead, the setter
just ignores the passed value. http://crbug.com/468611 |
460 } | 460 } |
461 | 461 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 DEFINE_STATIC_LOCAL(protocol::HashSet<String16>, getters, ()); | 725 DEFINE_STATIC_LOCAL(protocol::HashSet<String16>, getters, ()); |
726 if (getters.size() == 0) { | 726 if (getters.size() == 0) { |
727 const char* members[] = { "$0", "$1", "$2", "$3", "$4", "$_" }; | 727 const char* members[] = { "$0", "$1", "$2", "$3", "$4", "$_" }; |
728 for (size_t i = 0; i < WTF_ARRAY_LENGTH(members); ++i) | 728 for (size_t i = 0; i < WTF_ARRAY_LENGTH(members); ++i) |
729 getters.add(members[i]); | 729 getters.add(members[i]); |
730 } | 730 } |
731 return getters.find(name) != getters.end(); | 731 return getters.find(name) != getters.end(); |
732 } | 732 } |
733 | 733 |
734 } // namespace blink | 734 } // namespace blink |
OLD | NEW |