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

Side by Side Diff: chrome/browser/worker_host/worker_process_host.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, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_
6 #define CHROME_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_
7
8 #include <list>
9
10 #include "base/basictypes.h"
11 #include "base/scoped_ptr.h"
12 #include "chrome/common/child_process_host.h"
13 #include "chrome/common/ipc_channel.h"
14 #include "googleurl/src/gurl.h"
15
16 class ResourceMessageFilter;
17
18 class WorkerProcessHost : public ChildProcessHost {
19 public:
20 WorkerProcessHost(MessageLoop* main_message_loop);
21 ~WorkerProcessHost();
22
23 // Starts the process. Returns true iff it succeeded.
24 bool Init();
25
26 // Creates a worker object in the process.
27 void CreateWorker(const GURL& url,
28 int worker_route_id,
29 int renderer_route_id,
30 ResourceMessageFilter* filter);
31
32 // Returns true iff the given message from a renderer process was forwarded to
33 // the worker.
34 bool FilterMessage(const IPC::Message& message);
35
36 void RendererShutdown(ResourceMessageFilter* filter);
37
38 private:
39 // Called when a message arrives from the worker process.
40 void OnMessageReceived(const IPC::Message& message);
41
42 // Contains information about each worker instance, needed to forward messages
43 // between the renderer and worker processes.
44 struct WorkerInstance {
45 int worker_route_id;
46 int renderer_route_id;
47 ResourceMessageFilter* filter;
48 };
49
50 typedef std::list<WorkerInstance> Instances;
51 Instances instances_;
52
53 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost);
54 };
55
56 #endif // CHROME_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.cc ('k') | chrome/browser/worker_host/worker_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698