Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 10054007: Assert we do not leak requests for the system and safe browsing contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
646 // Need to do the CheckForLeaks on IOThread instead of in ShutDown where 648 // Need to do the CheckForLeaks on IOThread instead of in ShutDown where
647 // url_request_context_getter_ is cleared, since the URLRequestContextGetter 649 // url_request_context_getter_ is cleared, since the URLRequestContextGetter
648 // will PostTask to IOTread to delete itself. 650 // will PostTask to IOTread to delete itself.
649 using base::debug::LeakTracker; 651 using base::debug::LeakTracker;
650 LeakTracker<SafeBrowsingURLRequestContextGetter>::CheckForLeaks(); 652 LeakTracker<SafeBrowsingURLRequestContextGetter>::CheckForLeaks();
651 653
652 DCHECK(url_request_context_.get()); 654 DCHECK(url_request_context_.get());
653 url_request_context_ = NULL; 655 url_request_context_ = NULL;
654 } 656 }
655 657
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 Stop(); 1462 Stop();
1461 1463
1462 if (csd_service_.get()) 1464 if (csd_service_.get())
1463 csd_service_->SetEnabledAndRefreshState(enable); 1465 csd_service_->SetEnabledAndRefreshState(enable);
1464 if (download_service_.get()) { 1466 if (download_service_.get()) {
1465 download_service_->SetEnabled( 1467 download_service_->SetEnabled(
1466 enable && !CommandLine::ForCurrentProcess()->HasSwitch( 1468 enable && !CommandLine::ForCurrentProcess()->HasSwitch(
1467 switches::kDisableImprovedDownloadProtection)); 1469 switches::kDisableImprovedDownloadProtection));
1468 } 1470 }
1469 } 1471 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698