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