| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 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 // Callback will be invoked either right away (if operation is finished) or | 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. | 40 // from inside ::OnStopBinding() when it is safe to reuse the bind_context. |
| 41 typedef Callback4<IMoniker*, IBindCtx*, IStream*, const char*>::Type | 41 typedef base::Callback<void(IMoniker*, IBindCtx*, IStream*, const char*)> |
| 42 TerminateBindCallback; | 42 TerminateBindCallback; |
| 43 void TerminateBind(TerminateBindCallback* callback); | 43 void TerminateBind(const TerminateBindCallback& callback); |
| 44 | 44 |
| 45 // Parent Window for UrlMon error dialogs | 45 // Parent Window for UrlMon error dialogs |
| 46 void set_parent_window(HWND parent_window) { | 46 void set_parent_window(HWND parent_window) { |
| 47 parent_window_ = parent_window; | 47 parent_window_ = parent_window; |
| 48 } | 48 } |
| 49 | 49 |
| 50 // This function passes information on whether ChromeFrame is running in | 50 // This function passes information on whether ChromeFrame is running in |
| 51 // privileged mode. | 51 // privileged mode. |
| 52 void set_privileged_mode(bool privileged_mode) { | 52 void set_privileged_mode(bool privileged_mode) { |
| 53 privileged_mode_ = privileged_mode; | 53 privileged_mode_ = privileged_mode; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 void set_pending(bool pending) { | 112 void set_pending(bool pending) { |
| 113 pending_ = pending; | 113 pending_ = pending; |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool pending() const { | 116 bool pending() const { |
| 117 return pending_; | 117 return pending_; |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool terminate_requested() const { | 120 bool terminate_requested() const { |
| 121 return terminate_bind_callback_.get() != NULL; | 121 return !terminate_bind_callback_.is_null(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 std::string response_headers() { | 124 std::string response_headers() { |
| 125 return response_headers_; | 125 return response_headers_; |
| 126 } | 126 } |
| 127 | 127 |
| 128 protected: | 128 protected: |
| 129 void ReleaseBindings(); | 129 void ReleaseBindings(); |
| 130 | 130 |
| 131 HRESULT StartAsyncDownload(); | 131 HRESULT StartAsyncDownload(); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 base::win::ScopedComPtr<IStream> pending_data_; | 238 base::win::ScopedComPtr<IStream> pending_data_; |
| 239 | 239 |
| 240 size_t pending_read_size_; | 240 size_t pending_read_size_; |
| 241 base::PlatformThreadId thread_; | 241 base::PlatformThreadId thread_; |
| 242 HWND parent_window_; | 242 HWND parent_window_; |
| 243 bool headers_received_; | 243 bool headers_received_; |
| 244 int calling_delegate_; // re-entrancy protection. | 244 int calling_delegate_; // re-entrancy protection. |
| 245 // Set to true if the ChromeFrame instance is running in privileged mode. | 245 // Set to true if the ChromeFrame instance is running in privileged mode. |
| 246 bool privileged_mode_; | 246 bool privileged_mode_; |
| 247 bool pending_; | 247 bool pending_; |
| 248 scoped_ptr<TerminateBindCallback> terminate_bind_callback_; | 248 TerminateBindCallback terminate_bind_callback_; |
| 249 std::string response_headers_; | 249 std::string response_headers_; |
| 250 // Defaults to true and indicates whether we want to keep the original | 250 // Defaults to true and indicates whether we want to keep the original |
| 251 // transaction alive when we receive the last data notification from | 251 // transaction alive when we receive the last data notification from |
| 252 // urlmon. | 252 // urlmon. |
| 253 bool is_expecting_download_; | 253 bool is_expecting_download_; |
| 254 // Set to true if the Urlmon transaction object needs to be cleaned up | 254 // Set to true if the Urlmon transaction object needs to be cleaned up |
| 255 // when this object is destroyed. Happens if we return | 255 // when this object is destroyed. Happens if we return |
| 256 // INET_E_TERMINATE_BIND from OnDataAvailable in the last data notification. | 256 // INET_E_TERMINATE_BIND from OnDataAvailable in the last data notification. |
| 257 bool cleanup_transaction_; | 257 bool cleanup_transaction_; |
| 258 // Copy of the request headers. | 258 // Copy of the request headers. |
| 259 std::string request_headers_; | 259 std::string request_headers_; |
| 260 | 260 |
| 261 DISALLOW_COPY_AND_ASSIGN(UrlmonUrlRequest); | 261 DISALLOW_COPY_AND_ASSIGN(UrlmonUrlRequest); |
| 262 }; | 262 }; |
| 263 | 263 |
| 264 #endif // CHROME_FRAME_URLMON_URL_REQUEST_PRIVATE_H_ | 264 #endif // CHROME_FRAME_URLMON_URL_REQUEST_PRIVATE_H_ |
| OLD | NEW |