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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "third_party/WebKit/public/web/ConsoleMessageTraits.h"
6
7 #include "third_party/WebKit/public/platform/WebString.h"
8
9 namespace mojo {
10
11 // Ensure that the WebConsoleMessage::Level enum values stay in sync with the
12 // mojom::ConsoleMessageLevel.
13 #define STATIC_ASSERT_ENUM(a, b) \
14 static_assert(static_cast<int>(a) == static_cast<int>(b), \
15 "mismatching enum : " #a)
16
17 STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelDebug,
18 blink::mojom::ConsoleMessageLevel::Debug);
19 STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelLog,
20 blink::mojom::ConsoleMessageLevel::Log);
21 STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelInfo,
22 blink::mojom::ConsoleMessageLevel::Info);
23 STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelWarning,
24 blink::mojom::ConsoleMessageLevel::Warning);
25 STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelError,
26 blink::mojom::ConsoleMessageLevel::Error);
27 STATIC_ASSERT_ENUM(blink::WebConsoleMessage::Level::LevelLast,
28 blink::mojom::ConsoleMessageLevel::Last);
29
30 // static
31 blink::mojom::ConsoleMessageLevel
32 EnumTraits<blink::mojom::ConsoleMessageLevel, blink::WebConsoleMessage::Level>::
33 ToMojom(blink::WebConsoleMessage::Level level) {
34 return static_cast<blink::mojom::ConsoleMessageLevel>(level);
35 }
36 // static
horo 2017/01/16 11:24:12 nit: line break.
shimazu 2017/01/16 23:17:53 Done.
37 bool EnumTraits<blink::mojom::ConsoleMessageLevel,
38 blink::WebConsoleMessage::Level>::
39 FromMojom(blink::mojom::ConsoleMessageLevel in,
40 blink::WebConsoleMessage::Level* out) {
41 *out = static_cast<blink::WebConsoleMessage::Level>(in);
42 return true;
43 }
44
45 } // namespace mojo
OLDNEW
« 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