OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_ | 5 #ifndef MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_ |
6 #define MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_ | 6 #define MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 class FilePath; | 12 class FilePath; |
13 } | 13 } |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 class URLRequestContext; | 16 class URLRequestContext; |
17 } | 17 } |
18 | 18 |
19 namespace mojo { | 19 namespace mojo { |
20 | 20 |
21 class NetworkContext { | 21 class NetworkContext { |
22 public: | 22 public: |
| 23 explicit NetworkContext( |
| 24 scoped_ptr<net::URLRequestContext> url_request_context); |
23 explicit NetworkContext(const base::FilePath& base_path); | 25 explicit NetworkContext(const base::FilePath& base_path); |
24 ~NetworkContext(); | 26 ~NetworkContext(); |
25 | 27 |
26 net::URLRequestContext* url_request_context() { | 28 net::URLRequestContext* url_request_context() { |
27 return url_request_context_.get(); | 29 return url_request_context_.get(); |
28 } | 30 } |
29 | 31 |
30 private: | 32 private: |
| 33 static scoped_ptr<net::URLRequestContext> MakeURLRequestContext( |
| 34 const base::FilePath& base_path); |
| 35 |
31 scoped_ptr<net::URLRequestContext> url_request_context_; | 36 scoped_ptr<net::URLRequestContext> url_request_context_; |
32 | 37 |
33 DISALLOW_COPY_AND_ASSIGN(NetworkContext); | 38 DISALLOW_COPY_AND_ASSIGN(NetworkContext); |
34 }; | 39 }; |
35 | 40 |
36 } // namespace mojo | 41 } // namespace mojo |
37 | 42 |
38 #endif // MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_ | 43 #endif // MOJO_SERVICES_NETWORK_NETWORK_CONTEXT_H_ |
OLD | NEW |