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

Side by Side Diff: chrome/worker/worker_process.cc

Issue 20413: old1 (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/worker/worker_process.h ('k') | chrome/worker/worker_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 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 #include <windows.h>
6 #include "chrome/worker/worker_process.h"
7
8 #include "base/basictypes.h"
9 #include "base/scoped_handle.h"
10 #include "chrome/common/ipc_channel.h"
11 #include "chrome/common/ipc_message_utils.h"
12 #include "chrome/common/worker_messages.h"
13
14 // Custom factory to allow us to pass additional ctor arguments.
15 class WorkerProcessFactory : public ChildProcessFactoryInterface {
16 public:
17 explicit WorkerProcessFactory() {}
18
19 virtual ChildProcess* Create(const std::wstring& channel_name) {
20 return new WorkerProcess(channel_name);
21 }
22 };
23
24
25 // No AddRef required when using WorkerProcess with RunnableMethod. This is
26 // okay since the lifetime of the WorkerProcess is always greater than the
27 // lifetime of WorkerThread because it's a member variable.
28 template <> struct RunnableMethodTraits<WorkerProcess> {
29 static void RetainCallee(WorkerProcess*) {}
30 static void ReleaseCallee(WorkerProcess*) {}
31 };
32
33 WorkerProcess::WorkerProcess(const std::wstring& channel_name) :
34 #pragma warning(suppress: 4355) // Okay to pass "this" here.
35 worker_thread_(this, channel_name) {
36 }
37
38 WorkerProcess::~WorkerProcess() {
39 }
40
41 bool WorkerProcess::GlobalInit(const std::wstring &channel_name) {
42 WorkerProcessFactory factory;
43 return ChildProcess::GlobalInit(channel_name, &factory);
44 }
45
46
47 // Note: may be called on any thread
48 void WorkerProcess::OnFinalRelease() {
49 }
OLDNEW
« no previous file with comments | « chrome/worker/worker_process.h ('k') | chrome/worker/worker_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698