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

Unified Diff: third_party/WebKit/public/web/ConsoleMessageTraits.cpp

Issue 2630273002: ServiceWorker: mojofy ResumeAfterDownload and AddMessageToConsole (Closed)
Patch Set: Removed unnecessary consts and includes Created 3 years, 11 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
Index: third_party/WebKit/public/web/ConsoleMessageTraits.cpp
diff --git a/third_party/WebKit/public/web/ConsoleMessageTraits.cpp b/third_party/WebKit/public/web/ConsoleMessageTraits.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3069c1cf51970ab12d3cefb79ffad36ac6707ece
--- /dev/null
+++ b/third_party/WebKit/public/web/ConsoleMessageTraits.cpp
@@ -0,0 +1,45 @@
+// Copyright 2017 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 "third_party/WebKit/public/web/ConsoleMessageTraits.h"
+
+#include "third_party/WebKit/public/platform/WebString.h"
+
+namespace mojo {
+
+// Ensure that the WebConsoleMessage::Level enum values stay in sync with the
+// mojom::ConsoleMessageLevel.
+#define STATIC_ASSERT_ENUM(a, b) \
+ static_assert(static_cast<int>(a) == static_cast<int>(b), \
+ "mismatching enum : " #a)
+
+STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelDebug,
+ blink::mojom::ConsoleMessageLevel::Debug);
+STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelLog,
+ blink::mojom::ConsoleMessageLevel::Log);
+STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelInfo,
+ blink::mojom::ConsoleMessageLevel::Info);
+STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelWarning,
+ blink::mojom::ConsoleMessageLevel::Warning);
+STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelError,
+ blink::mojom::ConsoleMessageLevel::Error);
+STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelLast,
+ blink::mojom::ConsoleMessageLevel::Last);
+
+// static
+blink::mojom::ConsoleMessageLevel
+EnumTraits<blink::mojom::ConsoleMessageLevel, blink::WebConsoleMessage::Level>::
+ ToMojom(blink::WebConsoleMessage::Level level) {
+ return static_cast<blink::mojom::ConsoleMessageLevel>(level);
+}
+// static
horo 2017/01/16 11:24:12 nit: line break.
shimazu 2017/01/16 23:17:53 Done.
+bool EnumTraits<blink::mojom::ConsoleMessageLevel,
+ blink::WebConsoleMessage::Level>::
+ FromMojom(blink::mojom::ConsoleMessageLevel in,
+ blink::WebConsoleMessage::Level* out) {
+ *out = static_cast<blink::WebConsoleMessage::Level>(in);
+ return true;
+}
+
+} // namespace mojo
« no previous file with comments | « third_party/WebKit/public/web/ConsoleMessageTraits.h ('k') | third_party/WebKit/public/web/console_message.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698