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

Side by Side Diff: storage/browser/fileapi/file_system_url_request_job.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/websockets/websocket_stream_cookie_test.cc ('k') | storage/browser/fileapi/file_system_url_request_job_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698