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

Unified Diff: src/inspector/StringUtil.cpp

Issue 2339173004: Revert of [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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/inspector/StringUtil.h ('k') | src/inspector/V8Console.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/StringUtil.cpp
diff --git a/src/inspector/StringUtil.cpp b/src/inspector/StringUtil.cpp
index 8d6e9c581971de14d8f704ec91b0684edfde6ec5..04b9e85c8f471566541cc27f5fb0d7b2f46e9fa1 100644
--- a/src/inspector/StringUtil.cpp
+++ b/src/inspector/StringUtil.cpp
@@ -6,27 +6,22 @@
#include "src/inspector/protocol/Protocol.h"
-#include <limits>
-
namespace v8_inspector {
v8::Local<v8::String> toV8String(v8::Isolate* isolate, const String16& string) {
if (string.isEmpty()) return v8::String::Empty(isolate);
- DCHECK(string.length() < v8::String::kMaxLength);
return v8::String::NewFromTwoByte(
isolate, reinterpret_cast<const uint16_t*>(string.characters16()),
- v8::NewStringType::kNormal, static_cast<int>(string.length()))
+ v8::NewStringType::kNormal, string.length())
.ToLocalChecked();
}
v8::Local<v8::String> toV8StringInternalized(v8::Isolate* isolate,
const String16& string) {
if (string.isEmpty()) return v8::String::Empty(isolate);
- DCHECK(string.length() < v8::String::kMaxLength);
return v8::String::NewFromTwoByte(
isolate, reinterpret_cast<const uint16_t*>(string.characters16()),
- v8::NewStringType::kInternalized,
- static_cast<int>(string.length()))
+ v8::NewStringType::kInternalized, string.length())
.ToLocalChecked();
}
@@ -39,15 +34,14 @@
v8::Local<v8::String> toV8String(v8::Isolate* isolate,
const StringView& string) {
if (!string.length()) return v8::String::Empty(isolate);
- DCHECK(string.length() < v8::String::kMaxLength);
if (string.is8Bit())
return v8::String::NewFromOneByte(
isolate, reinterpret_cast<const uint8_t*>(string.characters8()),
- v8::NewStringType::kNormal, static_cast<int>(string.length()))
+ v8::NewStringType::kNormal, string.length())
.ToLocalChecked();
return v8::String::NewFromTwoByte(
isolate, reinterpret_cast<const uint16_t*>(string.characters16()),
- v8::NewStringType::kNormal, static_cast<int>(string.length()))
+ v8::NewStringType::kNormal, string.length())
.ToLocalChecked();
}
@@ -97,20 +91,14 @@
std::unique_ptr<protocol::Value> parseJSON(const StringView& string) {
if (!string.length()) return nullptr;
- DCHECK(string.length() <= std::numeric_limits<int>::max());
- if (string.is8Bit()) {
- return protocol::parseJSON(string.characters8(),
- static_cast<int>(string.length()));
- }
- return protocol::parseJSON(string.characters16(),
- static_cast<int>(string.length()));
+ if (string.is8Bit())
+ return protocol::parseJSON(string.characters8(), string.length());
+ return protocol::parseJSON(string.characters16(), string.length());
}
std::unique_ptr<protocol::Value> parseJSON(const String16& string) {
if (!string.length()) return nullptr;
- DCHECK(string.length() <= std::numeric_limits<int>::max());
- return protocol::parseJSON(string.characters16(),
- static_cast<int>(string.length()));
+ return protocol::parseJSON(string.characters16(), string.length());
}
} // namespace protocol
« no previous file with comments | « src/inspector/StringUtil.h ('k') | src/inspector/V8Console.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698