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

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

Issue 1995423002: [DevTools] Set vanilla object as console prototype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-property-on-console-proto-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 createBoundFunctionProperty(context, console, "assert", V8Console::assertCal lback); 649 createBoundFunctionProperty(context, console, "assert", V8Console::assertCal lback);
650 createBoundFunctionProperty(context, console, "markTimeline", V8Console::mar kTimelineCallback); 650 createBoundFunctionProperty(context, console, "markTimeline", V8Console::mar kTimelineCallback);
651 createBoundFunctionProperty(context, console, "profile", V8Console::profileC allback); 651 createBoundFunctionProperty(context, console, "profile", V8Console::profileC allback);
652 createBoundFunctionProperty(context, console, "profileEnd", V8Console::profi leEndCallback); 652 createBoundFunctionProperty(context, console, "profileEnd", V8Console::profi leEndCallback);
653 createBoundFunctionProperty(context, console, "timeline", V8Console::timelin eCallback); 653 createBoundFunctionProperty(context, console, "timeline", V8Console::timelin eCallback);
654 createBoundFunctionProperty(context, console, "timelineEnd", V8Console::time lineEndCallback); 654 createBoundFunctionProperty(context, console, "timelineEnd", V8Console::time lineEndCallback);
655 createBoundFunctionProperty(context, console, "time", V8Console::timeCallbac k); 655 createBoundFunctionProperty(context, console, "time", V8Console::timeCallbac k);
656 createBoundFunctionProperty(context, console, "timeEnd", V8Console::timeEndC allback); 656 createBoundFunctionProperty(context, console, "timeEnd", V8Console::timeEndC allback);
657 createBoundFunctionProperty(context, console, "timeStamp", V8Console::timeSt ampCallback); 657 createBoundFunctionProperty(context, console, "timeStamp", V8Console::timeSt ampCallback);
658 658
659 bool success = console->SetPrototype(context, v8::Object::New(isolate)).From Maybe(false);
660 DCHECK(success);
661
659 if (hasMemoryAttribute) 662 if (hasMemoryAttribute)
660 console->SetAccessorProperty(toV8StringInternalized(isolate, "memory"), v8::Function::New(isolate, V8Console::memoryGetterCallback, console), v8::Functi on::New(isolate, V8Console::memorySetterCallback), static_cast<v8::PropertyAttri bute>(v8::None), v8::DEFAULT); 663 console->SetAccessorProperty(toV8StringInternalized(isolate, "memory"), v8::Function::New(isolate, V8Console::memoryGetterCallback, console), v8::Functi on::New(isolate, V8Console::memorySetterCallback), static_cast<v8::PropertyAttri bute>(v8::None), v8::DEFAULT);
661 664
662 console->SetPrivate(context, inspectedContextPrivateKey(isolate), v8::Extern al::New(isolate, inspectedContext)); 665 console->SetPrivate(context, inspectedContextPrivateKey(isolate), v8::Extern al::New(isolate, inspectedContext));
663 return console; 666 return console;
664 } 667 }
665 668
666 v8::Local<v8::Object> V8Console::createCommandLineAPI(InspectedContext* inspecte dContext) 669 v8::Local<v8::Object> V8Console::createCommandLineAPI(InspectedContext* inspecte dContext)
667 { 670 {
668 v8::Local<v8::Context> context = inspectedContext->context(); 671 v8::Local<v8::Context> context = inspectedContext->context();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 DEFINE_STATIC_LOCAL(protocol::HashSet<String16>, getters, ()); 726 DEFINE_STATIC_LOCAL(protocol::HashSet<String16>, getters, ());
724 if (getters.size() == 0) { 727 if (getters.size() == 0) {
725 const char* members[] = { "$0", "$1", "$2", "$3", "$4", "$_" }; 728 const char* members[] = { "$0", "$1", "$2", "$3", "$4", "$_" };
726 for (size_t i = 0; i < WTF_ARRAY_LENGTH(members); ++i) 729 for (size_t i = 0; i < WTF_ARRAY_LENGTH(members); ++i)
727 getters.add(members[i]); 730 getters.add(members[i]);
728 } 731 }
729 return getters.find(name) != getters.end(); 732 return getters.find(name) != getters.end();
730 } 733 }
731 734
732 } // namespace blink 735 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-property-on-console-proto-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698