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

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

Issue 7575010: Removal of Profile from content part 7. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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/cancelable_request.h" 5 #include "content/browser/cancelable_request.h"
6 6
7 CancelableRequestProvider::CancelableRequestProvider() 7 CancelableRequestProvider::CancelableRequestProvider()
8 : next_handle_(1) { 8 : next_handle_(1) {
9 } 9 }
10 10
11 CancelableRequestProvider::~CancelableRequestProvider() { 11 CancelableRequestProvider::~CancelableRequestProvider() {
12 // There may be requests whose result callback has not been run yet. We need 12 // There may be requests whose result callback has not been run yet. We need
13 // to cancel them otherwise they may try and call us back after we've been 13 // to cancel them otherwise they may try and call us back after we've been
14 // deleted, or do other bad things. This can occur on shutdown (or profile 14 // deleted, or do other bad things. This can occur on shutdown (or browser
15 // destruction) when a request is scheduled, completed (but not dispatched), 15 // context destruction) when a request is scheduled, completed (but not
16 // then the Profile is deleted. 16 // dispatched), then the BrowserContext is deleted.
17 base::AutoLock lock(pending_request_lock_); 17 base::AutoLock lock(pending_request_lock_);
18 while (!pending_requests_.empty()) 18 while (!pending_requests_.empty())
19 CancelRequestLocked(pending_requests_.begin()); 19 CancelRequestLocked(pending_requests_.begin());
20 } 20 }
21 21
22 CancelableRequestProvider::Handle CancelableRequestProvider::AddRequest( 22 CancelableRequestProvider::Handle CancelableRequestProvider::AddRequest(
23 CancelableRequestBase* request, 23 CancelableRequestBase* request,
24 CancelableRequestConsumerBase* consumer) { 24 CancelableRequestConsumerBase* consumer) {
25 Handle handle; 25 Handle handle;
26 { 26 {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 void CancelableRequestBase::Init(CancelableRequestProvider* provider, 102 void CancelableRequestBase::Init(CancelableRequestProvider* provider,
103 CancelableRequestProvider::Handle handle, 103 CancelableRequestProvider::Handle handle,
104 CancelableRequestConsumerBase* consumer) { 104 CancelableRequestConsumerBase* consumer) {
105 DCHECK(handle_ == 0 && provider_ == NULL && consumer_ == NULL); 105 DCHECK(handle_ == 0 && provider_ == NULL && consumer_ == NULL);
106 provider_ = provider; 106 provider_ = provider;
107 consumer_ = consumer; 107 consumer_ = consumer;
108 handle_ = handle; 108 handle_ = handle;
109 } 109 }
OLDNEW
« no previous file with comments | « content/browser/appcache/chrome_appcache_service.h ('k') | content/browser/chrome_blob_storage_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698