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 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 12 matching lines...) Expand all Loading... | |
23 class NET_EXPORT URLRequestJobFactory | 23 class NET_EXPORT URLRequestJobFactory |
24 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | 24 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
25 public: | 25 public: |
26 // TODO(shalev): Move this to URLRequestJobFactoryImpl. | 26 // TODO(shalev): Move this to URLRequestJobFactoryImpl. |
27 class NET_EXPORT ProtocolHandler { | 27 class NET_EXPORT ProtocolHandler { |
28 public: | 28 public: |
29 virtual ~ProtocolHandler(); | 29 virtual ~ProtocolHandler(); |
30 | 30 |
31 virtual URLRequestJob* MaybeCreateJob( | 31 virtual URLRequestJob* MaybeCreateJob( |
32 URLRequest* request, NetworkDelegate* network_delegate) const = 0; | 32 URLRequest* request, NetworkDelegate* network_delegate) const = 0; |
33 | |
34 // Indicates if it should be safe to redirect to |location|. Should handle | |
35 // protocols handled by MaybeCreateJob(). | |
mmenke
2013/02/19 17:26:15
This comment is not correct. As-is, it sounds lik
pauljensen
2013/02/20 15:13:27
I adjusted the comment to be more correct. We can
| |
36 // NOTE(pauljensen): Default implementation returns true. | |
37 virtual bool IsSafeRedirectTarget(const GURL& location) const; | |
33 }; | 38 }; |
34 | 39 |
35 URLRequestJobFactory(); | 40 URLRequestJobFactory(); |
36 virtual ~URLRequestJobFactory(); | 41 virtual ~URLRequestJobFactory(); |
37 | 42 |
38 virtual URLRequestJob* MaybeCreateJobWithProtocolHandler( | 43 virtual URLRequestJob* MaybeCreateJobWithProtocolHandler( |
39 const std::string& scheme, | 44 const std::string& scheme, |
40 URLRequest* request, | 45 URLRequest* request, |
41 NetworkDelegate* network_delegate) const = 0; | 46 NetworkDelegate* network_delegate) const = 0; |
42 | 47 |
43 virtual bool IsHandledProtocol(const std::string& scheme) const = 0; | 48 virtual bool IsHandledProtocol(const std::string& scheme) const = 0; |
44 | 49 |
45 virtual bool IsHandledURL(const GURL& url) const = 0; | 50 virtual bool IsHandledURL(const GURL& url) const = 0; |
46 | 51 |
52 virtual bool IsSafeRedirectTarget(const GURL& location) const = 0; | |
53 | |
47 private: | 54 private: |
48 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); | 55 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); |
49 }; | 56 }; |
50 | 57 |
51 } // namespace net | 58 } // namespace net |
52 | 59 |
53 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 60 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
OLD | NEW |