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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2498203004: Move media::mojom::RemoterFactory to content, add ContentBrowserClient API. (Closed)
Patch Set: The fix: Add/register a default RemoterFactory in RenderFrameHostImpl. Created 4 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #include "content/public/common/isolated_world_ids.h" 89 #include "content/public/common/isolated_world_ids.h"
90 #include "content/public/common/service_manager_connection.h" 90 #include "content/public/common/service_manager_connection.h"
91 #include "content/public/common/service_names.h" 91 #include "content/public/common/service_names.h"
92 #include "content/public/common/url_constants.h" 92 #include "content/public/common/url_constants.h"
93 #include "content/public/common/url_utils.h" 93 #include "content/public/common/url_utils.h"
94 #include "device/generic_sensor/sensor_provider_impl.h" 94 #include "device/generic_sensor/sensor_provider_impl.h"
95 #include "device/geolocation/geolocation_service_context.h" 95 #include "device/geolocation/geolocation_service_context.h"
96 #include "device/vibration/vibration_manager_impl.h" 96 #include "device/vibration/vibration_manager_impl.h"
97 #include "device/wake_lock/wake_lock_service_context.h" 97 #include "device/wake_lock/wake_lock_service_context.h"
98 #include "media/base/media_switches.h" 98 #include "media/base/media_switches.h"
99 #include "media/media_features.h"
99 #include "media/mojo/interfaces/media_service.mojom.h" 100 #include "media/mojo/interfaces/media_service.mojom.h"
101 #include "media/mojo/interfaces/remoting.mojom.h"
100 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" 102 #include "mojo/public/cpp/bindings/associated_interface_ptr.h"
101 #include "mojo/public/cpp/bindings/strong_binding.h" 103 #include "mojo/public/cpp/bindings/strong_binding.h"
102 #include "services/service_manager/public/cpp/connector.h" 104 #include "services/service_manager/public/cpp/connector.h"
103 #include "services/service_manager/public/cpp/interface_provider.h" 105 #include "services/service_manager/public/cpp/interface_provider.h"
104 #include "third_party/WebKit/public/platform/modules/shapedetection/shapedetecti on.mojom.h" 106 #include "third_party/WebKit/public/platform/modules/shapedetection/shapedetecti on.mojom.h"
105 #include "ui/accessibility/ax_tree.h" 107 #include "ui/accessibility/ax_tree.h"
106 #include "ui/accessibility/ax_tree_update.h" 108 #include "ui/accessibility/ax_tree_update.h"
107 #include "ui/gfx/geometry/quad_f.h" 109 #include "ui/gfx/geometry/quad_f.h"
108 #include "url/gurl.h" 110 #include "url/gurl.h"
109 111
(...skipping 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after
2242 base::Bind(&MediaDevicesDispatcherHost::Create, GetProcess()->GetID(), 2244 base::Bind(&MediaDevicesDispatcherHost::Create, GetProcess()->GetID(),
2243 GetRoutingID(), GetProcess() 2245 GetRoutingID(), GetProcess()
2244 ->GetBrowserContext() 2246 ->GetBrowserContext()
2245 ->GetResourceContext() 2247 ->GetResourceContext()
2246 ->GetMediaDeviceIDSalt(), 2248 ->GetMediaDeviceIDSalt(),
2247 base::Unretained(media_stream_manager)), 2249 base::Unretained(media_stream_manager)),
2248 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 2250 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
2249 } 2251 }
2250 #endif 2252 #endif
2251 2253
2254 #if BUILDFLAG(ENABLE_MEDIA_REMOTING)
2255 // Add a no-op RemoterFactory binder. Embedders that support media remoting
2256 // will override this via their ContentBrowserClient.
2257 class NullRemoterFactory final : public media::mojom::RemoterFactory {
Ben Goodger (Google) 2016/11/16 18:56:13 Since the renderer requires this always, rather th
miu 2016/11/16 22:30:06 Done. Prior to this, I had assumed it was normal/S
2258 public:
2259 void Create(media::mojom::RemotingSourcePtr source,
2260 media::mojom::RemoterRequest remoter) final {}
2261 static void CreateRemoterFactory(
2262 media::mojom::RemoterFactoryRequest request) {
2263 mojo::MakeStrongBinding(base::MakeUnique<NullRemoterFactory>(),
2264 std::move(request));
2265 }
2266 };
2267 GetInterfaceRegistry()->AddInterface(
2268 base::Bind(&NullRemoterFactory::CreateRemoterFactory));
2269 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
2270
2252 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces( 2271 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces(
2253 GetInterfaceRegistry(), this); 2272 GetInterfaceRegistry(), this);
2254 } 2273 }
2255 2274
2256 void RenderFrameHostImpl::ResetWaitingState() { 2275 void RenderFrameHostImpl::ResetWaitingState() {
2257 DCHECK(is_active()); 2276 DCHECK(is_active());
2258 2277
2259 // Whenever we reset the RFH state, we should not be waiting for beforeunload 2278 // Whenever we reset the RFH state, we should not be waiting for beforeunload
2260 // or close acks. We clear them here to be safe, since they can cause 2279 // or close acks. We clear them here to be safe, since they can cause
2261 // navigations to be ignored in OnDidCommitProvisionalLoad. 2280 // navigations to be ignored in OnDidCommitProvisionalLoad.
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
3266 // There is no pending NavigationEntry in these cases, so pass 0 as the 3285 // There is no pending NavigationEntry in these cases, so pass 0 as the
3267 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3286 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3268 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3287 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3269 return NavigationHandleImpl::Create( 3288 return NavigationHandleImpl::Create(
3270 params.url, frame_tree_node_, is_renderer_initiated, 3289 params.url, frame_tree_node_, is_renderer_initiated,
3271 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), 3290 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(),
3272 entry_id_for_data_nav, false); // started_from_context_menu 3291 entry_id_for_data_nav, false); // started_from_context_menu
3273 } 3292 }
3274 3293
3275 } // namespace content 3294 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698