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/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
11 #include "net/url_request/url_request_file_job.h" | 11 #include "net/url_request/url_request_file_job.h" |
12 #include "net/url_request/url_request_filter.h" | 12 #include "net/url_request/url_request_filter.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 using content::BrowserThread; | 15 using content::BrowserThread; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 class URLRequestPrepackagedJob : public net::URLRequestFileJob { | 21 class URLRequestPrepackagedJob : public net::URLRequestFileJob { |
22 public: | 22 public: |
23 URLRequestPrepackagedJob(net::URLRequest* request, | 23 URLRequestPrepackagedJob(net::URLRequest* request, |
24 net::NetworkDelegate* network_delegate, | 24 net::NetworkDelegate* network_delegate, |
25 const base::FilePath& file_path) | 25 const base::FilePath& file_path) |
26 : net::URLRequestFileJob(request, network_delegate, file_path) {} | 26 : net::URLRequestFileJob(request, network_delegate, file_path) {} |
27 | 27 |
28 virtual int GetResponseCode() const { return 200; } | 28 virtual int GetResponseCode() const OVERRIDE { return 200; } |
29 | 29 |
30 private: | 30 private: |
31 virtual ~URLRequestPrepackagedJob() {} | 31 virtual ~URLRequestPrepackagedJob() {} |
32 | 32 |
33 DISALLOW_COPY_AND_ASSIGN(URLRequestPrepackagedJob); | 33 DISALLOW_COPY_AND_ASSIGN(URLRequestPrepackagedJob); |
34 }; | 34 }; |
35 | 35 |
36 } // namespace | 36 } // namespace |
37 | 37 |
38 class URLRequestPrepackagedInterceptor::Delegate | 38 class URLRequestPrepackagedInterceptor::Delegate |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 base::Bind(&Delegate::SetResponse, | 153 base::Bind(&Delegate::SetResponse, |
154 base::Unretained(delegate_), url, path, | 154 base::Unretained(delegate_), url, path, |
155 true)); | 155 true)); |
156 } | 156 } |
157 | 157 |
158 int URLRequestPrepackagedInterceptor::GetHitCount() { | 158 int URLRequestPrepackagedInterceptor::GetHitCount() { |
159 return delegate_->GetHitCount(); | 159 return delegate_->GetHitCount(); |
160 } | 160 } |
161 | 161 |
162 } // namespace content | 162 } // namespace content |
OLD | NEW |