| 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 #include "chrome_frame/urlmon_url_request.h" | 5 #include "chrome_frame/urlmon_url_request.h" |
| 6 | 6 |
| 7 #include <urlmon.h> | 7 #include <urlmon.h> |
| 8 #include <wininet.h> | 8 #include <wininet.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 // network error. | 1099 // network error. |
| 1100 scoped_refptr<UrlmonUrlRequest> request = LookupRequest(request_id, | 1100 scoped_refptr<UrlmonUrlRequest> request = LookupRequest(request_id, |
| 1101 &request_map_); | 1101 &request_map_); |
| 1102 if (request) { | 1102 if (request) { |
| 1103 request->Read(bytes_to_read); | 1103 request->Read(bytes_to_read); |
| 1104 } else if (background_worker_thread_enabled_) { | 1104 } else if (background_worker_thread_enabled_) { |
| 1105 base::AutoLock lock(background_resource_map_lock_); | 1105 base::AutoLock lock(background_resource_map_lock_); |
| 1106 request = LookupRequest(request_id, &background_request_map_); | 1106 request = LookupRequest(request_id, &background_request_map_); |
| 1107 if (request) { | 1107 if (request) { |
| 1108 background_thread_->message_loop()->PostTask( | 1108 background_thread_->message_loop()->PostTask( |
| 1109 FROM_HERE, base::IgnoreReturn<bool>(base::Bind( | 1109 FROM_HERE, base::Bind(base::IgnoreResult(&UrlmonUrlRequest::Read), |
| 1110 &UrlmonUrlRequest::Read, request.get(), bytes_to_read))); | 1110 request.get(), bytes_to_read)); |
| 1111 } | 1111 } |
| 1112 } | 1112 } |
| 1113 if (!request) | 1113 if (!request) |
| 1114 DLOG(ERROR) << __FUNCTION__ << " no request found for " << request_id; | 1114 DLOG(ERROR) << __FUNCTION__ << " no request found for " << request_id; |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 void UrlmonUrlRequestManager::DownloadRequestInHost(int request_id) { | 1117 void UrlmonUrlRequestManager::DownloadRequestInHost(int request_id) { |
| 1118 DVLOG(1) << __FUNCTION__ << " " << request_id; | 1118 DVLOG(1) << __FUNCTION__ << " " << request_id; |
| 1119 if (!IsWindow(notification_window_)) { | 1119 if (!IsWindow(notification_window_)) { |
| 1120 NOTREACHED() << "Cannot handle download if we don't have anyone to hand it " | 1120 NOTREACHED() << "Cannot handle download if we don't have anyone to hand it " |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 Stop(); | 1411 Stop(); |
| 1412 } | 1412 } |
| 1413 | 1413 |
| 1414 void UrlmonUrlRequestManager::ResourceFetcherThread::Init() { | 1414 void UrlmonUrlRequestManager::ResourceFetcherThread::Init() { |
| 1415 CoInitialize(NULL); | 1415 CoInitialize(NULL); |
| 1416 } | 1416 } |
| 1417 | 1417 |
| 1418 void UrlmonUrlRequestManager::ResourceFetcherThread::CleanUp() { | 1418 void UrlmonUrlRequestManager::ResourceFetcherThread::CleanUp() { |
| 1419 CoUninitialize(); | 1419 CoUninitialize(); |
| 1420 } | 1420 } |
| 1421 | |
| OLD | NEW |