| OLD | NEW |
| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 webkit_glue::kForegroundTabTimerInterval); | 396 webkit_glue::kForegroundTabTimerInterval); |
| 397 | 397 |
| 398 OnSetRendererPrefs(renderer_prefs); | 398 OnSetRendererPrefs(renderer_prefs); |
| 399 | 399 |
| 400 host_window_ = parent_hwnd; | 400 host_window_ = parent_hwnd; |
| 401 | 401 |
| 402 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 402 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 403 if (command_line.HasSwitch(switches::kEnableAccessibility)) | 403 if (command_line.HasSwitch(switches::kEnableAccessibility)) |
| 404 WebAccessibilityCache::enableAccessibility(); | 404 WebAccessibilityCache::enableAccessibility(); |
| 405 | 405 |
| 406 audio_message_filter_ = new AudioMessageFilter(routing_id_); | |
| 407 render_thread_->AddFilter(audio_message_filter_); | |
| 408 | |
| 409 #if defined(ENABLE_P2P_APIS) | 406 #if defined(ENABLE_P2P_APIS) |
| 410 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableP2PApi)) | 407 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableP2PApi)) |
| 411 p2p_socket_dispatcher_ = new P2PSocketDispatcher(this); | 408 p2p_socket_dispatcher_ = new P2PSocketDispatcher(this); |
| 412 #endif | 409 #endif |
| 413 | 410 |
| 414 content::GetContentClient()->renderer()->RenderViewCreated(this); | 411 content::GetContentClient()->renderer()->RenderViewCreated(this); |
| 415 } | 412 } |
| 416 | 413 |
| 417 RenderView::~RenderView() { | 414 RenderView::~RenderView() { |
| 418 if (decrement_shared_popup_at_destruction_) | 415 if (decrement_shared_popup_at_destruction_) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 430 #if defined(OS_MACOSX) | 427 #if defined(OS_MACOSX) |
| 431 // Destroy all fake plugin window handles on the browser side. | 428 // Destroy all fake plugin window handles on the browser side. |
| 432 while (!fake_plugin_window_handles_.empty()) { | 429 while (!fake_plugin_window_handles_.empty()) { |
| 433 // Make sure no NULL plugin window handles were inserted into this list. | 430 // Make sure no NULL plugin window handles were inserted into this list. |
| 434 DCHECK(*fake_plugin_window_handles_.begin()); | 431 DCHECK(*fake_plugin_window_handles_.begin()); |
| 435 // DestroyFakePluginWindowHandle modifies fake_plugin_window_handles_. | 432 // DestroyFakePluginWindowHandle modifies fake_plugin_window_handles_. |
| 436 DestroyFakePluginWindowHandle(*fake_plugin_window_handles_.begin()); | 433 DestroyFakePluginWindowHandle(*fake_plugin_window_handles_.begin()); |
| 437 } | 434 } |
| 438 #endif | 435 #endif |
| 439 | 436 |
| 440 render_thread_->RemoveFilter(audio_message_filter_); | |
| 441 | |
| 442 #ifndef NDEBUG | 437 #ifndef NDEBUG |
| 443 // Make sure we are no longer referenced by the ViewMap. | 438 // Make sure we are no longer referenced by the ViewMap. |
| 444 ViewMap* views = g_view_map.Pointer(); | 439 ViewMap* views = g_view_map.Pointer(); |
| 445 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) | 440 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) |
| 446 DCHECK_NE(this, it->second) << "Failed to call Close?"; | 441 DCHECK_NE(this, it->second) << "Failed to call Close?"; |
| 447 #endif | 442 #endif |
| 448 | 443 |
| 449 FOR_EACH_OBSERVER(RenderViewObserver, observers_, set_render_view(NULL)); | 444 FOR_EACH_OBSERVER(RenderViewObserver, observers_, set_render_view(NULL)); |
| 450 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct()); | 445 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct()); |
| 451 } | 446 } |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 return WebStorageNamespace::createSessionStorageNamespace(quota); | 1341 return WebStorageNamespace::createSessionStorageNamespace(quota); |
| 1347 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); | 1342 CHECK(session_storage_namespace_id_ != kInvalidSessionStorageNamespaceId); |
| 1348 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION, | 1343 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION, |
| 1349 session_storage_namespace_id_); | 1344 session_storage_namespace_id_); |
| 1350 } | 1345 } |
| 1351 | 1346 |
| 1352 void RenderView::didAddMessageToConsole( | 1347 void RenderView::didAddMessageToConsole( |
| 1353 const WebConsoleMessage& message, const WebString& source_name, | 1348 const WebConsoleMessage& message, const WebString& source_name, |
| 1354 unsigned source_line) { | 1349 unsigned source_line) { |
| 1355 logging::LogSeverity log_severity = logging::LOG_VERBOSE; | 1350 logging::LogSeverity log_severity = logging::LOG_VERBOSE; |
| 1356 switch(message.level) { | 1351 switch (message.level) { |
| 1357 case WebConsoleMessage::LevelTip: | 1352 case WebConsoleMessage::LevelTip: |
| 1358 log_severity = logging::LOG_VERBOSE; | 1353 log_severity = logging::LOG_VERBOSE; |
| 1359 break; | 1354 break; |
| 1360 case WebConsoleMessage::LevelLog: | 1355 case WebConsoleMessage::LevelLog: |
| 1361 log_severity = logging::LOG_INFO; | 1356 log_severity = logging::LOG_INFO; |
| 1362 break; | 1357 break; |
| 1363 case WebConsoleMessage::LevelWarning: | 1358 case WebConsoleMessage::LevelWarning: |
| 1364 log_severity = logging::LOG_WARNING; | 1359 log_severity = logging::LOG_WARNING; |
| 1365 break; | 1360 break; |
| 1366 case WebConsoleMessage::LevelError: | 1361 case WebConsoleMessage::LevelError: |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 | 1878 |
| 1884 scoped_ptr<media::MessageLoopFactory> message_loop_factory( | 1879 scoped_ptr<media::MessageLoopFactory> message_loop_factory( |
| 1885 new media::MessageLoopFactoryImpl()); | 1880 new media::MessageLoopFactoryImpl()); |
| 1886 scoped_ptr<media::FilterCollection> collection( | 1881 scoped_ptr<media::FilterCollection> collection( |
| 1887 new media::FilterCollection()); | 1882 new media::FilterCollection()); |
| 1888 | 1883 |
| 1889 // Add in any custom filter factories first. | 1884 // Add in any custom filter factories first. |
| 1890 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 1885 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 1891 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 1886 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
| 1892 // Add the chrome specific audio renderer. | 1887 // Add the chrome specific audio renderer. |
| 1893 collection->AddAudioRenderer(new AudioRendererImpl(audio_message_filter())); | 1888 collection->AddAudioRenderer(new AudioRendererImpl()); |
| 1894 } | 1889 } |
| 1895 | 1890 |
| 1896 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; | 1891 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; |
| 1897 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); | 1892 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); |
| 1898 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( | 1893 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( |
| 1899 new webkit_glue::VideoRendererImpl(pts_logging)); | 1894 new webkit_glue::VideoRendererImpl(pts_logging)); |
| 1900 collection->AddVideoRenderer(renderer); | 1895 collection->AddVideoRenderer(renderer); |
| 1901 video_renderer = renderer; | 1896 video_renderer = renderer; |
| 1902 | 1897 |
| 1903 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( | 1898 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( |
| (...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |