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

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

Issue 2035653006: [DevTools] Move Console to v8 inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved api a bit Created 4 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 const Maybe<bool>& generatePreview, 80 const Maybe<bool>& generatePreview,
81 const Maybe<bool>& userGesture, 81 const Maybe<bool>& userGesture,
82 std::unique_ptr<RemoteObject>* result, 82 std::unique_ptr<RemoteObject>* result,
83 Maybe<bool>* wasThrown, 83 Maybe<bool>* wasThrown,
84 Maybe<ExceptionDetails>* exceptionDetails) 84 Maybe<ExceptionDetails>* exceptionDetails)
85 { 85 {
86 int contextId; 86 int contextId;
87 if (executionContextId.isJust()) { 87 if (executionContextId.isJust()) {
88 contextId = executionContextId.fromJust(); 88 contextId = executionContextId.fromJust();
89 } else { 89 } else {
90 contextId = m_debugger->client()->ensureDefaultContextInGroup(m_session- >contextGroupId()); 90 v8::HandleScope handles(m_debugger->isolate());
91 if (!contextId) { 91 v8::Local<v8::Context> defaultContext = m_debugger->client()->ensureDefa ultContextInGroup(m_session->contextGroupId());
92 if (defaultContext.IsEmpty()) {
92 *errorString = "Cannot find default execution context"; 93 *errorString = "Cannot find default execution context";
93 return; 94 return;
94 } 95 }
96 contextId = V8DebuggerImpl::contextId(defaultContext);
95 } 97 }
96 98
97 InjectedScript::ContextScope scope(errorString, m_debugger, m_session->conte xtGroupId(), contextId); 99 InjectedScript::ContextScope scope(errorString, m_debugger, m_session->conte xtGroupId(), contextId);
98 if (!scope.initialize()) 100 if (!scope.initialize())
99 return; 101 return;
100 102
101 if (doNotPauseOnExceptionsAndMuteConsole.fromMaybe(false)) 103 if (doNotPauseOnExceptionsAndMuteConsole.fromMaybe(false))
102 scope.ignoreExceptionsAndMuteConsole(); 104 scope.ignoreExceptionsAndMuteConsole();
103 if (userGesture.fromMaybe(false)) 105 if (userGesture.fromMaybe(false))
104 scope.pretendUserGesture(); 106 scope.pretendUserGesture();
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 414 }
413 } 415 }
414 416
415 void V8RuntimeAgentImpl::inspect(std::unique_ptr<protocol::Runtime::RemoteObject > objectToInspect, std::unique_ptr<protocol::DictionaryValue> hints) 417 void V8RuntimeAgentImpl::inspect(std::unique_ptr<protocol::Runtime::RemoteObject > objectToInspect, std::unique_ptr<protocol::DictionaryValue> hints)
416 { 418 {
417 if (m_enabled) 419 if (m_enabled)
418 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints) ); 420 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints) );
419 } 421 }
420 422
421 } // namespace blink 423 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698