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

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: Refactored major parts of the failing 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
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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 return WebStorageNamespace::createSessionStorageNamespace(quota); 1338 return WebStorageNamespace::createSessionStorageNamespace(quota);
1344 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); 1339 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId);
1345 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION, 1340 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION,
1346 session_storage_namespace_id_); 1341 session_storage_namespace_id_);
1347 } 1342 }
1348 1343
1349 void RenderView::didAddMessageToConsole( 1344 void RenderView::didAddMessageToConsole(
1350 const WebConsoleMessage& message, const WebString& source_name, 1345 const WebConsoleMessage& message, const WebString& source_name,
1351 unsigned source_line) { 1346 unsigned source_line) {
1352 logging::LogSeverity log_severity = logging::LOG_VERBOSE; 1347 logging::LogSeverity log_severity = logging::LOG_VERBOSE;
1353 switch(message.level) { 1348 switch (message.level) {
1354 case WebConsoleMessage::LevelTip: 1349 case WebConsoleMessage::LevelTip:
1355 log_severity = logging::LOG_VERBOSE; 1350 log_severity = logging::LOG_VERBOSE;
1356 break; 1351 break;
1357 case WebConsoleMessage::LevelLog: 1352 case WebConsoleMessage::LevelLog:
1358 log_severity = logging::LOG_INFO; 1353 log_severity = logging::LOG_INFO;
1359 break; 1354 break;
1360 case WebConsoleMessage::LevelWarning: 1355 case WebConsoleMessage::LevelWarning:
1361 log_severity = logging::LOG_WARNING; 1356 log_severity = logging::LOG_WARNING;
1362 break; 1357 break;
1363 case WebConsoleMessage::LevelError: 1358 case WebConsoleMessage::LevelError:
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 1876
1882 scoped_ptr<media::MessageLoopFactory> message_loop_factory( 1877 scoped_ptr<media::MessageLoopFactory> message_loop_factory(
1883 new media::MessageLoopFactoryImpl()); 1878 new media::MessageLoopFactoryImpl());
1884 scoped_ptr<media::FilterCollection> collection( 1879 scoped_ptr<media::FilterCollection> collection(
1885 new media::FilterCollection()); 1880 new media::FilterCollection());
1886 1881
1887 // Add in any custom filter factories first. 1882 // Add in any custom filter factories first.
1888 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 1883 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
1889 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { 1884 if (!cmd_line->HasSwitch(switches::kDisableAudio)) {
1890 // Add the chrome specific audio renderer. 1885 // Add the chrome specific audio renderer.
1891 collection->AddAudioRenderer(new AudioRendererImpl(audio_message_filter())); 1886 collection->AddAudioRenderer(new AudioRendererImpl());
1892 } 1887 }
1893 1888
1894 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; 1889 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer;
1895 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); 1890 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging);
1896 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( 1891 scoped_refptr<webkit_glue::VideoRendererImpl> renderer(
1897 new webkit_glue::VideoRendererImpl(pts_logging)); 1892 new webkit_glue::VideoRendererImpl(pts_logging));
1898 collection->AddVideoRenderer(renderer); 1893 collection->AddVideoRenderer(renderer);
1899 video_renderer = renderer; 1894 video_renderer = renderer;
1900 1895
1901 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( 1896 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result(
(...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after
4256 const webkit_glue::CustomContextMenuContext& custom_context) { 4251 const webkit_glue::CustomContextMenuContext& custom_context) {
4257 if (custom_context.is_pepper_menu) 4252 if (custom_context.is_pepper_menu)
4258 pepper_delegate_.OnContextMenuClosed(custom_context); 4253 pepper_delegate_.OnContextMenuClosed(custom_context);
4259 else 4254 else
4260 context_menu_node_.reset(); 4255 context_menu_node_.reset();
4261 } 4256 }
4262 4257
4263 void RenderView::OnNetworkStateChanged(bool online) { 4258 void RenderView::OnNetworkStateChanged(bool online) {
4264 WebNetworkStateNotifier::setOnLine(online); 4259 WebNetworkStateNotifier::setOnLine(online);
4265 } 4260 }
OLDNEW
« content/renderer/media/audio_renderer_impl_unittest.cc ('K') | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698