| 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 #include "chrome_frame/urlmon_url_request.h" | 5 #include "chrome_frame/urlmon_url_request.h" |
| 6 | 6 |
| 7 #include <wininet.h> | 7 #include <wininet.h> |
| 8 #include <urlmon.h> | 8 #include <urlmon.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 15 #include "base/threading/platform_thread.h" |
| 15 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 16 #include "chrome_frame/bind_context_info.h" | 17 #include "chrome_frame/bind_context_info.h" |
| 17 #include "chrome_frame/chrome_frame_activex_base.h" | 18 #include "chrome_frame/chrome_frame_activex_base.h" |
| 18 #include "chrome_frame/extra_system_apis.h" | 19 #include "chrome_frame/extra_system_apis.h" |
| 19 #include "chrome_frame/html_utils.h" | 20 #include "chrome_frame/html_utils.h" |
| 20 #include "chrome_frame/urlmon_url_request_private.h" | 21 #include "chrome_frame/urlmon_url_request_private.h" |
| 21 #include "chrome_frame/urlmon_upload_data_stream.h" | 22 #include "chrome_frame/urlmon_upload_data_stream.h" |
| 22 #include "chrome_frame/utils.h" | 23 #include "chrome_frame/utils.h" |
| 23 #include "net/base/load_flags.h" | 24 #include "net/base/load_flags.h" |
| 24 #include "net/http/http_util.h" | 25 #include "net/http/http_util.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 40 UrlmonUrlRequest::~UrlmonUrlRequest() { | 41 UrlmonUrlRequest::~UrlmonUrlRequest() { |
| 41 DVLOG(1) << __FUNCTION__ << me(); | 42 DVLOG(1) << __FUNCTION__ << me(); |
| 42 } | 43 } |
| 43 | 44 |
| 44 std::string UrlmonUrlRequest::me() const { | 45 std::string UrlmonUrlRequest::me() const { |
| 45 return base::StringPrintf(" id: %i Obj: %X ", id(), this); | 46 return base::StringPrintf(" id: %i Obj: %X ", id(), this); |
| 46 } | 47 } |
| 47 | 48 |
| 48 bool UrlmonUrlRequest::Start() { | 49 bool UrlmonUrlRequest::Start() { |
| 49 DVLOG(1) << __FUNCTION__ << me() << url(); | 50 DVLOG(1) << __FUNCTION__ << me() << url(); |
| 50 DCHECK(thread_ == 0 || thread_ == PlatformThread::CurrentId()); | 51 DCHECK(thread_ == 0 || thread_ == base::PlatformThread::CurrentId()); |
| 51 thread_ = PlatformThread::CurrentId(); | 52 thread_ = base::PlatformThread::CurrentId(); |
| 52 status_.Start(); | 53 status_.Start(); |
| 53 // The UrlmonUrlRequest instance can get destroyed in the context of | 54 // The UrlmonUrlRequest instance can get destroyed in the context of |
| 54 // StartAsyncDownload if BindToStorage finishes synchronously with an error. | 55 // StartAsyncDownload if BindToStorage finishes synchronously with an error. |
| 55 // Grab a reference to protect against this. | 56 // Grab a reference to protect against this. |
| 56 scoped_refptr<UrlmonUrlRequest> ref(this); | 57 scoped_refptr<UrlmonUrlRequest> ref(this); |
| 57 HRESULT hr = StartAsyncDownload(); | 58 HRESULT hr = StartAsyncDownload(); |
| 58 if (FAILED(hr) && status_.get_state() != UrlmonUrlRequest::Status::DONE) { | 59 if (FAILED(hr) && status_.get_state() != UrlmonUrlRequest::Status::DONE) { |
| 59 status_.Done(); | 60 status_.Done(); |
| 60 status_.set_result(URLRequestStatus::FAILED, HresultToNetError(hr)); | 61 status_.set_result(URLRequestStatus::FAILED, HresultToNetError(hr)); |
| 61 NotifyDelegateAndDie(); | 62 NotifyDelegateAndDie(); |
| 62 } | 63 } |
| 63 return true; | 64 return true; |
| 64 } | 65 } |
| 65 | 66 |
| 66 void UrlmonUrlRequest::Stop() { | 67 void UrlmonUrlRequest::Stop() { |
| 67 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 68 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 68 DCHECK((status_.get_state() != Status::DONE) == (binding_ != NULL)); | 69 DCHECK((status_.get_state() != Status::DONE) == (binding_ != NULL)); |
| 69 Status::State state = status_.get_state(); | 70 Status::State state = status_.get_state(); |
| 70 delegate_ = NULL; | 71 delegate_ = NULL; |
| 71 | 72 |
| 72 // If DownloadInHost is already requested, we will quit soon anyway. | 73 // If DownloadInHost is already requested, we will quit soon anyway. |
| 73 if (terminate_requested()) | 74 if (terminate_requested()) |
| 74 return; | 75 return; |
| 75 | 76 |
| 76 switch (state) { | 77 switch (state) { |
| 77 case Status::WORKING: | 78 case Status::WORKING: |
| 78 status_.Cancel(); | 79 status_.Cancel(); |
| 79 if (binding_) | 80 if (binding_) |
| 80 binding_->Abort(); | 81 binding_->Abort(); |
| 81 break; | 82 break; |
| 82 | 83 |
| 83 case Status::ABORTING: | 84 case Status::ABORTING: |
| 84 status_.Cancel(); | 85 status_.Cancel(); |
| 85 break; | 86 break; |
| 86 | 87 |
| 87 case Status::DONE: | 88 case Status::DONE: |
| 88 status_.Cancel(); | 89 status_.Cancel(); |
| 89 NotifyDelegateAndDie(); | 90 NotifyDelegateAndDie(); |
| 90 break; | 91 break; |
| 91 } | 92 } |
| 92 } | 93 } |
| 93 | 94 |
| 94 bool UrlmonUrlRequest::Read(int bytes_to_read) { | 95 bool UrlmonUrlRequest::Read(int bytes_to_read) { |
| 95 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 96 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 96 DCHECK_GE(bytes_to_read, 0); | 97 DCHECK_GE(bytes_to_read, 0); |
| 97 DCHECK_EQ(0, calling_delegate_); | 98 DCHECK_EQ(0, calling_delegate_); |
| 98 DVLOG(1) << __FUNCTION__ << me(); | 99 DVLOG(1) << __FUNCTION__ << me(); |
| 99 | 100 |
| 100 is_expecting_download_ = false; | 101 is_expecting_download_ = false; |
| 101 | 102 |
| 102 // Re-entrancy check. Thou shall not call Read() while process OnReadComplete! | 103 // Re-entrancy check. Thou shall not call Read() while process OnReadComplete! |
| 103 DCHECK_EQ(0u, pending_read_size_); | 104 DCHECK_EQ(0u, pending_read_size_); |
| 104 if (pending_read_size_ != 0) | 105 if (pending_read_size_ != 0) |
| 105 return false; | 106 return false; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 129 HRESULT UrlmonUrlRequest::InitPending(const GURL& url, IMoniker* moniker, | 130 HRESULT UrlmonUrlRequest::InitPending(const GURL& url, IMoniker* moniker, |
| 130 IBindCtx* bind_context, | 131 IBindCtx* bind_context, |
| 131 bool enable_frame_busting, | 132 bool enable_frame_busting, |
| 132 bool privileged_mode, | 133 bool privileged_mode, |
| 133 HWND notification_window, | 134 HWND notification_window, |
| 134 IStream* cache) { | 135 IStream* cache) { |
| 135 DVLOG(1) << __FUNCTION__ << me() << url.spec(); | 136 DVLOG(1) << __FUNCTION__ << me() << url.spec(); |
| 136 DCHECK(bind_context_ == NULL); | 137 DCHECK(bind_context_ == NULL); |
| 137 DCHECK(moniker_ == NULL); | 138 DCHECK(moniker_ == NULL); |
| 138 DCHECK(cache_ == NULL); | 139 DCHECK(cache_ == NULL); |
| 139 DCHECK(thread_ == 0 || thread_ == PlatformThread::CurrentId()); | 140 DCHECK(thread_ == 0 || thread_ == base::PlatformThread::CurrentId()); |
| 140 thread_ = PlatformThread::CurrentId(); | 141 thread_ = base::PlatformThread::CurrentId(); |
| 141 bind_context_ = bind_context; | 142 bind_context_ = bind_context; |
| 142 moniker_ = moniker; | 143 moniker_ = moniker; |
| 143 enable_frame_busting_ = enable_frame_busting; | 144 enable_frame_busting_ = enable_frame_busting; |
| 144 privileged_mode_ = privileged_mode; | 145 privileged_mode_ = privileged_mode; |
| 145 parent_window_ = notification_window; | 146 parent_window_ = notification_window; |
| 146 cache_ = cache; | 147 cache_ = cache; |
| 147 set_url(url.spec()); | 148 set_url(url.spec()); |
| 148 set_pending(true); | 149 set_pending(true); |
| 149 | 150 |
| 150 // Request has already started and data is fetched. We will get the | 151 // Request has already started and data is fetched. We will get the |
| 151 // GetBindInfo call as per contract but the return values are | 152 // GetBindInfo call as per contract but the return values are |
| 152 // ignored. So just set "get" as a method to make our GetBindInfo | 153 // ignored. So just set "get" as a method to make our GetBindInfo |
| 153 // implementation happy. | 154 // implementation happy. |
| 154 method_ = "get"; | 155 method_ = "get"; |
| 155 return S_OK; | 156 return S_OK; |
| 156 } | 157 } |
| 157 | 158 |
| 158 void UrlmonUrlRequest::TerminateBind(TerminateBindCallback* callback) { | 159 void UrlmonUrlRequest::TerminateBind(TerminateBindCallback* callback) { |
| 159 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 160 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 160 DVLOG(1) << __FUNCTION__ << me(); | 161 DVLOG(1) << __FUNCTION__ << me(); |
| 161 cleanup_transaction_ = false; | 162 cleanup_transaction_ = false; |
| 162 if (status_.get_state() == Status::DONE) { | 163 if (status_.get_state() == Status::DONE) { |
| 163 // Binding is stopped. Note result could be an error. | 164 // Binding is stopped. Note result could be an error. |
| 164 callback->Run(moniker_, bind_context_); | 165 callback->Run(moniker_, bind_context_); |
| 165 delete callback; | 166 delete callback; |
| 166 } else { | 167 } else { |
| 167 // WORKING (ABORTING?). Save the callback. | 168 // WORKING (ABORTING?). Save the callback. |
| 168 // Now we will return INET_TERMINATE_BIND from ::OnDataAvailable() and in | 169 // Now we will return INET_TERMINATE_BIND from ::OnDataAvailable() and in |
| 169 // ::OnStopBinding will invoke the callback passing our moniker and | 170 // ::OnStopBinding will invoke the callback passing our moniker and |
| (...skipping 13 matching lines...) Expand all Loading... |
| 183 while ((hr = ReadStream(read_stream, 0xffff, &data)) == S_OK) { | 184 while ((hr = ReadStream(read_stream, 0xffff, &data)) == S_OK) { |
| 184 // Just drop the data. | 185 // Just drop the data. |
| 185 } | 186 } |
| 186 DLOG_IF(WARNING, hr != E_PENDING) << __FUNCTION__ << | 187 DLOG_IF(WARNING, hr != E_PENDING) << __FUNCTION__ << |
| 187 base::StringPrintf(" expected E_PENDING but got 0x%08X", hr); | 188 base::StringPrintf(" expected E_PENDING but got 0x%08X", hr); |
| 188 } | 189 } |
| 189 } | 190 } |
| 190 } | 191 } |
| 191 | 192 |
| 192 size_t UrlmonUrlRequest::SendDataToDelegate(size_t bytes_to_read) { | 193 size_t UrlmonUrlRequest::SendDataToDelegate(size_t bytes_to_read) { |
| 193 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 194 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 194 DCHECK_NE(id(), -1); | 195 DCHECK_NE(id(), -1); |
| 195 DCHECK_GT(bytes_to_read, 0U); | 196 DCHECK_GT(bytes_to_read, 0U); |
| 196 size_t bytes_copied = 0; | 197 size_t bytes_copied = 0; |
| 197 if (delegate_) { | 198 if (delegate_) { |
| 198 std::string read_data; | 199 std::string read_data; |
| 199 if (cache_) { | 200 if (cache_) { |
| 200 HRESULT hr = ReadStream(cache_, bytes_to_read, &read_data); | 201 HRESULT hr = ReadStream(cache_, bytes_to_read, &read_data); |
| 201 if (hr == S_FALSE || read_data.length() < bytes_to_read) { | 202 if (hr == S_FALSE || read_data.length() < bytes_to_read) { |
| 202 DVLOG(1) << __FUNCTION__ << me() << "all cached data read"; | 203 DVLOG(1) << __FUNCTION__ << me() << "all cached data read"; |
| 203 cache_.Release(); | 204 cache_.Release(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 } | 236 } |
| 236 } else { | 237 } else { |
| 237 DLOG(ERROR) << __FUNCTION__ << me() << "no delegate"; | 238 DLOG(ERROR) << __FUNCTION__ << me() << "no delegate"; |
| 238 } | 239 } |
| 239 | 240 |
| 240 return bytes_copied; | 241 return bytes_copied; |
| 241 } | 242 } |
| 242 | 243 |
| 243 STDMETHODIMP UrlmonUrlRequest::OnStartBinding(DWORD reserved, | 244 STDMETHODIMP UrlmonUrlRequest::OnStartBinding(DWORD reserved, |
| 244 IBinding* binding) { | 245 IBinding* binding) { |
| 245 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 246 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 246 binding_ = binding; | 247 binding_ = binding; |
| 247 if (pending_) { | 248 if (pending_) { |
| 248 response_headers_ = GetHttpHeadersFromBinding(binding_); | 249 response_headers_ = GetHttpHeadersFromBinding(binding_); |
| 249 DCHECK(!response_headers_.empty()); | 250 DCHECK(!response_headers_.empty()); |
| 250 } | 251 } |
| 251 return S_OK; | 252 return S_OK; |
| 252 } | 253 } |
| 253 | 254 |
| 254 STDMETHODIMP UrlmonUrlRequest::GetPriority(LONG *priority) { | 255 STDMETHODIMP UrlmonUrlRequest::GetPriority(LONG *priority) { |
| 255 if (!priority) | 256 if (!priority) |
| 256 return E_POINTER; | 257 return E_POINTER; |
| 257 *priority = THREAD_PRIORITY_NORMAL; | 258 *priority = THREAD_PRIORITY_NORMAL; |
| 258 return S_OK; | 259 return S_OK; |
| 259 } | 260 } |
| 260 | 261 |
| 261 STDMETHODIMP UrlmonUrlRequest::OnLowResource(DWORD reserved) { | 262 STDMETHODIMP UrlmonUrlRequest::OnLowResource(DWORD reserved) { |
| 262 return S_OK; | 263 return S_OK; |
| 263 } | 264 } |
| 264 | 265 |
| 265 STDMETHODIMP UrlmonUrlRequest::OnProgress(ULONG progress, ULONG max_progress, | 266 STDMETHODIMP UrlmonUrlRequest::OnProgress(ULONG progress, ULONG max_progress, |
| 266 ULONG status_code, LPCWSTR status_text) { | 267 ULONG status_code, LPCWSTR status_text) { |
| 267 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 268 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 268 | 269 |
| 269 if (status_.get_state() != Status::WORKING) | 270 if (status_.get_state() != Status::WORKING) |
| 270 return S_OK; | 271 return S_OK; |
| 271 | 272 |
| 272 // Ignore any notifications received while we are in the pending state | 273 // Ignore any notifications received while we are in the pending state |
| 273 // waiting for the request to be initiated by Chrome. | 274 // waiting for the request to be initiated by Chrome. |
| 274 if (pending_ && status_code != BINDSTATUS_REDIRECTING) | 275 if (pending_ && status_code != BINDSTATUS_REDIRECTING) |
| 275 return S_OK; | 276 return S_OK; |
| 276 | 277 |
| 277 if (!delegate_) { | 278 if (!delegate_) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 DVLOG(1) << __FUNCTION__ << me() | 335 DVLOG(1) << __FUNCTION__ << me() |
| 335 << base::StringPrintf(L"code: %i status: %ls", status_code, | 336 << base::StringPrintf(L"code: %i status: %ls", status_code, |
| 336 status_text); | 337 status_text); |
| 337 break; | 338 break; |
| 338 } | 339 } |
| 339 | 340 |
| 340 return S_OK; | 341 return S_OK; |
| 341 } | 342 } |
| 342 | 343 |
| 343 STDMETHODIMP UrlmonUrlRequest::OnStopBinding(HRESULT result, LPCWSTR error) { | 344 STDMETHODIMP UrlmonUrlRequest::OnStopBinding(HRESULT result, LPCWSTR error) { |
| 344 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 345 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 345 DVLOG(1) << __FUNCTION__ << me() | 346 DVLOG(1) << __FUNCTION__ << me() |
| 346 << "- Request stopped, Result: " << std::hex << result; | 347 << "- Request stopped, Result: " << std::hex << result; |
| 347 DCHECK(status_.get_state() == Status::WORKING || | 348 DCHECK(status_.get_state() == Status::WORKING || |
| 348 status_.get_state() == Status::ABORTING); | 349 status_.get_state() == Status::ABORTING); |
| 349 | 350 |
| 350 Status::State state = status_.get_state(); | 351 Status::State state = status_.get_state(); |
| 351 | 352 |
| 352 // Mark we a are done. | 353 // Mark we a are done. |
| 353 status_.Done(); | 354 status_.Done(); |
| 354 | 355 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 DVLOG(1) << __FUNCTION__ << me() << "POST request with no data!"; | 479 DVLOG(1) << __FUNCTION__ << me() << "POST request with no data!"; |
| 479 } | 480 } |
| 480 } | 481 } |
| 481 | 482 |
| 482 return S_OK; | 483 return S_OK; |
| 483 } | 484 } |
| 484 | 485 |
| 485 STDMETHODIMP UrlmonUrlRequest::OnDataAvailable(DWORD flags, DWORD size, | 486 STDMETHODIMP UrlmonUrlRequest::OnDataAvailable(DWORD flags, DWORD size, |
| 486 FORMATETC* formatetc, | 487 FORMATETC* formatetc, |
| 487 STGMEDIUM* storage) { | 488 STGMEDIUM* storage) { |
| 488 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 489 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 489 DVLOG(1) << __FUNCTION__ << me() << "bytes available: " << size; | 490 DVLOG(1) << __FUNCTION__ << me() << "bytes available: " << size; |
| 490 | 491 |
| 491 if (terminate_requested()) { | 492 if (terminate_requested()) { |
| 492 DVLOG(1) << " Download requested. INET_E_TERMINATED_BIND returned"; | 493 DVLOG(1) << " Download requested. INET_E_TERMINATED_BIND returned"; |
| 493 return INET_E_TERMINATED_BIND; | 494 return INET_E_TERMINATED_BIND; |
| 494 } | 495 } |
| 495 | 496 |
| 496 if (!storage || (storage->tymed != TYMED_ISTREAM)) { | 497 if (!storage || (storage->tymed != TYMED_ISTREAM)) { |
| 497 NOTREACHED(); | 498 NOTREACHED(); |
| 498 return E_INVALIDARG; | 499 return E_INVALIDARG; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 STDMETHODIMP UrlmonUrlRequest::OnObjectAvailable(REFIID iid, IUnknown* object) { | 532 STDMETHODIMP UrlmonUrlRequest::OnObjectAvailable(REFIID iid, IUnknown* object) { |
| 532 // We are calling BindToStorage on the moniker we should always get called | 533 // We are calling BindToStorage on the moniker we should always get called |
| 533 // back on OnDataAvailable and should never get OnObjectAvailable | 534 // back on OnDataAvailable and should never get OnObjectAvailable |
| 534 NOTREACHED(); | 535 NOTREACHED(); |
| 535 return E_NOTIMPL; | 536 return E_NOTIMPL; |
| 536 } | 537 } |
| 537 | 538 |
| 538 STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url, | 539 STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url, |
| 539 const wchar_t* current_headers, DWORD reserved, | 540 const wchar_t* current_headers, DWORD reserved, |
| 540 wchar_t** additional_headers) { | 541 wchar_t** additional_headers) { |
| 541 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 542 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 542 if (!additional_headers) { | 543 if (!additional_headers) { |
| 543 NOTREACHED(); | 544 NOTREACHED(); |
| 544 return E_POINTER; | 545 return E_POINTER; |
| 545 } | 546 } |
| 546 | 547 |
| 547 DVLOG(1) << __FUNCTION__ << me() << "headers: \n" << current_headers; | 548 DVLOG(1) << __FUNCTION__ << me() << "headers: \n" << current_headers; |
| 548 | 549 |
| 549 if (status_.get_state() == Status::ABORTING) { | 550 if (status_.get_state() == Status::ABORTING) { |
| 550 // At times the BINDSTATUS_REDIRECTING notification which is sent to the | 551 // At times the BINDSTATUS_REDIRECTING notification which is sent to the |
| 551 // IBindStatusCallback interface does not have an accompanying HTTP | 552 // IBindStatusCallback interface does not have an accompanying HTTP |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 new_headers.size()); | 608 new_headers.size()); |
| 608 } | 609 } |
| 609 } | 610 } |
| 610 | 611 |
| 611 return hr; | 612 return hr; |
| 612 } | 613 } |
| 613 | 614 |
| 614 STDMETHODIMP UrlmonUrlRequest::OnResponse(DWORD dwResponseCode, | 615 STDMETHODIMP UrlmonUrlRequest::OnResponse(DWORD dwResponseCode, |
| 615 const wchar_t* response_headers, const wchar_t* request_headers, | 616 const wchar_t* response_headers, const wchar_t* request_headers, |
| 616 wchar_t** additional_headers) { | 617 wchar_t** additional_headers) { |
| 617 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 618 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 618 DVLOG(1) << __FUNCTION__ << me() << "headers: \n" << response_headers; | 619 DVLOG(1) << __FUNCTION__ << me() << "headers: \n" << response_headers; |
| 619 | 620 |
| 620 if (!delegate_) { | 621 if (!delegate_) { |
| 621 DLOG(WARNING) << "Invalid delegate"; | 622 DLOG(WARNING) << "Invalid delegate"; |
| 622 return S_OK; | 623 return S_OK; |
| 623 } | 624 } |
| 624 | 625 |
| 625 std::string raw_headers = WideToUTF8(response_headers); | 626 std::string raw_headers = WideToUTF8(response_headers); |
| 626 | 627 |
| 627 delegate_->AddPrivacyDataForUrl(url(), "", 0); | 628 delegate_->AddPrivacyDataForUrl(url(), "", 0); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 } | 823 } |
| 823 } | 824 } |
| 824 | 825 |
| 825 DLOG_IF(ERROR, FAILED(hr)) << me() << | 826 DLOG_IF(ERROR, FAILED(hr)) << me() << |
| 826 base::StringPrintf(L"StartAsyncDownload failed: 0x%08X", hr); | 827 base::StringPrintf(L"StartAsyncDownload failed: 0x%08X", hr); |
| 827 | 828 |
| 828 return hr; | 829 return hr; |
| 829 } | 830 } |
| 830 | 831 |
| 831 void UrlmonUrlRequest::NotifyDelegateAndDie() { | 832 void UrlmonUrlRequest::NotifyDelegateAndDie() { |
| 832 DCHECK_EQ(thread_, PlatformThread::CurrentId()); | 833 DCHECK_EQ(thread_, base::PlatformThread::CurrentId()); |
| 833 DVLOG(1) << __FUNCTION__ << me(); | 834 DVLOG(1) << __FUNCTION__ << me(); |
| 834 | 835 |
| 835 PluginUrlRequestDelegate* delegate = delegate_; | 836 PluginUrlRequestDelegate* delegate = delegate_; |
| 836 delegate_ = NULL; | 837 delegate_ = NULL; |
| 837 ReleaseBindings(); | 838 ReleaseBindings(); |
| 838 TerminateTransaction(); | 839 TerminateTransaction(); |
| 839 if (delegate) { | 840 if (delegate) { |
| 840 URLRequestStatus result = status_.get_result(); | 841 URLRequestStatus result = status_.get_result(); |
| 841 delegate->OnResponseEnd(id(), result); | 842 delegate->OnResponseEnd(id(), result); |
| 842 } else { | 843 } else { |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 privacy_info_.privacy_records[UTF8ToWide(url)]; | 1238 privacy_info_.privacy_records[UTF8ToWide(url)]; |
| 1238 | 1239 |
| 1239 privacy_entry.flags |= flags; | 1240 privacy_entry.flags |= flags; |
| 1240 privacy_entry.policy_ref = UTF8ToWide(policy_ref); | 1241 privacy_entry.policy_ref = UTF8ToWide(policy_ref); |
| 1241 | 1242 |
| 1242 if (fire_privacy_event && IsWindow(notification_window_)) { | 1243 if (fire_privacy_event && IsWindow(notification_window_)) { |
| 1243 PostMessage(notification_window_, WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, 1, | 1244 PostMessage(notification_window_, WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, 1, |
| 1244 0); | 1245 0); |
| 1245 } | 1246 } |
| 1246 } | 1247 } |
| OLD | NEW |