| Index: webkit/browser/fileapi/file_system_url_request_job.cc
|
| diff --git a/webkit/browser/fileapi/file_system_url_request_job.cc b/webkit/browser/fileapi/file_system_url_request_job.cc
|
| index fe445649a70a4f400e1f1525b5645e352312080a..8ccc5bbf0ab9565b9d9f47d38b5a98816e306e68 100644
|
| --- a/webkit/browser/fileapi/file_system_url_request_job.cc
|
| +++ b/webkit/browser/fileapi/file_system_url_request_job.cc
|
| @@ -57,8 +57,10 @@ static net::HttpResponseHeaders* CreateHttpResponseHeaders() {
|
| FileSystemURLRequestJob::FileSystemURLRequestJob(
|
| URLRequest* request,
|
| NetworkDelegate* network_delegate,
|
| + const std::string& storage_domain,
|
| FileSystemContext* file_system_context)
|
| : URLRequestJob(request, network_delegate),
|
| + storage_domain_(storage_domain),
|
| file_system_context_(file_system_context),
|
| is_directory_(false),
|
| remaining_bytes_(0),
|
| @@ -157,6 +159,14 @@ void FileSystemURLRequestJob::StartAsync() {
|
| return;
|
| DCHECK(!reader_.get());
|
| url_ = file_system_context_->CrackURL(request_->url());
|
| + if (!url_.is_valid()) {
|
| + file_system_context_->AttemptAutoMountForURLRequest(
|
| + request_,
|
| + storage_domain_,
|
| + base::Bind(&FileSystemURLRequestJob::DidAttemptAutoMount,
|
| + weak_factory_.GetWeakPtr()));
|
| + return;
|
| + }
|
| if (!file_system_context_->CanServeURLRequest(url_)) {
|
| // In incognito mode the API is not usable and there should be no data.
|
| NotifyFailed(net::ERR_FILE_NOT_FOUND);
|
| @@ -168,6 +178,15 @@ void FileSystemURLRequestJob::StartAsync() {
|
| weak_factory_.GetWeakPtr()));
|
| }
|
|
|
| +void FileSystemURLRequestJob::DidAttemptAutoMount(base::File::Error result) {
|
| + if (result >= 0 &&
|
| + file_system_context_->CrackURL(request_->url()).is_valid()) {
|
| + StartAsync();
|
| + } else {
|
| + NotifyFailed(net::ERR_FILE_NOT_FOUND);
|
| + }
|
| +}
|
| +
|
| void FileSystemURLRequestJob::DidGetMetadata(
|
| base::File::Error error_code,
|
| const base::File::Info& file_info) {
|
|
|