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/callback_old.h" | 10 #include "base/callback_old.h" |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 | 1254 |
1255 StopAllRequestsHelper(&request_map_, NULL); | 1255 StopAllRequestsHelper(&request_map_, NULL); |
1256 | 1256 |
1257 if (background_worker_thread_enabled_) { | 1257 if (background_worker_thread_enabled_) { |
1258 DCHECK(background_thread_.get()); | 1258 DCHECK(background_thread_.get()); |
1259 background_thread_->message_loop()->PostTask( | 1259 background_thread_->message_loop()->PostTask( |
1260 FROM_HERE, | 1260 FROM_HERE, |
1261 NewRunnableMethod( | 1261 NewRunnableMethod( |
1262 this, &UrlmonUrlRequestManager::StopAllRequestsHelper, | 1262 this, &UrlmonUrlRequestManager::StopAllRequestsHelper, |
1263 &background_request_map_, &background_resource_map_lock_)); | 1263 &background_request_map_, &background_resource_map_lock_)); |
| 1264 background_thread_->Stop(); |
| 1265 background_thread_.reset(); |
1264 } | 1266 } |
1265 } | 1267 } |
1266 | 1268 |
1267 void UrlmonUrlRequestManager::StopAllRequestsHelper( | 1269 void UrlmonUrlRequestManager::StopAllRequestsHelper( |
1268 RequestMap* request_map, | 1270 RequestMap* request_map, |
1269 base::Lock* request_map_lock) { | 1271 base::Lock* request_map_lock) { |
1270 DCHECK(request_map); | 1272 DCHECK(request_map); |
1271 | 1273 |
1272 DVLOG(1) << __FUNCTION__ << " stopping " << request_map->size() | 1274 DVLOG(1) << __FUNCTION__ << " stopping " << request_map->size() |
1273 << " requests"; | 1275 << " requests"; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1367 GetConfigBool(true, kUseBackgroundThreadForSubResources); | 1369 GetConfigBool(true, kUseBackgroundThreadForSubResources); |
1368 if (background_worker_thread_enabled_) { | 1370 if (background_worker_thread_enabled_) { |
1369 base::Thread::Options options; | 1371 base::Thread::Options options; |
1370 options.message_loop_type = MessageLoop::TYPE_UI; | 1372 options.message_loop_type = MessageLoop::TYPE_UI; |
1371 background_thread_->StartWithOptions(options); | 1373 background_thread_->StartWithOptions(options); |
1372 } | 1374 } |
1373 } | 1375 } |
1374 | 1376 |
1375 UrlmonUrlRequestManager::~UrlmonUrlRequestManager() { | 1377 UrlmonUrlRequestManager::~UrlmonUrlRequestManager() { |
1376 StopAll(); | 1378 StopAll(); |
1377 if (background_worker_thread_enabled_) | |
1378 background_thread_->Stop(); | |
1379 } | 1379 } |
1380 | 1380 |
1381 void UrlmonUrlRequestManager::AddPrivacyDataForUrl( | 1381 void UrlmonUrlRequestManager::AddPrivacyDataForUrl( |
1382 const std::string& url, const std::string& policy_ref, | 1382 const std::string& url, const std::string& policy_ref, |
1383 int32 flags) { | 1383 int32 flags) { |
1384 DCHECK(!url.empty()); | 1384 DCHECK(!url.empty()); |
1385 | 1385 |
1386 bool fire_privacy_event = false; | 1386 bool fire_privacy_event = false; |
1387 | 1387 |
1388 if (privacy_info_.privacy_records.empty()) | 1388 if (privacy_info_.privacy_records.empty()) |
(...skipping 27 matching lines...) Expand all Loading... |
1416 } | 1416 } |
1417 | 1417 |
1418 void UrlmonUrlRequestManager::ResourceFetcherThread::Init() { | 1418 void UrlmonUrlRequestManager::ResourceFetcherThread::Init() { |
1419 CoInitialize(NULL); | 1419 CoInitialize(NULL); |
1420 } | 1420 } |
1421 | 1421 |
1422 void UrlmonUrlRequestManager::ResourceFetcherThread::CleanUp() { | 1422 void UrlmonUrlRequestManager::ResourceFetcherThread::CleanUp() { |
1423 CoUninitialize(); | 1423 CoUninitialize(); |
1424 } | 1424 } |
1425 | 1425 |
OLD | NEW |