OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/test/net/url_request_prepackaged_interceptor.h" | 5 #include "content/test/net/url_request_prepackaged_interceptor.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" |
8 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
9 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
10 #include "net/url_request/url_request.h" | 11 #include "net/url_request/url_request.h" |
11 #include "net/url_request/url_request_file_job.h" | 12 #include "net/url_request/url_request_file_job.h" |
12 #include "net/url_request/url_request_filter.h" | 13 #include "net/url_request/url_request_filter.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 | 15 |
15 using content::BrowserThread; | 16 using content::BrowserThread; |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 class URLRequestPrepackagedJob : public net::URLRequestFileJob { | 22 class URLRequestPrepackagedJob : public net::URLRequestFileJob { |
22 public: | 23 public: |
23 URLRequestPrepackagedJob(net::URLRequest* request, | 24 URLRequestPrepackagedJob(net::URLRequest* request, |
24 net::NetworkDelegate* network_delegate, | 25 net::NetworkDelegate* network_delegate, |
25 const base::FilePath& file_path) | 26 const base::FilePath& file_path) |
26 : net::URLRequestFileJob(request, network_delegate, file_path) {} | 27 : net::URLRequestFileJob( |
| 28 request, network_delegate, file_path, |
| 29 content::BrowserThread::GetBlockingPool()-> |
| 30 GetTaskRunnerWithShutdownBehavior( |
| 31 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)) {} |
27 | 32 |
28 virtual int GetResponseCode() const OVERRIDE { return 200; } | 33 virtual int GetResponseCode() const OVERRIDE { return 200; } |
29 | 34 |
30 private: | 35 private: |
31 virtual ~URLRequestPrepackagedJob() {} | 36 virtual ~URLRequestPrepackagedJob() {} |
32 | 37 |
33 DISALLOW_COPY_AND_ASSIGN(URLRequestPrepackagedJob); | 38 DISALLOW_COPY_AND_ASSIGN(URLRequestPrepackagedJob); |
34 }; | 39 }; |
35 | 40 |
36 } // namespace | 41 } // namespace |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return delegate_->GetHitCount(); | 177 return delegate_->GetHitCount(); |
173 } | 178 } |
174 | 179 |
175 | 180 |
176 URLLocalHostRequestPrepackagedInterceptor | 181 URLLocalHostRequestPrepackagedInterceptor |
177 ::URLLocalHostRequestPrepackagedInterceptor() | 182 ::URLLocalHostRequestPrepackagedInterceptor() |
178 : URLRequestPrepackagedInterceptor("http", "localhost") { | 183 : URLRequestPrepackagedInterceptor("http", "localhost") { |
179 } | 184 } |
180 | 185 |
181 } // namespace content | 186 } // namespace content |
OLD | NEW |