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

Unified Diff: content/browser/file_system/file_system_dispatcher_host.cc

Issue 7433006: Pepper quota support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 5 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 | « content/browser/file_system/file_system_dispatcher_host.h ('k') | content/common/file_system_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 =
« no previous file with comments | « content/browser/file_system/file_system_dispatcher_host.h ('k') | content/common/file_system_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698