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

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

Issue 2072613003: Convert GetSearchProviderInstallState to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 4 years, 5 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
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_RENDER_PROCESS_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <list> 11 #include <list>
12 12
13 #include "base/id_map.h" 13 #include "base/id_map.h"
14 #include "base/memory/ptr_util.h"
14 #include "base/process/kill.h" 15 #include "base/process/kill.h"
15 #include "base/process/process_handle.h" 16 #include "base/process/process_handle.h"
16 #include "base/supports_user_data.h" 17 #include "base/supports_user_data.h"
17 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
19 #include "content/public/browser/owned_interface.h"
18 #include "ipc/ipc_channel_proxy.h" 20 #include "ipc/ipc_channel_proxy.h"
19 #include "ipc/ipc_sender.h" 21 #include "ipc/ipc_sender.h"
22 #include "services/shell/public/cpp/interface_registry.h"
20 #include "ui/gfx/native_widget_types.h" 23 #include "ui/gfx/native_widget_types.h"
21 24
22 class GURL; 25 class GURL;
23 26
24 namespace base { 27 namespace base {
25 class SharedPersistentMemoryAllocator; 28 class SharedPersistentMemoryAllocator;
26 class TimeDelta; 29 class TimeDelta;
27 } 30 }
28 31
29 namespace media { 32 namespace media {
30 class AudioOutputController; 33 class AudioOutputController;
31 class MediaKeys; 34 class MediaKeys;
32 } 35 }
33 36
34 namespace shell { 37 namespace shell {
35 class Connection; 38 class Connection;
36 class InterfaceProvider; 39 class InterfaceProvider;
37 class InterfaceRegistry;
38 } 40 }
39 41
40 namespace content { 42 namespace content {
41 class BrowserContext; 43 class BrowserContext;
42 class BrowserMessageFilter; 44 class BrowserMessageFilter;
45 class OwnedInterface;
43 class RenderProcessHostObserver; 46 class RenderProcessHostObserver;
44 class RenderWidgetHost; 47 class RenderWidgetHost;
45 class StoragePartition; 48 class StoragePartition;
46 struct GlobalRequestID; 49 struct GlobalRequestID;
47 50
48 // Interface that represents the browser side of the browser <-> renderer 51 // Interface that represents the browser side of the browser <-> renderer
49 // communication channel. There will generally be one RenderProcessHost per 52 // communication channel. There will generally be one RenderProcessHost per
50 // renderer process. 53 // renderer process.
51 class CONTENT_EXPORT RenderProcessHost : public IPC::Sender, 54 class CONTENT_EXPORT RenderProcessHost : public IPC::Sender,
52 public IPC::Listener, 55 public IPC::Listener,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // Call this to allow queueing of IPC messages that are sent before the 178 // Call this to allow queueing of IPC messages that are sent before the
176 // process is launched. 179 // process is launched.
177 virtual void EnableSendQueue() = 0; 180 virtual void EnableSendQueue() = 0;
178 181
179 // Returns the renderer channel. 182 // Returns the renderer channel.
180 virtual IPC::ChannelProxy* GetChannel() = 0; 183 virtual IPC::ChannelProxy* GetChannel() = 0;
181 184
182 // Adds a message filter to the IPC channel. 185 // Adds a message filter to the IPC channel.
183 virtual void AddFilter(BrowserMessageFilter* filter) = 0; 186 virtual void AddFilter(BrowserMessageFilter* filter) = 0;
184 187
188 // Adds an interface impl which will be owned by this host and registered in
189 // its interface registry. Requests to bind will be handled by calling
190 // |callback|, which must be a member function on |impl|. The method referred
191 // to by |Callback| must conform to the signature `void fun(MyInterfaceRequest
192 // request)`.
193 //
194 // New connections and incoming messages will be dispatched on |task_runner|
195 // (or on the current task runner if not specified). The impl will also be
196 // deleted on |task_runner|.
197 template <typename InterfaceImpl, typename Callback>
198 void AddOwnedInterface(std::unique_ptr<InterfaceImpl> impl,
199 Callback callback,
200 const scoped_refptr<base::SingleThreadTaskRunner>&
201 task_runner = nullptr) {
202 auto owned = base::MakeUnique<content::OwnedInterfaceImpl<InterfaceImpl>>(
203 std::move(impl), task_runner);
204 GetInterfaceRegistry()->AddInterface(
205 base::Bind(callback, base::Unretained(owned->get())), task_runner);
206 AddOwnedInterface(std::move(owned));
207 }
208
209 // Adds the |impl| to the collection of interface impls owned by this
210 // host. The impl must be registered separately using
211 // |GetInterfaceRegistry()|. This function is useful if a single object is
212 // used to implement several interfaces.
213 //
214 // Implementation of |AddOwnedInterface()| must guarantee that the added impls
215 // outlive the |InterfaceRegistry| returned by |GetInterfaceRegistry()|.
216 virtual void AddOwnedInterface(std::unique_ptr<OwnedInterface> impl) = 0;
217
185 // Try to shutdown the associated render process as fast as possible 218 // Try to shutdown the associated render process as fast as possible
186 virtual bool FastShutdownForPageCount(size_t count) = 0; 219 virtual bool FastShutdownForPageCount(size_t count) = 0;
187 220
188 // TODO(ananta) 221 // TODO(ananta)
189 // Revisit whether the virtual functions declared from here on need to be 222 // Revisit whether the virtual functions declared from here on need to be
190 // part of the interface. 223 // part of the interface.
191 virtual void SetIgnoreInputEvents(bool ignore_input_events) = 0; 224 virtual void SetIgnoreInputEvents(bool ignore_input_events) = 0;
192 virtual bool IgnoreInputEvents() const = 0; 225 virtual bool IgnoreInputEvents() const = 0;
193 226
194 // Schedules the host for deletion and removes it from the all_hosts list. 227 // Schedules the host for deletion and removes it from the all_hosts list.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 static void SetMaxRendererProcessCount(size_t count); 401 static void SetMaxRendererProcessCount(size_t count);
369 402
370 // Returns the current maximum number of renderer process hosts kept by the 403 // Returns the current maximum number of renderer process hosts kept by the
371 // content module. 404 // content module.
372 static size_t GetMaxRendererProcessCount(); 405 static size_t GetMaxRendererProcessCount();
373 }; 406 };
374 407
375 } // namespace content. 408 } // namespace content.
376 409
377 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ 410 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698