Index: content/child/fileapi/webfilesystem_impl.h |
diff --git a/content/child/fileapi/webfilesystem_impl.h b/content/child/fileapi/webfilesystem_impl.h |
index 40cc2e0e5d8806bac6e88b40514a38378476923e..e5348db1cca302edde3cb9c5fdac2d74120051fc 100644 |
--- a/content/child/fileapi/webfilesystem_impl.h |
+++ b/content/child/fileapi/webfilesystem_impl.h |
@@ -14,8 +14,16 @@ |
#include "content/child/worker_task_runner.h" |
#include "third_party/WebKit/public/platform/WebFileSystem.h" |
+// TODO(hashimoto): Remove this hack. |
+#if defined(READ_DIRECTORY_RETURNS_INT) |
+#define READ_DIRECTORY_RETURN_TYPE int |
+#else |
+#define READ_DIRECTORY_RETURN_TYPE void |
+#endif |
+ |
namespace base { |
class MessageLoopProxy; |
+class WaitableEvent; |
} |
namespace blink { |
@@ -30,6 +38,8 @@ class WebFileSystemImpl : public blink::WebFileSystem, |
public WorkerTaskRunner::Observer, |
public base::NonThreadSafe { |
public: |
+ class WaitableCallbackResults; |
+ |
// Returns thread-specific instance. If non-null |main_thread_loop| |
// is given and no thread-specific instance has been created it may |
// create a new instance. |
@@ -90,7 +100,7 @@ class WebFileSystemImpl : public blink::WebFileSystem, |
virtual void directoryExists( |
const blink::WebURL& path, |
blink::WebFileSystemCallbacks) OVERRIDE; |
- virtual void readDirectory( |
+ virtual READ_DIRECTORY_RETURN_TYPE readDirectory( |
const blink::WebURL& path, |
blink::WebFileSystemCallbacks) OVERRIDE; |
virtual void createFileWriter( |
@@ -100,18 +110,25 @@ class WebFileSystemImpl : public blink::WebFileSystem, |
virtual void createSnapshotFileAndReadMetadata( |
const blink::WebURL& path, |
blink::WebFileSystemCallbacks); |
+ virtual bool waitForAdditionalResult(int callbacksId); |
int RegisterCallbacks(const blink::WebFileSystemCallbacks& callbacks); |
- blink::WebFileSystemCallbacks GetAndUnregisterCallbacks( |
- int callbacks_id); |
+ blink::WebFileSystemCallbacks GetCallbacks(int callbacks_id); |
+ void UnregisterCallbacks(int callbacks_id); |
private: |
typedef std::map<int, blink::WebFileSystemCallbacks> CallbacksMap; |
+ typedef std::map<int, scoped_refptr<WaitableCallbackResults> > |
+ WaitableCallbackResultsMap; |
+ |
+ WaitableCallbackResults* MaybeCreateWaitableResults( |
+ const blink::WebFileSystemCallbacks& callbacks, int callbacks_id); |
scoped_refptr<base::MessageLoopProxy> main_thread_loop_; |
CallbacksMap callbacks_; |
int next_callbacks_id_; |
+ WaitableCallbackResultsMap waitable_results_; |
DISALLOW_COPY_AND_ASSIGN(WebFileSystemImpl); |
}; |