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

Side by Side Diff: content/browser/browser_process_sub_thread.cc

Issue 10299002: Stop refcounting URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialize to NULL Created 8 years, 7 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
OLDNEW
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 "content/browser/browser_process_sub_thread.h" 5 #include "content/browser/browser_process_sub_thread.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <Objbase.h> 8 #include <Objbase.h>
9 #endif 9 #endif
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 base::ThreadRestrictions::DisallowWaiting(); 46 base::ThreadRestrictions::DisallowWaiting();
47 } 47 }
48 } 48 }
49 49
50 void BrowserProcessSubThread::CleanUp() { 50 void BrowserProcessSubThread::CleanUp() {
51 if (BrowserThread::CurrentlyOn(BrowserThread::IO)) 51 if (BrowserThread::CurrentlyOn(BrowserThread::IO))
52 IOThreadPreCleanUp(); 52 IOThreadPreCleanUp();
53 53
54 BrowserThreadImpl::CleanUp(); 54 BrowserThreadImpl::CleanUp();
55 55
56 if (BrowserThread::CurrentlyOn(BrowserThread::IO))
57 IOThreadPostCleanUp();
58
59 delete notification_service_; 56 delete notification_service_;
60 notification_service_ = NULL; 57 notification_service_ = NULL;
61 58
62 #if defined(OS_WIN) 59 #if defined(OS_WIN)
63 // Closes the COM library on the current thread. CoInitialize must 60 // Closes the COM library on the current thread. CoInitialize must
64 // be balanced by a corresponding call to CoUninitialize. 61 // be balanced by a corresponding call to CoUninitialize.
65 CoUninitialize(); 62 CoUninitialize();
66 #endif 63 #endif
67 } 64 }
68 65
69 void BrowserProcessSubThread::IOThreadPreCleanUp() { 66 void BrowserProcessSubThread::IOThreadPreCleanUp() {
70 // Kill all things that might be holding onto 67 // Kill all things that might be holding onto
71 // net::URLRequest/net::URLRequestContexts. 68 // net::URLRequest/net::URLRequestContexts.
72 69
73 // Destroy all URLRequests started by URLFetchers. 70 // Destroy all URLRequests started by URLFetchers.
74 content::URLFetcher::CancelAll(); 71 content::URLFetcher::CancelAll();
75 72
76 IndexedDBKeyUtilityClient::Shutdown(); 73 IndexedDBKeyUtilityClient::Shutdown();
77 74
78 // If any child processes are still running, terminate them and 75 // If any child processes are still running, terminate them and
79 // and delete the BrowserChildProcessHost instances to release whatever 76 // and delete the BrowserChildProcessHost instances to release whatever
80 // IO thread only resources they are referencing. 77 // IO thread only resources they are referencing.
81 BrowserChildProcessHostImpl::TerminateAll(); 78 BrowserChildProcessHostImpl::TerminateAll();
82 } 79 }
83 80
84 void BrowserProcessSubThread::IOThreadPostCleanUp() {
85 // net::URLRequest instances must NOT outlive the IO thread.
86 base::debug::LeakTracker<net::URLRequest>::CheckForLeaks();
87 }
88
89 } // namespace content 81 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_process_sub_thread.h ('k') | content/browser/renderer_host/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698