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