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

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

Issue 2468233003: [DevTools] Migrate Accessibility, Log, Worker to new style (Closed)
Patch Set: addressed comments Created 4 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/InspectorWorkerAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorWorkerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorWorkerAgent.cpp
index 819f5c346d9761df44c820ec5467756deb3b57b5..d7743bc97b36696c6d1c3f3afdefebec632d5f36 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorWorkerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorWorkerAgent.cpp
@@ -55,23 +55,23 @@ void InspectorWorkerAgent::restore() {
connectToAllProxies();
}
-void InspectorWorkerAgent::disable(ErrorString*) {
+Response InspectorWorkerAgent::disable() {
if (autoAttachEnabled()) {
disconnectFromAllProxies();
m_instrumentingAgents->removeInspectorWorkerAgent(this);
}
m_state->setBoolean(WorkerAgentState::autoAttach, false);
m_state->setBoolean(WorkerAgentState::waitForDebuggerOnStart, false);
+ return Response::OK();
}
-void InspectorWorkerAgent::setAutoAttach(ErrorString*,
- bool autoAttach,
- bool waitForDebuggerOnStart) {
+Response InspectorWorkerAgent::setAutoAttach(bool autoAttach,
+ bool waitForDebuggerOnStart) {
m_state->setBoolean(WorkerAgentState::waitForDebuggerOnStart,
waitForDebuggerOnStart);
if (autoAttach == autoAttachEnabled())
- return;
+ return Response::OK();
m_state->setBoolean(WorkerAgentState::autoAttach, autoAttach);
if (autoAttach) {
m_instrumentingAgents->addInspectorWorkerAgent(this);
@@ -80,20 +80,20 @@ void InspectorWorkerAgent::setAutoAttach(ErrorString*,
disconnectFromAllProxies();
m_instrumentingAgents->removeInspectorWorkerAgent(this);
}
+ return Response::OK();
}
bool InspectorWorkerAgent::autoAttachEnabled() {
return m_state->booleanProperty(WorkerAgentState::autoAttach, false);
}
-void InspectorWorkerAgent::sendMessageToTarget(ErrorString* error,
- const String& targetId,
- const String& message) {
+Response InspectorWorkerAgent::sendMessageToTarget(const String& targetId,
+ const String& message) {
WorkerInspectorProxy* proxy = m_connectedProxies.get(targetId);
- if (proxy)
- proxy->sendMessageToInspector(message);
- else
- *error = "Not attached to a target with given id";
+ if (!proxy)
+ return Response::Error("Not attached to a target with given id");
+ proxy->sendMessageToInspector(message);
+ return Response::OK();
}
void InspectorWorkerAgent::setTracingSessionId(const String& sessionId) {

Powered by Google App Engine
This is Rietveld 408576698