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

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: 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // mojom::RouteProvider: 375 // mojom::RouteProvider:
374 void GetRoute( 376 void GetRoute(
375 int32_t routing_id, 377 int32_t routing_id,
376 mojom::AssociatedInterfaceProviderAssociatedRequest request) override; 378 mojom::AssociatedInterfaceProviderAssociatedRequest request) override;
377 379
378 // mojom::AssociatedInterfaceProvider: 380 // mojom::AssociatedInterfaceProvider:
379 void GetAssociatedInterface( 381 void GetAssociatedInterface(
380 const std::string& name, 382 const std::string& name,
381 mojom::AssociatedInterfaceAssociatedRequest request) override; 383 mojom::AssociatedInterfaceAssociatedRequest request) override;
382 384
385 // mojom::RendererHost
386 void GetBlobURLLoaderFactory(mojom::URLLoaderFactoryRequest request) override;
387
383 void BindRouteProvider(mojom::RouteProviderAssociatedRequest request); 388 void BindRouteProvider(mojom::RouteProviderAssociatedRequest request);
384 389
385 void CreateMusGpuRequest(const service_manager::BindSourceInfo& source_info, 390 void CreateMusGpuRequest(const service_manager::BindSourceInfo& source_info,
386 ui::mojom::GpuRequest request); 391 ui::mojom::GpuRequest request);
387 void CreateOffscreenCanvasProvider( 392 void CreateOffscreenCanvasProvider(
388 const service_manager::BindSourceInfo& source_info, 393 const service_manager::BindSourceInfo& source_info,
389 blink::mojom::OffscreenCanvasProviderRequest request); 394 blink::mojom::OffscreenCanvasProviderRequest request);
390 void BindFrameSinkProvider(const service_manager::BindSourceInfo& source_info, 395 void BindFrameSinkProvider(const service_manager::BindSourceInfo& source_info,
391 mojom::FrameSinkProviderRequest request); 396 mojom::FrameSinkProviderRequest request);
392 void CreateStoragePartitionService( 397 void CreateStoragePartitionService(
393 const service_manager::BindSourceInfo& source_info, 398 const service_manager::BindSourceInfo& source_info,
394 mojom::StoragePartitionServiceRequest request); 399 mojom::StoragePartitionServiceRequest request);
400 void CreateRendererHost(const service_manager::BindSourceInfo& source_info,
401 mojom::RendererHostRequest request);
395 void CreateURLLoaderFactory( 402 void CreateURLLoaderFactory(
396 const service_manager::BindSourceInfo& source_info, 403 const service_manager::BindSourceInfo& source_info,
397 mojom::URLLoaderFactoryRequest request); 404 mojom::URLLoaderFactoryRequest request);
398 405
399 // Control message handlers. 406 // Control message handlers.
400 void OnShutdownRequest(); 407 void OnShutdownRequest();
401 void SuddenTerminationChanged(bool enabled); 408 void SuddenTerminationChanged(bool enabled);
402 void OnUserMetricsRecordAction(const std::string& action); 409 void OnUserMetricsRecordAction(const std::string& action);
403 void OnCloseACK(int old_route_id); 410 void OnCloseACK(int old_route_id);
404 411
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 679
673 scoped_refptr<ResourceMessageFilter> resource_message_filter_; 680 scoped_refptr<ResourceMessageFilter> resource_message_filter_;
674 std::unique_ptr<GpuClient, BrowserThread::DeleteOnIOThread> gpu_client_; 681 std::unique_ptr<GpuClient, BrowserThread::DeleteOnIOThread> gpu_client_;
675 std::unique_ptr<PushMessagingManager, BrowserThread::DeleteOnIOThread> 682 std::unique_ptr<PushMessagingManager, BrowserThread::DeleteOnIOThread>
676 push_messaging_manager_; 683 push_messaging_manager_;
677 684
678 std::unique_ptr<OffscreenCanvasProviderImpl> offscreen_canvas_provider_; 685 std::unique_ptr<OffscreenCanvasProviderImpl> offscreen_canvas_provider_;
679 686
680 mojom::RouteProviderAssociatedPtr remote_route_provider_; 687 mojom::RouteProviderAssociatedPtr remote_route_provider_;
681 mojom::RendererAssociatedPtr renderer_interface_; 688 mojom::RendererAssociatedPtr renderer_interface_;
689 mojo::Binding<mojom::RendererHost> renderer_host_binding_;
682 690
683 // Tracks active audio streams within the render process; used to determine if 691 // Tracks active audio streams within the render process; used to determine if
684 // if a process should be backgrounded. 692 // if a process should be backgrounded.
685 int audio_stream_count_ = 0; 693 int audio_stream_count_ = 0;
686 694
687 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend 695 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend
688 // WeakPtrs which are invalidated any time the RPHI is recycled. 696 // WeakPtrs which are invalidated any time the RPHI is recycled.
689 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> 697 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>>
690 instance_weak_factory_; 698 instance_weak_factory_;
691 699
692 FrameSinkProviderImpl frame_sink_provider_; 700 FrameSinkProviderImpl frame_sink_provider_;
693 701
694 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 702 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
695 703
696 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 704 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
697 }; 705 };
698 706
699 } // namespace content 707 } // namespace content
700 708
701 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 709 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698