OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // A net::URLRequestJob class that simulates network errors (including https | 5 // A net::URLRequestJob class that simulates network errors (including https |
6 // related). | 6 // related). |
7 // It is based on URLRequestMockHttpJob. | 7 // It is based on URLRequestMockHttpJob. |
8 | 8 |
9 #ifndef CHROME_BROWSER_NET_URL_REQUEST_MOCK_NET_ERROR_JOB_H_ | 9 #ifndef CONTENT_BROWSER_NET_URL_REQUEST_MOCK_NET_ERROR_JOB_H_ |
10 #define CHROME_BROWSER_NET_URL_REQUEST_MOCK_NET_ERROR_JOB_H_ | 10 #define CONTENT_BROWSER_NET_URL_REQUEST_MOCK_NET_ERROR_JOB_H_ |
11 #pragma once | 11 #pragma once |
12 | 12 |
13 #include "base/task.h" | 13 #include "base/task.h" |
14 #include "chrome/browser/net/url_request_mock_http_job.h" | 14 #include "content/browser/net/url_request_mock_http_job.h" |
15 | 15 |
16 class URLRequestMockNetErrorJob : public URLRequestMockHTTPJob { | 16 class URLRequestMockNetErrorJob : public URLRequestMockHTTPJob { |
17 public: | 17 public: |
18 URLRequestMockNetErrorJob(net::URLRequest* request, | 18 URLRequestMockNetErrorJob(net::URLRequest* request, |
19 const std::vector<int>& errors, | 19 const std::vector<int>& errors, |
20 net::X509Certificate* ssl_cert, | 20 net::X509Certificate* ssl_cert, |
21 const FilePath& file_path); | 21 const FilePath& file_path); |
22 | 22 |
23 virtual void Start(); | 23 virtual void Start(); |
24 virtual void ContinueDespiteLastError(); | 24 virtual void ContinueDespiteLastError(); |
(...skipping 27 matching lines...) Expand all Loading... |
52 | 52 |
53 struct MockInfo; | 53 struct MockInfo; |
54 typedef std::map<GURL, MockInfo> URLMockInfoMap; | 54 typedef std::map<GURL, MockInfo> URLMockInfoMap; |
55 static URLMockInfoMap url_mock_info_map_; | 55 static URLMockInfoMap url_mock_info_map_; |
56 | 56 |
57 ScopedRunnableMethodFactory<URLRequestMockNetErrorJob> method_factory_; | 57 ScopedRunnableMethodFactory<URLRequestMockNetErrorJob> method_factory_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(URLRequestMockNetErrorJob); | 59 DISALLOW_COPY_AND_ASSIGN(URLRequestMockNetErrorJob); |
60 }; | 60 }; |
61 | 61 |
62 #endif // CHROME_BROWSER_NET_URL_REQUEST_MOCK_NET_ERROR_JOB_H_ | 62 #endif // CONTENT_BROWSER_NET_URL_REQUEST_MOCK_NET_ERROR_JOB_H_ |
OLD | NEW |