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

Unified Diff: webkit/fileapi/file_system_url_request_job.cc

Issue 9562032: Use the new CreateSnapshotFile() in FileSystemURLRequest job (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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: webkit/fileapi/file_system_url_request_job.cc
diff --git a/webkit/fileapi/file_system_url_request_job.cc b/webkit/fileapi/file_system_url_request_job.cc
index c5de0122afb9c8726d0c8f571304395173662abe..97ad6b4e51c062ac791b028599cc8e811aff9159 100644
--- a/webkit/fileapi/file_system_url_request_job.cc
+++ b/webkit/fileapi/file_system_url_request_job.cc
@@ -22,6 +22,7 @@
#include "net/http/http_response_info.h"
#include "net/http/http_util.h"
#include "net/url_request/url_request.h"
+#include "webkit/blob/shareable_file_reference.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation.h"
#include "webkit/fileapi/file_system_util.h"
@@ -181,15 +182,17 @@ void FileSystemURLRequestJob::StartAsync() {
net::ERR_INVALID_URL));
return;
}
- operation->GetMetadata(
+ operation->CreateSnapshotFile(
request_->url(),
- base::Bind(&FileSystemURLRequestJob::DidGetMetadata, this));
+ base::Bind(&FileSystemURLRequestJob::DidCreateSnapshot, this));
}
-void FileSystemURLRequestJob::DidGetMetadata(
+void FileSystemURLRequestJob::DidCreateSnapshot(
base::PlatformFileError error_code,
const base::PlatformFileInfo& file_info,
- const FilePath& platform_path) {
+ const FilePath& platform_path,
+ const scoped_refptr<webkit_blob::ShareableFileReference>&
+ deletable_file_ref) {
if (error_code != base::PLATFORM_FILE_OK) {
NotifyFailed(error_code == base::PLATFORM_FILE_ERROR_INVALID_URL ?
net::ERR_INVALID_URL : net::ERR_FILE_NOT_FOUND);
@@ -202,6 +205,9 @@ void FileSystemURLRequestJob::DidGetMetadata(
is_directory_ = file_info.is_directory;
+ // Keep the reference (if it's non-null) so that the file won't go away.
+ snapshot_ref_ = deletable_file_ref;
+
if (!byte_range_.ComputeBounds(file_info.size)) {
NotifyFailed(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE);
return;
« webkit/fileapi/file_system_url_request_job.h ('K') | « webkit/fileapi/file_system_url_request_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698