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

Unified Diff: content/browser/fileapi/fileapi_message_filter.h

Issue 11410019: ********** Chromium Blob hacking (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years 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
Index: content/browser/fileapi/fileapi_message_filter.h
===================================================================
--- content/browser/fileapi/fileapi_message_filter.h (revision 171309)
+++ content/browser/fileapi/fileapi_message_filter.h (working copy)
@@ -5,12 +5,11 @@
#ifndef CONTENT_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_
#define CONTENT_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_
-#include <set>
+#include <map>
#include <string>
#include "base/callback.h"
#include "base/file_util_proxy.h"
-#include "base/hash_tables.h"
#include "base/id_map.h"
#include "base/platform_file.h"
#include "base/shared_memory.h"
@@ -37,6 +36,7 @@
} // namespace net
namespace webkit_blob {
+class BlobStorageConsumer;
class ShareableFileReference;
}
@@ -100,7 +100,7 @@
void OnReadDirectory(int request_id, const GURL& path);
void OnWrite(int request_id,
const GURL& path,
- const GURL& blob_url,
+ const std::string& blob_uuid,
int64 offset);
void OnTruncate(int request_id, const GURL& path, int64 length);
void OnTouchFile(int request_id,
@@ -115,18 +115,22 @@
void OnSyncGetPlatformPath(const GURL& path,
FilePath* platform_path);
void OnCreateSnapshotFile(int request_id,
- const GURL& blob_url,
const GURL& path);
+ void OnDidReceiveSnapshotFile(int request_id);
+ void OnStartBuildingBlob2(const std::string& uuid);
+ void OnAppendBlobDataItem2(const std::string& uuid,
+ const webkit_blob::BlobData::Item& item);
+ void OnAppendSharedMemory2(const std::string& uuid,
+ base::SharedMemoryHandle handle,
+ size_t buffer_size);
+ void OnFinishBuildingBlob2(const std::string& uuid,
+ const std::string& content_type);
+ void OnCancelBuildingBlob(const std::string& uuid);
+ void OnIncrementBlobRefCount(const std::string& uuid);
+ void OnDecrementBlobRefCount(const std::string& uuid);
+ void OnRegisterPublicBlobURL(const GURL& public_url, const std::string& uuid);
+ void OnRevokePublicBlobURL(const GURL& public_url);
- void OnStartBuildingBlob(const GURL& url);
- void OnAppendBlobDataItem(const GURL& url,
- const webkit_blob::BlobData::Item& item);
- void OnAppendSharedMemory(const GURL& url, base::SharedMemoryHandle handle,
- size_t buffer_size);
- void OnFinishBuildingBlob(const GURL& url, const std::string& content_type);
- void OnCloneBlob(const GURL& url, const GURL& src_url);
- void OnRemoveBlob(const GURL& url);
-
// Callback functions to be used when each file operation is finished.
void DidFinish(int request_id, base::PlatformFileError result);
void DidCancel(int request_id, base::PlatformFileError result);
@@ -154,19 +158,13 @@
void DidDeleteFileSystem(int request_id,
base::PlatformFileError result);
void DidCreateSnapshot(
+ const fileapi::FileSystemURL& url,
int request_id,
- const base::Callback<void(const FilePath&)>& register_file_callback,
base::PlatformFileError result,
const base::PlatformFileInfo& info,
const FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
- // Registers the given file pointed by |virtual_path| and backed by
- // |platform_path| as the |blob_url|. Called by DidCreateSnapshot.
- void RegisterFileAsBlob(const GURL& blob_url,
- const fileapi::FileSystemURL& url,
- const FilePath& platform_path);
-
// Checks renderer's access permissions for single file.
bool HasPermissionsForFile(const fileapi::FileSystemURL& url,
int permissions,
@@ -192,10 +190,15 @@
scoped_refptr<ChromeBlobStorageContext> blob_storage_context_;
- // Keep track of blob URLs registered in this process. Need to unregister
- // all of them when the renderer process dies.
- base::hash_set<std::string> blob_urls_;
+ // Keep track of blobs utilized in this process and cleans up
+ // accordingly when the renderer process dies.
+ scoped_ptr<webkit_blob::BlobStorageConsumer> blob_storage_consumer_;
+ // Used to keep snapshot files alive while a DidCreateSnapshot
+ // is being sent to the renderer.
+ std::map<int, scoped_refptr<webkit_blob::ShareableFileReference> >
+ in_transit_snapshot_files_;
+
// Keep track of file system file URLs opened by OpenFile() in this process.
// Need to close all of them when the renderer process dies.
std::multiset<GURL> open_filesystem_urls_;

Powered by Google App Engine
This is Rietveld 408576698