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

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.h

Issue 2877343003: Switch browser/extensions/api/file_system/file_system_api.[h|cc] to the TaskScheduler API (Closed)
Patch Set: Fixes. Created 3 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
Index: chrome/browser/extensions/api/file_system/file_system_api.h
diff --git a/chrome/browser/extensions/api/file_system/file_system_api.h b/chrome/browser/extensions/api/file_system/file_system_api.h
index 740c44706c185d021514b170b0a882f33a68cc4e..7c5a99d724eca80872502b5089a0ea84f10dba66 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.h
+++ b/chrome/browser/extensions/api/file_system/file_system_api.h
@@ -13,6 +13,7 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/task_scheduler/post_task.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
@@ -157,7 +158,7 @@ class FileSystemEntryFunction : public ChromeAsyncExtensionFunction {
protected:
FileSystemEntryFunction();
- ~FileSystemEntryFunction() override {}
+ ~FileSystemEntryFunction() override;
// This is called when writable file entries are being returned. The function
// will ensure the files exist, creating them if necessary, and also check
@@ -187,6 +188,11 @@ class FileSystemEntryFunction : public ChromeAsyncExtensionFunction {
// Whether a directory has been requested.
bool is_directory_;
+
+ // The task runner used to do file operations.
+ const scoped_refptr<base::SequencedTaskRunner> task_runner_ =
+ base::CreateSequencedTaskRunnerWithTraits(
+ {base::MayBlock(), base::TaskPriority::BACKGROUND});
};
class FileSystemGetWritableEntryFunction : public FileSystemEntryFunction {

Powered by Google App Engine
This is Rietveld 408576698