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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.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/V8HeapProfilerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
index d256fe1cc29efadd69b30ae1ba089dcdd7ec3742..65f22c2ef857b86568a9c02fa1e1ca3833303af2 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
@@ -237,7 +237,7 @@ void V8HeapProfilerAgentImpl::takeHeapSnapshot(ErrorString* errorString, const p
void V8HeapProfilerAgentImpl::getObjectByHeapObjectId(ErrorString* error, const String16& heapSnapshotObjectId, const protocol::Maybe<String16>& objectGroup, std::unique_ptr<protocol::Runtime::RemoteObject>* result)
{
bool ok;
- int id = heapSnapshotObjectId.toInt(&ok);
+ int id = protocol::string16CharactersToInt(heapSnapshotObjectId.characters16(), heapSnapshotObjectId.length(), &ok);
if (!ok) {
*error = "Invalid heap snapshot object id";
return;
@@ -263,7 +263,7 @@ void V8HeapProfilerAgentImpl::getObjectByHeapObjectId(ErrorString* error, const
void V8HeapProfilerAgentImpl::addInspectedHeapObject(ErrorString* errorString, const String16& inspectedHeapObjectId)
{
bool ok;
- int id = inspectedHeapObjectId.toInt(&ok);
+ int id = protocol::string16CharactersToInt(inspectedHeapObjectId.characters16(), inspectedHeapObjectId.length(), &ok);
if (!ok) {
*errorString = "Invalid heap snapshot object id";
return;
@@ -294,7 +294,7 @@ void V8HeapProfilerAgentImpl::getHeapObjectId(ErrorString* errorString, const St
return;
v8::SnapshotObjectId id = m_isolate->GetHeapProfiler()->GetObjectId(value);
- *heapSnapshotObjectId = String16::fromInteger(id);
+ *heapSnapshotObjectId = protocol::string16FromInteger(id);
}
void V8HeapProfilerAgentImpl::requestHeapStatsUpdate()
@@ -362,7 +362,7 @@ std::unique_ptr<protocol::HeapProfiler::SamplingHeapProfileNode> buildSampingHea
selfSize += allocation.size * allocation.count;
std::unique_ptr<protocol::Runtime::CallFrame> callFrame = protocol::Runtime::CallFrame::create()
.setFunctionName(toProtocolString(node->name))
- .setScriptId(String16::fromInteger(node->script_id))
+ .setScriptId(protocol::string16FromInteger(node->script_id))
.setUrl(toProtocolString(node->script_name))
.setLineNumber(node->line_number - 1)
.setColumnNumber(node->column_number - 1)

Powered by Google App Engine
This is Rietveld 408576698