| Index: chrome/browser/automation/url_request_mock_http_job.cc
|
| ===================================================================
|
| --- chrome/browser/automation/url_request_mock_http_job.cc (revision 23129)
|
| +++ chrome/browser/automation/url_request_mock_http_job.cc (working copy)
|
| @@ -19,22 +19,8 @@
|
| /* static */
|
| URLRequestJob* URLRequestMockHTTPJob::Factory(URLRequest* request,
|
| const std::string& scheme) {
|
| - std::wstring file_url(L"file:///");
|
| - file_url += base_path_;
|
| - const std::string& url = request->url().spec();
|
| - // Fix up the url to be the file url we're loading from disk.
|
| - std::string host_prefix("http://");
|
| - host_prefix.append(kMockHostname);
|
| - size_t host_prefix_len = host_prefix.length();
|
| - if (url.compare(0, host_prefix_len, host_prefix.data(),
|
| - host_prefix_len) == 0) {
|
| - file_url += UTF8ToWide(url.substr(host_prefix_len));
|
| - }
|
| -
|
| - // Convert the file:/// URL to a path on disk.
|
| - FilePath file_path;
|
| - net::FileURLToFilePath(GURL(WideToUTF8(file_url)), &file_path);
|
| - return new URLRequestMockHTTPJob(request, file_path);
|
| + return new URLRequestMockHTTPJob(request,
|
| + GetOnDiskPath(base_path_, request, scheme));
|
| }
|
|
|
| /* static */
|
| @@ -56,6 +42,28 @@
|
| return GURL(url);
|
| }
|
|
|
| +/* static */
|
| +FilePath URLRequestMockHTTPJob::GetOnDiskPath(const std::wstring& base_path,
|
| + URLRequest* request,
|
| + const std::string& scheme) {
|
| + std::wstring file_url(L"file:///");
|
| + file_url += base_path;
|
| + const std::string& url = request->url().spec();
|
| + // Fix up the url to be the file url we're loading from disk.
|
| + std::string host_prefix("http://");
|
| + host_prefix.append(kMockHostname);
|
| + size_t host_prefix_len = host_prefix.length();
|
| + if (url.compare(0, host_prefix_len, host_prefix.data(),
|
| + host_prefix_len) == 0) {
|
| + file_url += UTF8ToWide(url.substr(host_prefix_len));
|
| + }
|
| +
|
| + // Convert the file:/// URL to a path on disk.
|
| + FilePath file_path;
|
| + net::FileURLToFilePath(GURL(WideToUTF8(file_url)), &file_path);
|
| + return file_path;
|
| +}
|
| +
|
| URLRequestMockHTTPJob::URLRequestMockHTTPJob(URLRequest* request,
|
| const FilePath& file_path)
|
| : URLRequestFileJob(request, file_path) { }
|
|
|
| Property changes on: chrome\browser\automation\url_request_mock_http_job.cc
|
| ___________________________________________________________________
|
| Added: svn:mergeinfo
|
| Merged /branches/chrome_webkit_merge_branch/chrome/browser/automation/url_request_mock_http_job.cc:r69-2775
|
| Merged /trunk/src/chrome/browser/automation/url_request_mock_http_job.cc:r21668
|
|
|
|
|