Chromium Code Reviews| Index: content/browser/fileapi/fileapi_message_filter.cc | 
| diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc | 
| index 9ee9ede7307e20117d621e15c73e4a743885c407..25710aec1c94ef0d25c9a3d8b454af6544d1d6fd 100644 | 
| --- a/content/browser/fileapi/fileapi_message_filter.cc | 
| +++ b/content/browser/fileapi/fileapi_message_filter.cc | 
| @@ -17,7 +17,6 @@ | 
| #include "base/time/time.h" | 
| #include "content/browser/bad_message.h" | 
| #include "content/browser/child_process_security_policy_impl.h" | 
| -#include "content/browser/fileapi/blob_storage_host.h" | 
| #include "content/browser/fileapi/browser_file_system_helper.h" | 
| #include "content/browser/fileapi/chrome_blob_storage_context.h" | 
| #include "content/browser/streams/stream_registry.h" | 
| @@ -53,10 +52,7 @@ namespace content { | 
| namespace { | 
| -const uint32 kFilteredMessageClasses[] = { | 
| - BlobMsgStart, | 
| - FileSystemMsgStart, | 
| -}; | 
| +const uint32 kFilteredMessageClasses[] = {BlobMsgStart, FileSystemMsgStart}; | 
| 
 
michaeln
2015/12/15 02:40:48
does BlobMsgStart still belong here given the new
 
dmurph
2015/12/18 03:22:50
I don't think so.
 
 | 
| void RevokeFilePermission(int child_id, const base::FilePath& path) { | 
| ChildProcessSecurityPolicyImpl::GetInstance()->RevokeAllPermissionsForFile( | 
| @@ -116,18 +112,13 @@ void FileAPIMessageFilter::OnChannelConnected(int32 peer_pid) { | 
| DCHECK(request_context_); | 
| } | 
| - blob_storage_host_.reset( | 
| - new BlobStorageHost(blob_storage_context_->context())); | 
| - | 
| operation_runner_ = context_->CreateFileSystemOperationRunner(); | 
| } | 
| void FileAPIMessageFilter::OnChannelClosing() { | 
| DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| - // Unregister all the blob and stream URLs that are previously registered in | 
| - // this process. | 
| - blob_storage_host_.reset(); | 
| + // Unregister all stream URLs that are previously registered in this process. | 
| for (base::hash_set<std::string>::const_iterator iter = stream_urls_.begin(); | 
| iter != stream_urls_.end(); ++iter) { | 
| stream_context_->registry()->UnregisterStream(GURL(*iter)); | 
| @@ -169,19 +160,6 @@ bool FileAPIMessageFilter::OnMessageReceived(const IPC::Message& message) { | 
| OnDidReceiveSnapshotFile) | 
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_SyncGetPlatformPath, | 
| OnSyncGetPlatformPath) | 
| - IPC_MESSAGE_HANDLER(BlobHostMsg_StartBuilding, OnStartBuildingBlob) | 
| - IPC_MESSAGE_HANDLER(BlobHostMsg_AppendBlobDataItem, | 
| - OnAppendBlobDataItemToBlob) | 
| - IPC_MESSAGE_HANDLER(BlobHostMsg_SyncAppendSharedMemory, | 
| - OnAppendSharedMemoryToBlob) | 
| - IPC_MESSAGE_HANDLER(BlobHostMsg_FinishBuilding, OnFinishBuildingBlob) | 
| - IPC_MESSAGE_HANDLER(BlobHostMsg_IncrementRefCount, | 
| - OnIncrementBlobRefCount) | 
| - IPC_MESSAGE_HANDLER(BlobHostMsg_DecrementRefCount, | 
| - OnDecrementBlobRefCount) | 
| - IPC_MESSAGE_HANDLER(BlobHostMsg_RegisterPublicURL, | 
| - OnRegisterPublicBlobURL) | 
| - IPC_MESSAGE_HANDLER(BlobHostMsg_RevokePublicURL, OnRevokePublicBlobURL) | 
| IPC_MESSAGE_HANDLER(StreamHostMsg_StartBuilding, OnStartBuildingStream) | 
| IPC_MESSAGE_HANDLER(StreamHostMsg_AppendBlobDataItem, | 
| OnAppendBlobDataItemToStream) | 
| @@ -514,90 +492,6 @@ void FileAPIMessageFilter::OnDidReceiveSnapshotFile(int request_id) { | 
| in_transit_snapshot_files_.erase(request_id); | 
| } | 
| -void FileAPIMessageFilter::OnStartBuildingBlob(const std::string& uuid) { | 
| - DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| - ignore_result(blob_storage_host_->StartBuildingBlob(uuid)); | 
| -} | 
| - | 
| -void FileAPIMessageFilter::OnAppendBlobDataItemToBlob( | 
| - const std::string& uuid, | 
| - const storage::DataElement& item) { | 
| - DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| - if (item.type() == storage::DataElement::TYPE_FILE_FILESYSTEM) { | 
| - FileSystemURL filesystem_url(context_->CrackURL(item.filesystem_url())); | 
| - if (!FileSystemURLIsValid(context_, filesystem_url) || | 
| - !security_policy_->CanReadFileSystemFile(process_id_, filesystem_url)) { | 
| - ignore_result(blob_storage_host_->CancelBuildingBlob(uuid)); | 
| - return; | 
| - } | 
| - } | 
| - if (item.type() == storage::DataElement::TYPE_FILE && | 
| - !security_policy_->CanReadFile(process_id_, item.path())) { | 
| - ignore_result(blob_storage_host_->CancelBuildingBlob(uuid)); | 
| - return; | 
| - } | 
| - if (item.length() == 0) { | 
| - bad_message::ReceivedBadMessage(this, | 
| - bad_message::FAMF_APPEND_ITEM_TO_BLOB); | 
| - return; | 
| - } | 
| - ignore_result(blob_storage_host_->AppendBlobDataItem(uuid, item)); | 
| -} | 
| - | 
| -void FileAPIMessageFilter::OnAppendSharedMemoryToBlob( | 
| - const std::string& uuid, | 
| - base::SharedMemoryHandle handle, | 
| - size_t buffer_size) { | 
| - DCHECK(base::SharedMemory::IsHandleValid(handle)); | 
| - if (!buffer_size) { | 
| - bad_message::ReceivedBadMessage( | 
| - this, bad_message::FAMF_APPEND_SHARED_MEMORY_TO_BLOB); | 
| - return; | 
| - } | 
| -#if defined(OS_WIN) | 
| - base::SharedMemory shared_memory(handle, true, PeerHandle()); | 
| -#else | 
| - base::SharedMemory shared_memory(handle, true); | 
| -#endif | 
| - if (!shared_memory.Map(buffer_size)) { | 
| - ignore_result(blob_storage_host_->CancelBuildingBlob(uuid)); | 
| - return; | 
| - } | 
| - | 
| - storage::DataElement item; | 
| - item.SetToSharedBytes(static_cast<char*>(shared_memory.memory()), | 
| - buffer_size); | 
| - ignore_result(blob_storage_host_->AppendBlobDataItem(uuid, item)); | 
| -} | 
| - | 
| -void FileAPIMessageFilter::OnFinishBuildingBlob( | 
| - const std::string& uuid, const std::string& content_type) { | 
| - DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| - ignore_result(blob_storage_host_->FinishBuildingBlob(uuid, content_type)); | 
| - // TODO(michaeln): check return values once blink has migrated, crbug/174200 | 
| -} | 
| - | 
| -void FileAPIMessageFilter::OnIncrementBlobRefCount(const std::string& uuid) { | 
| - DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| - ignore_result(blob_storage_host_->IncrementBlobRefCount(uuid)); | 
| -} | 
| - | 
| -void FileAPIMessageFilter::OnDecrementBlobRefCount(const std::string& uuid) { | 
| - DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| - ignore_result(blob_storage_host_->DecrementBlobRefCount(uuid)); | 
| -} | 
| - | 
| -void FileAPIMessageFilter::OnRegisterPublicBlobURL( | 
| - const GURL& public_url, const std::string& uuid) { | 
| - DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| - ignore_result(blob_storage_host_->RegisterPublicBlobURL(public_url, uuid)); | 
| -} | 
| - | 
| -void FileAPIMessageFilter::OnRevokePublicBlobURL(const GURL& public_url) { | 
| - DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| - ignore_result(blob_storage_host_->RevokePublicBlobURL(public_url)); | 
| -} | 
| - | 
| void FileAPIMessageFilter::OnStartBuildingStream( | 
| const GURL& url, const std::string& content_type) { | 
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |