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

Unified Diff: content/browser/power_save_blocker_factory.cc

Issue 1991593002: Pass SequencedTaskRunner to PowerSaveBlocker for ui/file operations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@device-power-save-blocker
Patch Set: mac Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/power_save_blocker_chromeos.cc ('k') | content/browser/power_save_blocker_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/power_save_blocker_factory.cc
diff --git a/content/browser/power_save_blocker_factory.cc b/content/browser/power_save_blocker_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8dea1419c64c1ce5f20cf9d164ca65c360a8550c
--- /dev/null
+++ b/content/browser/power_save_blocker_factory.cc
@@ -0,0 +1,24 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/browser/power_save_blocker_factory.h"
+
+#include "base/threading/sequenced_worker_pool.h"
+#include "content/public/browser/browser_thread.h"
+
+namespace content {
+
+std::unique_ptr<PowerSaveBlocker> CreatePowerSaveBlocker(
+ PowerSaveBlocker::PowerSaveBlockerType type,
+ PowerSaveBlocker::Reason reason,
+ const std::string& description) {
+ base::SequencedWorkerPool::SequenceToken token =
+ base::SequencedWorkerPool::GetSequenceToken();
+ return PowerSaveBlocker::CreateWithTaskRunners(
+ type, reason, description,
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
+ BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(token));
+}
+
+} // namespace content
« no previous file with comments | « content/browser/power_save_blocker_chromeos.cc ('k') | content/browser/power_save_blocker_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698