OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); | 2412 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); |
2413 | 2413 |
2414 WebMediaPlayer* player = CreateWebMediaPlayerForMediaStream(frame, url, | 2414 WebMediaPlayer* player = CreateWebMediaPlayerForMediaStream(frame, url, |
2415 client); | 2415 client); |
2416 if (player) | 2416 if (player) |
2417 return player; | 2417 return player; |
2418 | 2418 |
2419 #if defined(OS_ANDROID) | 2419 #if defined(OS_ANDROID) |
2420 return CreateAndroidWebMediaPlayer(frame, url, client); | 2420 return CreateAndroidWebMediaPlayer(frame, url, client); |
2421 #else | 2421 #else |
2422 scoped_refptr<media::AudioRendererSink> sink; | |
2423 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableAudio)) { | |
2424 sink = RenderThreadImpl::current()->GetAudioRendererMixerManager()-> | |
2425 CreateInput(routing_id_, render_frame->GetRoutingID()); | |
2426 DVLOG(1) << "Using AudioRendererMixerManager-provided sink: " << sink.get(); | |
2427 } | |
2428 | |
2429 WebMediaPlayerParams params( | 2422 WebMediaPlayerParams params( |
2430 base::Bind(&ContentRendererClient::DeferMediaLoad, | 2423 base::Bind(&ContentRendererClient::DeferMediaLoad, |
2431 base::Unretained(GetContentClient()->renderer()), | 2424 base::Unretained(GetContentClient()->renderer()), |
2432 static_cast<RenderFrame*>(render_frame)), | 2425 static_cast<RenderFrame*>(render_frame)), |
2433 sink); | 2426 RenderThreadImpl::current()->GetAudioRendererMixerManager()->CreateInput( |
| 2427 routing_id_, render_frame->GetRoutingID())); |
2434 return new WebMediaPlayerImpl(frame, client, AsWeakPtr(), params); | 2428 return new WebMediaPlayerImpl(frame, client, AsWeakPtr(), params); |
2435 #endif // defined(OS_ANDROID) | 2429 #endif // defined(OS_ANDROID) |
2436 } | 2430 } |
2437 | 2431 |
2438 void RenderViewImpl::didAccessInitialDocument(WebFrame* frame) { | 2432 void RenderViewImpl::didAccessInitialDocument(WebFrame* frame) { |
2439 // Notify the browser process that it is no longer safe to show the pending | 2433 // Notify the browser process that it is no longer safe to show the pending |
2440 // URL of the main frame, since a URL spoof is now possible. | 2434 // URL of the main frame, since a URL spoof is now possible. |
2441 if (!frame->parent() && page_id_ == -1) | 2435 if (!frame->parent() && page_id_ == -1) |
2442 Send(new ViewHostMsg_DidAccessInitialDocument(routing_id_)); | 2436 Send(new ViewHostMsg_DidAccessInitialDocument(routing_id_)); |
2443 } | 2437 } |
(...skipping 2779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5223 for (size_t i = 0; i < icon_urls.size(); i++) { | 5217 for (size_t i = 0; i < icon_urls.size(); i++) { |
5224 WebURL url = icon_urls[i].iconURL(); | 5218 WebURL url = icon_urls[i].iconURL(); |
5225 if (!url.isEmpty()) | 5219 if (!url.isEmpty()) |
5226 urls.push_back(FaviconURL(url, | 5220 urls.push_back(FaviconURL(url, |
5227 ToFaviconType(icon_urls[i].iconType()))); | 5221 ToFaviconType(icon_urls[i].iconType()))); |
5228 } | 5222 } |
5229 SendUpdateFaviconURL(urls); | 5223 SendUpdateFaviconURL(urls); |
5230 } | 5224 } |
5231 | 5225 |
5232 } // namespace content | 5226 } // namespace content |
OLD | NEW |