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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2821203005: Add a mojo implementation of AudioOutputIPC. (Closed)
Patch Set: Fix test issues 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 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "content/common/clipboard_messages.h" 56 #include "content/common/clipboard_messages.h"
57 #include "content/common/content_constants_internal.h" 57 #include "content/common/content_constants_internal.h"
58 #include "content/common/content_security_policy/csp_context.h" 58 #include "content/common/content_security_policy/csp_context.h"
59 #include "content/common/content_security_policy_header.h" 59 #include "content/common/content_security_policy_header.h"
60 #include "content/common/download/mhtml_save_status.h" 60 #include "content/common/download/mhtml_save_status.h"
61 #include "content/common/edit_command.h" 61 #include "content/common/edit_command.h"
62 #include "content/common/frame_messages.h" 62 #include "content/common/frame_messages.h"
63 #include "content/common/frame_owner_properties.h" 63 #include "content/common/frame_owner_properties.h"
64 #include "content/common/frame_replication_state.h" 64 #include "content/common/frame_replication_state.h"
65 #include "content/common/input_messages.h" 65 #include "content/common/input_messages.h"
66 #include "content/common/media/renderer_audio_output_stream_factory.mojom.h"
66 #include "content/common/navigation_params.h" 67 #include "content/common/navigation_params.h"
67 #include "content/common/page_messages.h" 68 #include "content/common/page_messages.h"
68 #include "content/common/savable_subframe.h" 69 #include "content/common/savable_subframe.h"
69 #include "content/common/service_worker/service_worker_types.h" 70 #include "content/common/service_worker/service_worker_types.h"
70 #include "content/common/site_isolation_policy.h" 71 #include "content/common/site_isolation_policy.h"
71 #include "content/common/swapped_out_messages.h" 72 #include "content/common/swapped_out_messages.h"
72 #include "content/common/view_messages.h" 73 #include "content/common/view_messages.h"
73 #include "content/common/worker_url_loader_factory_provider.mojom.h" 74 #include "content/common/worker_url_loader_factory_provider.mojom.h"
74 #include "content/public/common/appcache_info.h" 75 #include "content/public/common/appcache_info.h"
75 #include "content/public/common/associated_interface_provider.h" 76 #include "content/public/common/associated_interface_provider.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 #include "content/renderer/gpu/gpu_benchmarking_extension.h" 110 #include "content/renderer/gpu/gpu_benchmarking_extension.h"
110 #include "content/renderer/history_entry.h" 111 #include "content/renderer/history_entry.h"
111 #include "content/renderer/history_serialization.h" 112 #include "content/renderer/history_serialization.h"
112 #include "content/renderer/image_downloader/image_downloader_impl.h" 113 #include "content/renderer/image_downloader/image_downloader_impl.h"
113 #include "content/renderer/ime_event_guard.h" 114 #include "content/renderer/ime_event_guard.h"
114 #include "content/renderer/input/input_handler_manager.h" 115 #include "content/renderer/input/input_handler_manager.h"
115 #include "content/renderer/installedapp/related_apps_fetcher.h" 116 #include "content/renderer/installedapp/related_apps_fetcher.h"
116 #include "content/renderer/internal_document_state_data.h" 117 #include "content/renderer/internal_document_state_data.h"
117 #include "content/renderer/manifest/manifest_manager.h" 118 #include "content/renderer/manifest/manifest_manager.h"
118 #include "content/renderer/media/audio_device_factory.h" 119 #include "content/renderer/media/audio_device_factory.h"
120 #include "content/renderer/media/audio_ipc_factory.h"
119 #include "content/renderer/media/media_devices_listener_impl.h" 121 #include "content/renderer/media/media_devices_listener_impl.h"
120 #include "content/renderer/media/media_permission_dispatcher.h" 122 #include "content/renderer/media/media_permission_dispatcher.h"
121 #include "content/renderer/media/media_stream_dispatcher.h" 123 #include "content/renderer/media/media_stream_dispatcher.h"
122 #include "content/renderer/media/media_stream_renderer_factory_impl.h" 124 #include "content/renderer/media/media_stream_renderer_factory_impl.h"
123 #include "content/renderer/media/render_media_log.h" 125 #include "content/renderer/media/render_media_log.h"
124 #include "content/renderer/media/renderer_webmediaplayer_delegate.h" 126 #include "content/renderer/media/renderer_webmediaplayer_delegate.h"
125 #include "content/renderer/media/user_media_client_impl.h" 127 #include "content/renderer/media/user_media_client_impl.h"
126 #include "content/renderer/media/web_media_element_source_utils.h" 128 #include "content/renderer/media/web_media_element_source_utils.h"
127 #include "content/renderer/media/webmediaplayer_ms.h" 129 #include "content/renderer/media/webmediaplayer_ms.h"
128 #include "content/renderer/mojo/blink_connector_js_wrapper.h" 130 #include "content/renderer/mojo/blink_connector_js_wrapper.h"
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 1222
1221 base::trace_event::TraceLog::GetInstance()->RemoveProcessLabel(routing_id_); 1223 base::trace_event::TraceLog::GetInstance()->RemoveProcessLabel(routing_id_);
1222 1224
1223 // Unregister from InputHandlerManager. render_thread may be NULL in tests. 1225 // Unregister from InputHandlerManager. render_thread may be NULL in tests.
1224 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 1226 RenderThreadImpl* render_thread = RenderThreadImpl::current();
1225 InputHandlerManager* input_handler_manager = 1227 InputHandlerManager* input_handler_manager =
1226 render_thread ? render_thread->input_handler_manager() : nullptr; 1228 render_thread ? render_thread->input_handler_manager() : nullptr;
1227 if (input_handler_manager) 1229 if (input_handler_manager)
1228 input_handler_manager->UnregisterRoutingID(GetRoutingID()); 1230 input_handler_manager->UnregisterRoutingID(GetRoutingID());
1229 1231
1232 if (AudioIPCFactory::get())
1233 AudioIPCFactory::get()->MaybeDeregisterRemoteFactory(GetRoutingID());
o1ka 2017/05/11 10:58:41 Wrap it into a static method?
Max Morin 2017/05/11 15:31:18 I feel like this code is consistent with the code
o1ka 2017/05/15 13:27:08 Why would you need consistency here? This is "Mayb
1234
1230 if (is_main_frame_) { 1235 if (is_main_frame_) {
1231 // Ensure the RenderView doesn't point to this object, once it is destroyed. 1236 // Ensure the RenderView doesn't point to this object, once it is destroyed.
1232 // TODO(nasko): Add a check that the |main_render_frame_| of |render_view_| 1237 // TODO(nasko): Add a check that the |main_render_frame_| of |render_view_|
1233 // is |this|, once the object is no longer leaked. 1238 // is |this|, once the object is no longer leaked.
1234 // See https://crbug.com/464764. 1239 // See https://crbug.com/464764.
1235 render_view_->main_render_frame_ = nullptr; 1240 render_view_->main_render_frame_ = nullptr;
1236 } 1241 }
1237 1242
1238 render_view_->UnregisterRenderFrame(this); 1243 render_view_->UnregisterRenderFrame(this);
1239 g_routing_id_frame_map.Get().erase(routing_id_); 1244 g_routing_id_frame_map.Get().erase(routing_id_);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 1298 RenderThreadImpl* render_thread = RenderThreadImpl::current();
1294 // render_thread may be NULL in tests. 1299 // render_thread may be NULL in tests.
1295 InputHandlerManager* input_handler_manager = 1300 InputHandlerManager* input_handler_manager =
1296 render_thread ? render_thread->input_handler_manager() : nullptr; 1301 render_thread ? render_thread->input_handler_manager() : nullptr;
1297 if (input_handler_manager) { 1302 if (input_handler_manager) {
1298 DCHECK(render_view_->HasAddedInputHandler()); 1303 DCHECK(render_view_->HasAddedInputHandler());
1299 input_handler_manager->RegisterAssociatedRenderFrameRoutingID( 1304 input_handler_manager->RegisterAssociatedRenderFrameRoutingID(
1300 GetRoutingID(), render_view_->GetRoutingID()); 1305 GetRoutingID(), render_view_->GetRoutingID());
1301 } 1306 }
1302 1307
1308 // AudioIPCFactory may be null in tests.
1309 if (AudioIPCFactory::get() && AudioIPCFactory::get()->UsingMojoFactories()) {
1310 mojom::RendererAudioOutputStreamFactoryPtr factory_ptr;
1311 GetRemoteInterfaces()->GetInterface(&factory_ptr);
1312 AudioIPCFactory::get()->RegisterRemoteFactory(GetRoutingID(),
o1ka 2017/05/11 10:58:41 It looks like a static MaybeRegisterRemoteFactorie
Max Morin 2017/05/11 15:31:18 I moved some logic into AudioIPCFactory, but still
1313 std::move(factory_ptr));
1314 }
1315
1303 const base::CommandLine& command_line = 1316 const base::CommandLine& command_line =
1304 *base::CommandLine::ForCurrentProcess(); 1317 *base::CommandLine::ForCurrentProcess();
1305 if (command_line.HasSwitch(switches::kDomAutomationController)) 1318 if (command_line.HasSwitch(switches::kDomAutomationController))
1306 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; 1319 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION;
1307 if (command_line.HasSwitch(switches::kStatsCollectionController)) 1320 if (command_line.HasSwitch(switches::kStatsCollectionController))
1308 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; 1321 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION;
1309 } 1322 }
1310 1323
1311 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { 1324 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) {
1312 DCHECK(!blame_context_); 1325 DCHECK(!blame_context_);
(...skipping 5791 matching lines...) Expand 10 before | Expand all | Expand 10 after
7104 policy(info.default_policy), 7117 policy(info.default_policy),
7105 replaces_current_history_item(info.replaces_current_history_item), 7118 replaces_current_history_item(info.replaces_current_history_item),
7106 history_navigation_in_new_child_frame( 7119 history_navigation_in_new_child_frame(
7107 info.is_history_navigation_in_new_child_frame), 7120 info.is_history_navigation_in_new_child_frame),
7108 client_redirect(info.is_client_redirect), 7121 client_redirect(info.is_client_redirect),
7109 cache_disabled(info.is_cache_disabled), 7122 cache_disabled(info.is_cache_disabled),
7110 form(info.form), 7123 form(info.form),
7111 source_location(info.source_location) {} 7124 source_location(info.source_location) {}
7112 7125
7113 } // namespace content 7126 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698