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

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

Issue 7157001: Implements AudioMessageFilter as member in RenderThread (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Fixed nits in AudioRenderImpl unit test Created 9 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "content/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 webkit_glue::kForegroundTabTimerInterval); 395 webkit_glue::kForegroundTabTimerInterval);
396 396
397 OnSetRendererPrefs(renderer_prefs); 397 OnSetRendererPrefs(renderer_prefs);
398 398
399 host_window_ = parent_hwnd; 399 host_window_ = parent_hwnd;
400 400
401 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 401 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
402 if (command_line.HasSwitch(switches::kEnableAccessibility)) 402 if (command_line.HasSwitch(switches::kEnableAccessibility))
403 WebAccessibilityCache::enableAccessibility(); 403 WebAccessibilityCache::enableAccessibility();
404 404
405 audio_message_filter_ = new AudioMessageFilter(routing_id_);
406 render_thread_->AddFilter(audio_message_filter_);
407
408 #if defined(ENABLE_P2P_APIS) 405 #if defined(ENABLE_P2P_APIS)
409 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableP2PApi)) 406 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableP2PApi))
410 p2p_socket_dispatcher_ = new P2PSocketDispatcher(this); 407 p2p_socket_dispatcher_ = new P2PSocketDispatcher(this);
411 #endif 408 #endif
412 409
413 content::GetContentClient()->renderer()->RenderViewCreated(this); 410 content::GetContentClient()->renderer()->RenderViewCreated(this);
414 } 411 }
415 412
416 RenderView::~RenderView() { 413 RenderView::~RenderView() {
417 if (decrement_shared_popup_at_destruction_) 414 if (decrement_shared_popup_at_destruction_)
(...skipping 11 matching lines...) Expand all
429 #if defined(OS_MACOSX) 426 #if defined(OS_MACOSX)
430 // Destroy all fake plugin window handles on the browser side. 427 // Destroy all fake plugin window handles on the browser side.
431 while (!fake_plugin_window_handles_.empty()) { 428 while (!fake_plugin_window_handles_.empty()) {
432 // Make sure no NULL plugin window handles were inserted into this list. 429 // Make sure no NULL plugin window handles were inserted into this list.
433 DCHECK(*fake_plugin_window_handles_.begin()); 430 DCHECK(*fake_plugin_window_handles_.begin());
434 // DestroyFakePluginWindowHandle modifies fake_plugin_window_handles_. 431 // DestroyFakePluginWindowHandle modifies fake_plugin_window_handles_.
435 DestroyFakePluginWindowHandle(*fake_plugin_window_handles_.begin()); 432 DestroyFakePluginWindowHandle(*fake_plugin_window_handles_.begin());
436 } 433 }
437 #endif 434 #endif
438 435
439 render_thread_->RemoveFilter(audio_message_filter_);
440
441 #ifndef NDEBUG 436 #ifndef NDEBUG
442 // Make sure we are no longer referenced by the ViewMap. 437 // Make sure we are no longer referenced by the ViewMap.
443 ViewMap* views = g_view_map.Pointer(); 438 ViewMap* views = g_view_map.Pointer();
444 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) 439 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it)
445 DCHECK_NE(this, it->second) << "Failed to call Close?"; 440 DCHECK_NE(this, it->second) << "Failed to call Close?";
446 #endif 441 #endif
447 442
448 FOR_EACH_OBSERVER(RenderViewObserver, observers_, set_render_view(NULL)); 443 FOR_EACH_OBSERVER(RenderViewObserver, observers_, set_render_view(NULL));
449 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct()); 444 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct());
450 } 445 }
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 return WebStorageNamespace::createSessionStorageNamespace(quota); 1339 return WebStorageNamespace::createSessionStorageNamespace(quota);
1345 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); 1340 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId);
1346 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION, 1341 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION,
1347 session_storage_namespace_id_); 1342 session_storage_namespace_id_);
1348 } 1343 }
1349 1344
1350 void RenderView::didAddMessageToConsole( 1345 void RenderView::didAddMessageToConsole(
1351 const WebConsoleMessage& message, const WebString& source_name, 1346 const WebConsoleMessage& message, const WebString& source_name,
1352 unsigned source_line) { 1347 unsigned source_line) {
1353 logging::LogSeverity log_severity = logging::LOG_VERBOSE; 1348 logging::LogSeverity log_severity = logging::LOG_VERBOSE;
1354 switch(message.level) { 1349 switch (message.level) {
1355 case WebConsoleMessage::LevelTip: 1350 case WebConsoleMessage::LevelTip:
1356 log_severity = logging::LOG_VERBOSE; 1351 log_severity = logging::LOG_VERBOSE;
1357 break; 1352 break;
1358 case WebConsoleMessage::LevelLog: 1353 case WebConsoleMessage::LevelLog:
1359 log_severity = logging::LOG_INFO; 1354 log_severity = logging::LOG_INFO;
1360 break; 1355 break;
1361 case WebConsoleMessage::LevelWarning: 1356 case WebConsoleMessage::LevelWarning:
1362 log_severity = logging::LOG_WARNING; 1357 log_severity = logging::LOG_WARNING;
1363 break; 1358 break;
1364 case WebConsoleMessage::LevelError: 1359 case WebConsoleMessage::LevelError:
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 1877
1883 scoped_ptr<media::MessageLoopFactory> message_loop_factory( 1878 scoped_ptr<media::MessageLoopFactory> message_loop_factory(
1884 new media::MessageLoopFactoryImpl()); 1879 new media::MessageLoopFactoryImpl());
1885 scoped_ptr<media::FilterCollection> collection( 1880 scoped_ptr<media::FilterCollection> collection(
1886 new media::FilterCollection()); 1881 new media::FilterCollection());
1887 1882
1888 // Add in any custom filter factories first. 1883 // Add in any custom filter factories first.
1889 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 1884 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
1890 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { 1885 if (!cmd_line->HasSwitch(switches::kDisableAudio)) {
1891 // Add the chrome specific audio renderer. 1886 // Add the chrome specific audio renderer.
1892 collection->AddAudioRenderer(new AudioRendererImpl(audio_message_filter())); 1887 collection->AddAudioRenderer(new AudioRendererImpl());
1893 } 1888 }
1894 1889
1895 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; 1890 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer;
1896 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); 1891 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging);
1897 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( 1892 scoped_refptr<webkit_glue::VideoRendererImpl> renderer(
1898 new webkit_glue::VideoRendererImpl(pts_logging)); 1893 new webkit_glue::VideoRendererImpl(pts_logging));
1899 collection->AddVideoRenderer(renderer); 1894 collection->AddVideoRenderer(renderer);
1900 video_renderer = renderer; 1895 video_renderer = renderer;
1901 1896
1902 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( 1897 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result(
(...skipping 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after
4263 const webkit_glue::CustomContextMenuContext& custom_context) { 4258 const webkit_glue::CustomContextMenuContext& custom_context) {
4264 if (custom_context.is_pepper_menu) 4259 if (custom_context.is_pepper_menu)
4265 pepper_delegate_.OnContextMenuClosed(custom_context); 4260 pepper_delegate_.OnContextMenuClosed(custom_context);
4266 else 4261 else
4267 context_menu_node_.reset(); 4262 context_menu_node_.reset();
4268 } 4263 }
4269 4264
4270 void RenderView::OnNetworkStateChanged(bool online) { 4265 void RenderView::OnNetworkStateChanged(bool online) {
4271 WebNetworkStateNotifier::setOnLine(online); 4266 WebNetworkStateNotifier::setOnLine(online);
4272 } 4267 }
OLDNEW
« no previous file with comments | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698