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

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

Issue 2383683002: [DevTools] don't truncate [[Entries]] from Runtime.getProperties (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | 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/V8Debugger.h" 5 #include "platform/v8_inspector/V8Debugger.h"
6 6
7 #include "platform/v8_inspector/DebuggerScript.h" 7 #include "platform/v8_inspector/DebuggerScript.h"
8 #include "platform/v8_inspector/ScriptBreakpoint.h" 8 #include "platform/v8_inspector/ScriptBreakpoint.h"
9 #include "platform/v8_inspector/V8Compat.h" 9 #include "platform/v8_inspector/V8Compat.h"
10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" 10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h"
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 } 648 }
649 649
650 v8::Local<v8::Value> V8Debugger::collectionEntries(v8::Local<v8::Context> contex t, v8::Local<v8::Object> object) 650 v8::Local<v8::Value> V8Debugger::collectionEntries(v8::Local<v8::Context> contex t, v8::Local<v8::Object> object)
651 { 651 {
652 if (!enabled()) { 652 if (!enabled()) {
653 NOTREACHED(); 653 NOTREACHED();
654 return v8::Undefined(m_isolate); 654 return v8::Undefined(m_isolate);
655 } 655 }
656 v8::Local<v8::Value> argv[] = { object }; 656 v8::Local<v8::Value> argv[] = { object };
657 v8::Local<v8::Value> entriesValue = callDebuggerMethod("getCollectionEntries ", 1, argv).ToLocalChecked(); 657 v8::Local<v8::Value> entriesValue = callDebuggerMethod("getCollectionEntries ", 1, argv).ToLocalChecked();
658 v8::Local<v8::Value> copied; 658 if (!entriesValue->IsArray())
659 if (!copyValueFromDebuggerContext(m_isolate, debuggerContext(), context, ent riesValue).ToLocal(&copied) || !copied->IsArray())
660 return v8::Undefined(m_isolate); 659 return v8::Undefined(m_isolate);
661 if (!markArrayEntriesAsInternal(context, v8::Local<v8::Array>::Cast(copied), V8InternalValueType::kEntry)) 660 v8::Local<v8::Array> entries = entriesValue.As<v8::Array>();
661 v8::Local<v8::Array> copiedArray = v8::Array::New(m_isolate, entries->Length ());
662 if (!copiedArray->SetPrototype(context, v8::Null(m_isolate)).FromMaybe(false ))
662 return v8::Undefined(m_isolate); 663 return v8::Undefined(m_isolate);
663 return copied; 664 for (uint32_t i = 0; i < entries->Length(); ++i) {
665 v8::Local<v8::Value> item;
666 if (!entries->Get(debuggerContext(), i).ToLocal(&item))
667 return v8::Undefined(m_isolate);
668 v8::Local<v8::Value> copied;
669 if (!copyValueFromDebuggerContext(m_isolate, debuggerContext(), context, item).ToLocal(&copied))
670 return v8::Undefined(m_isolate);
671 if (!createDataProperty(context, copiedArray, i, copied).FromMaybe(false ))
672 return v8::Undefined(m_isolate);
673 }
674 if (!markArrayEntriesAsInternal(context, v8::Local<v8::Array>::Cast(copiedAr ray), V8InternalValueType::kEntry))
675 return v8::Undefined(m_isolate);
676 return copiedArray;
664 } 677 }
665 678
666 v8::Local<v8::Value> V8Debugger::generatorObjectLocation(v8::Local<v8::Context> context, v8::Local<v8::Object> object) 679 v8::Local<v8::Value> V8Debugger::generatorObjectLocation(v8::Local<v8::Context> context, v8::Local<v8::Object> object)
667 { 680 {
668 if (!enabled()) { 681 if (!enabled()) {
669 NOTREACHED(); 682 NOTREACHED();
670 return v8::Null(m_isolate); 683 return v8::Null(m_isolate);
671 } 684 }
672 v8::Local<v8::Value> argv[] = { object }; 685 v8::Local<v8::Value> argv[] = { object };
673 v8::Local<v8::Value> location = callDebuggerMethod("getGeneratorObjectLocati on", 1, argv).ToLocalChecked(); 686 v8::Local<v8::Value> location = callDebuggerMethod("getGeneratorObjectLocati on", 1, argv).ToLocalChecked();
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 return nullptr; 843 return nullptr;
831 844
832 size_t stackSize = fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; 845 size_t stackSize = fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1;
833 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) 846 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId))
834 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; 847 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture;
835 848
836 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); 849 return V8StackTraceImpl::capture(this, contextGroupId, stackSize);
837 } 850 }
838 851
839 } // namespace v8_inspector 852 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698