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

Side by Side Diff: net/disk_cache/in_flight_io.cc

Issue 4291001: Convert implicit scoped_refptr constructor calls to explicit ones, part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/build
Patch Set: comments Created 10 years, 1 month 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 | « net/disk_cache/in_flight_backend_io.cc ('k') | net/http/http_network_transaction.cc » ('j') | 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) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2010 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 "net/disk_cache/in_flight_io.h" 5 #include "net/disk_cache/in_flight_io.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace disk_cache { 9 namespace disk_cache {
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Runs on the primary thread. 67 // Runs on the primary thread.
68 void InFlightIO::InvokeCallback(BackgroundIO* operation, bool cancel_task) { 68 void InFlightIO::InvokeCallback(BackgroundIO* operation, bool cancel_task) {
69 operation->io_completed()->Wait(); 69 operation->io_completed()->Wait();
70 70
71 if (cancel_task) 71 if (cancel_task)
72 operation->Cancel(); 72 operation->Cancel();
73 73
74 // Make sure that we remove the operation from the list before invoking the 74 // Make sure that we remove the operation from the list before invoking the
75 // callback (so that a subsequent cancel does not invoke the callback again). 75 // callback (so that a subsequent cancel does not invoke the callback again).
76 DCHECK(io_list_.find(operation) != io_list_.end()); 76 DCHECK(io_list_.find(operation) != io_list_.end());
77 io_list_.erase(operation); 77 io_list_.erase(make_scoped_refptr(operation));
78 OnOperationComplete(operation, cancel_task); 78 OnOperationComplete(operation, cancel_task);
79 } 79 }
80 80
81 // Runs on the primary thread. 81 // Runs on the primary thread.
82 void InFlightIO::OnOperationPosted(BackgroundIO* operation) { 82 void InFlightIO::OnOperationPosted(BackgroundIO* operation) {
83 DCHECK(callback_thread_->BelongsToCurrentThread()); 83 DCHECK(callback_thread_->BelongsToCurrentThread());
84 io_list_.insert(operation); 84 io_list_.insert(make_scoped_refptr(operation));
85 } 85 }
86 86
87 } // namespace disk_cache 87 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/in_flight_backend_io.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698