Index: extensions/browser/file_reader.h |
diff --git a/extensions/browser/file_reader.h b/extensions/browser/file_reader.h |
index 9b391f8635be496d1792bfa6d52f4307aec29bc3..a9f88688cca1e136125037ffdb312357cb91172e 100644 |
--- a/extensions/browser/file_reader.h |
+++ b/extensions/browser/file_reader.h |
@@ -19,10 +19,15 @@ |
class FileReader : public base::RefCountedThreadSafe<FileReader> { |
public: |
// Reports success or failure and the data of the file upon success. |
- typedef base::Callback<void(bool, std::unique_ptr<std::string>)> Callback; |
+ using DoneCallback = base::Callback<void(bool, std::unique_ptr<std::string>)>; |
+ // Lets the caller accomplish tasks on the file data, after the file content |
+ // has been read. |
+ // If the file reading doesn't succeed, this will be ignored. |
+ using OptionalFileThreadTaskCallback = base::Callback<void(std::string*)>; |
FileReader(const extensions::ExtensionResource& resource, |
- const Callback& callback); |
+ const OptionalFileThreadTaskCallback& file_thread_task_callback, |
+ const DoneCallback& done_callback); |
// Called to start reading the file on a background thread. Upon completion, |
// the callback will be notified of the results. |
@@ -36,7 +41,8 @@ class FileReader : public base::RefCountedThreadSafe<FileReader> { |
void ReadFileOnBackgroundThread(); |
extensions::ExtensionResource resource_; |
- Callback callback_; |
+ OptionalFileThreadTaskCallback optional_file_thread_task_callback_; |
+ DoneCallback done_callback_; |
const scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_; |
}; |