| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_SSL_SSL_ERROR_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 6 #define CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "chrome/browser/renderer_host/global_request_id.h" |
| 12 #include "chrome/browser/ssl/ssl_manager.h" | 13 #include "chrome/browser/ssl/ssl_manager.h" |
| 13 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | |
| 14 #include "chrome/common/filter_policy.h" | 14 #include "chrome/common/filter_policy.h" |
| 15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 #include "webkit/glue/resource_type.h" | 16 #include "webkit/glue/resource_type.h" |
| 17 | 17 |
| 18 class ResourceDispatcherHost; |
| 18 class SSLCertErrorHandler; | 19 class SSLCertErrorHandler; |
| 19 class TabContents; | 20 class TabContents; |
| 20 class URLRequest; | 21 class URLRequest; |
| 21 | 22 |
| 22 // An SSLErrorHandler carries information from the IO thread to the UI thread | 23 // An SSLErrorHandler carries information from the IO thread to the UI thread |
| 23 // and is dispatched to the appropriate SSLManager when it arrives on the | 24 // and is dispatched to the appropriate SSLManager when it arrives on the |
| 24 // UI thread. Subclasses should override the OnDispatched/OnDispatchFailed | 25 // UI thread. Subclasses should override the OnDispatched/OnDispatchFailed |
| 25 // methods to implement the actions that should be taken on the UI thread. | 26 // methods to implement the actions that should be taken on the UI thread. |
| 26 // These methods can call the different convenience methods ContinueRequest/ | 27 // These methods can call the different convenience methods ContinueRequest/ |
| 27 // CancelRequest/StartRequest to perform any required action on the URLRequest | 28 // CancelRequest/StartRequest to perform any required action on the URLRequest |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 virtual void OnDispatchFailed() { TakeNoAction(); } | 107 virtual void OnDispatchFailed() { TakeNoAction(); } |
| 107 | 108 |
| 108 // Can use the manager_ member. | 109 // Can use the manager_ member. |
| 109 virtual void OnDispatched() { TakeNoAction(); } | 110 virtual void OnDispatched() { TakeNoAction(); } |
| 110 | 111 |
| 111 // Should only be accessed on the UI thread. | 112 // Should only be accessed on the UI thread. |
| 112 SSLManager* manager_; // Our manager. | 113 SSLManager* manager_; // Our manager. |
| 113 | 114 |
| 114 // The id of the URLRequest associated with this object. | 115 // The id of the URLRequest associated with this object. |
| 115 // Should only be accessed from the IO thread. | 116 // Should only be accessed from the IO thread. |
| 116 ResourceDispatcherHost::GlobalRequestID request_id_; | 117 GlobalRequestID request_id_; |
| 117 | 118 |
| 118 // The ResourceDispatcherHost we are associated with. | 119 // The ResourceDispatcherHost we are associated with. |
| 119 ResourceDispatcherHost* resource_dispatcher_host_; | 120 ResourceDispatcherHost* resource_dispatcher_host_; |
| 120 | 121 |
| 121 private: | 122 private: |
| 122 // Completes the CancelRequest operation on the IO thread. | 123 // Completes the CancelRequest operation on the IO thread. |
| 123 // Call on the IO thread. | 124 // Call on the IO thread. |
| 124 void CompleteCancelRequest(int error); | 125 void CompleteCancelRequest(int error); |
| 125 | 126 |
| 126 // Completes the ContinueRequest operation on the IO thread. | 127 // Completes the ContinueRequest operation on the IO thread. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 const std::string main_frame_origin_; | 160 const std::string main_frame_origin_; |
| 160 | 161 |
| 161 // A flag to make sure we notify the URLRequest exactly once. | 162 // A flag to make sure we notify the URLRequest exactly once. |
| 162 // Should only be accessed on the IO thread | 163 // Should only be accessed on the IO thread |
| 163 bool request_has_been_notified_; | 164 bool request_has_been_notified_; |
| 164 | 165 |
| 165 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); | 166 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); |
| 166 }; | 167 }; |
| 167 | 168 |
| 168 #endif // CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 169 #endif // CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| OLD | NEW |