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

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

Issue 1838683002: [DevTools] Debugger::currentCallFrames returns array instead linked list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wrap-with-corrrect-injected-script
Patch Set: Created 4 years, 9 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 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 : m_isolate(debuggerContext->GetIsolate()) 40 : m_isolate(debuggerContext->GetIsolate())
41 , m_debuggerContext(m_isolate, debuggerContext) 41 , m_debuggerContext(m_isolate, debuggerContext)
42 , m_callFrame(m_isolate, callFrame) 42 , m_callFrame(m_isolate, callFrame)
43 { 43 {
44 } 44 }
45 45
46 JavaScriptCallFrame::~JavaScriptCallFrame() 46 JavaScriptCallFrame::~JavaScriptCallFrame()
47 { 47 {
48 } 48 }
49 49
50 PassOwnPtr<JavaScriptCallFrame> JavaScriptCallFrame::caller()
51 {
52 v8::HandleScope handleScope(m_isolate);
53 v8::Local<v8::Context> debuggerContext = v8::Local<v8::Context>::New(m_isola te, m_debuggerContext);
54 v8::Local<v8::Value> callerFrame = v8::Local<v8::Object>::New(m_isolate, m_c allFrame)->Get(toV8StringInternalized(m_isolate, "caller"));
55 if (callerFrame.IsEmpty() || !callerFrame->IsObject())
56 return 0;
57 return JavaScriptCallFrame::create(debuggerContext, v8::Local<v8::Object>::C ast(callerFrame));
58 }
59
60 int JavaScriptCallFrame::callV8FunctionReturnInt(const char* name) const 50 int JavaScriptCallFrame::callV8FunctionReturnInt(const char* name) const
61 { 51 {
62 v8::HandleScope handleScope(m_isolate); 52 v8::HandleScope handleScope(m_isolate);
63 v8::MicrotasksScope microtasks(m_isolate, v8::MicrotasksScope::kDoNotRunMicr otasks); 53 v8::MicrotasksScope microtasks(m_isolate, v8::MicrotasksScope::kDoNotRunMicr otasks);
64 v8::Local<v8::Context> context = v8::Local<v8::Context>::New(m_isolate, m_de buggerContext); 54 v8::Local<v8::Context> context = v8::Local<v8::Context>::New(m_isolate, m_de buggerContext);
65 v8::Local<v8::Object> callFrame = v8::Local<v8::Object>::New(m_isolate, m_ca llFrame); 55 v8::Local<v8::Object> callFrame = v8::Local<v8::Object>::New(m_isolate, m_ca llFrame);
66 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(callFrame->Get( toV8StringInternalized(m_isolate, name))); 56 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(callFrame->Get( toV8StringInternalized(m_isolate, name)));
67 v8::Local<v8::Value> result; 57 v8::Local<v8::Value> result;
68 if (!func->Call(context, callFrame, 0, nullptr).ToLocal(&result) || !result- >IsInt32()) 58 if (!func->Call(context, callFrame, 0, nullptr).ToLocal(&result) || !result- >IsInt32())
69 return 0; 59 return 0;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 v8::Local<v8::Function> setVariableValueFunction = v8::Local<v8::Function>:: Cast(callFrame->Get(toV8StringInternalized(m_isolate, "setVariableValue"))); 118 v8::Local<v8::Function> setVariableValueFunction = v8::Local<v8::Function>:: Cast(callFrame->Get(toV8StringInternalized(m_isolate, "setVariableValue")));
129 v8::Local<v8::Value> argv[] = { 119 v8::Local<v8::Value> argv[] = {
130 v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)), 120 v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)),
131 variableName, 121 variableName,
132 newValue 122 newValue
133 }; 123 };
134 return setVariableValueFunction->Call(m_isolate->GetCurrentContext(), callFr ame, WTF_ARRAY_LENGTH(argv), argv); 124 return setVariableValueFunction->Call(m_isolate->GetCurrentContext(), callFr ame, WTF_ARRAY_LENGTH(argv), argv);
135 } 125 }
136 126
137 } // namespace blink 127 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698