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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp

Issue 2226863003: [DevTools] Reduce API surface of String16. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp
index f580af4f068ea0904f92ac69df16ff6ceddf25e0..ab4c43ff6ec898fa650aa0a94ba20876a5d01dcc 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp
@@ -99,7 +99,8 @@ int V8Debugger::contextId(v8::Local<v8::Context> context)
size_t commaPos2 = dataString.find(",", commaPos + 1);
if (commaPos2 == kNotFound)
return 0;
- return dataString.substring(commaPos + 1, commaPos2 - commaPos - 1).toInt();
+ String16 idString = dataString.substring(commaPos + 1, commaPos2 - commaPos - 1);
+ return protocol::string16CharactersToInt(idString.characters16(), idString.length());
}
// static
@@ -114,7 +115,8 @@ int V8Debugger::getGroupId(v8::Local<v8::Context> context)
size_t commaPos = dataString.find(",");
if (commaPos == kNotFound)
return 0;
- return dataString.substring(0, commaPos).toInt();
+ String16 groupString = dataString.substring(0, commaPos);
+ return protocol::string16CharactersToInt(groupString.characters16(), groupString.length());
}
void V8Debugger::getCompiledScripts(int contextGroupId, std::vector<std::unique_ptr<V8DebuggerScript>>& result)
@@ -437,7 +439,7 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext, v8::Lo
for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) {
v8::Local<v8::Value> hitBreakpointNumber = hitBreakpointNumbers->Get(i);
DCHECK(!hitBreakpointNumber.IsEmpty() && hitBreakpointNumber->IsInt32());
- breakpointIds.push_back(String16::fromInteger(hitBreakpointNumber->Int32Value()));
+ breakpointIds.push_back(protocol::string16FromInteger(hitBreakpointNumber->Int32Value()));
}
}
@@ -689,7 +691,7 @@ v8::Local<v8::Value> V8Debugger::functionLocation(v8::Local<v8::Context> context
if (lineNumber == v8::Function::kLineOffsetNotFound || columnNumber == v8::Function::kLineOffsetNotFound)
return v8::Null(m_isolate);
v8::Local<v8::Object> location = v8::Object::New(m_isolate);
- if (!location->Set(context, toV8StringInternalized(m_isolate, "scriptId"), toV8String(m_isolate, String16::fromInteger(scriptId))).FromMaybe(false))
+ if (!location->Set(context, toV8StringInternalized(m_isolate, "scriptId"), toV8String(m_isolate, protocol::string16FromInteger(scriptId))).FromMaybe(false))
return v8::Null(m_isolate);
if (!location->Set(context, toV8StringInternalized(m_isolate, "lineNumber"), v8::Integer::New(m_isolate, lineNumber)).FromMaybe(false))
return v8::Null(m_isolate);
@@ -715,7 +717,7 @@ int V8Debugger::markContext(const V8ContextInfo& info)
{
DCHECK(info.context->GetIsolate() == m_isolate);
int contextId = ++m_lastContextId;
- String16 debugData = String16::fromInteger(info.contextGroupId) + "," + String16::fromInteger(contextId) + "," + info.auxData;
+ String16 debugData = protocol::string16FromInteger(info.contextGroupId) + "," + protocol::string16FromInteger(contextId) + "," + info.auxData;
v8::Context::Scope contextScope(info.context);
info.context->SetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex), toV8String(m_isolate, debugData));
return contextId;

Powered by Google App Engine
This is Rietveld 408576698