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

Unified Diff: third_party/WebKit/Source/core/inspector/CodeGeneratorInspectorStrings.py

Issue 1437993003: Revert of [DevTools] Filter any messages from previous sessions in DevToolsAgentHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/CodeGeneratorInspectorStrings.py
diff --git a/third_party/WebKit/Source/core/inspector/CodeGeneratorInspectorStrings.py b/third_party/WebKit/Source/core/inspector/CodeGeneratorInspectorStrings.py
index 03e46f91f4efc255aeb18ec53f00240ff9190cf7..e20c806b234e88ef746e710e2284598f8348e1d9 100644
--- a/third_party/WebKit/Source/core/inspector/CodeGeneratorInspectorStrings.py
+++ b/third_party/WebKit/Source/core/inspector/CodeGeneratorInspectorStrings.py
@@ -43,19 +43,19 @@
""")
backend_method = (
-"""void InspectorBackendDispatcherImpl::${domainName}_$methodName(int sessionId, int callId, JSONObject*$requestMessageObject, JSONArray* protocolErrors)
+"""void InspectorBackendDispatcherImpl::${domainName}_$methodName(int callId, JSONObject*$requestMessageObject, JSONArray* protocolErrors)
{
if (!$agentField)
protocolErrors->pushString("${domainName} handler is not available.");
$methodCode
if (protocolErrors->length()) {
- reportProtocolError(sessionId, callId, InvalidParams, String::format(InvalidParamsFormatString, commandName($commandNameIndex)), protocolErrors);
+ reportProtocolError(callId, InvalidParams, String::format(InvalidParamsFormatString, commandName($commandNameIndex)), protocolErrors);
return;
}
$agentCallParamsDeclaration
$agentField->$methodName($agentCallParams);
$responseCook
- sendResponse(sessionId, callId, $sendResponseCallParams);
+ sendResponse(callId, $sendResponseCallParams);
}
""")
@@ -69,7 +69,7 @@
""")
callback_main_methods = (
-"""InspectorBackendDispatcher::$agentName::$callbackName::$callbackName(PassRefPtrWillBeRawPtr<InspectorBackendDispatcherImpl> backendImpl, int sessionId, int id) : CallbackBase(backendImpl, sessionId, id) {}
+"""InspectorBackendDispatcher::$agentName::$callbackName::$callbackName(PassRefPtrWillBeRawPtr<InspectorBackendDispatcherImpl> backendImpl, int id) : CallbackBase(backendImpl, id) {}
void InspectorBackendDispatcher::$agentName::$callbackName::sendSuccess($parameters)
{
@@ -150,7 +150,7 @@
class CORE_EXPORT CallbackBase: public RefCountedWillBeGarbageCollectedFinalized<CallbackBase> {
public:
- CallbackBase(PassRefPtrWillBeRawPtr<InspectorBackendDispatcherImpl> backendImpl, int sessionId, int id);
+ CallbackBase(PassRefPtrWillBeRawPtr<InspectorBackendDispatcherImpl> backendImpl, int id);
virtual ~CallbackBase();
DECLARE_VIRTUAL_TRACE();
void sendFailure(const ErrorString&);
@@ -163,7 +163,6 @@
void disable() { m_alreadySent = true; }
RefPtrWillBeMember<InspectorBackendDispatcherImpl> m_backendImpl;
- int m_sessionId;
int m_id;
bool m_alreadySent;
@@ -185,9 +184,9 @@
LastEntry,
};
- void reportProtocolError(int sessionId, int callId, CommonErrorCode, const String& errorMessage) const;
- virtual void reportProtocolError(int sessionId, int callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const = 0;
- virtual void dispatch(int sessionId, const String& message) = 0;
+ void reportProtocolError(int callId, CommonErrorCode, const String& errorMessage) const;
+ virtual void reportProtocolError(int callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const = 0;
+ virtual void dispatch(const String& message) = 0;
static bool getCommandName(const String& message, String* result);
enum MethodNames {
@@ -259,16 +258,16 @@
}
virtual void clearFrontend() { m_inspectorFrontendChannel = 0; }
- virtual void dispatch(int sessionId, const String& message);
- virtual void reportProtocolError(int sessionId, int callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const;
+ virtual void dispatch(const String& message);
+ virtual void reportProtocolError(int callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const;
using InspectorBackendDispatcher::reportProtocolError;
- void sendResponse(int sessionId, int callId, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData, PassRefPtr<JSONObject> result);
+ void sendResponse(int callId, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData, PassRefPtr<JSONObject> result);
bool isActive() { return m_inspectorFrontendChannel; }
$setters
private:
- using CallHandler = void (InspectorBackendDispatcherImpl::*)(int sessionId, int callId, JSONObject* messageObject, JSONArray* protocolErrors);
+ using CallHandler = void (InspectorBackendDispatcherImpl::*)(int callId, JSONObject* messageObject, JSONArray* protocolErrors);
using DispatchMap = HashMap<String, CallHandler>;
$methodDeclarations
@@ -286,13 +285,13 @@
static PassRefPtr<JSONObject> getObject(JSONObject* object, const char* name, bool* valueFound, JSONArray* protocolErrors);
static PassRefPtr<JSONArray> getArray(JSONObject* object, const char* name, bool* valueFound, JSONArray* protocolErrors);
- void sendResponse(int sessionId, int callId, ErrorString invocationError, PassRefPtr<JSONObject> result)
- {
- sendResponse(sessionId, callId, invocationError, RefPtr<JSONValue>(), result);
- }
- void sendResponse(int sessionId, int callId, ErrorString invocationError)
- {
- sendResponse(sessionId, callId, invocationError, RefPtr<JSONValue>(), JSONObject::create());
+ void sendResponse(int callId, ErrorString invocationError, PassRefPtr<JSONObject> result)
+ {
+ sendResponse(callId, invocationError, RefPtr<JSONValue>(), result);
+ }
+ void sendResponse(int callId, ErrorString invocationError)
+ {
+ sendResponse(callId, invocationError, RefPtr<JSONValue>(), JSONObject::create());
}
static const char InvalidParamsFormatString[];
@@ -310,7 +309,7 @@
}
-void InspectorBackendDispatcherImpl::dispatch(int sessionId, const String& message)
+void InspectorBackendDispatcherImpl::dispatch(const String& message)
{
RefPtrWillBeRawPtr<InspectorBackendDispatcher> protect(this);
int callId = 0;
@@ -330,18 +329,18 @@
HashMap<String, CallHandler>::iterator it = m_dispatchMap.find(method);
if (it == m_dispatchMap.end()) {
- reportProtocolError(sessionId, callId, MethodNotFound, "'" + method + "' wasn't found");
+ reportProtocolError(callId, MethodNotFound, "'" + method + "' wasn't found");
return;
}
RefPtr<JSONArray> protocolErrors = JSONArray::create();
- ((*this).*it->value)(sessionId, callId, messageObject.get(), protocolErrors.get());
-}
-
-void InspectorBackendDispatcherImpl::sendResponse(int sessionId, int callId, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData, PassRefPtr<JSONObject> result)
+ ((*this).*it->value)(callId, messageObject.get(), protocolErrors.get());
+}
+
+void InspectorBackendDispatcherImpl::sendResponse(int callId, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData, PassRefPtr<JSONObject> result)
{
if (invocationError.length()) {
- reportProtocolError(sessionId, callId, ServerError, invocationError, errorData);
+ reportProtocolError(callId, ServerError, invocationError, errorData);
return;
}
@@ -349,15 +348,15 @@
responseMessage->setNumber("id", callId);
responseMessage->setObject("result", result);
if (m_inspectorFrontendChannel)
- m_inspectorFrontendChannel->sendProtocolResponse(sessionId, callId, responseMessage.release());
-}
-
-void InspectorBackendDispatcher::reportProtocolError(int sessionId, int callId, CommonErrorCode code, const String& errorMessage) const
-{
- reportProtocolError(sessionId, callId, code, errorMessage, PassRefPtr<JSONValue>());
-}
-
-void InspectorBackendDispatcherImpl::reportProtocolError(int sessionId, int callId, CommonErrorCode code, const String& errorMessage, PassRefPtr<JSONValue> data) const
+ m_inspectorFrontendChannel->sendProtocolResponse(callId, responseMessage.release());
+}
+
+void InspectorBackendDispatcher::reportProtocolError(int callId, CommonErrorCode code, const String& errorMessage) const
+{
+ reportProtocolError(callId, code, errorMessage, PassRefPtr<JSONValue>());
+}
+
+void InspectorBackendDispatcherImpl::reportProtocolError(int callId, CommonErrorCode code, const String& errorMessage, PassRefPtr<JSONValue> data) const
{
ASSERT(code >=0);
ASSERT((unsigned)code < m_commonErrors.size());
@@ -372,7 +371,7 @@
message->setObject("error", error);
message->setNumber("id", callId);
if (m_inspectorFrontendChannel)
- m_inspectorFrontendChannel->sendProtocolResponse(sessionId, callId, message.release());
+ m_inspectorFrontendChannel->sendProtocolResponse(callId, message.release());
}
template<typename R, typename V, typename V0>
@@ -465,8 +464,8 @@
return true;
}
-InspectorBackendDispatcher::CallbackBase::CallbackBase(PassRefPtrWillBeRawPtr<InspectorBackendDispatcherImpl> backendImpl, int sessionId, int id)
- : m_backendImpl(backendImpl), m_sessionId(sessionId), m_id(id), m_alreadySent(false) {}
+InspectorBackendDispatcher::CallbackBase::CallbackBase(PassRefPtrWillBeRawPtr<InspectorBackendDispatcherImpl> backendImpl, int id)
+ : m_backendImpl(backendImpl), m_id(id), m_alreadySent(false) {}
InspectorBackendDispatcher::CallbackBase::~CallbackBase() {}
@@ -490,7 +489,7 @@
{
if (m_alreadySent)
return;
- m_backendImpl->sendResponse(m_sessionId, m_id, invocationError, errorData, partialMessage);
+ m_backendImpl->sendResponse(m_id, invocationError, errorData, partialMessage);
m_alreadySent = true;
}

Powered by Google App Engine
This is Rietveld 408576698