| OLD | NEW |
| 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 23 matching lines...) Expand all Loading... |
| 34 #include "src/inspector/inspected-context.h" | 34 #include "src/inspector/inspected-context.h" |
| 35 #include "src/inspector/protocol/Protocol.h" | 35 #include "src/inspector/protocol/Protocol.h" |
| 36 #include "src/inspector/remote-object-id.h" | 36 #include "src/inspector/remote-object-id.h" |
| 37 #include "src/inspector/string-util.h" | 37 #include "src/inspector/string-util.h" |
| 38 #include "src/inspector/v8-console-message.h" | 38 #include "src/inspector/v8-console-message.h" |
| 39 #include "src/inspector/v8-debugger-agent-impl.h" | 39 #include "src/inspector/v8-debugger-agent-impl.h" |
| 40 #include "src/inspector/v8-debugger.h" | 40 #include "src/inspector/v8-debugger.h" |
| 41 #include "src/inspector/v8-inspector-impl.h" | 41 #include "src/inspector/v8-inspector-impl.h" |
| 42 #include "src/inspector/v8-inspector-session-impl.h" | 42 #include "src/inspector/v8-inspector-session-impl.h" |
| 43 #include "src/inspector/v8-stack-trace-impl.h" | 43 #include "src/inspector/v8-stack-trace-impl.h" |
| 44 #include "src/tracing/trace-event.h" | |
| 45 | 44 |
| 46 #include "include/v8-inspector.h" | 45 #include "include/v8-inspector.h" |
| 47 | 46 |
| 48 namespace v8_inspector { | 47 namespace v8_inspector { |
| 49 | 48 |
| 50 namespace V8RuntimeAgentImplState { | 49 namespace V8RuntimeAgentImplState { |
| 51 static const char customObjectFormatterEnabled[] = | 50 static const char customObjectFormatterEnabled[] = |
| 52 "customObjectFormatterEnabled"; | 51 "customObjectFormatterEnabled"; |
| 53 static const char runtimeEnabled[] = "runtimeEnabled"; | 52 static const char runtimeEnabled[] = "runtimeEnabled"; |
| 54 }; | 53 }; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 265 |
| 267 V8RuntimeAgentImpl::~V8RuntimeAgentImpl() {} | 266 V8RuntimeAgentImpl::~V8RuntimeAgentImpl() {} |
| 268 | 267 |
| 269 void V8RuntimeAgentImpl::evaluate( | 268 void V8RuntimeAgentImpl::evaluate( |
| 270 const String16& expression, const Maybe<String16>& objectGroup, | 269 const String16& expression, const Maybe<String16>& objectGroup, |
| 271 const Maybe<bool>& includeCommandLineAPI, const Maybe<bool>& silent, | 270 const Maybe<bool>& includeCommandLineAPI, const Maybe<bool>& silent, |
| 272 const Maybe<int>& executionContextId, const Maybe<bool>& returnByValue, | 271 const Maybe<int>& executionContextId, const Maybe<bool>& returnByValue, |
| 273 const Maybe<bool>& generatePreview, const Maybe<bool>& userGesture, | 272 const Maybe<bool>& generatePreview, const Maybe<bool>& userGesture, |
| 274 const Maybe<bool>& awaitPromise, | 273 const Maybe<bool>& awaitPromise, |
| 275 std::unique_ptr<EvaluateCallback> callback) { | 274 std::unique_ptr<EvaluateCallback> callback) { |
| 276 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), | |
| 277 "EvaluateScript"); | |
| 278 ErrorString errorString; | 275 ErrorString errorString; |
| 279 int contextId = | 276 int contextId = |
| 280 ensureContext(&errorString, m_inspector, m_session->contextGroupId(), | 277 ensureContext(&errorString, m_inspector, m_session->contextGroupId(), |
| 281 executionContextId); | 278 executionContextId); |
| 282 if (!errorString.isEmpty()) { | 279 if (!errorString.isEmpty()) { |
| 283 callback->sendFailure(errorString); | 280 callback->sendFailure(errorString); |
| 284 return; | 281 return; |
| 285 } | 282 } |
| 286 | 283 |
| 287 InjectedScript::ContextScope scope(&errorString, m_inspector, | 284 InjectedScript::ContextScope scope(&errorString, m_inspector, |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 } | 729 } |
| 733 | 730 |
| 734 bool V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, | 731 bool V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, |
| 735 bool generatePreview) { | 732 bool generatePreview) { |
| 736 message->reportToFrontend(&m_frontend, m_session, generatePreview); | 733 message->reportToFrontend(&m_frontend, m_session, generatePreview); |
| 737 m_frontend.flush(); | 734 m_frontend.flush(); |
| 738 return m_inspector->hasConsoleMessageStorage(m_session->contextGroupId()); | 735 return m_inspector->hasConsoleMessageStorage(m_session->contextGroupId()); |
| 739 } | 736 } |
| 740 | 737 |
| 741 } // namespace v8_inspector | 738 } // namespace v8_inspector |
| OLD | NEW |