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

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

Issue 2139543002: [DevTools] Report console API calls through Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 { 363 {
364 if (m_enabled) 364 if (m_enabled)
365 return; 365 return;
366 m_session->client()->runtimeEnabled(); 366 m_session->client()->runtimeEnabled();
367 m_enabled = true; 367 m_enabled = true;
368 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true); 368 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true);
369 m_session->debugger()->enableStackCapturingIfNeeded(); 369 m_session->debugger()->enableStackCapturingIfNeeded();
370 m_session->reportAllContexts(this); 370 m_session->reportAllContexts(this);
371 V8ConsoleMessageStorage* storage = m_session->debugger()->ensureConsoleMessa geStorage(m_session->contextGroupId()); 371 V8ConsoleMessageStorage* storage = m_session->debugger()->ensureConsoleMessa geStorage(m_session->contextGroupId());
372 for (const auto& message : storage->messages()) { 372 for (const auto& message : storage->messages()) {
373 if (message->origin() == V8MessageOrigin::kException || message->origin( ) == V8MessageOrigin::kRevokedException) 373 if (message->origin() != V8MessageOrigin::kExternalConsole)
374 reportMessage(message.get(), false); 374 reportMessage(message.get(), false);
375 } 375 }
376 } 376 }
377 377
378 void V8RuntimeAgentImpl::disable(ErrorString* errorString) 378 void V8RuntimeAgentImpl::disable(ErrorString* errorString)
379 { 379 {
380 if (!m_enabled) 380 if (!m_enabled)
381 return; 381 return;
382 m_enabled = false; 382 m_enabled = false;
383 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false); 383 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 m_frontend.executionContextDestroyed(context->contextId()); 420 m_frontend.executionContextDestroyed(context->contextId());
421 } 421 }
422 } 422 }
423 423
424 void V8RuntimeAgentImpl::inspect(std::unique_ptr<protocol::Runtime::RemoteObject > objectToInspect, std::unique_ptr<protocol::DictionaryValue> hints) 424 void V8RuntimeAgentImpl::inspect(std::unique_ptr<protocol::Runtime::RemoteObject > objectToInspect, std::unique_ptr<protocol::DictionaryValue> hints)
425 { 425 {
426 if (m_enabled) 426 if (m_enabled)
427 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints) ); 427 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints) );
428 } 428 }
429 429
430 void V8RuntimeAgentImpl::exceptionMessageAdded(V8ConsoleMessage* message) 430 void V8RuntimeAgentImpl::messageAdded(V8ConsoleMessage* message)
431 { 431 {
432 if (m_enabled) 432 if (m_enabled)
433 reportMessage(message, true); 433 reportMessage(message, true);
434 } 434 }
435 435
436 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP review) 436 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP review)
437 { 437 {
438 DCHECK(message->origin() == V8MessageOrigin::kException || message->origin() == V8MessageOrigin::kRevokedException); 438 DCHECK(message->origin() != V8MessageOrigin::kExternalConsole);
439 message->reportToFrontend(&m_frontend, m_session, generatePreview); 439 message->reportToFrontend(&m_frontend, m_session, generatePreview);
440 m_frontend.flush(); 440 m_frontend.flush();
441 } 441 }
442 442
443 } // namespace blink 443 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698