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

Side by Side Diff: src/inspector/v8-runtime-agent-impl.cc

Issue 2713023004: [inspector] added reconnect method for tests (Closed)
Patch Set: rebased Created 3 years, 9 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
« no previous file with comments | « no previous file | test/inspector/console/memory-setter-in-strict-mode.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 514 }
515 515
516 Response V8RuntimeAgentImpl::runIfWaitingForDebugger() { 516 Response V8RuntimeAgentImpl::runIfWaitingForDebugger() {
517 m_inspector->client()->runIfWaitingForDebugger(m_session->contextGroupId()); 517 m_inspector->client()->runIfWaitingForDebugger(m_session->contextGroupId());
518 return Response::OK(); 518 return Response::OK();
519 } 519 }
520 520
521 Response V8RuntimeAgentImpl::setCustomObjectFormatterEnabled(bool enabled) { 521 Response V8RuntimeAgentImpl::setCustomObjectFormatterEnabled(bool enabled) {
522 m_state->setBoolean(V8RuntimeAgentImplState::customObjectFormatterEnabled, 522 m_state->setBoolean(V8RuntimeAgentImplState::customObjectFormatterEnabled,
523 enabled); 523 enabled);
524 if (!m_enabled) return Response::Error("Runtime agent is not enabled");
524 m_session->setCustomObjectFormatterEnabled(enabled); 525 m_session->setCustomObjectFormatterEnabled(enabled);
525 return Response::OK(); 526 return Response::OK();
526 } 527 }
527 528
528 Response V8RuntimeAgentImpl::discardConsoleEntries() { 529 Response V8RuntimeAgentImpl::discardConsoleEntries() {
529 V8ConsoleMessageStorage* storage = 530 V8ConsoleMessageStorage* storage =
530 m_inspector->ensureConsoleMessageStorage(m_session->contextGroupId()); 531 m_inspector->ensureConsoleMessageStorage(m_session->contextGroupId());
531 storage->clear(); 532 storage->clear();
532 return Response::OK(); 533 return Response::OK();
533 } 534 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 } 672 }
672 return Response::OK(); 673 return Response::OK();
673 } 674 }
674 675
675 Response V8RuntimeAgentImpl::disable() { 676 Response V8RuntimeAgentImpl::disable() {
676 if (!m_enabled) return Response::OK(); 677 if (!m_enabled) return Response::OK();
677 m_enabled = false; 678 m_enabled = false;
678 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false); 679 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false);
679 m_inspector->disableStackCapturingIfNeeded(); 680 m_inspector->disableStackCapturingIfNeeded();
680 m_session->discardInjectedScripts(); 681 m_session->discardInjectedScripts();
682 m_session->setCustomObjectFormatterEnabled(false);
681 reset(); 683 reset();
682 m_inspector->client()->endEnsureAllContextsInGroup( 684 m_inspector->client()->endEnsureAllContextsInGroup(
683 m_session->contextGroupId()); 685 m_session->contextGroupId());
684 return Response::OK(); 686 return Response::OK();
685 } 687 }
686 688
687 void V8RuntimeAgentImpl::reset() { 689 void V8RuntimeAgentImpl::reset() {
688 m_compiledScripts.clear(); 690 m_compiledScripts.clear();
689 if (m_enabled) { 691 if (m_enabled) {
690 if (const V8InspectorImpl::ContextByIdMap* contexts = 692 if (const V8InspectorImpl::ContextByIdMap* contexts =
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 } 733 }
732 734
733 bool V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, 735 bool V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message,
734 bool generatePreview) { 736 bool generatePreview) {
735 message->reportToFrontend(&m_frontend, m_session, generatePreview); 737 message->reportToFrontend(&m_frontend, m_session, generatePreview);
736 m_frontend.flush(); 738 m_frontend.flush();
737 return m_inspector->hasConsoleMessageStorage(m_session->contextGroupId()); 739 return m_inspector->hasConsoleMessageStorage(m_session->contextGroupId());
738 } 740 }
739 741
740 } // namespace v8_inspector 742 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « no previous file | test/inspector/console/memory-setter-in-strict-mode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698