Commit 09dcdf81 authored by kinuko@chromium.org's avatar kinuko@chromium.org

Make WebFileSystemCallbacks not self-destruct

It's multi-sided patch, so again it has ugly ifdefs.

Corresponding blink patch:
https://codereview.chromium.org/23704004/

BUG=257349
TEST=try, both with and without Blink patch

Review URL: https://chromiumcodereview.appspot.com/23762002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221710 0039d316-1c4b-4281-b951-d872f2087c98
parent e0532fb0
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#include "content/child/fileapi/webfilewriter_impl.h" #include "content/child/fileapi/webfilewriter_impl.h"
#include "content/common/fileapi/file_system_messages.h" #include "content/common/fileapi/file_system_messages.h"
#include "third_party/WebKit/public/platform/WebFileInfo.h" #include "third_party/WebKit/public/platform/WebFileInfo.h"
#include "third_party/WebKit/public/platform/WebFileSystemCallbacks.h"
#include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/web/WebFileSystemCallbacks.h"
#include "url/gurl.h" #include "url/gurl.h"
#include "webkit/child/worker_task_runner.h" #include "webkit/child/worker_task_runner.h"
#include "webkit/common/fileapi/directory_entry.h" #include "webkit/common/fileapi/directory_entry.h"
...@@ -37,14 +37,23 @@ namespace content { ...@@ -37,14 +37,23 @@ namespace content {
namespace { namespace {
// TODO(kinuko): Remove this hack after the two-sided patch lands.
WebFileSystemCallbacks* Wrapper(WebFileSystemCallbacksType& cb) {
#ifdef NON_SELFDESTRUCT_WEBFILESYSTEMCALLBACKS
return &cb;
#else
return cb;
#endif
}
base::LazyInstance<base::ThreadLocalPointer<WebFileSystemImpl> >::Leaky base::LazyInstance<base::ThreadLocalPointer<WebFileSystemImpl> >::Leaky
g_webfilesystem_tls = LAZY_INSTANCE_INITIALIZER; g_webfilesystem_tls = LAZY_INSTANCE_INITIALIZER;
class WaitableCallbackResults { class WaitableCallbackResults {
public: public:
static WaitableCallbackResults* MaybeCreate( static WaitableCallbackResults* MaybeCreate(
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
if (callbacks->shouldBlockUntilCompletion()) if (Wrapper(callbacks)->shouldBlockUntilCompletion())
return new WaitableCallbackResults; return new WaitableCallbackResults;
return NULL; return NULL;
} }
...@@ -110,10 +119,9 @@ void RunCallbacks(int callbacks_id, Method method, const Params& params) { ...@@ -110,10 +119,9 @@ void RunCallbacks(int callbacks_id, Method method, const Params& params) {
WebFileSystemImpl::ThreadSpecificInstance(NULL); WebFileSystemImpl::ThreadSpecificInstance(NULL);
if (!filesystem) if (!filesystem)
return; return;
WebFileSystemCallbacks* callbacks = WebFileSystemCallbacksType callbacks =
filesystem->GetAndUnregisterCallbacks(callbacks_id); filesystem->GetAndUnregisterCallbacks(callbacks_id);
DCHECK(callbacks); DispatchToMethod(Wrapper(callbacks), method, params);
DispatchToMethod(callbacks, method, params);
} }
void DispatchResultsClosure(int thread_id, int callbacks_id, void DispatchResultsClosure(int thread_id, int callbacks_id,
...@@ -208,17 +216,17 @@ void DidCreateFileWriter( ...@@ -208,17 +216,17 @@ void DidCreateFileWriter(
if (!filesystem) if (!filesystem)
return; return;
WebFileSystemCallbacks* callbacks = WebFileSystemCallbacksType callbacks =
filesystem->GetAndUnregisterCallbacks(callbacks_id); filesystem->GetAndUnregisterCallbacks(callbacks_id);
DCHECK(callbacks);
if (file_info.is_directory || file_info.size < 0) { if (file_info.is_directory || file_info.size < 0) {
callbacks->didFail(WebKit::WebFileErrorInvalidState); Wrapper(callbacks)->didFail(WebKit::WebFileErrorInvalidState);
return; return;
} }
WebFileWriterImpl::Type type = callbacks->shouldBlockUntilCompletion() ? WebFileWriterImpl::Type type =
WebFileWriterImpl::TYPE_SYNC : WebFileWriterImpl::TYPE_ASYNC; Wrapper(callbacks)->shouldBlockUntilCompletion() ?
callbacks->didCreateFileWriter( WebFileWriterImpl::TYPE_SYNC : WebFileWriterImpl::TYPE_ASYNC;
Wrapper(callbacks)->didCreateFileWriter(
new WebFileWriterImpl(path, client, type, main_thread_loop), new WebFileWriterImpl(path, client, type, main_thread_loop),
file_info.size); file_info.size);
} }
...@@ -247,14 +255,13 @@ void DidCreateSnapshotFile( ...@@ -247,14 +255,13 @@ void DidCreateSnapshotFile(
if (!filesystem) if (!filesystem)
return; return;
WebFileSystemCallbacks* callbacks = WebFileSystemCallbacksType callbacks =
filesystem->GetAndUnregisterCallbacks(callbacks_id); filesystem->GetAndUnregisterCallbacks(callbacks_id);
DCHECK(callbacks);
WebFileInfo web_file_info; WebFileInfo web_file_info;
webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info);
web_file_info.platformPath = platform_path.AsUTF16Unsafe(); web_file_info.platformPath = platform_path.AsUTF16Unsafe();
callbacks->didCreateSnapshotFile(web_file_info); Wrapper(callbacks)->didCreateSnapshotFile(web_file_info);
// TODO(michaeln,kinuko): Use ThreadSafeSender when Blob becomes // TODO(michaeln,kinuko): Use ThreadSafeSender when Blob becomes
// non-bridge model. // non-bridge model.
...@@ -298,16 +305,18 @@ void WebFileSystemImpl::DeleteThreadSpecificInstance() { ...@@ -298,16 +305,18 @@ void WebFileSystemImpl::DeleteThreadSpecificInstance() {
} }
WebFileSystemImpl::WebFileSystemImpl(base::MessageLoopProxy* main_thread_loop) WebFileSystemImpl::WebFileSystemImpl(base::MessageLoopProxy* main_thread_loop)
: main_thread_loop_(main_thread_loop) { : main_thread_loop_(main_thread_loop),
next_callbacks_id_(0) {
g_webfilesystem_tls.Pointer()->Set(this); g_webfilesystem_tls.Pointer()->Set(this);
} }
WebFileSystemImpl::~WebFileSystemImpl() { WebFileSystemImpl::~WebFileSystemImpl() {
IDMap<WebFileSystemCallbacks>::iterator iter(&callbacks_); #if !defined(NON_SELFDESTRUCT_WEBFILESYSTEMCALLBACKS)
while (!iter.IsAtEnd()) { for (CallbacksMap::iterator iter = callbacks_.begin();
iter.GetCurrentValue()->didFail(WebKit::WebFileErrorAbort); iter != callbacks_.end(); ++iter) {
iter.Advance(); iter->second->didFail(WebKit::WebFileErrorAbort);
} }
#endif
g_webfilesystem_tls.Pointer()->Set(NULL); g_webfilesystem_tls.Pointer()->Set(NULL);
} }
...@@ -319,7 +328,7 @@ void WebFileSystemImpl::openFileSystem( ...@@ -319,7 +328,7 @@ void WebFileSystemImpl::openFileSystem(
const WebKit::WebURL& storage_partition, const WebKit::WebURL& storage_partition,
WebKit::WebFileSystemType type, WebKit::WebFileSystemType type,
bool create, bool create,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -341,7 +350,7 @@ void WebFileSystemImpl::openFileSystem( ...@@ -341,7 +350,7 @@ void WebFileSystemImpl::openFileSystem(
void WebFileSystemImpl::deleteFileSystem( void WebFileSystemImpl::deleteFileSystem(
const WebKit::WebURL& storage_partition, const WebKit::WebURL& storage_partition,
WebKit::WebFileSystemType type, WebKit::WebFileSystemType type,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -359,7 +368,7 @@ void WebFileSystemImpl::deleteFileSystem( ...@@ -359,7 +368,7 @@ void WebFileSystemImpl::deleteFileSystem(
void WebFileSystemImpl::move( void WebFileSystemImpl::move(
const WebKit::WebURL& src_path, const WebKit::WebURL& src_path,
const WebKit::WebURL& dest_path, const WebKit::WebURL& dest_path,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -376,7 +385,7 @@ void WebFileSystemImpl::move( ...@@ -376,7 +385,7 @@ void WebFileSystemImpl::move(
void WebFileSystemImpl::copy( void WebFileSystemImpl::copy(
const WebKit::WebURL& src_path, const WebKit::WebURL& src_path,
const WebKit::WebURL& dest_path, const WebKit::WebURL& dest_path,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -392,7 +401,7 @@ void WebFileSystemImpl::copy( ...@@ -392,7 +401,7 @@ void WebFileSystemImpl::copy(
void WebFileSystemImpl::remove( void WebFileSystemImpl::remove(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -408,7 +417,7 @@ void WebFileSystemImpl::remove( ...@@ -408,7 +417,7 @@ void WebFileSystemImpl::remove(
void WebFileSystemImpl::removeRecursively( void WebFileSystemImpl::removeRecursively(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -424,7 +433,7 @@ void WebFileSystemImpl::removeRecursively( ...@@ -424,7 +433,7 @@ void WebFileSystemImpl::removeRecursively(
void WebFileSystemImpl::readMetadata( void WebFileSystemImpl::readMetadata(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -444,7 +453,7 @@ void WebFileSystemImpl::readMetadata( ...@@ -444,7 +453,7 @@ void WebFileSystemImpl::readMetadata(
void WebFileSystemImpl::createFile( void WebFileSystemImpl::createFile(
const WebKit::WebURL& path, const WebKit::WebURL& path,
bool exclusive, bool exclusive,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -461,7 +470,7 @@ void WebFileSystemImpl::createFile( ...@@ -461,7 +470,7 @@ void WebFileSystemImpl::createFile(
void WebFileSystemImpl::createDirectory( void WebFileSystemImpl::createDirectory(
const WebKit::WebURL& path, const WebKit::WebURL& path,
bool exclusive, bool exclusive,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -477,7 +486,7 @@ void WebFileSystemImpl::createDirectory( ...@@ -477,7 +486,7 @@ void WebFileSystemImpl::createDirectory(
void WebFileSystemImpl::fileExists( void WebFileSystemImpl::fileExists(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -493,7 +502,7 @@ base::Unretained(waitable_results))), ...@@ -493,7 +502,7 @@ base::Unretained(waitable_results))),
void WebFileSystemImpl::directoryExists( void WebFileSystemImpl::directoryExists(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -509,7 +518,7 @@ void WebFileSystemImpl::directoryExists( ...@@ -509,7 +518,7 @@ void WebFileSystemImpl::directoryExists(
void WebFileSystemImpl::readDirectory( void WebFileSystemImpl::readDirectory(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -536,7 +545,7 @@ WebKit::WebFileWriter* WebFileSystemImpl::createFileWriter( ...@@ -536,7 +545,7 @@ WebKit::WebFileWriter* WebFileSystemImpl::createFileWriter(
void WebFileSystemImpl::createFileWriter( void WebFileSystemImpl::createFileWriter(
const WebURL& path, const WebURL& path,
WebKit::WebFileWriterClient* client, WebKit::WebFileWriterClient* client,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -556,7 +565,7 @@ void WebFileSystemImpl::createFileWriter( ...@@ -556,7 +565,7 @@ void WebFileSystemImpl::createFileWriter(
void WebFileSystemImpl::createSnapshotFileAndReadMetadata( void WebFileSystemImpl::createSnapshotFileAndReadMetadata(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks* callbacks) { WebFileSystemCallbacksType callbacks) {
int callbacks_id = RegisterCallbacks(callbacks); int callbacks_id = RegisterCallbacks(callbacks);
WaitableCallbackResults* waitable_results = WaitableCallbackResults* waitable_results =
WaitableCallbackResults::MaybeCreate(callbacks); WaitableCallbackResults::MaybeCreate(callbacks);
...@@ -574,14 +583,20 @@ void WebFileSystemImpl::createSnapshotFileAndReadMetadata( ...@@ -574,14 +583,20 @@ void WebFileSystemImpl::createSnapshotFileAndReadMetadata(
make_scoped_ptr(waitable_results)); make_scoped_ptr(waitable_results));
} }
int WebFileSystemImpl::RegisterCallbacks(WebFileSystemCallbacks* callbacks) { int WebFileSystemImpl::RegisterCallbacks(WebFileSystemCallbacksType callbacks) {
return callbacks_.Add(callbacks); DCHECK(CalledOnValidThread());
int id = next_callbacks_id_++;
callbacks_[id] = callbacks;
return id;
} }
WebFileSystemCallbacks* WebFileSystemImpl::GetAndUnregisterCallbacks( WebFileSystemCallbacksType WebFileSystemImpl::GetAndUnregisterCallbacks(
int callbacks_id) { int callbacks_id) {
WebFileSystemCallbacks* callbacks = callbacks_.Lookup(callbacks_id); DCHECK(CalledOnValidThread());
callbacks_.Remove(callbacks_id); CallbacksMap::iterator found = callbacks_.find(callbacks_id);
DCHECK(found != callbacks_.end());
WebFileSystemCallbacksType callbacks = found->second;
callbacks_.erase(found);
return callbacks; return callbacks;
} }
......
...@@ -5,9 +5,10 @@ ...@@ -5,9 +5,10 @@
#ifndef CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ #ifndef CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_
#define CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_ #define CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_
#include <map>
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/id_map.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h" #include "base/threading/non_thread_safe.h"
#include "third_party/WebKit/public/platform/WebFileSystem.h" #include "third_party/WebKit/public/platform/WebFileSystem.h"
...@@ -23,6 +24,13 @@ class WebFileWriter; ...@@ -23,6 +24,13 @@ class WebFileWriter;
class WebFileWriterClient; class WebFileWriterClient;
} }
// TODO(kinuko): Remove this hack after the two-sided patch lands.
#ifdef NON_SELFDESTRUCT_WEBFILESYSTEMCALLBACKS
typedef WebKit::WebFileSystemCallbacks WebFileSystemCallbacksType;
#else
typedef WebKit::WebFileSystemCallbacks* WebFileSystemCallbacksType;
#endif
namespace content { namespace content {
class WebFileSystemImpl class WebFileSystemImpl
...@@ -52,62 +60,67 @@ class WebFileSystemImpl ...@@ -52,62 +60,67 @@ class WebFileSystemImpl
const WebKit::WebURL& storage_partition, const WebKit::WebURL& storage_partition,
const WebKit::WebFileSystemType type, const WebKit::WebFileSystemType type,
bool create, bool create,
WebKit::WebFileSystemCallbacks*); WebFileSystemCallbacksType);
virtual void deleteFileSystem( virtual void deleteFileSystem(
const WebKit::WebURL& storage_partition, const WebKit::WebURL& storage_partition,
const WebKit::WebFileSystemType type, const WebKit::WebFileSystemType type,
WebKit::WebFileSystemCallbacks*); WebFileSystemCallbacksType);
virtual void move( virtual void move(
const WebKit::WebURL& src_path, const WebKit::WebURL& src_path,
const WebKit::WebURL& dest_path, const WebKit::WebURL& dest_path,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void copy( virtual void copy(
const WebKit::WebURL& src_path, const WebKit::WebURL& src_path,
const WebKit::WebURL& dest_path, const WebKit::WebURL& dest_path,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void remove( virtual void remove(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void removeRecursively( virtual void removeRecursively(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void readMetadata( virtual void readMetadata(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void createFile( virtual void createFile(
const WebKit::WebURL& path, const WebKit::WebURL& path,
bool exclusive, bool exclusive,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void createDirectory( virtual void createDirectory(
const WebKit::WebURL& path, const WebKit::WebURL& path,
bool exclusive, bool exclusive,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void fileExists( virtual void fileExists(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void directoryExists( virtual void directoryExists(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void readDirectory( virtual void readDirectory(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual WebKit::WebFileWriter* createFileWriter( virtual WebKit::WebFileWriter* createFileWriter(
const WebKit::WebURL& path, WebKit::WebFileWriterClient*) OVERRIDE; const WebKit::WebURL& path,
WebKit::WebFileWriterClient*);
virtual void createFileWriter( virtual void createFileWriter(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileWriterClient*, WebKit::WebFileWriterClient*,
WebKit::WebFileSystemCallbacks*) OVERRIDE; WebFileSystemCallbacksType) OVERRIDE;
virtual void createSnapshotFileAndReadMetadata( virtual void createSnapshotFileAndReadMetadata(
const WebKit::WebURL& path, const WebKit::WebURL& path,
WebKit::WebFileSystemCallbacks*); WebFileSystemCallbacksType);
int RegisterCallbacks(WebKit::WebFileSystemCallbacks* callbacks); int RegisterCallbacks(WebFileSystemCallbacksType callbacks);
WebKit::WebFileSystemCallbacks* GetAndUnregisterCallbacks( WebFileSystemCallbacksType GetAndUnregisterCallbacks(
int callbacks_id); int callbacks_id);
private: private:
typedef std::map<int, WebFileSystemCallbacksType> CallbacksMap;
scoped_refptr<base::MessageLoopProxy> main_thread_loop_; scoped_refptr<base::MessageLoopProxy> main_thread_loop_;
IDMap<WebKit::WebFileSystemCallbacks> callbacks_;
CallbacksMap callbacks_;
int next_callbacks_id_;
DISALLOW_COPY_AND_ASSIGN(WebFileSystemImpl); DISALLOW_COPY_AND_ASSIGN(WebFileSystemImpl);
}; };
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include "content/child/fileapi/webfilewriter_base.h" #include "content/child/fileapi/webfilewriter_base.h"
#include "base/logging.h" #include "base/logging.h"
#include "third_party/WebKit/public/platform/WebFileError.h"
#include "third_party/WebKit/public/platform/WebFileWriterClient.h"
#include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/web/WebFileError.h"
#include "third_party/WebKit/public/web/WebFileWriterClient.h"
#include "webkit/common/fileapi/file_system_util.h" #include "webkit/common/fileapi/file_system_util.h"
using fileapi::PlatformFileErrorToWebFileError; using fileapi::PlatformFileErrorToWebFileError;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "base/platform_file.h" #include "base/platform_file.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "third_party/WebKit/public/web/WebFileWriter.h" #include "third_party/WebKit/public/platform/WebFileWriter.h"
#include "url/gurl.h" #include "url/gurl.h"
namespace WebKit { namespace WebKit {
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/public/platform/WebFileError.h"
#include "third_party/WebKit/public/platform/WebFileWriterClient.h"
#include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/web/WebFileError.h"
#include "third_party/WebKit/public/web/WebFileWriterClient.h"
#include "url/gurl.h" #include "url/gurl.h"
namespace content { namespace content {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/platform_file.h" #include "base/platform_file.h"
#include "third_party/WebKit/public/web/WebFileError.h" #include "third_party/WebKit/public/platform/WebFileError.h"
#include "third_party/WebKit/public/platform/WebFileSystemType.h" #include "third_party/WebKit/public/platform/WebFileSystemType.h"
#include "webkit/common/fileapi/file_system_types.h" #include "webkit/common/fileapi/file_system_types.h"
#include "webkit/common/quota/quota_types.h" #include "webkit/common/quota/quota_types.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment