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

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

Issue 2034203002: [DevTools] Improve MainThreadDebugger::memoryInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added a test Created 4 years, 6 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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698