| 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 CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 6 #define CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // forwarded if JobInterceptorFactory decides to pass on them. | 105 // forwarded if JobInterceptorFactory decides to pass on them. |
| 106 void Chain(scoped_ptr<net::URLRequestJobFactory> job_factory); | 106 void Chain(scoped_ptr<net::URLRequestJobFactory> job_factory); |
| 107 | 107 |
| 108 // URLRequestJobFactory implementation. | 108 // URLRequestJobFactory implementation. |
| 109 virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( | 109 virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( |
| 110 const std::string& scheme, | 110 const std::string& scheme, |
| 111 net::URLRequest* request, | 111 net::URLRequest* request, |
| 112 net::NetworkDelegate* network_delegate) const OVERRIDE; | 112 net::NetworkDelegate* network_delegate) const OVERRIDE; |
| 113 virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE; | 113 virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE; |
| 114 virtual bool IsHandledURL(const GURL& url) const OVERRIDE; | 114 virtual bool IsHandledURL(const GURL& url) const OVERRIDE; |
| 115 virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE; |
| 115 | 116 |
| 116 private: | 117 private: |
| 117 // When JobInterceptorFactory decides to pass on particular requests, | 118 // When JobInterceptorFactory decides to pass on particular requests, |
| 118 // they're forwarded to the chained URLRequestJobFactory, |job_factory_|. | 119 // they're forwarded to the chained URLRequestJobFactory, |job_factory_|. |
| 119 scoped_ptr<URLRequestJobFactory> job_factory_; | 120 scoped_ptr<URLRequestJobFactory> job_factory_; |
| 120 // |io_thread_delegate_| performs the actual job creation decisions by | 121 // |io_thread_delegate_| performs the actual job creation decisions by |
| 121 // mirroring the ProtocolHandlerRegistry on the IO thread. | 122 // mirroring the ProtocolHandlerRegistry on the IO thread. |
| 122 scoped_refptr<IOThreadDelegate> io_thread_delegate_; | 123 scoped_refptr<IOThreadDelegate> io_thread_delegate_; |
| 123 | 124 |
| 124 DISALLOW_COPY_AND_ASSIGN(JobInterceptorFactory); | 125 DISALLOW_COPY_AND_ASSIGN(JobInterceptorFactory); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 323 |
| 323 // Copy of registry data for use on the IO thread. Changes to the registry | 324 // Copy of registry data for use on the IO thread. Changes to the registry |
| 324 // are posted to the IO thread where updates are applied to this object. | 325 // are posted to the IO thread where updates are applied to this object. |
| 325 scoped_refptr<IOThreadDelegate> io_thread_delegate_; | 326 scoped_refptr<IOThreadDelegate> io_thread_delegate_; |
| 326 | 327 |
| 327 DefaultClientObserverList default_client_observers_; | 328 DefaultClientObserverList default_client_observers_; |
| 328 | 329 |
| 329 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); | 330 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); |
| 330 }; | 331 }; |
| 331 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 332 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
| OLD | NEW |