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

Side by Side Diff: content/browser/appcache/appcache_disk_cache_unittest.cc

Issue 478053003: Remove implicit conversions from scoped_refptr to T* in content/browser/appcache/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | content/browser/appcache/appcache_group_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bind.h" 5 #include "base/bind.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 disk_cache->CreateEntry(1, &entry1, completion_callback_); 144 disk_cache->CreateEntry(1, &entry1, completion_callback_);
145 disk_cache->CreateEntry(2, &entry2, completion_callback_); 145 disk_cache->CreateEntry(2, &entry2, completion_callback_);
146 FlushCacheTasks(); 146 FlushCacheTasks();
147 EXPECT_TRUE(entry1); 147 EXPECT_TRUE(entry1);
148 EXPECT_TRUE(entry2); 148 EXPECT_TRUE(entry2);
149 149
150 // Write something to one of the entries and flush it. 150 // Write something to one of the entries and flush it.
151 const char* kData = "Hello"; 151 const char* kData = "Hello";
152 const int kDataLen = strlen(kData) + 1; 152 const int kDataLen = strlen(kData) + 1;
153 scoped_refptr<net::IOBuffer> write_buf(new net::WrappedIOBuffer(kData)); 153 scoped_refptr<net::IOBuffer> write_buf(new net::WrappedIOBuffer(kData));
154 entry1->Write(0, 0, write_buf, kDataLen, completion_callback_); 154 entry1->Write(0, 0, write_buf.get(), kDataLen, completion_callback_);
155 FlushCacheTasks(); 155 FlushCacheTasks();
156 156
157 // Queue up a read and a write. 157 // Queue up a read and a write.
158 scoped_refptr<net::IOBuffer> read_buf = new net::IOBuffer(kDataLen); 158 scoped_refptr<net::IOBuffer> read_buf = new net::IOBuffer(kDataLen);
159 entry1->Read(0, 0, read_buf.get(), kDataLen, completion_callback_); 159 entry1->Read(0, 0, read_buf.get(), kDataLen, completion_callback_);
160 entry2->Write(0, 0, write_buf.get(), kDataLen, completion_callback_); 160 entry2->Write(0, 0, write_buf.get(), kDataLen, completion_callback_);
161 161
162 // Pull the plug 162 // Pull the plug
163 disk_cache->Disable(); 163 disk_cache->Disable();
164 FlushCacheTasks(); 164 FlushCacheTasks();
(...skipping 10 matching lines...) Expand all
175 EXPECT_EQ( 175 EXPECT_EQ(
176 net::ERR_ABORTED, 176 net::ERR_ABORTED,
177 entry1->Read(0, 0, read_buf.get(), kDataLen, completion_callback_)); 177 entry1->Read(0, 0, read_buf.get(), kDataLen, completion_callback_));
178 entry1->Close(); 178 entry1->Close();
179 entry2->Close(); 179 entry2->Close();
180 180
181 FlushCacheTasks(); 181 FlushCacheTasks();
182 } 182 }
183 183
184 } // namespace content 184 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/appcache/appcache_group_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698