summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-24 00:21:26 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-24 00:21:26 +0000
commit828912619a537bf7a33a36c2441d922a7639bc9b (patch)
tree6c49122fa2a1d04ba8b3b65705bd6fbf23b3d34e /chrome/browser/automation
parented1ff5e175dbc151aa7999e2c7b79a82c8ff7052 (diff)
downloadchromium_src-828912619a537bf7a33a36c2441d922a7639bc9b.zip
chromium_src-828912619a537bf7a33a36c2441d922a7639bc9b.tar.gz
chromium_src-828912619a537bf7a33a36c2441d922a7639bc9b.tar.bz2
Implement extension:// protocol.
Review URL: http://codereview.chromium.org/15010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7462 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/url_request_mock_http_job.cc10
-rw-r--r--chrome/browser/automation/url_request_mock_http_job.h2
-rw-r--r--chrome/browser/automation/url_request_mock_net_error_job.cc19
-rw-r--r--chrome/browser/automation/url_request_mock_net_error_job.h3
4 files changed, 17 insertions, 17 deletions
diff --git a/chrome/browser/automation/url_request_mock_http_job.cc b/chrome/browser/automation/url_request_mock_http_job.cc
index 9f2ccfc..ed384e6 100644
--- a/chrome/browser/automation/url_request_mock_http_job.cc
+++ b/chrome/browser/automation/url_request_mock_http_job.cc
@@ -33,9 +33,8 @@ URLRequestJob* URLRequestMockHTTPJob::Factory(URLRequest* request,
// Convert the file:/// URL to a path on disk.
std::wstring file_path;
net::FileURLToFilePath(GURL(WideToUTF8(file_url)), &file_path);
- URLRequestMockHTTPJob* job = new URLRequestMockHTTPJob(request);
- job->file_path_ = FilePath::FromWStringHack(file_path);
- return job;
+ return new URLRequestMockHTTPJob(request,
+ FilePath::FromWStringHack(file_path));
}
/* static */
@@ -57,8 +56,9 @@ GURL URLRequestMockHTTPJob::GetMockUrl(const std::wstring& path) {
return GURL(url);
}
-URLRequestMockHTTPJob::URLRequestMockHTTPJob(URLRequest* request)
- : URLRequestFileJob(request) { }
+URLRequestMockHTTPJob::URLRequestMockHTTPJob(URLRequest* request,
+ const FilePath& file_path)
+ : URLRequestFileJob(request, file_path) { }
void URLRequestMockHTTPJob::GetResponseInfo(net::HttpResponseInfo* info) {
std::wstring header_file = file_path_.ToWStringHack() + kMockHeaderFileSuffix;
diff --git a/chrome/browser/automation/url_request_mock_http_job.h b/chrome/browser/automation/url_request_mock_http_job.h
index 2f34397..2772f1b 100644
--- a/chrome/browser/automation/url_request_mock_http_job.h
+++ b/chrome/browser/automation/url_request_mock_http_job.h
@@ -11,7 +11,7 @@
class URLRequestMockHTTPJob : public URLRequestFileJob {
public:
- URLRequestMockHTTPJob(URLRequest* request);
+ URLRequestMockHTTPJob(URLRequest* request, const FilePath& file_path);
virtual ~URLRequestMockHTTPJob() { }
virtual bool GetMimeType(std::string* mime_type);
diff --git a/chrome/browser/automation/url_request_mock_net_error_job.cc b/chrome/browser/automation/url_request_mock_net_error_job.cc
index 1c67d29..c6bfa80 100644
--- a/chrome/browser/automation/url_request_mock_net_error_job.cc
+++ b/chrome/browser/automation/url_request_mock_net_error_job.cc
@@ -46,26 +46,25 @@ URLRequestJob* URLRequestMockNetErrorJob::Factory(URLRequest* request,
DCHECK(iter != url_mock_info_map_.end());
MockInfo mock_info = iter->second;
- URLRequestMockNetErrorJob* job =
- new URLRequestMockNetErrorJob(request, mock_info.errors,
- mock_info.ssl_cert);
- // URLRequestMockNetErrorJob derives from URLRequestFileJob. We set the
- // file_path_ of the job so that the URLRequestFileJob methods will do the
- // loading from the files.
+ // URLRequestMockNetErrorJob derives from URLRequestFileJob. We pass a
+ // FilePath so that the URLRequestFileJob methods will do the loading from
+ // the files.
std::wstring file_url(L"file:///");
file_url.append(mock_info.base);
file_url.append(UTF8ToWide(url.path()));
// Convert the file:/// URL to a path on disk.
std::wstring file_path;
net::FileURLToFilePath(GURL(WideToUTF8(file_url)), &file_path);
- job->file_path_ = FilePath::FromWStringHack(file_path);
- return job;
+ return new URLRequestMockNetErrorJob(request, mock_info.errors,
+ mock_info.ssl_cert,
+ FilePath::FromWStringHack(file_path));
}
URLRequestMockNetErrorJob::URLRequestMockNetErrorJob(URLRequest* request,
- const std::vector<int>& errors, net::X509Certificate* cert)
- : URLRequestMockHTTPJob(request),
+ const std::vector<int>& errors, net::X509Certificate* cert,
+ const FilePath& file_path)
+ : URLRequestMockHTTPJob(request, file_path),
errors_(errors),
ssl_cert_(cert) {
}
diff --git a/chrome/browser/automation/url_request_mock_net_error_job.h b/chrome/browser/automation/url_request_mock_net_error_job.h
index 57aeedd..2f4d9f7 100644
--- a/chrome/browser/automation/url_request_mock_net_error_job.h
+++ b/chrome/browser/automation/url_request_mock_net_error_job.h
@@ -16,7 +16,8 @@ class URLRequestMockNetErrorJob : public URLRequestMockHTTPJob {
public:
URLRequestMockNetErrorJob(URLRequest* request,
const std::vector<int>& errors,
- net::X509Certificate* ssl_cert);
+ net::X509Certificate* ssl_cert,
+ const FilePath& file_path);
virtual ~URLRequestMockNetErrorJob();
virtual void Start();