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/bind.h" | 10 #include "base/bind.h" |
(...skipping 5707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5718 | 5718 |
5719 void RenderViewImpl::DidHandleTouchEvent(const WebTouchEvent& event) { | 5719 void RenderViewImpl::DidHandleTouchEvent(const WebTouchEvent& event) { |
5720 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleTouchEvent(event)); | 5720 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidHandleTouchEvent(event)); |
5721 } | 5721 } |
5722 | 5722 |
5723 void RenderViewImpl::OnWasHidden() { | 5723 void RenderViewImpl::OnWasHidden() { |
5724 RenderWidget::OnWasHidden(); | 5724 RenderWidget::OnWasHidden(); |
5725 | 5725 |
5726 #if defined(OS_ANDROID) | 5726 #if defined(OS_ANDROID) |
5727 // Inform WebMediaPlayerManagerAndroid to release all media player resources. | 5727 // Inform WebMediaPlayerManagerAndroid to release all media player resources. |
5728 // unless some media is playing. | 5728 // unless some audio is playing. |
5729 // If something is in progress the resource will not be freed, it will | 5729 // If something is in progress the resource will not be freed, it will |
5730 // only be freed once the tab is destroyed or if the user navigates away | 5730 // only be freed once the tab is destroyed or if the user navigates away |
5731 // via WebMediaPlayerAndroid::Destroy | 5731 // via WebMediaPlayerAndroid::Destroy |
5732 media_player_manager_->ReleaseMediaResourcesIfNotPlaying(); | 5732 media_player_manager_->ReleaseMediaResources(); |
scherkus (not reviewing)
2012/11/21 21:44:30
would it be more accurate to call this "ReleaseVid
qinmin
2012/11/21 21:53:54
I think video is not correct, as it also released
| |
5733 #endif | 5733 #endif |
5734 | 5734 |
5735 if (webview()) { | 5735 if (webview()) { |
5736 webview()->settings()->setMinimumTimerInterval( | 5736 webview()->settings()->setMinimumTimerInterval( |
5737 webkit_glue::kBackgroundTabTimerInterval); | 5737 webkit_glue::kBackgroundTabTimerInterval); |
5738 webview()->setVisibilityState(visibilityState(), false); | 5738 webview()->setVisibilityState(visibilityState(), false); |
5739 } | 5739 } |
5740 | 5740 |
5741 // Inform PPAPI plugins that their page is no longer visible. | 5741 // Inform PPAPI plugins that their page is no longer visible. |
5742 pepper_delegate_.PageVisibilityChanged(false); | 5742 pepper_delegate_.PageVisibilityChanged(false); |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6409 } | 6409 } |
6410 #endif | 6410 #endif |
6411 | 6411 |
6412 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6412 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6413 TransportDIB::Handle dib_handle) { | 6413 TransportDIB::Handle dib_handle) { |
6414 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6414 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6415 RenderProcess::current()->ReleaseTransportDIB(dib); | 6415 RenderProcess::current()->ReleaseTransportDIB(dib); |
6416 } | 6416 } |
6417 | 6417 |
6418 } // namespace content | 6418 } // namespace content |
OLD | NEW |