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

Side by Side Diff: net/disk_cache/flash/flash_entry_impl.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 6 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 | « net/disk_cache/file_posix.cc ('k') | net/disk_cache/flash/internal_entry.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) 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 "base/location.h" 5 #include "base/location.h"
6 #include "base/message_loop_proxy.h" 6 #include "base/message_loop_proxy.h"
7 #include "base/task_runner_util.h" 7 #include "base/task_runner_util.h"
8 #include "net/base/io_buffer.h" 8 #include "net/base/io_buffer.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/disk_cache/flash/flash_entry_impl.h" 10 #include "net/disk_cache/flash/flash_entry_impl.h"
(...skipping 13 matching lines...) Expand all
24 24
25 FlashEntryImpl::FlashEntryImpl(int32 id, 25 FlashEntryImpl::FlashEntryImpl(int32 id,
26 LogStore* store, 26 LogStore* store,
27 base::MessageLoopProxy* cache_thread) 27 base::MessageLoopProxy* cache_thread)
28 : init_(false), 28 : init_(false),
29 old_internal_entry_(new InternalEntry(id, store)), 29 old_internal_entry_(new InternalEntry(id, store)),
30 cache_thread_(cache_thread) { 30 cache_thread_(cache_thread) {
31 } 31 }
32 32
33 int FlashEntryImpl::Init(const CompletionCallback& callback) { 33 int FlashEntryImpl::Init(const CompletionCallback& callback) {
34 if (new_internal_entry_) { 34 if (new_internal_entry_.get()) {
35 DCHECK(callback.is_null()); 35 DCHECK(callback.is_null());
36 init_ = true; 36 init_ = true;
37 return net::OK; 37 return net::OK;
38 } 38 }
39 DCHECK(!callback.is_null() && old_internal_entry_); 39 DCHECK(!callback.is_null() && old_internal_entry_.get());
40 callback_ = callback; 40 callback_ = callback;
41 PostTaskAndReplyWithResult(cache_thread_, FROM_HERE, 41 PostTaskAndReplyWithResult(cache_thread_.get(),
42 FROM_HERE,
42 Bind(&InternalEntry::Init, old_internal_entry_), 43 Bind(&InternalEntry::Init, old_internal_entry_),
43 Bind(&FlashEntryImpl::OnInitComplete, this)); 44 Bind(&FlashEntryImpl::OnInitComplete, this));
44 return net::ERR_IO_PENDING; 45 return net::ERR_IO_PENDING;
45 } 46 }
46 47
47 void FlashEntryImpl::Doom() { 48 void FlashEntryImpl::Doom() {
48 DCHECK(init_); 49 DCHECK(init_);
49 NOTREACHED(); 50 NOTREACHED();
50 } 51 }
51 52
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 callback_.Run(net::OK); 141 callback_.Run(net::OK);
141 } 142 }
142 } 143 }
143 144
144 FlashEntryImpl::~FlashEntryImpl() { 145 FlashEntryImpl::~FlashEntryImpl() {
145 cache_thread_->PostTask(FROM_HERE, 146 cache_thread_->PostTask(FROM_HERE,
146 Bind(&InternalEntry::Close, new_internal_entry_)); 147 Bind(&InternalEntry::Close, new_internal_entry_));
147 } 148 }
148 149
149 } // namespace disk_cache 150 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/file_posix.cc ('k') | net/disk_cache/flash/internal_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698