OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/safe_browsing/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 // |system_url_request_context_getter| may be NULL during tests. | 636 // |system_url_request_context_getter| may be NULL during tests. |
637 if (system_url_request_context_getter) | 637 if (system_url_request_context_getter) |
638 url_request_context_->CopyFrom( | 638 url_request_context_->CopyFrom( |
639 system_url_request_context_getter->GetURLRequestContext()); | 639 system_url_request_context_getter->GetURLRequestContext()); |
640 url_request_context_->set_cookie_store(cookie_store); | 640 url_request_context_->set_cookie_store(cookie_store); |
641 } | 641 } |
642 | 642 |
643 void SafeBrowsingService::DestroyURLRequestContextOnIOThread() { | 643 void SafeBrowsingService::DestroyURLRequestContextOnIOThread() { |
644 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 644 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
645 | 645 |
646 url_request_context_->AssertNoURLRequests(); | |
647 | |
648 // Need to do the CheckForLeaks on IOThread instead of in ShutDown where | 646 // Need to do the CheckForLeaks on IOThread instead of in ShutDown where |
649 // url_request_context_getter_ is cleared, since the URLRequestContextGetter | 647 // url_request_context_getter_ is cleared, since the URLRequestContextGetter |
650 // will PostTask to IOTread to delete itself. | 648 // will PostTask to IOTread to delete itself. |
651 using base::debug::LeakTracker; | 649 using base::debug::LeakTracker; |
652 LeakTracker<SafeBrowsingURLRequestContextGetter>::CheckForLeaks(); | 650 LeakTracker<SafeBrowsingURLRequestContextGetter>::CheckForLeaks(); |
653 | 651 |
654 DCHECK(url_request_context_.get()); | 652 DCHECK(url_request_context_.get()); |
655 url_request_context_ = NULL; | 653 url_request_context_ = NULL; |
656 } | 654 } |
657 | 655 |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 Stop(); | 1460 Stop(); |
1463 | 1461 |
1464 if (csd_service_.get()) | 1462 if (csd_service_.get()) |
1465 csd_service_->SetEnabledAndRefreshState(enable); | 1463 csd_service_->SetEnabledAndRefreshState(enable); |
1466 if (download_service_.get()) { | 1464 if (download_service_.get()) { |
1467 download_service_->SetEnabled( | 1465 download_service_->SetEnabled( |
1468 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 1466 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
1469 switches::kDisableImprovedDownloadProtection)); | 1467 switches::kDisableImprovedDownloadProtection)); |
1470 } | 1468 } |
1471 } | 1469 } |
OLD | NEW |