| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // |job_factory| is set as the URLRequestJobFactory where requests are | 110 // |job_factory| is set as the URLRequestJobFactory where requests are |
| 111 // forwarded if JobInterceptorFactory decides to pass on them. | 111 // forwarded if JobInterceptorFactory decides to pass on them. |
| 112 void Chain(scoped_ptr<net::URLRequestJobFactory> job_factory); | 112 void Chain(scoped_ptr<net::URLRequestJobFactory> job_factory); |
| 113 | 113 |
| 114 // URLRequestJobFactory implementation. | 114 // URLRequestJobFactory implementation. |
| 115 net::URLRequestJob* MaybeCreateJobWithProtocolHandler( | 115 net::URLRequestJob* MaybeCreateJobWithProtocolHandler( |
| 116 const std::string& scheme, | 116 const std::string& scheme, |
| 117 net::URLRequest* request, | 117 net::URLRequest* request, |
| 118 net::NetworkDelegate* network_delegate) const override; | 118 net::NetworkDelegate* network_delegate) const override; |
| 119 |
| 120 net::URLRequestJob* MaybeInterceptRedirect( |
| 121 net::URLRequest* request, |
| 122 net::NetworkDelegate* network_delegate, |
| 123 const GURL& location) const override; |
| 124 |
| 125 net::URLRequestJob* MaybeInterceptResponse( |
| 126 net::URLRequest* request, |
| 127 net::NetworkDelegate* network_delegate) const override; |
| 128 |
| 119 bool IsHandledProtocol(const std::string& scheme) const override; | 129 bool IsHandledProtocol(const std::string& scheme) const override; |
| 120 bool IsHandledURL(const GURL& url) const override; | 130 bool IsHandledURL(const GURL& url) const override; |
| 121 bool IsSafeRedirectTarget(const GURL& location) const override; | 131 bool IsSafeRedirectTarget(const GURL& location) const override; |
| 122 | 132 |
| 123 private: | 133 private: |
| 124 // When JobInterceptorFactory decides to pass on particular requests, | 134 // When JobInterceptorFactory decides to pass on particular requests, |
| 125 // they're forwarded to the chained URLRequestJobFactory, |job_factory_|. | 135 // they're forwarded to the chained URLRequestJobFactory, |job_factory_|. |
| 126 scoped_ptr<URLRequestJobFactory> job_factory_; | 136 scoped_ptr<URLRequestJobFactory> job_factory_; |
| 127 // |io_thread_delegate_| performs the actual job creation decisions by | 137 // |io_thread_delegate_| performs the actual job creation decisions by |
| 128 // mirroring the ProtocolHandlerRegistry on the IO thread. | 138 // mirroring the ProtocolHandlerRegistry on the IO thread. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 386 |
| 377 // Copy of registry data for use on the IO thread. Changes to the registry | 387 // Copy of registry data for use on the IO thread. Changes to the registry |
| 378 // are posted to the IO thread where updates are applied to this object. | 388 // are posted to the IO thread where updates are applied to this object. |
| 379 scoped_refptr<IOThreadDelegate> io_thread_delegate_; | 389 scoped_refptr<IOThreadDelegate> io_thread_delegate_; |
| 380 | 390 |
| 381 DefaultClientObserverList default_client_observers_; | 391 DefaultClientObserverList default_client_observers_; |
| 382 | 392 |
| 383 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); | 393 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); |
| 384 }; | 394 }; |
| 385 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 395 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
| OLD | NEW |