summaryrefslogtreecommitdiffstats
path: root/content/browser/power_save_blocker_android.cc
diff options
context:
space:
mode:
authorwjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-22 04:30:18 +0000
committerwjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-22 04:30:18 +0000
commit54eec84cc0136fd44752c931822dbd55d4afb759 (patch)
treed97145e31642105a1cd217405af490bee19d438e /content/browser/power_save_blocker_android.cc
parent08dd9df32b4dbea0152babcdbcb4bd1ac3224758 (diff)
downloadchromium_src-54eec84cc0136fd44752c931822dbd55d4afb759.zip
chromium_src-54eec84cc0136fd44752c931822dbd55d4afb759.tar.gz
chromium_src-54eec84cc0136fd44752c931822dbd55d4afb759.tar.bz2
Revert 201424 "Keep screen on when there is an active WebRTC ses..."
experimental reversion due to http://build.chromium.org/p/chromium.linux/buildstatus?builder=Android%20Tests&number=4397 > Keep screen on when there is an active WebRTC session on Android. > > When WebRTC session has video channel, the screen is kept on. > > R=bulach@chromium.org, joth@chromium.org, qinmin@chromium.org, sky@chromium.org > > Review URL: https://codereview.chromium.org/15035013 TBR=wjia@chromium.org Review URL: https://codereview.chromium.org/15655002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/power_save_blocker_android.cc')
-rw-r--r--content/browser/power_save_blocker_android.cc53
1 files changed, 5 insertions, 48 deletions
diff --git a/content/browser/power_save_blocker_android.cc b/content/browser/power_save_blocker_android.cc
index 2358049..c349fe5 100644
--- a/content/browser/power_save_blocker_android.cc
+++ b/content/browser/power_save_blocker_android.cc
@@ -5,67 +5,24 @@
#include "content/browser/power_save_blocker_impl.h"
#include "base/logging.h"
-#include "content/browser/android/content_video_view.h"
-#include "content/public/browser/browser_thread.h"
namespace content {
class PowerSaveBlockerImpl::Delegate
- : public base::RefCountedThreadSafe<PowerSaveBlockerImpl::Delegate> {
- public:
- explicit Delegate(PowerSaveBlockerType type) : type_(type) {}
-
- // Does the actual work to apply or remove the desired power save block.
- void ApplyBlock();
- void RemoveBlock();
-
+ : public base::RefCounted<PowerSaveBlockerImpl::Delegate> {
private:
- friend class base::RefCountedThreadSafe<Delegate>;
+ friend class base::RefCounted<Delegate>;
~Delegate() {}
-
- // The counter of requests from clients for type
- // kPowerSaveBlockPreventDisplaySleep.
- static int blocker_count_;
- const PowerSaveBlockerType type_;
-
- DISALLOW_COPY_AND_ASSIGN(Delegate);
};
-int PowerSaveBlockerImpl::Delegate::blocker_count_ = 0;
-
-void PowerSaveBlockerImpl::Delegate::ApplyBlock() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (type_ != kPowerSaveBlockPreventDisplaySleep)
- return;
-
- if (blocker_count_ == 0)
- ContentVideoView::KeepScreenOn(true);
- ++blocker_count_;
-}
-
-void PowerSaveBlockerImpl::Delegate::RemoveBlock() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (type_ != kPowerSaveBlockPreventDisplaySleep)
- return;
-
- --blocker_count_;
- if (blocker_count_ == 0)
- ContentVideoView::KeepScreenOn(false);
-}
-
PowerSaveBlockerImpl::PowerSaveBlockerImpl(PowerSaveBlockerType type,
- const std::string& reason)
- : delegate_(new Delegate(type)) {
+ const std::string& reason) {
+ // TODO(wangxianzhu): Implement it.
// This may be called on any thread.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&Delegate::ApplyBlock, delegate_));
+ NOTIMPLEMENTED();
}
PowerSaveBlockerImpl::~PowerSaveBlockerImpl() {
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&Delegate::RemoveBlock, delegate_));
}
} // namespace content