| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "storage/browser/fileapi/file_system_url_request_job.h" | 5 #include "storage/browser/fileapi/file_system_url_request_job.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 237 } |
| 238 | 238 |
| 239 ReadRawDataComplete(result); | 239 ReadRawDataComplete(result); |
| 240 } | 240 } |
| 241 | 241 |
| 242 bool FileSystemURLRequestJob::IsRedirectResponse(GURL* location, | 242 bool FileSystemURLRequestJob::IsRedirectResponse(GURL* location, |
| 243 int* http_status_code) { | 243 int* http_status_code) { |
| 244 if (is_directory_) { | 244 if (is_directory_) { |
| 245 // This happens when we discovered the file is a directory, so needs a | 245 // This happens when we discovered the file is a directory, so needs a |
| 246 // slash at the end of the path. | 246 // slash at the end of the path. |
| 247 std::string new_path = request_->url().path(); | 247 std::string new_path = request_->url().path().as_string(); |
| 248 new_path.push_back('/'); | 248 new_path.push_back('/'); |
| 249 GURL::Replacements replacements; | 249 GURL::Replacements replacements; |
| 250 replacements.SetPathStr(new_path); | 250 replacements.SetPathStr(new_path); |
| 251 *location = request_->url().ReplaceComponents(replacements); | 251 *location = request_->url().ReplaceComponents(replacements); |
| 252 *http_status_code = 301; // simulate a permanent redirect | 252 *http_status_code = 301; // simulate a permanent redirect |
| 253 return true; | 253 return true; |
| 254 } | 254 } |
| 255 | 255 |
| 256 return false; | 256 return false; |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace storage | 259 } // namespace storage |
| OLD | NEW |