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

Side by Side Diff: net/base/directory_lister.cc

Issue 2786583002: chromeos: Check both original and absolute paths for file: scheme (Closed)
Patch Set: remove dcheck Created 3 years, 6 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 | « net/base/directory_lister.h ('k') | net/base/layered_network_delegate.h » ('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 "net/base/directory_lister.h" 5 #include "net/base/directory_lister.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 base::FilePath path; 137 base::FilePath path;
138 while (!(path = file_enum.Next()).empty()) { 138 while (!(path = file_enum.Next()).empty()) {
139 // Abort on cancellation. This is purely for performance reasons. 139 // Abort on cancellation. This is purely for performance reasons.
140 // Correctness guarantees are made by checks in DoneOnOriginThread. 140 // Correctness guarantees are made by checks in DoneOnOriginThread.
141 if (IsCancelled()) 141 if (IsCancelled())
142 return; 142 return;
143 143
144 DirectoryListerData data; 144 DirectoryListerData data;
145 data.info = file_enum.GetInfo(); 145 data.info = file_enum.GetInfo();
146 data.path = path; 146 data.path = path;
147 data.absolute_path = base::MakeAbsoluteFilePath(path);
147 directory_list->push_back(data); 148 directory_list->push_back(data);
148 149
149 /* TODO(brettw) bug 24107: It would be nice to send incremental updates. 150 /* TODO(brettw) bug 24107: It would be nice to send incremental updates.
150 We gather them all so they can be sorted, but eventually the sorting 151 We gather them all so they can be sorted, but eventually the sorting
151 should be done from JS to give more flexibility in the page. When we do 152 should be done from JS to give more flexibility in the page. When we do
152 that, we can uncomment this to send incremental updates to the page. 153 that, we can uncomment this to send incremental updates to the page.
153 154
154 const int kFilesPerEvent = 8; 155 const int kFilesPerEvent = 8;
155 if (file_data.size() < kFilesPerEvent) 156 if (file_data.size() < kFilesPerEvent)
156 continue; 157 continue;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 194
194 void DirectoryLister::OnListFile(const DirectoryListerData& data) { 195 void DirectoryLister::OnListFile(const DirectoryListerData& data) {
195 delegate_->OnListFile(data); 196 delegate_->OnListFile(data);
196 } 197 }
197 198
198 void DirectoryLister::OnListDone(int error) { 199 void DirectoryLister::OnListDone(int error) {
199 delegate_->OnListDone(error); 200 delegate_->OnListDone(error);
200 } 201 }
201 202
202 } // namespace net 203 } // namespace net
OLDNEW
« no previous file with comments | « net/base/directory_lister.h ('k') | net/base/layered_network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698