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

Unified Diff: chrome/browser/worker_host/worker_service.h

Issue 27157: Initial checkin of the out of process worker implementation.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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
« no previous file with comments | « chrome/browser/worker_host/worker_process_host.cc ('k') | chrome/browser/worker_host/worker_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/worker_host/worker_service.h
===================================================================
--- chrome/browser/worker_host/worker_service.h (revision 0)
+++ chrome/browser/worker_host/worker_service.h (revision 0)
@@ -0,0 +1,52 @@
+// Copyright (c) 2009 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 CHROME_BROWSER_WORKER_HOST__WORKER_SERVICE_H_
+#define CHROME_BROWSER_WORKER_HOST__WORKER_SERVICE_H_
+
+#include <list>
+
+#include "base/basictypes.h"
+#include "base/hash_tables.h"
+#include "base/singleton.h"
+#include "googleurl/src/gurl.h"
+
+namespace IPC {
+class Message;
+}
+
+class MessageLoop;
+class WorkerProcessHost;
+class ResourceMessageFilter;
+
+class WorkerService {
+ public:
+ // Returns the WorkerService singleton.
+ static WorkerService* GetInstance();
+
+ // Creates a dedicated worker. Returns true on success.
+ bool CreateDedicatedWorker(const GURL &url,
+ ResourceMessageFilter* filter,
+ int renderer_route_id);
+
+ // Called by ResourceMessageFilter when a message from the renderer comes that
+ // should be forwarded to the worker process.
+ void ForwardMessage(const IPC::Message& message);
+
+ // Called by ResourceMessageFilter when it's destructed so that all the
+ // WorkerProcessHost objects can remove their pointers to it.
+ void RendererShutdown(ResourceMessageFilter* filter);
+
+ private:
+ friend struct DefaultSingletonTraits<WorkerService>;
+
+ WorkerService();
+ ~WorkerService();
+
+ int next_worker_route_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(WorkerService);
+};
+
+#endif // CHROME_BROWSER_WORKER_HOST__WORKER_SERVICE_H_
« no previous file with comments | « chrome/browser/worker_host/worker_process_host.cc ('k') | chrome/browser/worker_host/worker_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698