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

Side by Side Diff: net/url_request/url_request_file_dir_job.cc

Issue 48113006: Fix scoping of raw_bytes in URLRequestFileDirJob::OnListFile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use AppendASCII in unittest Created 7 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
« no previous file with comments | « net/data/url_request_unittest/filedir-sentinel ('k') | net/url_request/url_request_unittest.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 "net/url_request/url_request_file_dir_job.h" 5 #include "net/url_request/url_request_file_dir_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 base::SysNativeMBToWide(dir_path_.value())); 112 base::SysNativeMBToWide(dir_path_.value()));
113 #endif 113 #endif
114 data_.append(GetDirectoryListingHeader(title)); 114 data_.append(GetDirectoryListingHeader(title));
115 wrote_header_ = true; 115 wrote_header_ = true;
116 } 116 }
117 117
118 #if defined(OS_WIN) 118 #if defined(OS_WIN)
119 std::string raw_bytes; // Empty on Windows means UTF-8 encoded name. 119 std::string raw_bytes; // Empty on Windows means UTF-8 encoded name.
120 #elif defined(OS_POSIX) 120 #elif defined(OS_POSIX)
121 // TOOD(jungshik): The same issue as for the directory name. 121 // TOOD(jungshik): The same issue as for the directory name.
122 const std::string& raw_bytes = data.info.GetName().value(); 122 base::FilePath filename = data.info.GetName();
123 const std::string& raw_bytes = filename.value();
123 #endif 124 #endif
124 data_.append(GetDirectoryListingEntry( 125 data_.append(GetDirectoryListingEntry(
125 data.info.GetName().LossyDisplayName(), 126 data.info.GetName().LossyDisplayName(),
126 raw_bytes, 127 raw_bytes,
127 data.info.IsDirectory(), 128 data.info.IsDirectory(),
128 data.info.GetSize(), 129 data.info.GetSize(),
129 data.info.GetLastModifiedTime())); 130 data.info.GetLastModifiedTime()));
130 131
131 // TODO(darin): coalesce more? 132 // TODO(darin): coalesce more?
132 CompleteRead(); 133 CompleteRead();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 *bytes_read = count; 179 *bytes_read = count;
179 return true; 180 return true;
180 } else if (list_complete_) { 181 } else if (list_complete_) {
181 // EOF 182 // EOF
182 return true; 183 return true;
183 } 184 }
184 return false; 185 return false;
185 } 186 }
186 187
187 } // namespace net 188 } // namespace net
OLDNEW
« no previous file with comments | « net/data/url_request_unittest/filedir-sentinel ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698