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

Unified Diff: src/inspector/V8ConsoleAgentImpl.cpp

Issue 2338413003: [inspector] change implementation file extension from cpp to cc (Closed)
Patch Set: string16 -> string-16 Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/inspector/V8ConsoleAgentImpl.h ('k') | src/inspector/V8ConsoleMessage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/V8ConsoleAgentImpl.cpp
diff --git a/src/inspector/V8ConsoleAgentImpl.cpp b/src/inspector/V8ConsoleAgentImpl.cpp
deleted file mode 100644
index 9e35cffe6174ae3057f46ff73017b8a591e3297d..0000000000000000000000000000000000000000
--- a/src/inspector/V8ConsoleAgentImpl.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "src/inspector/V8ConsoleAgentImpl.h"
-
-#include "src/inspector/V8ConsoleMessage.h"
-#include "src/inspector/V8InspectorImpl.h"
-#include "src/inspector/V8InspectorSessionImpl.h"
-#include "src/inspector/V8StackTraceImpl.h"
-#include "src/inspector/protocol/Protocol.h"
-
-namespace v8_inspector {
-
-namespace ConsoleAgentState {
-static const char consoleEnabled[] = "consoleEnabled";
-}
-
-V8ConsoleAgentImpl::V8ConsoleAgentImpl(
- V8InspectorSessionImpl* session, protocol::FrontendChannel* frontendChannel,
- protocol::DictionaryValue* state)
- : m_session(session),
- m_state(state),
- m_frontend(frontendChannel),
- m_enabled(false) {}
-
-V8ConsoleAgentImpl::~V8ConsoleAgentImpl() {}
-
-void V8ConsoleAgentImpl::enable(ErrorString* errorString) {
- if (m_enabled) return;
- m_state->setBoolean(ConsoleAgentState::consoleEnabled, true);
- m_enabled = true;
- m_session->inspector()->enableStackCapturingIfNeeded();
- reportAllMessages();
-}
-
-void V8ConsoleAgentImpl::disable(ErrorString* errorString) {
- if (!m_enabled) return;
- m_session->inspector()->disableStackCapturingIfNeeded();
- m_state->setBoolean(ConsoleAgentState::consoleEnabled, false);
- m_enabled = false;
-}
-
-void V8ConsoleAgentImpl::clearMessages(ErrorString* errorString) {}
-
-void V8ConsoleAgentImpl::restore() {
- if (!m_state->booleanProperty(ConsoleAgentState::consoleEnabled, false))
- return;
- ErrorString ignored;
- enable(&ignored);
-}
-
-void V8ConsoleAgentImpl::messageAdded(V8ConsoleMessage* message) {
- if (m_enabled) reportMessage(message, true);
-}
-
-bool V8ConsoleAgentImpl::enabled() { return m_enabled; }
-
-void V8ConsoleAgentImpl::reportAllMessages() {
- V8ConsoleMessageStorage* storage =
- m_session->inspector()->ensureConsoleMessageStorage(
- m_session->contextGroupId());
- for (const auto& message : storage->messages()) {
- if (message->origin() == V8MessageOrigin::kConsole) {
- if (!reportMessage(message.get(), false)) return;
- }
- }
-}
-
-bool V8ConsoleAgentImpl::reportMessage(V8ConsoleMessage* message,
- bool generatePreview) {
- DCHECK(message->origin() == V8MessageOrigin::kConsole);
- message->reportToFrontend(&m_frontend);
- m_frontend.flush();
- return m_session->inspector()->hasConsoleMessageStorage(
- m_session->contextGroupId());
-}
-
-} // namespace v8_inspector
« no previous file with comments | « src/inspector/V8ConsoleAgentImpl.h ('k') | src/inspector/V8ConsoleMessage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698