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

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

Issue 23762002: Make WebFileSystemCallbacks not self-destruct (Chrome-side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 3 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 d439158a6e2ed803baf497e562d126501994fcb7..f800ff9ba41a3c7b0052088d178aa62797fa34ae 100644
--- a/content/child/fileapi/webfilesystem_impl.h
+++ b/content/child/fileapi/webfilesystem_impl.h
@@ -5,9 +5,10 @@
#ifndef CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_
#define CONTENT_CHILD_FILEAPI_WEBFILESYSTEM_IMPL_H_
+#include <map>
+
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/id_map.h"
#include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h"
#include "third_party/WebKit/public/platform/WebFileSystem.h"
@@ -23,6 +24,13 @@ class WebFileWriter;
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 {
class WebFileSystemImpl
@@ -52,62 +60,67 @@ class WebFileSystemImpl
const WebKit::WebURL& storage_partition,
const WebKit::WebFileSystemType type,
bool create,
- WebKit::WebFileSystemCallbacks*);
+ WebFileSystemCallbacksType);
virtual void deleteFileSystem(
const WebKit::WebURL& storage_partition,
const WebKit::WebFileSystemType type,
- WebKit::WebFileSystemCallbacks*);
+ WebFileSystemCallbacksType);
virtual void move(
const WebKit::WebURL& src_path,
const WebKit::WebURL& dest_path,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void copy(
const WebKit::WebURL& src_path,
const WebKit::WebURL& dest_path,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void remove(
const WebKit::WebURL& path,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void removeRecursively(
const WebKit::WebURL& path,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void readMetadata(
const WebKit::WebURL& path,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void createFile(
const WebKit::WebURL& path,
bool exclusive,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void createDirectory(
const WebKit::WebURL& path,
bool exclusive,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void fileExists(
const WebKit::WebURL& path,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void directoryExists(
const WebKit::WebURL& path,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void readDirectory(
const WebKit::WebURL& path,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual WebKit::WebFileWriter* createFileWriter(
- const WebKit::WebURL& path, WebKit::WebFileWriterClient*) OVERRIDE;
+ const WebKit::WebURL& path,
+ WebKit::WebFileWriterClient*);
virtual void createFileWriter(
const WebKit::WebURL& path,
WebKit::WebFileWriterClient*,
- WebKit::WebFileSystemCallbacks*) OVERRIDE;
+ WebFileSystemCallbacksType) OVERRIDE;
virtual void createSnapshotFileAndReadMetadata(
const WebKit::WebURL& path,
- WebKit::WebFileSystemCallbacks*);
+ WebFileSystemCallbacksType);
- int RegisterCallbacks(WebKit::WebFileSystemCallbacks* callbacks);
- WebKit::WebFileSystemCallbacks* GetAndUnregisterCallbacks(
+ int RegisterCallbacks(WebFileSystemCallbacksType callbacks);
+ WebFileSystemCallbacksType GetAndUnregisterCallbacks(
int callbacks_id);
private:
+ typedef std::map<int, WebFileSystemCallbacksType> CallbacksMap;
+
scoped_refptr<base::MessageLoopProxy> main_thread_loop_;
- IDMap<WebKit::WebFileSystemCallbacks> callbacks_;
+
+ CallbacksMap callbacks_;
+ int next_callbacks_id_;
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