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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
430 pending_commit_(false), | 430 pending_commit_(false), |
431 nav_entry_id_(0), | 431 nav_entry_id_(0), |
432 accessibility_reset_token_(0), | 432 accessibility_reset_token_(0), |
433 accessibility_reset_count_(0), | 433 accessibility_reset_count_(0), |
434 browser_plugin_embedder_ax_tree_id_(ui::AXTreeIDRegistry::kNoAXTreeID), | 434 browser_plugin_embedder_ax_tree_id_(ui::AXTreeIDRegistry::kNoAXTreeID), |
435 no_create_browser_accessibility_manager_for_testing_(false), | 435 no_create_browser_accessibility_manager_for_testing_(false), |
436 web_ui_type_(WebUI::kNoWebUI), | 436 web_ui_type_(WebUI::kNoWebUI), |
437 pending_web_ui_type_(WebUI::kNoWebUI), | 437 pending_web_ui_type_(WebUI::kNoWebUI), |
438 should_reuse_web_ui_(false), | 438 should_reuse_web_ui_(false), |
439 has_selection_(false), | 439 has_selection_(false), |
440 is_audible_(false), | |
440 last_navigation_previews_state_(PREVIEWS_UNSPECIFIED), | 441 last_navigation_previews_state_(PREVIEWS_UNSPECIFIED), |
441 frame_host_interface_broker_binding_(this), | 442 frame_host_interface_broker_binding_(this), |
442 frame_host_associated_binding_(this), | 443 frame_host_associated_binding_(this), |
443 waiting_for_init_(renderer_initiated_creation), | 444 waiting_for_init_(renderer_initiated_creation), |
444 has_focused_editable_element_(false), | 445 has_focused_editable_element_(false), |
445 weak_ptr_factory_(this) { | 446 weak_ptr_factory_(this) { |
446 frame_tree_->AddRenderViewHostRef(render_view_host_); | 447 frame_tree_->AddRenderViewHostRef(render_view_host_); |
447 GetProcess()->AddRoute(routing_id_, this); | 448 GetProcess()->AddRoute(routing_id_, this); |
448 g_routing_id_frame_map.Get().insert(std::make_pair( | 449 g_routing_id_frame_map.Get().insert(std::make_pair( |
449 RenderFrameHostID(GetProcess()->GetID(), routing_id_), | 450 RenderFrameHostID(GetProcess()->GetID(), routing_id_), |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
988 ResetLoadingState(); | 989 ResetLoadingState(); |
989 | 990 |
990 // The renderer process is gone, so the |stream_handle_| will no longer be | 991 // The renderer process is gone, so the |stream_handle_| will no longer be |
991 // used. It can be released. | 992 // used. It can be released. |
992 // TODO(clamy): Remove this when we switch to Mojo streams. | 993 // TODO(clamy): Remove this when we switch to Mojo streams. |
993 stream_handle_.reset(); | 994 stream_handle_.reset(); |
994 | 995 |
995 // Any future UpdateState or UpdateTitle messages from this or a recreated | 996 // Any future UpdateState or UpdateTitle messages from this or a recreated |
996 // process should be ignored until the next commit. | 997 // process should be ignored until the next commit. |
997 set_nav_entry_id(0); | 998 set_nav_entry_id(0); |
999 | |
1000 if (is_audible_) | |
1001 GetProcess()->OnAudioStreamRemoved(); | |
998 } | 1002 } |
999 | 1003 |
1000 void RenderFrameHostImpl::ReportContentSecurityPolicyViolation( | 1004 void RenderFrameHostImpl::ReportContentSecurityPolicyViolation( |
1001 const CSPViolationParams& violation_params) { | 1005 const CSPViolationParams& violation_params) { |
1002 Send(new FrameMsg_ReportContentSecurityPolicyViolation(routing_id_, | 1006 Send(new FrameMsg_ReportContentSecurityPolicyViolation(routing_id_, |
1003 violation_params)); | 1007 violation_params)); |
1004 } | 1008 } |
1005 | 1009 |
1006 void RenderFrameHostImpl::SanitizeDataForUseInCspViolation( | 1010 void RenderFrameHostImpl::SanitizeDataForUseInCspViolation( |
1007 bool is_redirect, | 1011 bool is_redirect, |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1175 | 1179 |
1176 waiting_for_init_ = false; | 1180 waiting_for_init_ = false; |
1177 if (pendinging_navigate_) { | 1181 if (pendinging_navigate_) { |
1178 frame_tree_node()->navigator()->OnBeginNavigation( | 1182 frame_tree_node()->navigator()->OnBeginNavigation( |
1179 frame_tree_node(), pendinging_navigate_->first, | 1183 frame_tree_node(), pendinging_navigate_->first, |
1180 pendinging_navigate_->second); | 1184 pendinging_navigate_->second); |
1181 pendinging_navigate_.reset(); | 1185 pendinging_navigate_.reset(); |
1182 } | 1186 } |
1183 } | 1187 } |
1184 | 1188 |
1189 void RenderFrameHostImpl::OnAudioStateChanged(bool is_audible) { | |
1190 if (is_audible_ == is_audible) | |
1191 return; | |
1192 if (is_audible) | |
1193 GetProcess()->OnAudioStreamAdded(); | |
miu
2017/06/26 22:57:59
The OnAudioStreamAdded/Removed() methods need to b
lpy
2017/06/28 02:14:29
I will leave it to separate patches.
| |
1194 else | |
1195 GetProcess()->OnAudioStreamRemoved(); | |
1196 is_audible_ = is_audible; | |
1197 } | |
1198 | |
1185 void RenderFrameHostImpl::OnDidAddMessageToConsole( | 1199 void RenderFrameHostImpl::OnDidAddMessageToConsole( |
1186 int32_t level, | 1200 int32_t level, |
1187 const base::string16& message, | 1201 const base::string16& message, |
1188 int32_t line_no, | 1202 int32_t line_no, |
1189 const base::string16& source_id) { | 1203 const base::string16& source_id) { |
1190 if (level < logging::LOG_VERBOSE || level > logging::LOG_FATAL) { | 1204 if (level < logging::LOG_VERBOSE || level > logging::LOG_FATAL) { |
1191 bad_message::ReceivedBadMessage( | 1205 bad_message::ReceivedBadMessage( |
1192 GetProcess(), bad_message::RFH_DID_ADD_CONSOLE_MESSAGE_BAD_SEVERITY); | 1206 GetProcess(), bad_message::RFH_DID_ADD_CONSOLE_MESSAGE_BAD_SEVERITY); |
1193 return; | 1207 return; |
1194 } | 1208 } |
(...skipping 2921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4116 } | 4130 } |
4117 | 4131 |
4118 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( | 4132 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( |
4119 const std::string& interface_name, | 4133 const std::string& interface_name, |
4120 mojo::ScopedMessagePipeHandle pipe) { | 4134 mojo::ScopedMessagePipeHandle pipe) { |
4121 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); | 4135 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); |
4122 } | 4136 } |
4123 #endif | 4137 #endif |
4124 | 4138 |
4125 } // namespace content | 4139 } // namespace content |
OLD | NEW |