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

Side by Side Diff: net/url_request/view_cache_helper.cc

Issue 585833002: Revert of Remove void** from disk_cache interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « net/url_request/view_cache_helper.h ('k') | no next file » | 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 "net/url_request/view_cache_helper.h" 5 #include "net/url_request/view_cache_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "net/base/escape.h" 10 #include "net/base/escape.h"
(...skipping 27 matching lines...) Expand all
38 "</a></td></tr>"; 38 "</a></td></tr>";
39 return row; 39 return row;
40 } 40 }
41 41
42 } // namespace. 42 } // namespace.
43 43
44 ViewCacheHelper::ViewCacheHelper() 44 ViewCacheHelper::ViewCacheHelper()
45 : context_(NULL), 45 : context_(NULL),
46 disk_cache_(NULL), 46 disk_cache_(NULL),
47 entry_(NULL), 47 entry_(NULL),
48 iter_(NULL),
48 buf_len_(0), 49 buf_len_(0),
49 index_(0), 50 index_(0),
50 data_(NULL), 51 data_(NULL),
51 next_state_(STATE_NONE), 52 next_state_(STATE_NONE),
52 weak_factory_(this) { 53 weak_factory_(this) {
53 } 54 }
54 55
55 ViewCacheHelper::~ViewCacheHelper() { 56 ViewCacheHelper::~ViewCacheHelper() {
56 if (entry_) 57 if (entry_)
57 entry_->Close(); 58 entry_->Close();
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 next_state_ = STATE_OPEN_NEXT_ENTRY; 235 next_state_ = STATE_OPEN_NEXT_ENTRY;
235 return OK; 236 return OK;
236 } 237 }
237 238
238 next_state_ = STATE_OPEN_ENTRY; 239 next_state_ = STATE_OPEN_ENTRY;
239 return OK; 240 return OK;
240 } 241 }
241 242
242 int ViewCacheHelper::DoOpenNextEntry() { 243 int ViewCacheHelper::DoOpenNextEntry() {
243 next_state_ = STATE_OPEN_NEXT_ENTRY_COMPLETE; 244 next_state_ = STATE_OPEN_NEXT_ENTRY_COMPLETE;
244 if (!iter_) 245 return disk_cache_->OpenNextEntry(
245 iter_ = disk_cache_->CreateIterator(); 246 &iter_, &entry_,
246 return 247 base::Bind(&ViewCacheHelper::OnIOComplete, base::Unretained(this)));
247 iter_->OpenNextEntry(&entry_, base::Bind(&ViewCacheHelper::OnIOComplete,
248 base::Unretained(this)));
249 } 248 }
250 249
251 int ViewCacheHelper::DoOpenNextEntryComplete(int result) { 250 int ViewCacheHelper::DoOpenNextEntryComplete(int result) {
252 if (result == ERR_FAILED) { 251 if (result == ERR_FAILED) {
253 data_->append(VIEW_CACHE_TAIL); 252 data_->append(VIEW_CACHE_TAIL);
254 return OK; 253 return OK;
255 } 254 }
256 255
257 DCHECK_EQ(OK, result); 256 DCHECK_EQ(OK, result);
258 data_->append(FormatEntryInfo(entry_, url_prefix_)); 257 data_->append(FormatEntryInfo(entry_, url_prefix_));
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 entry_ = NULL; 358 entry_ = NULL;
360 } 359 }
361 return OK; 360 return OK;
362 } 361 }
363 362
364 void ViewCacheHelper::OnIOComplete(int result) { 363 void ViewCacheHelper::OnIOComplete(int result) {
365 DoLoop(result); 364 DoLoop(result);
366 } 365 }
367 366
368 } // namespace net. 367 } // namespace net.
OLDNEW
« no previous file with comments | « net/url_request/view_cache_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698