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

Side by Side Diff: Source/core/inspector/InspectorRuntimeAgent.cpp

Issue 369333002: DevTools: Added error message when the command is invoked from the console with exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add-evaluate-exception-details
Patch Set: Created 6 years, 5 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(Scrip tDebugServer* scriptDebugServer, ScriptDebugServer::PauseOnExceptionsState newSt ate) 67 static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(Scrip tDebugServer* scriptDebugServer, ScriptDebugServer::PauseOnExceptionsState newSt ate)
68 { 68 {
69 ASSERT(scriptDebugServer); 69 ASSERT(scriptDebugServer);
70 ScriptDebugServer::PauseOnExceptionsState presentState = scriptDebugServer-> pauseOnExceptionsState(); 70 ScriptDebugServer::PauseOnExceptionsState presentState = scriptDebugServer-> pauseOnExceptionsState();
71 if (presentState != newState) 71 if (presentState != newState)
72 scriptDebugServer->setPauseOnExceptionsState(newState); 72 scriptDebugServer->setPauseOnExceptionsState(newState);
73 return presentState; 73 return presentState;
74 } 74 }
75 75
76 void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& exp ression, const String* const objectGroup, const bool* const includeCommandLineAP I, const bool* const doNotPauseOnExceptionsAndMuteConsole, const int* executionC ontextId, const bool* const returnByValue, const bool* generatePreview, RefPtr<T ypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThr own) 76 void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& exp ression, const String* const objectGroup, const bool* const includeCommandLineAP I, const bool* const doNotPauseOnExceptionsAndMuteConsole, const int* executionC ontextId, const bool* const returnByValue, const bool* generatePreview, RefPtr<T ypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThr own, RefPtr<TypeBuilder::Debugger::ExceptionDetails>& exceptionDetails)
77 { 77 {
78 InjectedScript injectedScript = injectedScriptForEval(errorString, execution ContextId); 78 InjectedScript injectedScript = injectedScriptForEval(errorString, execution ContextId);
79 if (injectedScript.isEmpty()) 79 if (injectedScript.isEmpty())
80 return; 80 return;
81 ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = S criptDebugServer::DontPauseOnExceptions; 81 ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = S criptDebugServer::DontPauseOnExceptions;
82 if (asBool(doNotPauseOnExceptionsAndMuteConsole)) 82 if (asBool(doNotPauseOnExceptionsAndMuteConsole))
83 previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebug Server, ScriptDebugServer::DontPauseOnExceptions); 83 previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebug Server, ScriptDebugServer::DontPauseOnExceptions);
84 if (asBool(doNotPauseOnExceptionsAndMuteConsole)) 84 if (asBool(doNotPauseOnExceptionsAndMuteConsole))
85 muteConsole(); 85 muteConsole();
86 86
87 injectedScript.evaluate(errorString, expression, objectGroup ? *objectGroup : "", asBool(includeCommandLineAPI), asBool(returnByValue), asBool(generatePrevi ew), &result, wasThrown); 87 injectedScript.evaluate(errorString, expression, objectGroup ? *objectGroup : "", asBool(includeCommandLineAPI), asBool(returnByValue), asBool(generatePrevi ew), &result, wasThrown, &exceptionDetails);
88 88
89 if (asBool(doNotPauseOnExceptionsAndMuteConsole)) { 89 if (asBool(doNotPauseOnExceptionsAndMuteConsole)) {
90 unmuteConsole(); 90 unmuteConsole();
91 setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptions State); 91 setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptions State);
92 } 92 }
93 } 93 }
94 94
95 void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const Strin g& objectId, const String& expression, const RefPtr<JSONArray>* const optionalAr guments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* con st returnByValue, const bool* generatePreview, RefPtr<TypeBuilder::Runtime::Remo teObject>& result, TypeBuilder::OptOutput<bool>* wasThrown) 95 void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const Strin g& objectId, const String& expression, const RefPtr<JSONArray>* const optionalAr guments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* con st returnByValue, const bool* generatePreview, RefPtr<TypeBuilder::Runtime::Remo teObject>& result, TypeBuilder::OptOutput<bool>* wasThrown)
96 { 96 {
97 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForOb jectId(objectId); 97 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForOb jectId(objectId);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 m_frontend->executionContextCreated(ExecutionContextDescription::create() 207 m_frontend->executionContextCreated(ExecutionContextDescription::create()
208 .setId(executionContextId) 208 .setId(executionContextId)
209 .setIsPageContext(isPageContext) 209 .setIsPageContext(isPageContext)
210 .setName(name) 210 .setName(name)
211 .setFrameId(frameId) 211 .setFrameId(frameId)
212 .release()); 212 .release());
213 } 213 }
214 214
215 } // namespace WebCore 215 } // namespace WebCore
216 216
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorRuntimeAgent.h ('k') | Source/devtools/front_end/console/ConsoleView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698