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

Unified Diff: sky/engine/core/inspector/ConsoleMessageStorage.cpp

Issue 922893002: Merge the Sky Engine changes from the SkyDart branch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/inspector/ConsoleMessageStorage.h ('k') | sky/engine/core/inspector/InjectedScriptHost.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/inspector/ConsoleMessageStorage.cpp
diff --git a/sky/engine/core/inspector/ConsoleMessageStorage.cpp b/sky/engine/core/inspector/ConsoleMessageStorage.cpp
deleted file mode 100644
index e270e896bf3acf8bfc74ee72c4085172d7cf010f..0000000000000000000000000000000000000000
--- a/sky/engine/core/inspector/ConsoleMessageStorage.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2014 The Chromium 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 "sky/engine/config.h"
-#include "sky/engine/core/inspector/ConsoleMessageStorage.h"
-
-#include "sky/engine/core/dom/Document.h"
-#include "sky/engine/core/frame/LocalDOMWindow.h"
-#include "sky/engine/core/frame/LocalFrame.h"
-#include "sky/engine/core/inspector/ConsoleMessage.h"
-
-namespace blink {
-
-static const unsigned maxConsoleMessageCount = 1000;
-
-ConsoleMessageStorage::ConsoleMessageStorage(ExecutionContext* context)
- : m_expiredCount(0)
- , m_context(context)
- , m_frame(nullptr)
-{
-}
-
-ConsoleMessageStorage::ConsoleMessageStorage(LocalFrame* frame)
- : m_expiredCount(0)
- , m_context(nullptr)
- , m_frame(frame)
-{
-}
-
-void ConsoleMessageStorage::reportMessage(PassRefPtr<ConsoleMessage> prpMessage)
-{
- RefPtr<ConsoleMessage> message = prpMessage;
- message->collectCallStack();
-
- if (message->type() == ClearMessageType)
- clear();
-
- ASSERT(m_messages.size() <= maxConsoleMessageCount);
- if (m_messages.size() == maxConsoleMessageCount) {
- ++m_expiredCount;
- m_messages.removeFirst();
- }
- m_messages.append(message);
-}
-
-void ConsoleMessageStorage::clear()
-{
- m_messages.clear();
- m_expiredCount = 0;
-}
-
-Vector<unsigned> ConsoleMessageStorage::argumentCounts() const
-{
- Vector<unsigned> result(m_messages.size());
- for (size_t i = 0; i < m_messages.size(); ++i)
- result[i] = m_messages[i]->argumentCount();
- return result;
-}
-
-void ConsoleMessageStorage::frameWindowDiscarded(LocalDOMWindow* window)
-{
- for (size_t i = 0; i < m_messages.size(); ++i)
- m_messages[i]->frameWindowDiscarded(window);
-}
-
-size_t ConsoleMessageStorage::size() const
-{
- return m_messages.size();
-}
-
-ConsoleMessage* ConsoleMessageStorage::at(size_t index) const
-{
- return m_messages[index].get();
-}
-
-int ConsoleMessageStorage::expiredCount() const
-{
- return m_expiredCount;
-}
-
-ExecutionContext* ConsoleMessageStorage::executionContext() const
-{
- return m_frame ? m_frame->document() : m_context;
-}
-
-} // namespace blink
« no previous file with comments | « sky/engine/core/inspector/ConsoleMessageStorage.h ('k') | sky/engine/core/inspector/InjectedScriptHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698