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

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

Issue 2925903004: Add support for blob urls for subresources. (Closed)
Patch Set: review comment Created 3 years, 6 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 15 matching lines...) Expand all
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/media/renderer_audio_output_stream_facto ry_context_impl.h" 27 #include "content/browser/renderer_host/media/renderer_audio_output_stream_facto ry_context_impl.h"
28 #include "content/browser/renderer_host/offscreen_canvas_provider_impl.h" 28 #include "content/browser/renderer_host/offscreen_canvas_provider_impl.h"
29 #include "content/browser/webrtc/webrtc_eventlog_host.h" 29 #include "content/browser/webrtc/webrtc_eventlog_host.h"
30 #include "content/common/associated_interface_registry_impl.h" 30 #include "content/common/associated_interface_registry_impl.h"
31 #include "content/common/associated_interfaces.mojom.h" 31 #include "content/common/associated_interfaces.mojom.h"
32 #include "content/common/content_export.h" 32 #include "content/common/content_export.h"
33 #include "content/common/indexed_db/indexed_db.mojom.h" 33 #include "content/common/indexed_db/indexed_db.mojom.h"
34 #include "content/common/media/renderer_audio_output_stream_factory.mojom.h" 34 #include "content/common/media/renderer_audio_output_stream_factory.mojom.h"
35 #include "content/common/renderer.mojom.h" 35 #include "content/common/renderer.mojom.h"
36 #include "content/common/renderer_host.mojom.h"
36 #include "content/common/storage_partition_service.mojom.h" 37 #include "content/common/storage_partition_service.mojom.h"
37 #include "content/common/url_loader_factory.mojom.h" 38 #include "content/common/url_loader_factory.mojom.h"
38 #include "content/public/browser/render_process_host.h" 39 #include "content/public/browser/render_process_host.h"
39 #include "content/public/common/service_manager_connection.h" 40 #include "content/public/common/service_manager_connection.h"
40 #include "ipc/ipc_channel_proxy.h" 41 #include "ipc/ipc_channel_proxy.h"
41 #include "ipc/ipc_platform_file.h" 42 #include "ipc/ipc_platform_file.h"
42 #include "media/media_features.h" 43 #include "media/media_features.h"
43 #include "mojo/edk/embedder/outgoing_broker_client_invitation.h" 44 #include "mojo/edk/embedder/outgoing_broker_client_invitation.h"
44 #include "mojo/public/cpp/bindings/associated_binding.h" 45 #include "mojo/public/cpp/bindings/associated_binding.h"
45 #include "mojo/public/cpp/bindings/associated_binding_set.h" 46 #include "mojo/public/cpp/bindings/associated_binding_set.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // 104 //
104 // A RenderProcessHost is also associated with one and only one 105 // A RenderProcessHost is also associated with one and only one
105 // StoragePartition. This allows us to implement strong storage isolation 106 // StoragePartition. This allows us to implement strong storage isolation
106 // because all the IPCs from the RenderViews (renderer) will only ever be able 107 // because all the IPCs from the RenderViews (renderer) will only ever be able
107 // to access the partition they are assigned to. 108 // to access the partition they are assigned to.
108 class CONTENT_EXPORT RenderProcessHostImpl 109 class CONTENT_EXPORT RenderProcessHostImpl
109 : public RenderProcessHost, 110 : public RenderProcessHost,
110 public ChildProcessLauncher::Client, 111 public ChildProcessLauncher::Client,
111 public ui::GpuSwitchingObserver, 112 public ui::GpuSwitchingObserver,
112 public NON_EXPORTED_BASE(mojom::RouteProvider), 113 public NON_EXPORTED_BASE(mojom::RouteProvider),
113 public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider) { 114 public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider),
115 public NON_EXPORTED_BASE(mojom::RendererHost) {
114 public: 116 public:
115 RenderProcessHostImpl(BrowserContext* browser_context, 117 RenderProcessHostImpl(BrowserContext* browser_context,
116 StoragePartitionImpl* storage_partition_impl, 118 StoragePartitionImpl* storage_partition_impl,
117 bool is_for_guests_only); 119 bool is_for_guests_only);
118 ~RenderProcessHostImpl() override; 120 ~RenderProcessHostImpl() override;
119 121
120 // RenderProcessHost implementation (public portion). 122 // RenderProcessHost implementation (public portion).
121 bool Init() override; 123 bool Init() override;
122 void EnableSendQueue() override; 124 void EnableSendQueue() override;
123 int GetNextRoutingID() override; 125 int GetNextRoutingID() override;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 // mojom::RouteProvider: 378 // mojom::RouteProvider:
377 void GetRoute( 379 void GetRoute(
378 int32_t routing_id, 380 int32_t routing_id,
379 mojom::AssociatedInterfaceProviderAssociatedRequest request) override; 381 mojom::AssociatedInterfaceProviderAssociatedRequest request) override;
380 382
381 // mojom::AssociatedInterfaceProvider: 383 // mojom::AssociatedInterfaceProvider:
382 void GetAssociatedInterface( 384 void GetAssociatedInterface(
383 const std::string& name, 385 const std::string& name,
384 mojom::AssociatedInterfaceAssociatedRequest request) override; 386 mojom::AssociatedInterfaceAssociatedRequest request) override;
385 387
388 // mojom::RendererHost
389 void GetBlobURLLoaderFactory(mojom::URLLoaderFactoryRequest request) override;
390
386 void BindRouteProvider(mojom::RouteProviderAssociatedRequest request); 391 void BindRouteProvider(mojom::RouteProviderAssociatedRequest request);
387 392
388 void CreateMusGpuRequest(const service_manager::BindSourceInfo& source_info, 393 void CreateMusGpuRequest(const service_manager::BindSourceInfo& source_info,
389 ui::mojom::GpuRequest request); 394 ui::mojom::GpuRequest request);
390 void CreateOffscreenCanvasProvider( 395 void CreateOffscreenCanvasProvider(
391 const service_manager::BindSourceInfo& source_info, 396 const service_manager::BindSourceInfo& source_info,
392 blink::mojom::OffscreenCanvasProviderRequest request); 397 blink::mojom::OffscreenCanvasProviderRequest request);
393 void BindFrameSinkProvider(const service_manager::BindSourceInfo& source_info, 398 void BindFrameSinkProvider(const service_manager::BindSourceInfo& source_info,
394 mojom::FrameSinkProviderRequest request); 399 mojom::FrameSinkProviderRequest request);
395 void CreateStoragePartitionService( 400 void CreateStoragePartitionService(
396 const service_manager::BindSourceInfo& source_info, 401 const service_manager::BindSourceInfo& source_info,
397 mojom::StoragePartitionServiceRequest request); 402 mojom::StoragePartitionServiceRequest request);
403 void CreateRendererHost(const service_manager::BindSourceInfo& source_info,
404 mojom::RendererHostRequest request);
398 void CreateURLLoaderFactory( 405 void CreateURLLoaderFactory(
399 const service_manager::BindSourceInfo& source_info, 406 const service_manager::BindSourceInfo& source_info,
400 mojom::URLLoaderFactoryRequest request); 407 mojom::URLLoaderFactoryRequest request);
401 408
402 // Control message handlers. 409 // Control message handlers.
403 void OnShutdownRequest(); 410 void OnShutdownRequest();
404 void SuddenTerminationChanged(bool enabled); 411 void SuddenTerminationChanged(bool enabled);
405 void OnUserMetricsRecordAction(const std::string& action); 412 void OnUserMetricsRecordAction(const std::string& action);
406 void OnCloseACK(int old_route_id); 413 void OnCloseACK(int old_route_id);
407 414
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 682
676 scoped_refptr<ResourceMessageFilter> resource_message_filter_; 683 scoped_refptr<ResourceMessageFilter> resource_message_filter_;
677 std::unique_ptr<GpuClient, BrowserThread::DeleteOnIOThread> gpu_client_; 684 std::unique_ptr<GpuClient, BrowserThread::DeleteOnIOThread> gpu_client_;
678 std::unique_ptr<PushMessagingManager, BrowserThread::DeleteOnIOThread> 685 std::unique_ptr<PushMessagingManager, BrowserThread::DeleteOnIOThread>
679 push_messaging_manager_; 686 push_messaging_manager_;
680 687
681 std::unique_ptr<OffscreenCanvasProviderImpl> offscreen_canvas_provider_; 688 std::unique_ptr<OffscreenCanvasProviderImpl> offscreen_canvas_provider_;
682 689
683 mojom::RouteProviderAssociatedPtr remote_route_provider_; 690 mojom::RouteProviderAssociatedPtr remote_route_provider_;
684 mojom::RendererAssociatedPtr renderer_interface_; 691 mojom::RendererAssociatedPtr renderer_interface_;
692 mojo::Binding<mojom::RendererHost> renderer_host_binding_;
685 693
686 // Tracks active audio streams within the render process; used to determine if 694 // Tracks active audio streams within the render process; used to determine if
687 // if a process should be backgrounded. 695 // if a process should be backgrounded.
688 int audio_stream_count_ = 0; 696 int audio_stream_count_ = 0;
689 697
690 std::unique_ptr<resource_coordinator::ResourceCoordinatorInterface> 698 std::unique_ptr<resource_coordinator::ResourceCoordinatorInterface>
691 process_resource_coordinator_; 699 process_resource_coordinator_;
692 700
693 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend 701 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend
694 // WeakPtrs which are invalidated any time the RPHI is recycled. 702 // WeakPtrs which are invalidated any time the RPHI is recycled.
695 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> 703 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>>
696 instance_weak_factory_; 704 instance_weak_factory_;
697 705
698 FrameSinkProviderImpl frame_sink_provider_; 706 FrameSinkProviderImpl frame_sink_provider_;
699 707
700 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 708 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
701 709
702 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 710 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
703 }; 711 };
704 712
705 } // namespace content 713 } // namespace content
706 714
707 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 715 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698