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

Side by Side Diff: src/inspector/StringUtil.h

Issue 2332163002: [inspector] fixed all shorten-64-to-32 warnings (Closed)
Patch Set: Created 4 years, 3 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 V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project 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 V8_INSPECTOR_STRINGUTIL_H_ 5 #ifndef V8_INSPECTOR_STRINGUTIL_H_
6 #define V8_INSPECTOR_STRINGUTIL_H_ 6 #define V8_INSPECTOR_STRINGUTIL_H_
7 7
8 #include "src/inspector/Allocator.h" 8 #include "src/inspector/Allocator.h"
9 #include "src/inspector/String16.h" 9 #include "src/inspector/String16.h"
10 10
11 #include "include/v8-inspector.h" 11 #include "include/v8-inspector.h"
12 12
13 namespace v8_inspector { 13 namespace v8_inspector {
14 14
15 namespace protocol { 15 namespace protocol {
16 16
17 class Value; 17 class Value;
18 18
19 using String = v8_inspector::String16; 19 using String = v8_inspector::String16;
20 using StringBuilder = v8_inspector::String16Builder; 20 using StringBuilder = v8_inspector::String16Builder;
21 21
22 class StringUtil { 22 class StringUtil {
23 public: 23 public:
24 static String substring(const String& s, unsigned pos, unsigned len) { 24 static String substring(const String& s, size_t pos, size_t len) {
25 return s.substring(pos, len); 25 return s.substring(pos, len);
26 } 26 }
27 static String fromInteger(int number) { return String::fromInteger(number); } 27 static String fromInteger(int number) { return String::fromInteger(number); }
28 static String fromInteger(size_t number) {
29 return String::fromInteger(number);
30 }
28 static String fromDouble(double number) { return String::fromDouble(number); } 31 static String fromDouble(double number) { return String::fromDouble(number); }
29 static const size_t kNotFound = String::kNotFound; 32 static const size_t kNotFound = String::kNotFound;
30 static void builderReserve(StringBuilder& builder, unsigned capacity) { 33 static void builderReserve(StringBuilder& builder, size_t capacity) {
31 builder.reserveCapacity(capacity); 34 builder.reserveCapacity(capacity);
32 } 35 }
33 }; 36 };
34 37
35 std::unique_ptr<protocol::Value> parseJSON(const StringView& json); 38 std::unique_ptr<protocol::Value> parseJSON(const StringView& json);
36 std::unique_ptr<protocol::Value> parseJSON(const String16& json); 39 std::unique_ptr<protocol::Value> parseJSON(const String16& json);
37 40
38 } // namespace protocol 41 } // namespace protocol
39 42
40 std::unique_ptr<protocol::Value> toProtocolValue(v8::Local<v8::Context>, 43 std::unique_ptr<protocol::Value> toProtocolValue(v8::Local<v8::Context>,
(...skipping 21 matching lines...) Expand all
62 65
63 private: 66 private:
64 explicit StringBufferImpl(String16&); 67 explicit StringBufferImpl(String16&);
65 String16 m_owner; 68 String16 m_owner;
66 StringView m_string; 69 StringView m_string;
67 }; 70 };
68 71
69 } // namespace v8_inspector 72 } // namespace v8_inspector
70 73
71 #endif // V8_INSPECTOR_STRINGUTIL_H_ 74 #endif // V8_INSPECTOR_STRINGUTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698