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

Unified Diff: content/child/fileapi/webfilesystem_impl.h

Issue 188533002: Handle has_more correctly in WebFileSystemImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix race Created 6 years, 9 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 | « no previous file | content/child/fileapi/webfilesystem_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | content/child/fileapi/webfilesystem_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698