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

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

Issue 173181: Remove uses of deprecated version of FileUtil::ResolveShortcut.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: rewritten comment Created 11 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « base/file_util_win.cc ('k') | no next file » | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 // For loading files, we make use of overlapped i/o to ensure that reading from 5 // For loading files, we make use of overlapped i/o to ensure that reading from
6 // the filesystem (e.g., a network filesystem) does not block the calling 6 // the filesystem (e.g., a network filesystem) does not block the calling
7 // thread. An alternative approach would be to use a background thread or pool 7 // thread. An alternative approach would be to use a background thread or pool
8 // of threads, but it seems better to leverage the operating system's ability 8 // of threads, but it seems better to leverage the operating system's ability
9 // to do background file reads for us. 9 // to do background file reads for us.
10 // 10 //
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 GURL* location, int* http_status_code) { 273 GURL* location, int* http_status_code) {
274 #if defined(OS_WIN) 274 #if defined(OS_WIN)
275 std::wstring extension = 275 std::wstring extension =
276 file_util::GetFileExtensionFromPath(file_path_.value()); 276 file_util::GetFileExtensionFromPath(file_path_.value());
277 277
278 // Follow a Windows shortcut. 278 // Follow a Windows shortcut.
279 // We just resolve .lnk file, ignore others. 279 // We just resolve .lnk file, ignore others.
280 if (!LowerCaseEqualsASCII(extension, "lnk")) 280 if (!LowerCaseEqualsASCII(extension, "lnk"))
281 return false; 281 return false;
282 282
283 std::wstring new_path = file_path_.value(); 283 FilePath new_path = file_path_;
284 bool resolved; 284 bool resolved;
285 resolved = file_util::ResolveShortcut(&new_path); 285 resolved = file_util::ResolveShortcut(&new_path);
286 286
287 // If shortcut is not resolved succesfully, do not redirect. 287 // If shortcut is not resolved succesfully, do not redirect.
288 if (!resolved) 288 if (!resolved)
289 return false; 289 return false;
290 290
291 *location = net::FilePathToFileURL(FilePath(new_path)); 291 *location = net::FilePathToFileURL(new_path);
292 *http_status_code = 301; 292 *http_status_code = 301;
293 return true; 293 return true;
294 #else 294 #else
295 return false; 295 return false;
296 #endif 296 #endif
297 } 297 }
OLDNEW
« no previous file with comments | « base/file_util_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698