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 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
12 #include "base/threading/platform_thread.h" | 12 #include "base/threading/platform_thread.h" |
13 #include "net/url_request/url_request.h" | 13 #include "net/url_request/url_request.h" |
14 | 14 |
15 template <typename T> struct DefaultSingletonTraits; | 15 template <typename T> struct DefaultSingletonTraits; |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 // This class is responsible for managing the set of protocol factories and | 19 // This class is responsible for managing the set of protocol factories and |
20 // request interceptors that determine how an URLRequestJob gets created to | 20 // request interceptors that determine how an URLRequestJob gets created to |
21 // handle an URLRequest. | 21 // handle an URLRequest. |
22 // | 22 // |
23 // MULTI-THREADING NOTICE: | 23 // MULTI-THREADING NOTICE: |
24 // URLRequest is designed to have all consumers on a single thread, and | 24 // URLRequest is designed to have all consumers on a single thread, and |
25 // so no attempt is made to support Interceptor instances being | 25 // so no attempt is made to support Interceptor instances being |
26 // registered/unregistered or in any way poked on multiple threads. | 26 // registered/unregistered or in any way poked on multiple threads. |
27 class URLRequestJobManager { | 27 class NET_EXPORT URLRequestJobManager { |
mmenke
2014/11/20 16:46:09
include net/base/net_export.h (Or something like t
bengr
2014/11/20 17:30:38
Done.
| |
28 public: | 28 public: |
29 // Returns the singleton instance. | 29 // Returns the singleton instance. |
30 static URLRequestJobManager* GetInstance(); | 30 static URLRequestJobManager* GetInstance(); |
31 | 31 |
32 // Instantiate an URLRequestJob implementation based on the registered | 32 // Instantiate an URLRequestJob implementation based on the registered |
33 // interceptors and protocol factories. This will always succeed in | 33 // interceptors and protocol factories. This will always succeed in |
34 // returning a job unless we are--in the extreme case--out of memory. | 34 // returning a job unless we are--in the extreme case--out of memory. |
35 URLRequestJob* CreateJob(URLRequest* request, | 35 URLRequestJob* CreateJob(URLRequest* request, |
36 NetworkDelegate* network_delegate) const; | 36 NetworkDelegate* network_delegate) const; |
37 | 37 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 #endif | 87 #endif |
88 | 88 |
89 mutable base::Lock lock_; | 89 mutable base::Lock lock_; |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); | 91 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); |
92 }; | 92 }; |
93 | 93 |
94 } // namespace net | 94 } // namespace net |
95 | 95 |
96 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ | 96 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ |
OLD | NEW |