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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.h

Issue 2851173004: Eliminate bind callback that doesn't take a BindSourceInfo parameter. (Closed)
Patch Set: . Created 3 years, 7 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_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "content/browser/child_process_launcher.h" 24 #include "content/browser/child_process_launcher.h"
25 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 25 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
26 #include "content/browser/renderer_host/frame_sink_provider_impl.h" 26 #include "content/browser/renderer_host/frame_sink_provider_impl.h"
27 #include "content/browser/renderer_host/offscreen_canvas_provider_impl.h" 27 #include "content/browser/renderer_host/offscreen_canvas_provider_impl.h"
28 #include "content/browser/webrtc/webrtc_eventlog_host.h" 28 #include "content/browser/webrtc/webrtc_eventlog_host.h"
29 #include "content/common/associated_interface_registry_impl.h" 29 #include "content/common/associated_interface_registry_impl.h"
30 #include "content/common/associated_interfaces.mojom.h" 30 #include "content/common/associated_interfaces.mojom.h"
31 #include "content/common/content_export.h" 31 #include "content/common/content_export.h"
32 #include "content/common/indexed_db/indexed_db.mojom.h" 32 #include "content/common/indexed_db/indexed_db.mojom.h"
33 #include "content/common/renderer.mojom.h" 33 #include "content/common/renderer.mojom.h"
34 #include "content/common/storage_partition_service.mojom.h"
34 #include "content/public/browser/render_process_host.h" 35 #include "content/public/browser/render_process_host.h"
35 #include "content/public/common/service_manager_connection.h" 36 #include "content/public/common/service_manager_connection.h"
36 #include "ipc/ipc_channel_proxy.h" 37 #include "ipc/ipc_channel_proxy.h"
37 #include "ipc/ipc_platform_file.h" 38 #include "ipc/ipc_platform_file.h"
38 #include "media/media_features.h" 39 #include "media/media_features.h"
39 #include "mojo/edk/embedder/pending_process_connection.h" 40 #include "mojo/edk/embedder/pending_process_connection.h"
40 #include "mojo/public/cpp/bindings/associated_binding.h" 41 #include "mojo/public/cpp/bindings/associated_binding.h"
41 #include "mojo/public/cpp/bindings/associated_binding_set.h" 42 #include "mojo/public/cpp/bindings/associated_binding_set.h"
42 #include "mojo/public/cpp/bindings/interface_ptr.h" 43 #include "mojo/public/cpp/bindings/interface_ptr.h"
43 #include "services/service_manager/public/cpp/binder_registry.h" 44 #include "services/service_manager/public/cpp/binder_registry.h"
(...skipping 27 matching lines...) Expand all
71 class PeerConnectionTrackerHost; 72 class PeerConnectionTrackerHost;
72 class PushMessagingManager; 73 class PushMessagingManager;
73 class RenderFrameMessageFilter; 74 class RenderFrameMessageFilter;
74 class RenderWidgetHelper; 75 class RenderWidgetHelper;
75 class RenderWidgetHost; 76 class RenderWidgetHost;
76 class RenderWidgetHostImpl; 77 class RenderWidgetHostImpl;
77 class ResourceMessageFilter; 78 class ResourceMessageFilter;
78 class StoragePartition; 79 class StoragePartition;
79 class StoragePartitionImpl; 80 class StoragePartitionImpl;
80 81
81 namespace mojom {
82 class StoragePartitionService;
83 } // namespace mojom
84
85 typedef base::Thread* (*RendererMainThreadFactoryFunction)( 82 typedef base::Thread* (*RendererMainThreadFactoryFunction)(
86 const InProcessChildThreadParams& params); 83 const InProcessChildThreadParams& params);
87 84
88 // Implements a concrete RenderProcessHost for the browser process for talking 85 // Implements a concrete RenderProcessHost for the browser process for talking
89 // to actual renderer processes (as opposed to mocks). 86 // to actual renderer processes (as opposed to mocks).
90 // 87 //
91 // Represents the browser side of the browser <--> renderer communication 88 // Represents the browser side of the browser <--> renderer communication
92 // channel. There will be one RenderProcessHost per renderer process. 89 // channel. There will be one RenderProcessHost per renderer process.
93 // 90 //
94 // This object is refcounted so that it can release its resources when all 91 // This object is refcounted so that it can release its resources when all
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 int32_t routing_id, 337 int32_t routing_id,
341 mojom::AssociatedInterfaceProviderAssociatedRequest request) override; 338 mojom::AssociatedInterfaceProviderAssociatedRequest request) override;
342 339
343 // mojom::AssociatedInterfaceProvider: 340 // mojom::AssociatedInterfaceProvider:
344 void GetAssociatedInterface( 341 void GetAssociatedInterface(
345 const std::string& name, 342 const std::string& name,
346 mojom::AssociatedInterfaceAssociatedRequest request) override; 343 mojom::AssociatedInterfaceAssociatedRequest request) override;
347 344
348 void BindRouteProvider(mojom::RouteProviderAssociatedRequest request); 345 void BindRouteProvider(mojom::RouteProviderAssociatedRequest request);
349 346
350 void CreateMusGpuRequest(ui::mojom::GpuRequest request); 347 void CreateMusGpuRequest(const service_manager::BindSourceInfo& source_info,
348 ui::mojom::GpuRequest request);
351 void CreateOffscreenCanvasProvider( 349 void CreateOffscreenCanvasProvider(
350 const service_manager::BindSourceInfo& source_info,
352 blink::mojom::OffscreenCanvasProviderRequest request); 351 blink::mojom::OffscreenCanvasProviderRequest request);
353 void BindFrameSinkProvider(mojom::FrameSinkProviderRequest request); 352 void BindFrameSinkProvider(const service_manager::BindSourceInfo& source_info,
353 mojom::FrameSinkProviderRequest request);
354 void CreateStoragePartitionService( 354 void CreateStoragePartitionService(
355 mojo::InterfaceRequest<mojom::StoragePartitionService> request); 355 const service_manager::BindSourceInfo& source_info,
356 mojom::StoragePartitionServiceRequest request);
356 357
357 // Control message handlers. 358 // Control message handlers.
358 void OnShutdownRequest(); 359 void OnShutdownRequest();
359 void SuddenTerminationChanged(bool enabled); 360 void SuddenTerminationChanged(bool enabled);
360 void OnUserMetricsRecordAction(const std::string& action); 361 void OnUserMetricsRecordAction(const std::string& action);
361 void OnCloseACK(int old_route_id); 362 void OnCloseACK(int old_route_id);
362 363
363 // Generates a command line to be used to spawn a renderer and appends the 364 // Generates a command line to be used to spawn a renderer and appends the
364 // results to |*command_line|. 365 // results to |*command_line|.
365 void AppendRendererCommandLine(base::CommandLine* command_line); 366 void AppendRendererCommandLine(base::CommandLine* command_line);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 void SendAecDumpFileToRenderer(int id, 399 void SendAecDumpFileToRenderer(int id,
399 IPC::PlatformFileForTransit file_for_transit); 400 IPC::PlatformFileForTransit file_for_transit);
400 void SendDisableAecDumpToRenderer(); 401 void SendDisableAecDumpToRenderer();
401 base::FilePath GetAecDumpFilePathWithExtensions(const base::FilePath& file); 402 base::FilePath GetAecDumpFilePathWithExtensions(const base::FilePath& file);
402 #endif 403 #endif
403 404
404 static void OnMojoError(int render_process_id, const std::string& error); 405 static void OnMojoError(int render_process_id, const std::string& error);
405 406
406 template <typename InterfaceType> 407 template <typename InterfaceType>
407 using AddInterfaceCallback = 408 using AddInterfaceCallback =
408 base::Callback<void(mojo::InterfaceRequest<InterfaceType>)>; 409 base::Callback<void(const service_manager::BindSourceInfo&,
410 mojo::InterfaceRequest<InterfaceType>)>;
409 411
410 template <typename CallbackType> 412 template <typename CallbackType>
411 struct InterfaceGetter; 413 struct InterfaceGetter;
412 414
413 template <typename InterfaceType> 415 template <typename InterfaceType>
414 struct InterfaceGetter<AddInterfaceCallback<InterfaceType>> { 416 struct InterfaceGetter<AddInterfaceCallback<InterfaceType>> {
415 static void GetInterfaceOnUIThread( 417 static void GetInterfaceOnUIThread(
416 base::WeakPtr<RenderProcessHostImpl> weak_host, 418 base::WeakPtr<RenderProcessHostImpl> weak_host,
417 const AddInterfaceCallback<InterfaceType>& callback, 419 const AddInterfaceCallback<InterfaceType>& callback,
420 const service_manager::BindSourceInfo& source_info,
418 mojo::InterfaceRequest<InterfaceType> request) { 421 mojo::InterfaceRequest<InterfaceType> request) {
419 if (!weak_host) 422 if (!weak_host)
420 return; 423 return;
421 callback.Run(std::move(request)); 424 callback.Run(source_info, std::move(request));
422 } 425 }
423 }; 426 };
424 427
425 // Helper to bind an interface callback whose lifetime is limited to that of 428 // Helper to bind an interface callback whose lifetime is limited to that of
426 // the render process currently hosted by the RPHI. Callbacks added by this 429 // the render process currently hosted by the RPHI. Callbacks added by this
427 // method will never run beyond the next invocation of Cleanup(). 430 // method will never run beyond the next invocation of Cleanup().
428 template <typename CallbackType> 431 template <typename CallbackType>
429 void AddUIThreadInterface(service_manager::BinderRegistry* registry, 432 void AddUIThreadInterface(service_manager::BinderRegistry* registry,
430 const CallbackType& callback) { 433 const CallbackType& callback) {
431 registry->AddInterface( 434 registry->AddInterface(
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 FrameSinkProviderImpl frame_sink_provider_; 632 FrameSinkProviderImpl frame_sink_provider_;
630 633
631 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 634 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
632 635
633 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 636 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
634 }; 637 };
635 638
636 } // namespace content 639 } // namespace content
637 640
638 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 641 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/video_capture_host.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698