summaryrefslogtreecommitdiffstats
path: root/content/browser/worker_host/worker_service_observer.h
diff options
context:
space:
mode:
authoryurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-12 08:40:12 +0000
committeryurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-12 08:40:12 +0000
commitd9ddc0db322f5a437c6eb932676308f0ac7b448b (patch)
tree92c1b98aa313c515700146fee6294e7b77cbbfb6 /content/browser/worker_host/worker_service_observer.h
parent83c130ce5753269b00d1ee4891fd27286de068fc (diff)
downloadchromium_src-d9ddc0db322f5a437c6eb932676308f0ac7b448b.zip
chromium_src-d9ddc0db322f5a437c6eb932676308f0ac7b448b.tar.gz
chromium_src-d9ddc0db322f5a437c6eb932676308f0ac7b448b.tar.bz2
DevTools: support shared worker initialization debugger
To be able to debug shared workers initialization, devtools front-end needs to attach very early, before first statement of the worker script is executed. To achieve this on the IO thread we keep a list of shared workers for which devtools front-end was opened and not closed yet. If such worker is destroyed we store its URL and name in the pending workers list and once a new worker is created again we tell it to pause its worker context on start and wait for explicit notification from the devtools client or resume message(in case we learn that the client has already closed on the UI thread). After pause message was sent to the worker being created we put corresponding data to the paused_workers_ list and post reattach task to the UI thread which should result in reattach message to the new worker if the front-end still exists, otherwise when the worker data is removed from the paused_workers_ list we will send resume message and worker will continue to operate as usual. BUG=None TEST=None Review URL: http://codereview.chromium.org/8216008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105038 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/worker_host/worker_service_observer.h')
-rw-r--r--content/browser/worker_host/worker_service_observer.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/content/browser/worker_host/worker_service_observer.h b/content/browser/worker_host/worker_service_observer.h
new file mode 100644
index 0000000..8ee4514
--- /dev/null
+++ b/content/browser/worker_host/worker_service_observer.h
@@ -0,0 +1,27 @@
+// 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_WORKER_HOST_WORKER_SERVICE_OBSERVER_H_
+#define CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_OBSERVER_H_
+#pragma once
+
+#include "content/browser/worker_host/worker_process_host.h"
+
+class WorkerServiceObserver {
+ public:
+ virtual void WorkerCreated(
+ WorkerProcessHost* process,
+ const WorkerProcessHost::WorkerInstance& instance) = 0;
+ virtual void WorkerDestroyed(
+ WorkerProcessHost* process,
+ const WorkerProcessHost::WorkerInstance& instance) = 0;
+ virtual void WorkerContextStarted(
+ WorkerProcessHost* process,
+ int worker_route_id) = 0;
+
+ protected:
+ virtual ~WorkerServiceObserver() {}
+};
+
+#endif // CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_OBSERVER_H_