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

Side by Side Diff: content/public/browser/utility_process_host.h

Issue 2420253002: Rename shell namespace to service_manager (Closed)
Patch Set: . Created 4 years, 2 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
« no previous file with comments | « content/public/browser/render_process_host.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_
7 7
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/process/launch.h" 9 #include "base/process/launch.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "ipc/ipc_sender.h" 13 #include "ipc/ipc_sender.h"
14 14
15 namespace base { 15 namespace base {
16 class FilePath; 16 class FilePath;
17 class SequencedTaskRunner; 17 class SequencedTaskRunner;
18 } 18 }
19 19
20 namespace shell { 20 namespace service_manager {
21 class InterfaceProvider; 21 class InterfaceProvider;
22 } 22 }
23 23
24 namespace content { 24 namespace content {
25 class UtilityProcessHostClient; 25 class UtilityProcessHostClient;
26 struct ChildProcessData; 26 struct ChildProcessData;
27 27
28 // This class acts as the browser-side host to a utility child process. A 28 // This class acts as the browser-side host to a utility child process. A
29 // utility process is a short-lived process that is created to run a specific 29 // utility process is a short-lived process that is created to run a specific
30 // task. This class lives solely on the IO thread. 30 // task. This class lives solely on the IO thread.
31 // If you need a single method call in the process, use StartFooBar(p). 31 // If you need a single method call in the process, use StartFooBar(p).
32 // If you need multiple batches of work to be done in the process, use 32 // If you need multiple batches of work to be done in the process, use
33 // StartBatchMode(), then multiple calls to StartFooBar(p), then finish with 33 // StartBatchMode(), then multiple calls to StartFooBar(p), then finish with
34 // EndBatchMode(). 34 // EndBatchMode().
35 // If you need to bind Mojo interfaces, use Start() to start the child 35 // If you need to bind Mojo interfaces, use Start() to start the child
36 // process and GetRemoteInterfaces() to get the utility process' 36 // process and GetRemoteInterfaces() to get the utility process'
37 // shell::InterfaceProvider. 37 // service_manager::InterfaceProvider.
38 // 38 //
39 // Note: If your class keeps a ptr to an object of this type, grab a weak ptr to 39 // Note: If your class keeps a ptr to an object of this type, grab a weak ptr to
40 // avoid a use after free since this object is deleted synchronously but the 40 // avoid a use after free since this object is deleted synchronously but the
41 // client notification is asynchronous. See http://crbug.com/108871. 41 // client notification is asynchronous. See http://crbug.com/108871.
42 class UtilityProcessHost : public IPC::Sender { 42 class UtilityProcessHost : public IPC::Sender {
43 public: 43 public:
44 // Used to create a utility process. |client| is optional. If supplied it will 44 // Used to create a utility process. |client| is optional. If supplied it will
45 // be notified of incoming messages from the utility process. 45 // be notified of incoming messages from the utility process.
46 // |client_task_runner| is required if |client| is supplied and is the task 46 // |client_task_runner| is required if |client| is supplied and is the task
47 // runner upon which |client| will be invoked. 47 // runner upon which |client| will be invoked.
(...skipping 27 matching lines...) Expand all
75 // Returns information about the utility child process. 75 // Returns information about the utility child process.
76 virtual const ChildProcessData& GetData() = 0; 76 virtual const ChildProcessData& GetData() = 0;
77 77
78 #if defined(OS_POSIX) 78 #if defined(OS_POSIX)
79 virtual void SetEnv(const base::EnvironmentMap& env) = 0; 79 virtual void SetEnv(const base::EnvironmentMap& env) = 0;
80 #endif 80 #endif
81 81
82 // Starts the utility process. 82 // Starts the utility process.
83 virtual bool Start() = 0; 83 virtual bool Start() = 0;
84 84
85 // Returns the shell::InterfaceProvider the browser process can use to bind 85 // Returns the service_manager::InterfaceProvider the browser process can use
86 // to bind
86 // interfaces exposed to it from the utility process. 87 // interfaces exposed to it from the utility process.
87 virtual shell::InterfaceProvider* GetRemoteInterfaces() = 0; 88 virtual service_manager::InterfaceProvider* GetRemoteInterfaces() = 0;
88 89
89 // Set the name of the process to appear in the task manager. 90 // Set the name of the process to appear in the task manager.
90 virtual void SetName(const base::string16& name) = 0; 91 virtual void SetName(const base::string16& name) = 0;
91 }; 92 };
92 93
93 }; // namespace content 94 }; // namespace content
94 95
95 #endif // CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_ 96 #endif // CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « content/public/browser/render_process_host.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698