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

Side by Side Diff: chrome/browser/net/url_request_mock_net_error_job.cc

Issue 5755004: net: Add namespace net to URLRequestFileJob. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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 | « chrome/browser/net/url_request_mock_http_job.cc ('k') | net/url_request/url_request_file_job.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/net/url_request_mock_net_error_job.h" 5 #include "chrome/browser/net/url_request_mock_net_error_job.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 net::URLRequestJob* URLRequestMockNetErrorJob::Factory( 60 net::URLRequestJob* URLRequestMockNetErrorJob::Factory(
61 net::URLRequest* request, 61 net::URLRequest* request,
62 const std::string& scheme) { 62 const std::string& scheme) {
63 GURL url = request->url(); 63 GURL url = request->url();
64 64
65 URLMockInfoMap::const_iterator iter = url_mock_info_map_.find(url); 65 URLMockInfoMap::const_iterator iter = url_mock_info_map_.find(url);
66 DCHECK(iter != url_mock_info_map_.end()); 66 DCHECK(iter != url_mock_info_map_.end());
67 67
68 MockInfo mock_info = iter->second; 68 MockInfo mock_info = iter->second;
69 69
70 // URLRequestMockNetErrorJob derives from URLRequestFileJob. We pass a 70 // URLRequestMockNetErrorJob derives from net::URLRequestFileJob. We pass a
71 // FilePath so that the URLRequestFileJob methods will do the loading from 71 // FilePath so that the net::URLRequestFileJob methods will do the loading
72 // the files. 72 // from the files.
73 std::wstring file_url(L"file:///"); 73 std::wstring file_url(L"file:///");
74 file_url.append(mock_info.base); 74 file_url.append(mock_info.base);
75 file_url.append(UTF8ToWide(url.path())); 75 file_url.append(UTF8ToWide(url.path()));
76 // Convert the file:/// URL to a path on disk. 76 // Convert the file:/// URL to a path on disk.
77 FilePath file_path; 77 FilePath file_path;
78 net::FileURLToFilePath(GURL(WideToUTF8(file_url)), &file_path); 78 net::FileURLToFilePath(GURL(WideToUTF8(file_url)), &file_path);
79 return new URLRequestMockNetErrorJob(request, mock_info.errors, 79 return new URLRequestMockNetErrorJob(request, mock_info.errors,
80 mock_info.ssl_cert, 80 mock_info.ssl_cert,
81 file_path); 81 file_path);
82 } 82 }
(...skipping 27 matching lines...) Expand all
110 ssl_cert_.get()); 110 ssl_cert_.get());
111 } else { 111 } else {
112 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error)); 112 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error));
113 } 113 }
114 } 114 }
115 } 115 }
116 116
117 void URLRequestMockNetErrorJob::ContinueDespiteLastError() { 117 void URLRequestMockNetErrorJob::ContinueDespiteLastError() {
118 Start(); 118 Start();
119 } 119 }
OLDNEW
« no previous file with comments | « chrome/browser/net/url_request_mock_http_job.cc ('k') | net/url_request/url_request_file_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698