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

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

Issue 7633061: Merge 94892 - Pepper quota support (Closed) Base URL: svn://svn.chromium.org/chrome/branches/835/src/
Patch Set: Created 9 years, 4 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
===================================================================
--- content/browser/file_system/file_system_dispatcher_host.cc (revision 96768)
+++ content/browser/file_system/file_system_dispatcher_host.cc (working copy)
@@ -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 @@
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 @@
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