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_FRAME_URLMON_URL_REQUEST_PRIVATE_H_ | 5 #ifndef CHROME_FRAME_URLMON_URL_REQUEST_PRIVATE_H_ |
6 #define CHROME_FRAME_URLMON_URL_REQUEST_PRIVATE_H_ | 6 #define CHROME_FRAME_URLMON_URL_REQUEST_PRIVATE_H_ |
7 | 7 |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlcom.h> | 9 #include <atlcom.h> |
10 #include <string> | 10 #include <string> |
(...skipping 18 matching lines...) Expand all Loading... |
29 virtual bool Start(); | 29 virtual bool Start(); |
30 virtual void Stop(); | 30 virtual void Stop(); |
31 virtual bool Read(int bytes_to_read); | 31 virtual bool Read(int bytes_to_read); |
32 | 32 |
33 // Special function needed by ActiveDocument::Load() | 33 // Special function needed by ActiveDocument::Load() |
34 HRESULT InitPending(const GURL& url, IMoniker* moniker, IBindCtx* bind_ctx, | 34 HRESULT InitPending(const GURL& url, IMoniker* moniker, IBindCtx* bind_ctx, |
35 bool enable_frame_busting, bool privileged_mode, | 35 bool enable_frame_busting, bool privileged_mode, |
36 HWND notification_window, IStream* cache); | 36 HWND notification_window, IStream* cache); |
37 | 37 |
38 // Used from "DownloadRequestInHost". | 38 // Used from "DownloadRequestInHost". |
39 void StealMoniker(IMoniker** moniker, IBindCtx** bctx); | 39 // Callback will be invoked either right away (if operation is finished) or |
| 40 // from inside ::OnStopBinding() when it is safe to reuse the bind_context. |
| 41 typedef Callback2<IMoniker*, IBindCtx*>::Type TerminateBindCallback; |
| 42 void TerminateBind(TerminateBindCallback* callback); |
40 | 43 |
41 // Parent Window for UrlMon error dialogs | 44 // Parent Window for UrlMon error dialogs |
42 void set_parent_window(HWND parent_window) { | 45 void set_parent_window(HWND parent_window) { |
43 parent_window_ = parent_window; | 46 parent_window_ = parent_window; |
44 } | 47 } |
45 | 48 |
46 // This function passes information on whether ChromeFrame is running in | 49 // This function passes information on whether ChromeFrame is running in |
47 // privileged mode. | 50 // privileged mode. |
48 void set_privileged_mode(bool privileged_mode) { | 51 void set_privileged_mode(bool privileged_mode) { |
49 privileged_mode_ = privileged_mode; | 52 privileged_mode_ = privileged_mode; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 STDMETHOD(OnSecurityProblem)(DWORD problem); | 106 STDMETHOD(OnSecurityProblem)(DWORD problem); |
104 | 107 |
105 void set_pending(bool pending) { | 108 void set_pending(bool pending) { |
106 pending_ = pending; | 109 pending_ = pending; |
107 } | 110 } |
108 | 111 |
109 bool pending() const { | 112 bool pending() const { |
110 return pending_; | 113 return pending_; |
111 } | 114 } |
112 | 115 |
| 116 bool terminate_requested() const { |
| 117 return terminate_bind_callback_.get() != NULL; |
| 118 } |
| 119 |
113 std::string response_headers() { | 120 std::string response_headers() { |
114 return response_headers_; | 121 return response_headers_; |
115 } | 122 } |
116 | 123 |
117 protected: | 124 protected: |
118 void ReleaseBindings(); | 125 void ReleaseBindings(); |
119 | 126 |
120 // Manage data caching. Note: this class supports cache | 127 // Manage data caching. Note: this class supports cache |
121 // size less than 2GB | 128 // size less than 2GB |
122 FRIEND_TEST(UrlmonUrlRequestCache, ReadWrite); | 129 FRIEND_TEST(UrlmonUrlRequestCache, ReadWrite); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 GURL url_; | 271 GURL url_; |
265 Cache cached_data_; | 272 Cache cached_data_; |
266 size_t pending_read_size_; | 273 size_t pending_read_size_; |
267 PlatformThreadId thread_; | 274 PlatformThreadId thread_; |
268 HWND parent_window_; | 275 HWND parent_window_; |
269 bool headers_received_; | 276 bool headers_received_; |
270 int calling_delegate_; // re-entrancy protection. | 277 int calling_delegate_; // re-entrancy protection. |
271 // Set to true if the ChromeFrame instance is running in privileged mode. | 278 // Set to true if the ChromeFrame instance is running in privileged mode. |
272 bool privileged_mode_; | 279 bool privileged_mode_; |
273 bool pending_; | 280 bool pending_; |
| 281 scoped_ptr<TerminateBindCallback> terminate_bind_callback_; |
274 std::string response_headers_; | 282 std::string response_headers_; |
275 DISALLOW_COPY_AND_ASSIGN(UrlmonUrlRequest); | 283 DISALLOW_COPY_AND_ASSIGN(UrlmonUrlRequest); |
276 }; | 284 }; |
277 | 285 |
278 #endif // CHROME_FRAME_URLMON_URL_REQUEST_PRIVATE_H_ | 286 #endif // CHROME_FRAME_URLMON_URL_REQUEST_PRIVATE_H_ |
OLD | NEW |