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

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

Issue 2948613002: [AudioStreamMonitor] Adds API to collect frame-level audibility. (Closed)
Patch Set: Fix windows build Created 3 years, 5 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/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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 pending_commit_(false), 447 pending_commit_(false),
448 nav_entry_id_(0), 448 nav_entry_id_(0),
449 accessibility_reset_token_(0), 449 accessibility_reset_token_(0),
450 accessibility_reset_count_(0), 450 accessibility_reset_count_(0),
451 browser_plugin_embedder_ax_tree_id_(ui::AXTreeIDRegistry::kNoAXTreeID), 451 browser_plugin_embedder_ax_tree_id_(ui::AXTreeIDRegistry::kNoAXTreeID),
452 no_create_browser_accessibility_manager_for_testing_(false), 452 no_create_browser_accessibility_manager_for_testing_(false),
453 web_ui_type_(WebUI::kNoWebUI), 453 web_ui_type_(WebUI::kNoWebUI),
454 pending_web_ui_type_(WebUI::kNoWebUI), 454 pending_web_ui_type_(WebUI::kNoWebUI),
455 should_reuse_web_ui_(false), 455 should_reuse_web_ui_(false),
456 has_selection_(false), 456 has_selection_(false),
457 is_audible_(false),
457 last_navigation_previews_state_(PREVIEWS_UNSPECIFIED), 458 last_navigation_previews_state_(PREVIEWS_UNSPECIFIED),
458 frame_host_interface_broker_binding_(this), 459 frame_host_interface_broker_binding_(this),
459 frame_host_associated_binding_(this), 460 frame_host_associated_binding_(this),
460 waiting_for_init_(renderer_initiated_creation), 461 waiting_for_init_(renderer_initiated_creation),
461 has_focused_editable_element_(false), 462 has_focused_editable_element_(false),
462 weak_ptr_factory_(this) { 463 weak_ptr_factory_(this) {
463 frame_tree_->AddRenderViewHostRef(render_view_host_); 464 frame_tree_->AddRenderViewHostRef(render_view_host_);
464 GetProcess()->AddRoute(routing_id_, this); 465 GetProcess()->AddRoute(routing_id_, this);
465 g_routing_id_frame_map.Get().insert(std::make_pair( 466 g_routing_id_frame_map.Get().insert(std::make_pair(
466 RenderFrameHostID(GetProcess()->GetID(), routing_id_), 467 RenderFrameHostID(GetProcess()->GetID(), routing_id_),
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 ResetLoadingState(); 1006 ResetLoadingState();
1006 1007
1007 // The renderer process is gone, so the |stream_handle_| will no longer be 1008 // The renderer process is gone, so the |stream_handle_| will no longer be
1008 // used. It can be released. 1009 // used. It can be released.
1009 // TODO(clamy): Remove this when we switch to Mojo streams. 1010 // TODO(clamy): Remove this when we switch to Mojo streams.
1010 stream_handle_.reset(); 1011 stream_handle_.reset();
1011 1012
1012 // Any future UpdateState or UpdateTitle messages from this or a recreated 1013 // Any future UpdateState or UpdateTitle messages from this or a recreated
1013 // process should be ignored until the next commit. 1014 // process should be ignored until the next commit.
1014 set_nav_entry_id(0); 1015 set_nav_entry_id(0);
1016
1017 if (is_audible_)
1018 GetProcess()->OnAudioStreamRemoved();
1015 } 1019 }
1016 1020
1017 void RenderFrameHostImpl::ReportContentSecurityPolicyViolation( 1021 void RenderFrameHostImpl::ReportContentSecurityPolicyViolation(
1018 const CSPViolationParams& violation_params) { 1022 const CSPViolationParams& violation_params) {
1019 Send(new FrameMsg_ReportContentSecurityPolicyViolation(routing_id_, 1023 Send(new FrameMsg_ReportContentSecurityPolicyViolation(routing_id_,
1020 violation_params)); 1024 violation_params));
1021 } 1025 }
1022 1026
1023 void RenderFrameHostImpl::SanitizeDataForUseInCspViolation( 1027 void RenderFrameHostImpl::SanitizeDataForUseInCspViolation(
1024 bool is_redirect, 1028 bool is_redirect,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 1196
1193 waiting_for_init_ = false; 1197 waiting_for_init_ = false;
1194 if (pendinging_navigate_) { 1198 if (pendinging_navigate_) {
1195 frame_tree_node()->navigator()->OnBeginNavigation( 1199 frame_tree_node()->navigator()->OnBeginNavigation(
1196 frame_tree_node(), pendinging_navigate_->first, 1200 frame_tree_node(), pendinging_navigate_->first,
1197 pendinging_navigate_->second); 1201 pendinging_navigate_->second);
1198 pendinging_navigate_.reset(); 1202 pendinging_navigate_.reset();
1199 } 1203 }
1200 } 1204 }
1201 1205
1206 void RenderFrameHostImpl::OnAudibleStateChanged(bool is_audible) {
1207 if (is_audible_ == is_audible)
1208 return;
1209 if (is_audible)
1210 GetProcess()->OnAudioStreamAdded();
1211 else
1212 GetProcess()->OnAudioStreamRemoved();
1213 is_audible_ = is_audible;
1214 }
1215
1202 void RenderFrameHostImpl::OnDidAddMessageToConsole( 1216 void RenderFrameHostImpl::OnDidAddMessageToConsole(
1203 int32_t level, 1217 int32_t level,
1204 const base::string16& message, 1218 const base::string16& message,
1205 int32_t line_no, 1219 int32_t line_no,
1206 const base::string16& source_id) { 1220 const base::string16& source_id) {
1207 if (level < logging::LOG_VERBOSE || level > logging::LOG_FATAL) { 1221 if (level < logging::LOG_VERBOSE || level > logging::LOG_FATAL) {
1208 bad_message::ReceivedBadMessage( 1222 bad_message::ReceivedBadMessage(
1209 GetProcess(), bad_message::RFH_DID_ADD_CONSOLE_MESSAGE_BAD_SEVERITY); 1223 GetProcess(), bad_message::RFH_DID_ADD_CONSOLE_MESSAGE_BAD_SEVERITY);
1210 return; 1224 return;
1211 } 1225 }
(...skipping 2933 matching lines...) Expand 10 before | Expand all | Expand 10 after
4145 } 4159 }
4146 4160
4147 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( 4161 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame(
4148 const std::string& interface_name, 4162 const std::string& interface_name,
4149 mojo::ScopedMessagePipeHandle pipe) { 4163 mojo::ScopedMessagePipeHandle pipe) {
4150 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); 4164 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe));
4151 } 4165 }
4152 #endif 4166 #endif
4153 4167
4154 } // namespace content 4168 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/media/audio_stream_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698