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

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

Issue 2070283002: Use container::back() and container::pop_back(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « services/ui/ws/display_manager.cc ('k') | storage/common/fileapi/file_system_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_factory.h" 5 #include "storage/browser/fileapi/file_system_url_request_job_factory.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "net/url_request/url_request.h" 9 #include "net/url_request/url_request.h"
10 #include "storage/browser/fileapi/file_system_dir_url_request_job.h" 10 #include "storage/browser/fileapi/file_system_dir_url_request_job.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 FileSystemProtocolHandler::~FileSystemProtocolHandler() {} 46 FileSystemProtocolHandler::~FileSystemProtocolHandler() {}
47 47
48 net::URLRequestJob* FileSystemProtocolHandler::MaybeCreateJob( 48 net::URLRequestJob* FileSystemProtocolHandler::MaybeCreateJob(
49 net::URLRequest* request, net::NetworkDelegate* network_delegate) const { 49 net::URLRequest* request, net::NetworkDelegate* network_delegate) const {
50 const std::string path = request->url().path(); 50 const std::string path = request->url().path();
51 51
52 // If the path ends with a /, we know it's a directory. If the path refers 52 // If the path ends with a /, we know it's a directory. If the path refers
53 // to a directory and gets dispatched to FileSystemURLRequestJob, that class 53 // to a directory and gets dispatched to FileSystemURLRequestJob, that class
54 // redirects back here, by adding a / to the URL. 54 // redirects back here, by adding a / to the URL.
55 if (!path.empty() && path[path.size() - 1] == '/') { 55 if (!path.empty() && path.back() == '/') {
56 return new FileSystemDirURLRequestJob( 56 return new FileSystemDirURLRequestJob(
57 request, network_delegate, storage_domain_, file_system_context_); 57 request, network_delegate, storage_domain_, file_system_context_);
58 } 58 }
59 return new FileSystemURLRequestJob( 59 return new FileSystemURLRequestJob(
60 request, network_delegate, storage_domain_, file_system_context_); 60 request, network_delegate, storage_domain_, file_system_context_);
61 } 61 }
62 62
63 } // anonymous namespace 63 } // anonymous namespace
64 64
65 net::URLRequestJobFactory::ProtocolHandler* CreateFileSystemProtocolHandler( 65 net::URLRequestJobFactory::ProtocolHandler* CreateFileSystemProtocolHandler(
66 const std::string& storage_domain, FileSystemContext* context) { 66 const std::string& storage_domain, FileSystemContext* context) {
67 DCHECK(context); 67 DCHECK(context);
68 return new FileSystemProtocolHandler(storage_domain, context); 68 return new FileSystemProtocolHandler(storage_domain, context);
69 } 69 }
70 70
71 } // namespace storage 71 } // namespace storage
OLDNEW
« no previous file with comments | « services/ui/ws/display_manager.cc ('k') | storage/common/fileapi/file_system_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698