| Index: content/browser/file_system/file_system_dispatcher_host.cc
|
| diff --git a/content/browser/file_system/file_system_dispatcher_host.cc b/content/browser/file_system/file_system_dispatcher_host.cc
|
| index e4065e1dade51138fd2486121df79d28345a3008..15f74ac716a48f2bf13f929362a54c3e6ee8ef8f 100644
|
| --- a/content/browser/file_system/file_system_dispatcher_host.cc
|
| +++ b/content/browser/file_system/file_system_dispatcher_host.cc
|
| @@ -22,6 +22,8 @@
|
| #include "webkit/fileapi/file_system_operation.h"
|
| #include "webkit/fileapi/file_system_operation.h"
|
| #include "webkit/fileapi/file_system_path_manager.h"
|
| +#include "webkit/fileapi/file_system_quota_util.h"
|
| +#include "webkit/fileapi/file_system_util.h"
|
|
|
| using fileapi::FileSystemCallbackDispatcher;
|
| using fileapi::FileSystemOperation;
|
| @@ -143,6 +145,8 @@ bool FileSystemDispatcherHost::OnMessageReceived(
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_TouchFile, OnTouchFile)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_CancelWrite, OnCancel)
|
| IPC_MESSAGE_HANDLER(FileSystemHostMsg_OpenFile, OnOpenFile)
|
| + IPC_MESSAGE_HANDLER(FileSystemHostMsg_WillUpdate, OnWillUpdate)
|
| + IPC_MESSAGE_HANDLER(FileSystemHostMsg_DidUpdate, OnDidUpdate)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP_EX()
|
| return handled;
|
| @@ -242,6 +246,30 @@ void FileSystemDispatcherHost::OnOpenFile(
|
| GetNewOperation(request_id)->OpenFile(path, file_flags, peer_handle());
|
| }
|
|
|
| +void FileSystemDispatcherHost::OnWillUpdate(const GURL& path) {
|
| + GURL origin_url;
|
| + fileapi::FileSystemType type;
|
| + if (!CrackFileSystemURL(path, &origin_url, &type, NULL))
|
| + return;
|
| + fileapi::FileSystemQuotaUtil* quota_util = context_->GetQuotaUtil(type);
|
| + if (!quota_util)
|
| + return;
|
| + quota_util->proxy()->StartUpdateOrigin(origin_url, type);
|
| +}
|
| +
|
| +void FileSystemDispatcherHost::OnDidUpdate(const GURL& path, int64 delta) {
|
| + GURL origin_url;
|
| + fileapi::FileSystemType type;
|
| + if (!CrackFileSystemURL(path, &origin_url, &type, NULL))
|
| + return;
|
| + fileapi::FileSystemQuotaUtil* quota_util = context_->GetQuotaUtil(type);
|
| + if (!quota_util)
|
| + return;
|
| + quota_util->proxy()->UpdateOriginUsage(
|
| + context_->quota_manager_proxy(), origin_url, type, delta);
|
| + quota_util->proxy()->EndUpdateOrigin(origin_url, type);
|
| +}
|
| +
|
| FileSystemOperation* FileSystemDispatcherHost::GetNewOperation(
|
| int request_id) {
|
| BrowserFileSystemCallbackDispatcher* dispatcher =
|
|
|