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

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

Issue 2251343003: [DevTools] Generate separate copies of inspector_protocol. (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/core/inspector/InspectorSession.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorSession.cpp b/third_party/WebKit/Source/core/inspector/InspectorSession.cpp
index 75fd9290fcf87fccc0d90e8e1274cf39dbddf555..9a137a5ebace9ce7f7120e1daa119ced37f934ac 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorSession.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorSession.cpp
@@ -9,6 +9,7 @@
#include "core/frame/UseCounter.h"
#include "core/inspector/InspectorBaseAgent.h"
#include "core/inspector/InspectorInstrumentation.h"
+#include "core/inspector/V8InspectorStringConversion.h"
#include "platform/v8_inspector/public/V8Inspector.h"
#include "platform/v8_inspector/public/V8InspectorSession.h"
@@ -36,9 +37,10 @@ InspectorSession::InspectorSession(Client* client, InstrumentingAgents* instrume
m_state = protocol::DictionaryValue::create();
}
- String16 v8State;
+ String v8State;
m_state->getString(kV8StateKey, &v8State);
- m_v8Session = inspector->connect(contextGroupId, this, savedState ? &v8State : nullptr);
+ v8_inspector::String16 v8State16 = toV8InspectorString(v8State);
+ m_v8Session = inspector->connect(contextGroupId, this, savedState ? &v8State16 : nullptr);
}
InspectorSession::~InspectorSession()
@@ -73,8 +75,8 @@ void InspectorSession::dispose()
void InspectorSession::dispatchProtocolMessage(const String& method, const String& message)
{
DCHECK(!m_disposed);
- if (v8_inspector::V8InspectorSession::canDispatchMethod(method))
- m_v8Session->dispatchProtocolMessage(message);
+ if (v8_inspector::V8InspectorSession::canDispatchMethod(toV8InspectorString(method)))
+ m_v8Session->dispatchProtocolMessage(toV8InspectorString(message));
else
m_inspectorBackendDispatcher->dispatch(message);
}
@@ -85,12 +87,12 @@ void InspectorSession::didCommitLoadForLocalFrame(LocalFrame* frame)
m_agents[i]->didCommitLoadForLocalFrame(frame);
}
-void InspectorSession::sendProtocolResponse(int callId, const protocol::String16& message)
+void InspectorSession::sendProtocolResponse(int callId, const String& message)
{
if (m_disposed)
return;
flushProtocolNotifications();
- m_state->setString(kV8StateKey, m_v8Session->stateJSON());
+ m_state->setString(kV8StateKey, toCoreString(m_v8Session->stateJSON()));
String stateToSend = m_state->toJSONString();
if (stateToSend == m_lastSentState)
stateToSend = String();
@@ -99,13 +101,23 @@ void InspectorSession::sendProtocolResponse(int callId, const protocol::String16
m_client->sendProtocolMessage(m_sessionId, callId, message, stateToSend);
}
-void InspectorSession::sendProtocolNotification(const protocol::String16& message)
+void InspectorSession::sendProtocolResponse(int callId, const v8_inspector::String16& message)
+{
+ sendProtocolResponse(callId, toCoreString(message));
caseq 2016/08/19 02:50:36 Ouch. So it's an extra copy for everything that is
+}
+
+void InspectorSession::sendProtocolNotification(const String& message)
{
if (m_disposed)
return;
m_notificationQueue.append(message);
}
+void InspectorSession::sendProtocolNotification(const v8_inspector::String16& message)
+{
+ sendProtocolNotification(toCoreString(message));
+}
+
void InspectorSession::flushProtocolNotifications()
{
if (m_disposed)

Powered by Google App Engine
This is Rietveld 408576698