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 |