Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 #include "content/common/clipboard_messages.h" | 55 #include "content/common/clipboard_messages.h" |
| 56 #include "content/common/content_constants_internal.h" | 56 #include "content/common/content_constants_internal.h" |
| 57 #include "content/common/content_security_policy/csp_context.h" | 57 #include "content/common/content_security_policy/csp_context.h" |
| 58 #include "content/common/content_security_policy_header.h" | 58 #include "content/common/content_security_policy_header.h" |
| 59 #include "content/common/download/mhtml_save_status.h" | 59 #include "content/common/download/mhtml_save_status.h" |
| 60 #include "content/common/edit_command.h" | 60 #include "content/common/edit_command.h" |
| 61 #include "content/common/frame_messages.h" | 61 #include "content/common/frame_messages.h" |
| 62 #include "content/common/frame_owner_properties.h" | 62 #include "content/common/frame_owner_properties.h" |
| 63 #include "content/common/frame_replication_state.h" | 63 #include "content/common/frame_replication_state.h" |
| 64 #include "content/common/input_messages.h" | 64 #include "content/common/input_messages.h" |
| 65 #include "content/common/media/renderer_audio_output_stream_factory.mojom.h" | |
| 65 #include "content/common/navigation_params.h" | 66 #include "content/common/navigation_params.h" |
| 66 #include "content/common/page_messages.h" | 67 #include "content/common/page_messages.h" |
| 67 #include "content/common/savable_subframe.h" | 68 #include "content/common/savable_subframe.h" |
| 68 #include "content/common/service_worker/service_worker_types.h" | 69 #include "content/common/service_worker/service_worker_types.h" |
| 69 #include "content/common/site_isolation_policy.h" | 70 #include "content/common/site_isolation_policy.h" |
| 70 #include "content/common/swapped_out_messages.h" | 71 #include "content/common/swapped_out_messages.h" |
| 71 #include "content/common/view_messages.h" | 72 #include "content/common/view_messages.h" |
| 72 #include "content/public/common/appcache_info.h" | 73 #include "content/public/common/appcache_info.h" |
| 73 #include "content/public/common/associated_interface_provider.h" | 74 #include "content/public/common/associated_interface_provider.h" |
| 74 #include "content/public/common/bindings_policy.h" | 75 #include "content/public/common/bindings_policy.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 #include "content/renderer/gpu/gpu_benchmarking_extension.h" | 108 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
| 108 #include "content/renderer/history_entry.h" | 109 #include "content/renderer/history_entry.h" |
| 109 #include "content/renderer/history_serialization.h" | 110 #include "content/renderer/history_serialization.h" |
| 110 #include "content/renderer/image_downloader/image_downloader_impl.h" | 111 #include "content/renderer/image_downloader/image_downloader_impl.h" |
| 111 #include "content/renderer/ime_event_guard.h" | 112 #include "content/renderer/ime_event_guard.h" |
| 112 #include "content/renderer/input/input_handler_manager.h" | 113 #include "content/renderer/input/input_handler_manager.h" |
| 113 #include "content/renderer/installedapp/related_apps_fetcher.h" | 114 #include "content/renderer/installedapp/related_apps_fetcher.h" |
| 114 #include "content/renderer/internal_document_state_data.h" | 115 #include "content/renderer/internal_document_state_data.h" |
| 115 #include "content/renderer/manifest/manifest_manager.h" | 116 #include "content/renderer/manifest/manifest_manager.h" |
| 116 #include "content/renderer/media/audio_device_factory.h" | 117 #include "content/renderer/media/audio_device_factory.h" |
| 118 #include "content/renderer/media/audio_ipc_factory.h" | |
| 117 #include "content/renderer/media/media_devices_listener_impl.h" | 119 #include "content/renderer/media/media_devices_listener_impl.h" |
| 118 #include "content/renderer/media/media_permission_dispatcher.h" | 120 #include "content/renderer/media/media_permission_dispatcher.h" |
| 119 #include "content/renderer/media/media_stream_dispatcher.h" | 121 #include "content/renderer/media/media_stream_dispatcher.h" |
| 120 #include "content/renderer/media/media_stream_renderer_factory_impl.h" | 122 #include "content/renderer/media/media_stream_renderer_factory_impl.h" |
| 121 #include "content/renderer/media/render_media_log.h" | 123 #include "content/renderer/media/render_media_log.h" |
| 122 #include "content/renderer/media/renderer_webmediaplayer_delegate.h" | 124 #include "content/renderer/media/renderer_webmediaplayer_delegate.h" |
| 123 #include "content/renderer/media/user_media_client_impl.h" | 125 #include "content/renderer/media/user_media_client_impl.h" |
| 124 #include "content/renderer/media/web_media_element_source_utils.h" | 126 #include "content/renderer/media/web_media_element_source_utils.h" |
| 125 #include "content/renderer/media/webmediaplayer_ms.h" | 127 #include "content/renderer/media/webmediaplayer_ms.h" |
| 126 #include "content/renderer/mojo/blink_connector_js_wrapper.h" | 128 #include "content/renderer/mojo/blink_connector_js_wrapper.h" |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1213 | 1215 |
| 1214 base::trace_event::TraceLog::GetInstance()->RemoveProcessLabel(routing_id_); | 1216 base::trace_event::TraceLog::GetInstance()->RemoveProcessLabel(routing_id_); |
| 1215 | 1217 |
| 1216 // Unregister from InputHandlerManager. render_thread may be NULL in tests. | 1218 // Unregister from InputHandlerManager. render_thread may be NULL in tests. |
| 1217 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 1219 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 1218 InputHandlerManager* input_handler_manager = | 1220 InputHandlerManager* input_handler_manager = |
| 1219 render_thread ? render_thread->input_handler_manager() : nullptr; | 1221 render_thread ? render_thread->input_handler_manager() : nullptr; |
| 1220 if (input_handler_manager) | 1222 if (input_handler_manager) |
| 1221 input_handler_manager->UnregisterRoutingID(GetRoutingID()); | 1223 input_handler_manager->UnregisterRoutingID(GetRoutingID()); |
| 1222 | 1224 |
| 1225 if (base::FeatureList::IsEnabled( | |
|
o1ka
2017/04/20 10:36:00
Hide register/deregister logic in static methods o
Max Morin
2017/05/05 13:10:59
Done.
| |
| 1226 features::kUseMojoAudioOutputStreamFactory) && | |
| 1227 render_thread) { | |
| 1228 AudioIPCFactory::get()->DeregisterRemoteFactory(GetRoutingID()); | |
| 1229 } | |
| 1230 | |
| 1223 if (is_main_frame_) { | 1231 if (is_main_frame_) { |
| 1224 // Ensure the RenderView doesn't point to this object, once it is destroyed. | 1232 // Ensure the RenderView doesn't point to this object, once it is destroyed. |
| 1225 // TODO(nasko): Add a check that the |main_render_frame_| of |render_view_| | 1233 // TODO(nasko): Add a check that the |main_render_frame_| of |render_view_| |
| 1226 // is |this|, once the object is no longer leaked. | 1234 // is |this|, once the object is no longer leaked. |
| 1227 // See https://crbug.com/464764. | 1235 // See https://crbug.com/464764. |
| 1228 render_view_->main_render_frame_ = nullptr; | 1236 render_view_->main_render_frame_ = nullptr; |
| 1229 } | 1237 } |
| 1230 | 1238 |
| 1231 render_view_->UnregisterRenderFrame(this); | 1239 render_view_->UnregisterRenderFrame(this); |
| 1232 g_routing_id_frame_map.Get().erase(routing_id_); | 1240 g_routing_id_frame_map.Get().erase(routing_id_); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1286 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 1294 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 1287 // render_thread may be NULL in tests. | 1295 // render_thread may be NULL in tests. |
| 1288 InputHandlerManager* input_handler_manager = | 1296 InputHandlerManager* input_handler_manager = |
| 1289 render_thread ? render_thread->input_handler_manager() : nullptr; | 1297 render_thread ? render_thread->input_handler_manager() : nullptr; |
| 1290 if (input_handler_manager) { | 1298 if (input_handler_manager) { |
| 1291 DCHECK(render_view_->HasAddedInputHandler()); | 1299 DCHECK(render_view_->HasAddedInputHandler()); |
| 1292 input_handler_manager->RegisterAssociatedRenderFrameRoutingID( | 1300 input_handler_manager->RegisterAssociatedRenderFrameRoutingID( |
| 1293 GetRoutingID(), render_view_->GetRoutingID()); | 1301 GetRoutingID(), render_view_->GetRoutingID()); |
| 1294 } | 1302 } |
| 1295 | 1303 |
| 1304 if (base::FeatureList::IsEnabled( | |
| 1305 features::kUseMojoAudioOutputStreamFactory) && | |
| 1306 render_thread) { | |
| 1307 mojom::RendererAudioOutputStreamFactoryPtr factory_ptr; | |
| 1308 GetRemoteInterfaces()->GetInterface(&factory_ptr); | |
| 1309 AudioIPCFactory::get()->RegisterRemoteFactory(GetRoutingID(), | |
| 1310 std::move(factory_ptr)); | |
| 1311 } | |
| 1312 | |
| 1296 const base::CommandLine& command_line = | 1313 const base::CommandLine& command_line = |
| 1297 *base::CommandLine::ForCurrentProcess(); | 1314 *base::CommandLine::ForCurrentProcess(); |
| 1298 if (command_line.HasSwitch(switches::kDomAutomationController)) | 1315 if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 1299 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; | 1316 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; |
| 1300 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 1317 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| 1301 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; | 1318 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; |
| 1302 } | 1319 } |
| 1303 | 1320 |
| 1304 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { | 1321 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { |
| 1305 DCHECK(!blame_context_); | 1322 DCHECK(!blame_context_); |
| (...skipping 5676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6982 policy(info.default_policy), | 6999 policy(info.default_policy), |
| 6983 replaces_current_history_item(info.replaces_current_history_item), | 7000 replaces_current_history_item(info.replaces_current_history_item), |
| 6984 history_navigation_in_new_child_frame( | 7001 history_navigation_in_new_child_frame( |
| 6985 info.is_history_navigation_in_new_child_frame), | 7002 info.is_history_navigation_in_new_child_frame), |
| 6986 client_redirect(info.is_client_redirect), | 7003 client_redirect(info.is_client_redirect), |
| 6987 cache_disabled(info.is_cache_disabled), | 7004 cache_disabled(info.is_cache_disabled), |
| 6988 form(info.form), | 7005 form(info.form), |
| 6989 source_location(info.source_location) {} | 7006 source_location(info.source_location) {} |
| 6990 | 7007 |
| 6991 } // namespace content | 7008 } // namespace content |
| OLD | NEW |