summaryrefslogtreecommitdiffstats
path: root/content/browser/power_save_blocker_android.cc
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-12 05:10:02 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-12 05:10:02 +0000
commitcd173f2368d103f432a1251e69fc634a8ff9196a (patch)
treea72918a5d3a69e2cd371e1d00ef0efd1728f5087 /content/browser/power_save_blocker_android.cc
parent78e3c7de984d42a49ac6084eecf2bf1aedf59847 (diff)
downloadchromium_src-cd173f2368d103f432a1251e69fc634a8ff9196a.zip
chromium_src-cd173f2368d103f432a1251e69fc634a8ff9196a.tar.gz
chromium_src-cd173f2368d103f432a1251e69fc634a8ff9196a.tar.bz2
Fix PowerSaveBlocker crash in Android WebView
GetView returns NULL in Android WebView (see comment in ContentViewCoreImpl::GetWindowAndroid), so do not invoke power save block. This is ok since this should be controlled by embedding app through existing Java APIs. PowerSaveBlock is invoked for video playback. BUG=239760 Review URL: https://chromiumcodereview.appspot.com/22706010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/power_save_blocker_android.cc')
-rw-r--r--content/browser/power_save_blocker_android.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/content/browser/power_save_blocker_android.cc b/content/browser/power_save_blocker_android.cc
index d73caef..720fbb2 100644
--- a/content/browser/power_save_blocker_android.cc
+++ b/content/browser/power_save_blocker_android.cc
@@ -70,6 +70,9 @@ PowerSaveBlockerImpl::~PowerSaveBlockerImpl() {
}
void PowerSaveBlockerImpl::InitDisplaySleepBlocker(NativeView view_android) {
+ if (!view_android)
+ return;
+
delegate_ = new Delegate(view_android);
// This may be called on any thread.
BrowserThread::PostTask(