Index: extensions/browser/file_reader.h |
diff --git a/extensions/browser/file_reader.h b/extensions/browser/file_reader.h |
index 9b391f8635be496d1792bfa6d52f4307aec29bc3..d44675ba10b968a4fb55748bffca9f28ca2e8f83 100644 |
--- a/extensions/browser/file_reader.h |
+++ b/extensions/browser/file_reader.h |
@@ -19,10 +19,16 @@ |
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. |
Devlin
2016/09/01 04:21:25
This makes sense to me, but the code seems to disa
lazyboy
2016/09/01 05:52:58
See comment in execute_code_function.cc
|
+ using OptionalFileThreadTaskCallback = |
+ base::Callback<void(bool, 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 +42,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_; |
}; |