summaryrefslogtreecommitdiffstats
path: root/content/browser/debugger/worker_devtools_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/debugger/worker_devtools_manager.h')
-rw-r--r--content/browser/debugger/worker_devtools_manager.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/content/browser/debugger/worker_devtools_manager.h b/content/browser/debugger/worker_devtools_manager.h
new file mode 100644
index 0000000..25f68f6
--- /dev/null
+++ b/content/browser/debugger/worker_devtools_manager.h
@@ -0,0 +1,62 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_DEBUGGER_WORKER_DEVTOOLS_MANAGER_H_
+#define CONTENT_BROWSER_DEBUGGER_WORKER_DEVTOOLS_MANAGER_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/singleton.h"
+
+namespace IPC {
+class Message;
+}
+class DevToolsAgentHost;
+class WorkerDevToolsMessageFilter;
+
+// All methods are supposed to be called on the IO thread.
+class WorkerDevToolsManager {
+ public:
+ // Returns the WorkerDevToolsManager singleton.
+ static WorkerDevToolsManager* GetInstance();
+
+ // Called on the UI thread.
+ static DevToolsAgentHost* GetDevToolsAgentHostForWorker(
+ int worker_process_id,
+ int worker_route_id);
+
+ void WorkerProcessDestroying(int worker_process_host_id);
+ void ForwardToDevToolsClient(int worker_process_id,
+ int worker_route_id,
+ const IPC::Message& message);
+ private:
+ friend struct DefaultSingletonTraits<WorkerDevToolsManager>;
+ class AgentHosts;
+ class WorkerDevToolsAgentHost;
+
+ WorkerDevToolsManager();
+ ~WorkerDevToolsManager();
+
+ void RegisterDevToolsAgentHostForWorker(int worker_process_id,
+ int worker_route_id);
+ void ForwardToWorkerDevToolsAgent(int worker_process_host_id,
+ int worker_route_id,
+ const IPC::Message& message);
+ static void ForwardToDevToolsClientOnUIThread(
+ int worker_process_id,
+ int worker_route_id,
+ const IPC::Message& message);
+ static void NotifyWorkerDestroyedOnIOThread(int worker_process_id,
+ int worker_route_id);
+ static void NotifyWorkerDestroyedOnUIThread(int worker_process_id,
+ int worker_route_id);
+
+ class InspectedWorkersList;
+ scoped_ptr<InspectedWorkersList> inspected_workers_;
+
+ DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsManager);
+};
+
+#endif // CONTENT_BROWSER_DEBUGGER_WORKER_DEVTOOLS_MANAGER_H_