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

Side by Side Diff: third_party/WebKit/Source/platform/inspector_protocol/String16WTF.h

Issue 2151083002: DevTools: explicitly differentiate ints vs doubles in the protocol bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef String16WTF_h 5 #ifndef String16WTF_h
6 #define String16WTF_h 6 #define String16WTF_h
7 7
8 #include "platform/Decimal.h" 8 #include "platform/Decimal.h"
9 #include "public/platform/WebString.h" 9 #include "public/platform/WebString.h"
10 #include "wtf/text/StringBuilder.h" 10 #include "wtf/text/StringBuilder.h"
(...skipping 24 matching lines...) Expand all
35 String16(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue ) { } 35 String16(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue ) { }
36 bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue (); } 36 bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue (); }
37 operator WTF::String() const { return m_impl; } 37 operator WTF::String() const { return m_impl; }
38 operator WTF::StringView() const { return StringView(m_impl); } 38 operator WTF::StringView() const { return StringView(m_impl); }
39 operator WebString() { return m_impl; } 39 operator WebString() { return m_impl; }
40 const WTF::String& impl() const { return m_impl; } 40 const WTF::String& impl() const { return m_impl; }
41 String16 isolatedCopy() const { return String16(m_impl.isolatedCopy()); } 41 String16 isolatedCopy() const { return String16(m_impl.isolatedCopy()); }
42 42
43 ~String16() { } 43 ~String16() { }
44 44
45 static String16 number(int i) { return String::number(i); } 45 static String16 fromInteger(int i) { return String::number(i); }
46 static String16 fromDouble(double number) { return Decimal::fromDouble(numbe r).toString(); } 46 static String16 fromDouble(double number) { return Decimal::fromDouble(numbe r).toString(); }
47 static String16 fromDoubleFixedPrecision(double number, int precision) { ret urn String::numberToStringFixedWidth(number, precision); } 47 static String16 fromDoubleFixedPrecision(double number, int precision) { ret urn String::numberToStringFixedWidth(number, precision); }
48 48
49 size_t length() const { return m_impl.length(); } 49 size_t length() const { return m_impl.length(); }
50 bool isEmpty() const { return m_impl.isEmpty(); } 50 bool isEmpty() const { return m_impl.isEmpty(); }
51 UChar operator[](unsigned index) const { return m_impl[index]; } 51 UChar operator[](unsigned index) const { return m_impl[index]; }
52 52
53 unsigned sizeInBytes() const { return m_impl.sizeInBytes(); } 53 unsigned sizeInBytes() const { return m_impl.sizeInBytes(); }
54 const UChar* characters16() const { return m_impl.isEmpty() ? nullptr : m_im pl.characters16(); } 54 const UChar* characters16() const { return m_impl.isEmpty() ? nullptr : m_im pl.characters16(); }
55 55
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 template<> struct hash<String16> { 145 template<> struct hash<String16> {
146 std::size_t operator()(const String16& string) const 146 std::size_t operator()(const String16& string) const
147 { 147 {
148 return StringHash::hash(string.impl()); 148 return StringHash::hash(string.impl());
149 } 149 }
150 }; 150 };
151 151
152 } // namespace std 152 } // namespace std
153 153
154 #endif // !defined(String16WTF_h) 154 #endif // !defined(String16WTF_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698