| Index: webkit/browser/fileapi/file_system_dir_url_request_job.cc
|
| diff --git a/webkit/browser/fileapi/file_system_dir_url_request_job.cc b/webkit/browser/fileapi/file_system_dir_url_request_job.cc
|
| index b0f19660aa84135187aaad9550aeb7fafafb8d68..e2ef2b66740542f406ce88197ff81b2f08ff3f4a 100644
|
| --- a/webkit/browser/fileapi/file_system_dir_url_request_job.cc
|
| +++ b/webkit/browser/fileapi/file_system_dir_url_request_job.cc
|
| @@ -35,8 +35,10 @@ namespace fileapi {
|
| FileSystemDirURLRequestJob::FileSystemDirURLRequestJob(
|
| 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),
|
| weak_factory_(this) {
|
| }
|
| @@ -81,6 +83,13 @@ void FileSystemDirURLRequestJob::StartAsync() {
|
| if (!request_)
|
| return;
|
| url_ = file_system_context_->CrackURL(request_->url());
|
| + if (!url_.is_valid()) {
|
| + file_system_context_->AttemptAutoMountForURLRequest(
|
| + request_,
|
| + storage_domain_,
|
| + base::Bind(&FileSystemDirURLRequestJob::DidAttemptAutoMount,
|
| + weak_factory_.GetWeakPtr()));
|
| + }
|
| if (!file_system_context_->CanServeURLRequest(url_)) {
|
| // In incognito mode the API is not usable and there should be no data.
|
| if (url_.is_valid() && VirtualPath::IsRootPath(url_.virtual_path())) {
|
| @@ -99,6 +108,16 @@ void FileSystemDirURLRequestJob::StartAsync() {
|
| base::Bind(&FileSystemDirURLRequestJob::DidReadDirectory, this));
|
| }
|
|
|
| +void FileSystemDirURLRequestJob::DidAttemptAutoMount(base::File::Error result) {
|
| + if (result >= 0 &&
|
| + file_system_context_->CrackURL(request_->url()).is_valid()) {
|
| + StartAsync();
|
| + } else {
|
| + NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
|
| + net::ERR_FILE_NOT_FOUND));
|
| + }
|
| +}
|
| +
|
| void FileSystemDirURLRequestJob::DidReadDirectory(
|
| base::File::Error result,
|
| const std::vector<DirectoryEntry>& entries,
|
|
|