OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
13 #include "chrome/browser/renderer_host/global_request_id.h" | 13 #include "chrome/browser/renderer_host/global_request_id.h" |
14 #include "chrome/browser/ssl/ssl_manager.h" | 14 #include "chrome/browser/ssl/ssl_manager.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 ResourceDispatcherHost; |
19 class SSLCertErrorHandler; | 19 class SSLCertErrorHandler; |
20 class TabContents; | 20 class TabContents; |
| 21 |
| 22 namespace net { |
21 class URLRequest; | 23 class URLRequest; |
| 24 } // namespace net |
22 | 25 |
23 // An SSLErrorHandler carries information from the IO thread to the UI thread | 26 // An SSLErrorHandler carries information from the IO thread to the UI thread |
24 // and is dispatched to the appropriate SSLManager when it arrives on the | 27 // and is dispatched to the appropriate SSLManager when it arrives on the |
25 // UI thread. Subclasses should override the OnDispatched/OnDispatchFailed | 28 // UI thread. Subclasses should override the OnDispatched/OnDispatchFailed |
26 // methods to implement the actions that should be taken on the UI thread. | 29 // methods to implement the actions that should be taken on the UI thread. |
27 // These methods can call the different convenience methods ContinueRequest/ | 30 // These methods can call the different convenience methods ContinueRequest/ |
28 // CancelRequest to perform any required action on the URLRequest the | 31 // CancelRequest to perform any required action on the URLRequest the |
29 // ErrorHandler was created with. | 32 // ErrorHandler was created with. |
30 // | 33 // |
31 // IMPORTANT NOTE: | 34 // IMPORTANT NOTE: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // count is decremented appropriately. Subclasses that do not want to | 84 // count is decremented appropriately. Subclasses that do not want to |
82 // take any specific actions in their OnDispatched/OnDispatchFailed should | 85 // take any specific actions in their OnDispatched/OnDispatchFailed should |
83 // call this. | 86 // call this. |
84 void TakeNoAction(); | 87 void TakeNoAction(); |
85 | 88 |
86 protected: | 89 protected: |
87 friend class base::RefCountedThreadSafe<SSLErrorHandler>; | 90 friend class base::RefCountedThreadSafe<SSLErrorHandler>; |
88 | 91 |
89 // Construct on the IO thread. | 92 // Construct on the IO thread. |
90 SSLErrorHandler(ResourceDispatcherHost* resource_dispatcher_host, | 93 SSLErrorHandler(ResourceDispatcherHost* resource_dispatcher_host, |
91 URLRequest* request, | 94 net::URLRequest* request, |
92 ResourceType::Type resource_type, | 95 ResourceType::Type resource_type, |
93 const std::string& frame_origin, | 96 const std::string& frame_origin, |
94 const std::string& main_frame_origin); | 97 const std::string& main_frame_origin); |
95 | 98 |
96 virtual ~SSLErrorHandler(); | 99 virtual ~SSLErrorHandler(); |
97 | 100 |
98 // The following 2 methods are the methods subclasses should implement. | 101 // The following 2 methods are the methods subclasses should implement. |
99 virtual void OnDispatchFailed(); | 102 virtual void OnDispatchFailed(); |
100 | 103 |
101 // Can use the manager_ member. | 104 // Can use the manager_ member. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 const std::string main_frame_origin_; | 151 const std::string main_frame_origin_; |
149 | 152 |
150 // A flag to make sure we notify the URLRequest exactly once. | 153 // A flag to make sure we notify the URLRequest exactly once. |
151 // Should only be accessed on the IO thread | 154 // Should only be accessed on the IO thread |
152 bool request_has_been_notified_; | 155 bool request_has_been_notified_; |
153 | 156 |
154 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); | 157 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); |
155 }; | 158 }; |
156 | 159 |
157 #endif // CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 160 #endif // CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
OLD | NEW |