| 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 CONTENT_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 6 #define CONTENT_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" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // Find the appropriate SSLManager for the net::URLRequest and begin handling | 68 // Find the appropriate SSLManager for the net::URLRequest and begin handling |
| 69 // this error. | 69 // this error. |
| 70 // | 70 // |
| 71 // Call on UI thread. | 71 // Call on UI thread. |
| 72 void Dispatch(); | 72 void Dispatch(); |
| 73 | 73 |
| 74 // Available on either thread. | 74 // Available on either thread. |
| 75 const GURL& request_url() const { return request_url_; } | 75 const GURL& request_url() const { return request_url_; } |
| 76 | 76 |
| 77 // Available on either thread. | 77 // Available on either thread. |
| 78 ResourceType::Type resource_type() const { return resource_type_; } | 78 ResourceType resource_type() const { return resource_type_; } |
| 79 | 79 |
| 80 // Cancels the associated net::URLRequest. | 80 // Cancels the associated net::URLRequest. |
| 81 // This method can be called from OnDispatchFailed and OnDispatched. | 81 // This method can be called from OnDispatchFailed and OnDispatched. |
| 82 CONTENT_EXPORT void CancelRequest(); | 82 CONTENT_EXPORT void CancelRequest(); |
| 83 | 83 |
| 84 // Continue the net::URLRequest ignoring any previous errors. Note that some | 84 // Continue the net::URLRequest ignoring any previous errors. Note that some |
| 85 // errors cannot be ignored, in which case this will result in the request | 85 // errors cannot be ignored, in which case this will result in the request |
| 86 // being canceled. | 86 // being canceled. |
| 87 // This method can be called from OnDispatchFailed and OnDispatched. | 87 // This method can be called from OnDispatchFailed and OnDispatched. |
| 88 void ContinueRequest(); | 88 void ContinueRequest(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 102 | 102 |
| 103 int render_process_id() const { return render_process_id_; } | 103 int render_process_id() const { return render_process_id_; } |
| 104 int render_frame_id() const { return render_frame_id_; } | 104 int render_frame_id() const { return render_frame_id_; } |
| 105 | 105 |
| 106 protected: | 106 protected: |
| 107 friend class base::RefCountedThreadSafe<SSLErrorHandler>; | 107 friend class base::RefCountedThreadSafe<SSLErrorHandler>; |
| 108 | 108 |
| 109 // Construct on the IO thread. | 109 // Construct on the IO thread. |
| 110 SSLErrorHandler(const base::WeakPtr<Delegate>& delegate, | 110 SSLErrorHandler(const base::WeakPtr<Delegate>& delegate, |
| 111 const GlobalRequestID& id, | 111 const GlobalRequestID& id, |
| 112 ResourceType::Type resource_type, | 112 ResourceType resource_type, |
| 113 const GURL& url, | 113 const GURL& url, |
| 114 int render_process_id, | 114 int render_process_id, |
| 115 int render_frame_id); | 115 int render_frame_id); |
| 116 | 116 |
| 117 virtual ~SSLErrorHandler(); | 117 virtual ~SSLErrorHandler(); |
| 118 | 118 |
| 119 // The following 2 methods are the methods subclasses should implement. | 119 // The following 2 methods are the methods subclasses should implement. |
| 120 virtual void OnDispatchFailed(); | 120 virtual void OnDispatchFailed(); |
| 121 | 121 |
| 122 // Can use the manager_ member. | 122 // Can use the manager_ member. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 151 int render_process_id_; | 151 int render_process_id_; |
| 152 int render_frame_id_; | 152 int render_frame_id_; |
| 153 | 153 |
| 154 // The URL that we requested. | 154 // The URL that we requested. |
| 155 // This read-only member can be accessed on any thread. | 155 // This read-only member can be accessed on any thread. |
| 156 const GURL request_url_; | 156 const GURL request_url_; |
| 157 | 157 |
| 158 // What kind of resource is associated with the requested that generated | 158 // What kind of resource is associated with the requested that generated |
| 159 // that error. | 159 // that error. |
| 160 // This read-only member can be accessed on any thread. | 160 // This read-only member can be accessed on any thread. |
| 161 const ResourceType::Type resource_type_; | 161 const ResourceType resource_type_; |
| 162 | 162 |
| 163 // A flag to make sure we notify the net::URLRequest exactly once. | 163 // A flag to make sure we notify the net::URLRequest exactly once. |
| 164 // Should only be accessed on the IO thread | 164 // Should only be accessed on the IO thread |
| 165 bool request_has_been_notified_; | 165 bool request_has_been_notified_; |
| 166 | 166 |
| 167 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); | 167 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 } // namespace content | 170 } // namespace content |
| 171 | 171 |
| 172 #endif // CONTENT_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 172 #endif // CONTENT_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| OLD | NEW |