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

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

Issue 1836653002: [DevTools] Wrap call frame with its injected script instead top injected script (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compile-debugger-script
Patch Set: Created 4 years, 8 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 objectGroup.fromMaybe(""), 126 objectGroup.fromMaybe(""),
127 returnByValue.fromMaybe(false), 127 returnByValue.fromMaybe(false),
128 generatePreview.fromMaybe(false), 128 generatePreview.fromMaybe(false),
129 result, 129 result,
130 wasThrown, 130 wasThrown,
131 exceptionDetails); 131 exceptionDetails);
132 } 132 }
133 133
134 v8::MaybeLocal<v8::Value> V8RuntimeAgentImpl::evaluateInternal(InjectedScript* i njectedScript, bool doNotPauseOnExceptionsAndMuteConsole, const String& expressi on, v8::MaybeLocal<v8::Object> extension) 134 v8::MaybeLocal<v8::Value> V8RuntimeAgentImpl::evaluateInternal(InjectedScript* i njectedScript, bool doNotPauseOnExceptionsAndMuteConsole, const String& expressi on, v8::MaybeLocal<v8::Object> extension)
135 { 135 {
136 InjectedScriptManager::ScopedGlobalObjectExtension scopeExtension(injectedSc ript, nullptr, extension); 136 InjectedScript::ScopedGlobalObjectExtension scopeExtension(injectedScript, e xtension);
137 IgnoreExceptionsScope ignoreExceptionsScope(doNotPauseOnExceptionsAndMuteCon sole ? m_debugger : nullptr); 137 IgnoreExceptionsScope ignoreExceptionsScope(doNotPauseOnExceptionsAndMuteCon sole ? m_debugger : nullptr);
138 return m_debugger->compileAndRunInternalScript(injectedScript->context(), to V8String(injectedScript->isolate(), expression)); 138 return m_debugger->compileAndRunInternalScript(injectedScript->context(), to V8String(injectedScript->isolate(), expression));
139 } 139 }
140 140
141 void V8RuntimeAgentImpl::callFunctionOn(ErrorString* errorString, 141 void V8RuntimeAgentImpl::callFunctionOn(ErrorString* errorString,
142 const String16& objectId, 142 const String16& objectId,
143 const String16& expression, 143 const String16& expression,
144 const Maybe<protocol::Array<protocol::Runtime::CallArgument>>& optionalArgum ents, 144 const Maybe<protocol::Array<protocol::Runtime::CallArgument>>& optionalArgum ents,
145 const Maybe<bool>& doNotPauseOnExceptionsAndMuteConsole, 145 const Maybe<bool>& doNotPauseOnExceptionsAndMuteConsole,
146 const Maybe<bool>& returnByValue, 146 const Maybe<bool>& returnByValue,
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 if (script.IsEmpty()) { 385 if (script.IsEmpty()) {
386 *errorString = "Script execution failed"; 386 *errorString = "Script execution failed";
387 return; 387 return;
388 } 388 }
389 389
390 v8::MaybeLocal<v8::Object> commandLineAPI = includeCommandLineAPI.fromMaybe( false) ? injectedScript->commandLineAPI(errorString) : v8::MaybeLocal<v8::Object >(); 390 v8::MaybeLocal<v8::Object> commandLineAPI = includeCommandLineAPI.fromMaybe( false) ? injectedScript->commandLineAPI(errorString) : v8::MaybeLocal<v8::Object >();
391 if (includeCommandLineAPI.fromMaybe(false) && commandLineAPI.IsEmpty()) 391 if (includeCommandLineAPI.fromMaybe(false) && commandLineAPI.IsEmpty())
392 return; 392 return;
393 393
394 InjectedScriptManager::ScopedGlobalObjectExtension scopeExtension(injectedSc ript, nullptr, commandLineAPI); 394 InjectedScript::ScopedGlobalObjectExtension scopeExtension(injectedScript, c ommandLineAPI);
395 395
396 v8::TryCatch tryCatch(isolate); 396 v8::TryCatch tryCatch(isolate);
397 v8::MaybeLocal<v8::Value> maybeResultValue = m_debugger->runCompiledScript(c ontext, script); 397 v8::MaybeLocal<v8::Value> maybeResultValue = m_debugger->runCompiledScript(c ontext, script);
398 398
399 // InjectedScript may be gone after any evaluate call - find it again. 399 // InjectedScript may be gone after any evaluate call - find it again.
400 injectedScript = m_injectedScriptManager->findInjectedScript(errorString, ex ecutionContextId); 400 injectedScript = m_injectedScriptManager->findInjectedScript(errorString, ex ecutionContextId);
401 if (!injectedScript) 401 if (!injectedScript)
402 return; 402 return;
403 403
404 injectedScript->wrapEvaluateResult(errorString, maybeResultValue, tryCatch, objectGroup.fromMaybe(""), false, false, result, nullptr, exceptionDetails); 404 injectedScript->wrapEvaluateResult(errorString, maybeResultValue, tryCatch, objectGroup.fromMaybe(""), false, false, result, nullptr, exceptionDetails);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 } 538 }
539 539
540 void V8RuntimeAgentImpl::reportExecutionContextDestroyed(v8::Local<v8::Context> context) 540 void V8RuntimeAgentImpl::reportExecutionContextDestroyed(v8::Local<v8::Context> context)
541 { 541 {
542 int contextId = m_injectedScriptManager->discardInjectedScriptFor(context); 542 int contextId = m_injectedScriptManager->discardInjectedScriptFor(context);
543 if (m_enabled && contextId) 543 if (m_enabled && contextId)
544 m_frontend->executionContextDestroyed(contextId); 544 m_frontend->executionContextDestroyed(contextId);
545 } 545 }
546 546
547 } // namespace blink 547 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698