| 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 99439b742ac06bb8d7cef00da0376a8fb317f6cb..20607d38cd5364be7309cab273be24d6ad601dbc 100644
|
| --- a/content/browser/fileapi/fileapi_message_filter.cc
|
| +++ b/content/browser/fileapi/fileapi_message_filter.cc
|
| @@ -34,7 +34,6 @@
|
| #include "webkit/browser/fileapi/file_permission_policy.h"
|
| #include "webkit/browser/fileapi/file_system_context.h"
|
| #include "webkit/browser/fileapi/isolated_context.h"
|
| -#include "webkit/browser/quota/quota_manager.h"
|
| #include "webkit/common/blob/blob_data.h"
|
| #include "webkit/common/blob/shareable_file_reference.h"
|
| #include "webkit/common/fileapi/directory_entry.h"
|
| @@ -42,17 +41,10 @@
|
| #include "webkit/common/fileapi/file_system_types.h"
|
| #include "webkit/common/fileapi/file_system_util.h"
|
|
|
| -#if defined(ENABLE_PLUGINS)
|
| -#include "content/browser/renderer_host/pepper/pepper_security_helper.h"
|
| -#include "ppapi/shared_impl/file_type_conversion.h"
|
| -#endif // defined(ENABLE_PLUGINS)
|
| -
|
| using fileapi::FileSystemFileUtil;
|
| using fileapi::FileSystemBackend;
|
| using fileapi::FileSystemOperation;
|
| using fileapi::FileSystemURL;
|
| -using fileapi::FileUpdateObserver;
|
| -using fileapi::UpdateObserverList;
|
| using webkit_blob::BlobData;
|
| using webkit_blob::BlobStorageContext;
|
| using webkit_blob::BlobStorageHost;
|
| @@ -134,22 +126,6 @@ void FileAPIMessageFilter::OnChannelClosing() {
|
|
|
| in_transit_snapshot_files_.clear();
|
|
|
| - // Close all files that are previously OpenFile()'ed in this process.
|
| - if (!on_close_callbacks_.IsEmpty()) {
|
| - DLOG(INFO)
|
| - << "File API: Renderer process shut down before NotifyCloseFile"
|
| - << " for " << on_close_callbacks_.size() << " files opened in PPAPI";
|
| - }
|
| -
|
| - for (OnCloseCallbackMap::iterator itr(&on_close_callbacks_);
|
| - !itr.IsAtEnd(); itr.Advance()) {
|
| - const base::Closure* callback = itr.GetCurrentValue();
|
| - DCHECK(callback);
|
| - if (!callback->is_null())
|
| - callback->Run();
|
| - }
|
| -
|
| - on_close_callbacks_.Clear();
|
| operation_runner_.reset();
|
| operations_.clear();
|
| }
|
| @@ -180,16 +156,10 @@ bool FileAPIMessageFilter::OnMessageReceived(
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_Truncate, OnTruncate)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_TouchFile, OnTouchFile)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_CancelWrite, OnCancel)
|
| -#if defined(ENABLE_PLUGINS)
|
| - IPC_MESSAGE_HANDLER(FileSystemHostMsg_OpenPepperFile, OnOpenPepperFile)
|
| -#endif // defined(ENABLE_PLUGINS)
|
| - IPC_MESSAGE_HANDLER(FileSystemHostMsg_NotifyCloseFile, OnNotifyCloseFile)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_CreateSnapshotFile,
|
| OnCreateSnapshotFile)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_DidReceiveSnapshotFile,
|
| OnDidReceiveSnapshotFile)
|
| - IPC_MESSAGE_HANDLER(FileSystemHostMsg_WillUpdate, OnWillUpdate)
|
| - IPC_MESSAGE_HANDLER(FileSystemHostMsg_DidUpdate, OnDidUpdate)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_SyncGetPlatformPath,
|
| OnSyncGetPlatformPath)
|
| IPC_MESSAGE_HANDLER(BlobHostMsg_StartBuilding, OnStartBuildingBlob)
|
| @@ -496,84 +466,6 @@ void FileAPIMessageFilter::OnCancel(
|
| }
|
| }
|
|
|
| -#if defined(ENABLE_PLUGINS)
|
| -void FileAPIMessageFilter::OnOpenPepperFile(
|
| - int request_id, const GURL& path, int pp_open_flags) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| -FileSystemURL url(context_->CrackURL(path));
|
| - if (!ValidateFileSystemURL(request_id, url))
|
| - return;
|
| - if (!CanOpenFileSystemURLWithPepperFlags(pp_open_flags, process_id_, url)) {
|
| - Send(new FileSystemMsg_DidFail(
|
| - request_id, base::PLATFORM_FILE_ERROR_SECURITY));
|
| - return;
|
| - }
|
| -
|
| - quota::QuotaLimitType quota_policy = quota::kQuotaLimitTypeUnknown;
|
| - quota::QuotaManagerProxy* quota_manager_proxy =
|
| - context_->quota_manager_proxy();
|
| - CHECK(quota_manager_proxy);
|
| - CHECK(quota_manager_proxy->quota_manager());
|
| -
|
| - if (quota_manager_proxy->quota_manager()->IsStorageUnlimited(
|
| - url.origin(), FileSystemTypeToQuotaStorageType(url.type()))) {
|
| - quota_policy = quota::kQuotaLimitTypeUnlimited;
|
| - } else {
|
| - quota_policy = quota::kQuotaLimitTypeLimited;
|
| - }
|
| -
|
| - int platform_file_flags = 0;
|
| - if (!ppapi::PepperFileOpenFlagsToPlatformFileFlags(pp_open_flags,
|
| - &platform_file_flags)) {
|
| - // |pp_open_flags| should have already been checked in PepperFileIOHost.
|
| - NOTREACHED() << "Open file request with invalid pp_open_flags ignored.";
|
| - }
|
| -
|
| - operations_[request_id] = operation_runner()->OpenFile(
|
| - url, platform_file_flags, PeerHandle(),
|
| - base::Bind(&FileAPIMessageFilter::DidOpenFile, this, request_id,
|
| - quota_policy));
|
| -}
|
| -#endif // defined(ENABLE_PLUGINS)
|
| -
|
| -void FileAPIMessageFilter::OnNotifyCloseFile(int file_open_id) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| -
|
| - // Remove |file_open_id| from the map of |on_close_callback|s.
|
| - // It must only be called for a ID that is successfully opened and enrolled in
|
| - // DidOpenFile.
|
| - base::Closure* on_close_callback = on_close_callbacks_.Lookup(file_open_id);
|
| - if (on_close_callback && !on_close_callback->is_null()) {
|
| - on_close_callback->Run();
|
| - on_close_callbacks_.Remove(file_open_id);
|
| - }
|
| -}
|
| -
|
| -void FileAPIMessageFilter::OnWillUpdate(const GURL& path) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| - FileSystemURL url(context_->CrackURL(path));
|
| - if (!url.is_valid())
|
| - return;
|
| - const UpdateObserverList* observers =
|
| - context_->GetUpdateObservers(url.type());
|
| - if (!observers)
|
| - return;
|
| - observers->Notify(&FileUpdateObserver::OnStartUpdate, MakeTuple(url));
|
| -}
|
| -
|
| -void FileAPIMessageFilter::OnDidUpdate(const GURL& path, int64 delta) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| - FileSystemURL url(context_->CrackURL(path));
|
| - if (!url.is_valid())
|
| - return;
|
| - const UpdateObserverList* observers =
|
| - context_->GetUpdateObservers(url.type());
|
| - if (!observers)
|
| - return;
|
| - observers->Notify(&FileUpdateObserver::OnUpdate, MakeTuple(url, delta));
|
| - observers->Notify(&FileUpdateObserver::OnEndUpdate, MakeTuple(url));
|
| -}
|
| -
|
| void FileAPIMessageFilter::OnSyncGetPlatformPath(
|
| const GURL& path, base::FilePath* platform_path) {
|
| SyncGetPlatformPath(context_, process_id_, path, platform_path);
|
| @@ -815,31 +707,6 @@ void FileAPIMessageFilter::DidReadDirectory(
|
| operations_.erase(request_id);
|
| }
|
|
|
| -void FileAPIMessageFilter::DidOpenFile(int request_id,
|
| - quota::QuotaLimitType quota_policy,
|
| - base::PlatformFileError result,
|
| - base::PlatformFile file,
|
| - const base::Closure& on_close_callback,
|
| - base::ProcessHandle peer_handle) {
|
| - if (result == base::PLATFORM_FILE_OK) {
|
| - IPC::PlatformFileForTransit file_for_transit =
|
| - file != base::kInvalidPlatformFileValue ?
|
| - IPC::GetFileHandleForProcess(file, peer_handle, true) :
|
| - IPC::InvalidPlatformFileForTransit();
|
| - int file_open_id = on_close_callbacks_.Add(
|
| - new base::Closure(on_close_callback));
|
| -
|
| - Send(new FileSystemMsg_DidOpenFile(request_id,
|
| - file_for_transit,
|
| - file_open_id,
|
| - quota_policy));
|
| - } else {
|
| - Send(new FileSystemMsg_DidFail(request_id,
|
| - result));
|
| - }
|
| - operations_.erase(request_id);
|
| -}
|
| -
|
| void FileAPIMessageFilter::DidWrite(int request_id,
|
| base::PlatformFileError result,
|
| int64 bytes,
|
|
|