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

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: '' Created 9 years, 6 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 webkit_glue::kForegroundTabTimerInterval); 397 webkit_glue::kForegroundTabTimerInterval);
398 398
399 OnSetRendererPrefs(renderer_prefs); 399 OnSetRendererPrefs(renderer_prefs);
400 400
401 host_window_ = parent_hwnd; 401 host_window_ = parent_hwnd;
402 402
403 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 403 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
404 if (command_line.HasSwitch(switches::kEnableAccessibility)) 404 if (command_line.HasSwitch(switches::kEnableAccessibility))
405 WebAccessibilityCache::enableAccessibility(); 405 WebAccessibilityCache::enableAccessibility();
406 406
407 audio_message_filter_ = new AudioMessageFilter(routing_id_);
408 render_thread_->AddFilter(audio_message_filter_);
409
410 #if defined(ENABLE_P2P_APIS) 407 #if defined(ENABLE_P2P_APIS)
411 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableP2PApi)) 408 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableP2PApi))
412 p2p_socket_dispatcher_ = new P2PSocketDispatcher(this); 409 p2p_socket_dispatcher_ = new P2PSocketDispatcher(this);
413 #endif 410 #endif
414 411
415 content::GetContentClient()->renderer()->RenderViewCreated(this); 412 content::GetContentClient()->renderer()->RenderViewCreated(this);
416 } 413 }
417 414
418 RenderView::~RenderView() { 415 RenderView::~RenderView() {
419 if (decrement_shared_popup_at_destruction_) 416 if (decrement_shared_popup_at_destruction_)
(...skipping 11 matching lines...) Expand all
431 #if defined(OS_MACOSX) 428 #if defined(OS_MACOSX)
432 // Destroy all fake plugin window handles on the browser side. 429 // Destroy all fake plugin window handles on the browser side.
433 while (!fake_plugin_window_handles_.empty()) { 430 while (!fake_plugin_window_handles_.empty()) {
434 // Make sure no NULL plugin window handles were inserted into this list. 431 // Make sure no NULL plugin window handles were inserted into this list.
435 DCHECK(*fake_plugin_window_handles_.begin()); 432 DCHECK(*fake_plugin_window_handles_.begin());
436 // DestroyFakePluginWindowHandle modifies fake_plugin_window_handles_. 433 // DestroyFakePluginWindowHandle modifies fake_plugin_window_handles_.
437 DestroyFakePluginWindowHandle(*fake_plugin_window_handles_.begin()); 434 DestroyFakePluginWindowHandle(*fake_plugin_window_handles_.begin());
438 } 435 }
439 #endif 436 #endif
440 437
441 render_thread_->RemoveFilter(audio_message_filter_);
442
443 #ifndef NDEBUG 438 #ifndef NDEBUG
444 // Make sure we are no longer referenced by the ViewMap. 439 // Make sure we are no longer referenced by the ViewMap.
445 ViewMap* views = g_view_map.Pointer(); 440 ViewMap* views = g_view_map.Pointer();
446 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) 441 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it)
447 DCHECK_NE(this, it->second) << "Failed to call Close?"; 442 DCHECK_NE(this, it->second) << "Failed to call Close?";
448 #endif 443 #endif
449 444
450 FOR_EACH_OBSERVER(RenderViewObserver, observers_, set_render_view(NULL)); 445 FOR_EACH_OBSERVER(RenderViewObserver, observers_, set_render_view(NULL));
451 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct()); 446 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct());
452 } 447 }
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 return WebStorageNamespace::createSessionStorageNamespace(quota); 1342 return WebStorageNamespace::createSessionStorageNamespace(quota);
1348 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); 1343 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId);
1349 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION, 1344 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION,
1350 session_storage_namespace_id_); 1345 session_storage_namespace_id_);
1351 } 1346 }
1352 1347
1353 void RenderView::didAddMessageToConsole( 1348 void RenderView::didAddMessageToConsole(
1354 const WebConsoleMessage& message, const WebString& source_name, 1349 const WebConsoleMessage& message, const WebString& source_name,
1355 unsigned source_line) { 1350 unsigned source_line) {
1356 logging::LogSeverity log_severity = logging::LOG_VERBOSE; 1351 logging::LogSeverity log_severity = logging::LOG_VERBOSE;
1357 switch(message.level) { 1352 switch (message.level) {
scherkus (not reviewing) 2011/06/14 22:22:12 ?
henrika_dont_use 2011/06/15 15:16:39 Resolves lint warning. Should it not be a space he
scherkus (not reviewing) 2011/06/16 21:56:22 nope that's right -- I just had a brainfart :)
1358 case WebConsoleMessage::LevelTip: 1353 case WebConsoleMessage::LevelTip:
1359 log_severity = logging::LOG_VERBOSE; 1354 log_severity = logging::LOG_VERBOSE;
1360 break; 1355 break;
1361 case WebConsoleMessage::LevelLog: 1356 case WebConsoleMessage::LevelLog:
1362 log_severity = logging::LOG_INFO; 1357 log_severity = logging::LOG_INFO;
1363 break; 1358 break;
1364 case WebConsoleMessage::LevelWarning: 1359 case WebConsoleMessage::LevelWarning:
1365 log_severity = logging::LOG_WARNING; 1360 log_severity = logging::LOG_WARNING;
1366 break; 1361 break;
1367 case WebConsoleMessage::LevelError: 1362 case WebConsoleMessage::LevelError:
(...skipping 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after
4245 const webkit_glue::CustomContextMenuContext& custom_context) { 4240 const webkit_glue::CustomContextMenuContext& custom_context) {
4246 if (custom_context.is_pepper_menu) 4241 if (custom_context.is_pepper_menu)
4247 pepper_delegate_.OnContextMenuClosed(custom_context); 4242 pepper_delegate_.OnContextMenuClosed(custom_context);
4248 else 4243 else
4249 context_menu_node_.reset(); 4244 context_menu_node_.reset();
4250 } 4245 }
4251 4246
4252 void RenderView::OnNetworkStateChanged(bool online) { 4247 void RenderView::OnNetworkStateChanged(bool online) {
4253 WebNetworkStateNotifier::setOnLine(online); 4248 WebNetworkStateNotifier::setOnLine(online);
4254 } 4249 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698