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

Unified Diff: content/browser/renderer_host/database_message_filter.cc

Issue 1006423008: Add SetFileSize() IPC for WebSQL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove misleading comment. Created 5 years, 9 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
Index: content/browser/renderer_host/database_message_filter.cc
diff --git a/content/browser/renderer_host/database_message_filter.cc b/content/browser/renderer_host/database_message_filter.cc
index bb5bdd6946eafc25ebaa61b644661dd4d4d7990f..7a5de8a109170f2b01ceb5af9caa12d698b852cb 100644
--- a/content/browser/renderer_host/database_message_filter.cc
+++ b/content/browser/renderer_host/database_message_filter.cc
@@ -99,6 +99,8 @@ bool DatabaseMessageFilter::OnMessageReceived(const IPC::Message& message) {
OnDatabaseGetFileSize)
IPC_MESSAGE_HANDLER_DELAY_REPLY(DatabaseHostMsg_GetSpaceAvailable,
OnDatabaseGetSpaceAvailable)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(DatabaseHostMsg_SetFileSize,
+ OnDatabaseSetFileSize)
IPC_MESSAGE_HANDLER(DatabaseHostMsg_Opened, OnDatabaseOpened)
IPC_MESSAGE_HANDLER(DatabaseHostMsg_Modified, OnDatabaseModified)
IPC_MESSAGE_HANDLER(DatabaseHostMsg_Closed, OnDatabaseClosed)
@@ -288,6 +290,19 @@ void DatabaseMessageFilter::OnDatabaseGetUsageAndQuota(
Send(reply_msg);
}
+void DatabaseMessageFilter::OnDatabaseSetFileSize(
+ const base::string16& vfs_file_name, int64 size, IPC::Message* reply_msg) {
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+ bool success = false;
+ base::FilePath db_file =
+ DatabaseUtil::GetFullFilePathForVfsFile(db_tracker_.get(), vfs_file_name);
+ if (!db_file.empty())
+ success = VfsBackend::SetFileSize(db_file, size);
+
+ DatabaseHostMsg_SetFileSize::WriteReplyParams(reply_msg, success);
+ Send(reply_msg);
jam 2015/04/03 15:14:23 this method, and a few others in this class, are u
Scott Hess - ex-Googler 2015/04/03 17:16:36 Apologies, I was just copy/pasting from the parall
+}
+
void DatabaseMessageFilter::OnDatabaseOpened(
const std::string& origin_identifier,
const base::string16& database_name,

Powered by Google App Engine
This is Rietveld 408576698