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

Unified Diff: net/url_request/url_request_file_job.cc

Issue 7230: add file:// handling to mac and linux builds (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/net.xcodeproj/project.pbxproj ('k') | net/url_request/url_request_job_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_file_job.cc
===================================================================
--- net/url_request/url_request_file_job.cc (revision 3213)
+++ net/url_request/url_request_file_job.cc (working copy)
@@ -28,7 +28,9 @@
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "net/url_request/url_request.h"
+#if defined(OS_WIN)
#include "net/url_request/url_request_file_dir_job.h"
+#endif
#if defined(OS_WIN)
class URLRequestFileJob::AsyncResolver :
@@ -74,8 +76,10 @@
std::wstring file_path;
if (net::FileURLToFilePath(request->url(), &file_path)) {
if (file_path[file_path.size() - 1] == file_util::kPathSeparator) {
+#if defined(OS_WIN)
// Only directories have trailing slashes.
return new URLRequestFileDirJob(request, file_path);
+#endif
}
}
@@ -100,20 +104,22 @@
}
void URLRequestFileJob::Start() {
+#if defined(OS_WIN)
// Resolve UNC paths on a background thread.
if (!file_path_.compare(0, 2, L"\\\\")) {
DCHECK(!async_resolver_);
async_resolver_ = new AsyncResolver(this);
WorkerPool::PostTask(FROM_HERE, NewRunnableMethod(
async_resolver_.get(), &AsyncResolver::Resolve, file_path_), true);
- } else {
- file_util::FileInfo file_info;
- bool exists = file_util::GetFileInfo(file_path_, &file_info);
+ return;
+ }
+#endif
+ file_util::FileInfo file_info;
+ bool exists = file_util::GetFileInfo(file_path_, &file_info);
- // Continue asynchronously.
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &URLRequestFileJob::DidResolve, exists, file_info));
- }
+ // Continue asynchronously.
+ MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
+ this, &URLRequestFileJob::DidResolve, exists, file_info));
}
void URLRequestFileJob::Kill() {
« no previous file with comments | « net/net.xcodeproj/project.pbxproj ('k') | net/url_request/url_request_job_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698