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

Unified Diff: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp

Issue 2746053003: [DevTools] replaced slow ::serialize with StringBuilder (Closed)
Patch Set: fixed Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
diff --git a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
index 53fb54ed0f1ac0ce7cd3260c40f45008e0826071..a5061c8d88efd1ae1ba433f62dd2ed6f98fe7d05 100644
--- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
@@ -59,7 +59,6 @@
#include "core/inspector/InspectedFrames.h"
#include "core/inspector/InspectorTaskRunner.h"
#include "core/inspector/V8InspectorString.h"
-#include "core/inspector/protocol/Protocol.h"
#include "core/page/Page.h"
#include "core/timing/MemoryInfo.h"
#include "core/workers/MainThreadWorkletGlobalScope.h"
@@ -68,6 +67,7 @@
#include "platform/UserGestureIndicator.h"
#include "wtf/PtrUtil.h"
#include "wtf/ThreadingPrimitives.h"
+#include "wtf/text/StringBuilder.h"
namespace blink {
@@ -144,11 +144,13 @@ void MainThreadDebugger::contextCreated(ScriptState* scriptState,
ASSERT(isMainThread());
v8::HandleScope handles(scriptState->isolate());
DOMWrapperWorld& world = scriptState->world();
- std::unique_ptr<protocol::DictionaryValue> auxDataValue =
- protocol::DictionaryValue::create();
- auxDataValue->setBoolean("isDefault", world.isMainWorld());
- auxDataValue->setString("frameId", IdentifiersFactory::frameId(frame));
- String auxData = auxDataValue->serialize();
+ StringBuilder auxDataBuilder;
+ auxDataBuilder.append("{\"isDefault\":");
+ auxDataBuilder.append(world.isMainWorld() ? "true" : "false");
+ auxDataBuilder.append(",\"frameId\":\"");
+ auxDataBuilder.append(IdentifiersFactory::frameId(frame));
+ auxDataBuilder.append("\"}");
+ String auxData = auxDataBuilder.toString();
String humanReadableName = world.isIsolatedWorld()
? world.isolatedWorldHumanReadableName()
: String();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698