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

Unified Diff: third_party/WebKit/Source/core/layout/api/SelectionState.cpp

Issue 2732643004: Add operator<< to SelectionState for debug logging. (Closed)
Patch Set: Created 3 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 | « third_party/WebKit/Source/core/layout/api/SelectionState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/api/SelectionState.cpp
diff --git a/third_party/WebKit/Source/core/layout/api/SelectionState.cpp b/third_party/WebKit/Source/core/layout/api/SelectionState.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f5e7f016bd479fe06f8fe7d6cb61a6b2fec44fa3
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/api/SelectionState.cpp
@@ -0,0 +1,33 @@
+// 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 "core/layout/api/SelectionState.h"
+
+#include "wtf/Assertions.h"
+
+namespace blink {
+
+#ifndef NDEBUG
+
+std::ostream& operator<<(std::ostream& out, const SelectionState& state) {
yosin_UTC9 2017/03/06 04:51:10 nit: s/const SelectionState&/SelectionState/
+ switch (state) {
+ case SelectionNone:
yosin_UTC9 2017/03/06 04:51:10 How about using FOR_EACH_XXX(V) technique to make
+ return out << "None";
+ case SelectionStart:
+ return out << "Start";
+ case SelectionInside:
+ return out << "Inside";
+ case SelectionEnd:
+ return out << "End";
+ case SelectionBoth:
+ return out << "Both";
+ default:
+ NOTREACHED();
+ return out << "Unknown";
+ }
+}
+
+#endif
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/api/SelectionState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698