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

Side by Side Diff: net/http/http_cache_transaction.cc

Issue 8990001: base::Bind: Convert most of net/http. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang. Created 9 years 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 "net/http/http_cache_transaction.h" 5 #include "net/http/http_cache_transaction.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 //----------------------------------------------------------------------------- 101 //-----------------------------------------------------------------------------
102 102
103 HttpCache::Transaction::Transaction(HttpCache* cache) 103 HttpCache::Transaction::Transaction(HttpCache* cache)
104 : next_state_(STATE_NONE), 104 : next_state_(STATE_NONE),
105 request_(NULL), 105 request_(NULL),
106 cache_(cache->AsWeakPtr()), 106 cache_(cache->AsWeakPtr()),
107 entry_(NULL), 107 entry_(NULL),
108 new_entry_(NULL), 108 new_entry_(NULL),
109 network_trans_(NULL), 109 network_trans_(NULL),
110 callback_(NULL),
111 new_response_(NULL), 110 new_response_(NULL),
112 mode_(NONE), 111 mode_(NONE),
113 target_state_(STATE_NONE), 112 target_state_(STATE_NONE),
114 reading_(false), 113 reading_(false),
115 invalid_range_(false), 114 invalid_range_(false),
116 truncated_(false), 115 truncated_(false),
117 is_sparse_(false), 116 is_sparse_(false),
118 range_requested_(false), 117 range_requested_(false),
119 handling_206_(false), 118 handling_206_(false),
120 cache_pending_(false), 119 cache_pending_(false),
121 done_reading_(false), 120 done_reading_(false),
122 read_offset_(0), 121 read_offset_(0),
123 effective_load_flags_(0), 122 effective_load_flags_(0),
124 write_len_(0), 123 write_len_(0),
125 final_upload_progress_(0), 124 final_upload_progress_(0),
126 ALLOW_THIS_IN_INITIALIZER_LIST( 125 ALLOW_THIS_IN_INITIALIZER_LIST(io_callback_(
127 io_callback_(this, &Transaction::OnIOComplete)), 126 base::Bind(&Transaction::OnIOComplete, base::Unretained(this)))),
128 ALLOW_THIS_IN_INITIALIZER_LIST( 127 ALLOW_THIS_IN_INITIALIZER_LIST(
129 cache_callback_(new CancelableOldCompletionCallback<Transaction>( 128 cache_callback_(new CancelableOldCompletionCallback<Transaction>(
130 this, &Transaction::OnIOComplete))), 129 this, &Transaction::OnIOComplete))),
131 ALLOW_THIS_IN_INITIALIZER_LIST( 130 ALLOW_THIS_IN_INITIALIZER_LIST(
132 write_headers_callback_(new CancelableOldCompletionCallback<Transactio n>( 131 write_headers_callback_(new CancelableOldCompletionCallback<Transactio n>(
133 this, &Transaction::OnIOComplete))) { 132 this, &Transaction::OnIOComplete))) {
134 COMPILE_ASSERT(HttpCache::Transaction::kNumValidationHeaders == 133 COMPILE_ASSERT(HttpCache::Transaction::kNumValidationHeaders ==
135 arraysize(kValidationHeaders), 134 arraysize(kValidationHeaders),
136 Invalid_number_of_validation_headers); 135 Invalid_number_of_validation_headers);
137 } 136 }
138 137
139 HttpCache::Transaction::~Transaction() { 138 HttpCache::Transaction::~Transaction() {
140 // We may have to issue another IO, but we should never invoke the callback_ 139 // We may have to issue another IO, but we should never invoke the callback_
141 // after this point. 140 // after this point.
142 callback_ = NULL; 141 callback_.Reset();
143 142
144 if (cache_) { 143 if (cache_) {
145 if (entry_) { 144 if (entry_) {
146 bool cancel_request = reading_; 145 bool cancel_request = reading_;
147 if (cancel_request) { 146 if (cancel_request) {
148 if (partial_.get()) { 147 if (partial_.get()) {
149 entry_->disk_entry->CancelSparseIO(); 148 entry_->disk_entry->CancelSparseIO();
150 } else { 149 } else {
151 cancel_request &= (response_.headers->response_code() == 200); 150 cancel_request &= (response_.headers->response_code() == 200);
152 } 151 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 if (entry_ || !request_) 210 if (entry_ || !request_)
212 return LOAD_STATE_IDLE; 211 return LOAD_STATE_IDLE;
213 return LOAD_STATE_WAITING_FOR_CACHE; 212 return LOAD_STATE_WAITING_FOR_CACHE;
214 } 213 }
215 214
216 const BoundNetLog& HttpCache::Transaction::net_log() const { 215 const BoundNetLog& HttpCache::Transaction::net_log() const {
217 return net_log_; 216 return net_log_;
218 } 217 }
219 218
220 int HttpCache::Transaction::Start(const HttpRequestInfo* request, 219 int HttpCache::Transaction::Start(const HttpRequestInfo* request,
221 OldCompletionCallback* callback, 220 const CompletionCallback& callback,
222 const BoundNetLog& net_log) { 221 const BoundNetLog& net_log) {
223 DCHECK(request); 222 DCHECK(request);
224 DCHECK(callback); 223 DCHECK(!callback.is_null());
225 224
226 // Ensure that we only have one asynchronous call at a time. 225 // Ensure that we only have one asynchronous call at a time.
227 DCHECK(!callback_); 226 DCHECK(callback_.is_null());
228 DCHECK(!reading_); 227 DCHECK(!reading_);
229 DCHECK(!network_trans_.get()); 228 DCHECK(!network_trans_.get());
230 DCHECK(!entry_); 229 DCHECK(!entry_);
231 230
232 if (!cache_) 231 if (!cache_)
233 return ERR_UNEXPECTED; 232 return ERR_UNEXPECTED;
234 233
235 SetRequest(net_log, request); 234 SetRequest(net_log, request);
236 235
237 // We have to wait until the backend is initialized so we start the SM. 236 // We have to wait until the backend is initialized so we start the SM.
238 next_state_ = STATE_GET_BACKEND; 237 next_state_ = STATE_GET_BACKEND;
239 int rv = DoLoop(OK); 238 int rv = DoLoop(OK);
240 239
241 // Setting this here allows us to check for the existence of a callback_ to 240 // Setting this here allows us to check for the existence of a callback_ to
242 // determine if we are still inside Start. 241 // determine if we are still inside Start.
243 if (rv == ERR_IO_PENDING) 242 if (rv == ERR_IO_PENDING)
244 callback_ = callback; 243 callback_ = callback;
245 244
246 return rv; 245 return rv;
247 } 246 }
248 247
249 int HttpCache::Transaction::RestartIgnoringLastError( 248 int HttpCache::Transaction::RestartIgnoringLastError(
250 OldCompletionCallback* callback) { 249 const CompletionCallback& callback) {
251 DCHECK(callback); 250 DCHECK(!callback.is_null());
252 251
253 // Ensure that we only have one asynchronous call at a time. 252 // Ensure that we only have one asynchronous call at a time.
254 DCHECK(!callback_); 253 DCHECK(callback_.is_null());
255 254
256 if (!cache_) 255 if (!cache_)
257 return ERR_UNEXPECTED; 256 return ERR_UNEXPECTED;
258 257
259 int rv = RestartNetworkRequest(); 258 int rv = RestartNetworkRequest();
260 259
261 if (rv == ERR_IO_PENDING) 260 if (rv == ERR_IO_PENDING)
262 callback_ = callback; 261 callback_ = callback;
263 262
264 return rv; 263 return rv;
265 } 264 }
266 265
267 int HttpCache::Transaction::RestartWithCertificate( 266 int HttpCache::Transaction::RestartWithCertificate(
268 X509Certificate* client_cert, 267 X509Certificate* client_cert,
269 OldCompletionCallback* callback) { 268 const CompletionCallback& callback) {
270 DCHECK(callback); 269 DCHECK(!callback.is_null());
271 270
272 // Ensure that we only have one asynchronous call at a time. 271 // Ensure that we only have one asynchronous call at a time.
273 DCHECK(!callback_); 272 DCHECK(callback_.is_null());
274 273
275 if (!cache_) 274 if (!cache_)
276 return ERR_UNEXPECTED; 275 return ERR_UNEXPECTED;
277 276
278 int rv = RestartNetworkRequestWithCertificate(client_cert); 277 int rv = RestartNetworkRequestWithCertificate(client_cert);
279 278
280 if (rv == ERR_IO_PENDING) 279 if (rv == ERR_IO_PENDING)
281 callback_ = callback; 280 callback_ = callback;
282 281
283 return rv; 282 return rv;
284 } 283 }
285 284
286 int HttpCache::Transaction::RestartWithAuth( 285 int HttpCache::Transaction::RestartWithAuth(
287 const AuthCredentials& credentials, 286 const AuthCredentials& credentials,
288 OldCompletionCallback* callback) { 287 const CompletionCallback& callback) {
289 DCHECK(auth_response_.headers); 288 DCHECK(auth_response_.headers);
290 DCHECK(callback); 289 DCHECK(!callback.is_null());
291 290
292 // Ensure that we only have one asynchronous call at a time. 291 // Ensure that we only have one asynchronous call at a time.
293 DCHECK(!callback_); 292 DCHECK(callback_.is_null());
294 293
295 if (!cache_) 294 if (!cache_)
296 return ERR_UNEXPECTED; 295 return ERR_UNEXPECTED;
297 296
298 // Clear the intermediate response since we are going to start over. 297 // Clear the intermediate response since we are going to start over.
299 auth_response_ = HttpResponseInfo(); 298 auth_response_ = HttpResponseInfo();
300 299
301 int rv = RestartNetworkRequestWithAuth(credentials); 300 int rv = RestartNetworkRequestWithAuth(credentials);
302 301
303 if (rv == ERR_IO_PENDING) 302 if (rv == ERR_IO_PENDING)
304 callback_ = callback; 303 callback_ = callback;
305 304
306 return rv; 305 return rv;
307 } 306 }
308 307
309 bool HttpCache::Transaction::IsReadyToRestartForAuth() { 308 bool HttpCache::Transaction::IsReadyToRestartForAuth() {
310 if (!network_trans_.get()) 309 if (!network_trans_.get())
311 return false; 310 return false;
312 return network_trans_->IsReadyToRestartForAuth(); 311 return network_trans_->IsReadyToRestartForAuth();
313 } 312 }
314 313
315 int HttpCache::Transaction::Read(IOBuffer* buf, int buf_len, 314 int HttpCache::Transaction::Read(IOBuffer* buf, int buf_len,
316 OldCompletionCallback* callback) { 315 const CompletionCallback& callback) {
317 DCHECK(buf); 316 DCHECK(buf);
318 DCHECK_GT(buf_len, 0); 317 DCHECK_GT(buf_len, 0);
319 DCHECK(callback); 318 DCHECK(!callback.is_null());
320 319
321 DCHECK(!callback_); 320 DCHECK(callback_.is_null());
322 321
323 if (!cache_) 322 if (!cache_)
324 return ERR_UNEXPECTED; 323 return ERR_UNEXPECTED;
325 324
326 // If we have an intermediate auth response at this point, then it means the 325 // If we have an intermediate auth response at this point, then it means the
327 // user wishes to read the network response (the error page). If there is a 326 // user wishes to read the network response (the error page). If there is a
328 // previous response in the cache then we should leave it intact. 327 // previous response in the cache then we should leave it intact.
329 if (auth_response_.headers && mode_ != NONE) { 328 if (auth_response_.headers && mode_ != NONE) {
330 DCHECK(mode_ & WRITE); 329 DCHECK(mode_ & WRITE);
331 DoneWritingToEntry(mode_ == READ_WRITE); 330 DoneWritingToEntry(mode_ == READ_WRITE);
(...skipping 18 matching lines...) Expand all
350 break; 349 break;
351 case READ: 350 case READ:
352 rv = ReadFromEntry(buf, buf_len); 351 rv = ReadFromEntry(buf, buf_len);
353 break; 352 break;
354 default: 353 default:
355 NOTREACHED(); 354 NOTREACHED();
356 rv = ERR_FAILED; 355 rv = ERR_FAILED;
357 } 356 }
358 357
359 if (rv == ERR_IO_PENDING) { 358 if (rv == ERR_IO_PENDING) {
360 DCHECK(!callback_); 359 DCHECK(callback_.is_null());
361 callback_ = callback; 360 callback_ = callback;
362 } 361 }
363 return rv; 362 return rv;
364 } 363 }
365 364
366 void HttpCache::Transaction::StopCaching() { 365 void HttpCache::Transaction::StopCaching() {
367 // We really don't know where we are now. Hopefully there is no operation in 366 // We really don't know where we are now. Hopefully there is no operation in
368 // progress, but nothing really prevents this method to be called after we 367 // progress, but nothing really prevents this method to be called after we
369 // returned ERR_IO_PENDING. We cannot attempt to truncate the entry at this 368 // returned ERR_IO_PENDING. We cannot attempt to truncate the entry at this
370 // point because we need the state machine for that (and even if we are really 369 // point because we need the state machine for that (and even if we are really
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 uint64 HttpCache::Transaction::GetUploadProgress() const { 407 uint64 HttpCache::Transaction::GetUploadProgress() const {
409 if (network_trans_.get()) 408 if (network_trans_.get())
410 return network_trans_->GetUploadProgress(); 409 return network_trans_->GetUploadProgress();
411 return final_upload_progress_; 410 return final_upload_progress_;
412 } 411 }
413 412
414 //----------------------------------------------------------------------------- 413 //-----------------------------------------------------------------------------
415 414
416 void HttpCache::Transaction::DoCallback(int rv) { 415 void HttpCache::Transaction::DoCallback(int rv) {
417 DCHECK(rv != ERR_IO_PENDING); 416 DCHECK(rv != ERR_IO_PENDING);
418 DCHECK(callback_); 417 DCHECK(!callback_.is_null());
419 418
420 // Since Run may result in Read being called, clear callback_ up front. 419 // Since Run may result in Read being called, clear callback_ up front.
421 OldCompletionCallback* c = callback_; 420 CompletionCallback c = callback_;
422 callback_ = NULL; 421 callback_.Reset();
423 c->Run(rv); 422 c.Run(rv);
424 } 423 }
425 424
426 int HttpCache::Transaction::HandleResult(int rv) { 425 int HttpCache::Transaction::HandleResult(int rv) {
427 DCHECK(rv != ERR_IO_PENDING); 426 DCHECK(rv != ERR_IO_PENDING);
428 if (callback_) 427 if (!callback_.is_null())
429 DoCallback(rv); 428 DoCallback(rv);
429
430 return rv; 430 return rv;
431 } 431 }
432 432
433 // A few common patterns: (Foo* means Foo -> FooComplete) 433 // A few common patterns: (Foo* means Foo -> FooComplete)
434 // 434 //
435 // Not-cached entry: 435 // Not-cached entry:
436 // Start(): 436 // Start():
437 // GetBackend* -> InitEntry -> OpenEntry* -> CreateEntry* -> AddToEntry* -> 437 // GetBackend* -> InitEntry -> OpenEntry* -> CreateEntry* -> AddToEntry* ->
438 // SendRequest* -> SuccessfulSendRequest -> OverwriteCachedResponse -> 438 // SendRequest* -> SuccessfulSendRequest -> OverwriteCachedResponse ->
439 // CacheWriteResponse* -> TruncateCachedData* -> TruncateCachedMetadata* -> 439 // CacheWriteResponse* -> TruncateCachedData* -> TruncateCachedMetadata* ->
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 int HttpCache::Transaction::DoSendRequest() { 715 int HttpCache::Transaction::DoSendRequest() {
716 DCHECK(mode_ & WRITE || mode_ == NONE); 716 DCHECK(mode_ & WRITE || mode_ == NONE);
717 DCHECK(!network_trans_.get()); 717 DCHECK(!network_trans_.get());
718 718
719 // Create a network transaction. 719 // Create a network transaction.
720 int rv = cache_->network_layer_->CreateTransaction(&network_trans_); 720 int rv = cache_->network_layer_->CreateTransaction(&network_trans_);
721 if (rv != OK) 721 if (rv != OK)
722 return rv; 722 return rv;
723 723
724 next_state_ = STATE_SEND_REQUEST_COMPLETE; 724 next_state_ = STATE_SEND_REQUEST_COMPLETE;
725 rv = network_trans_->Start(request_, &io_callback_, net_log_); 725 rv = network_trans_->Start(request_, io_callback_, net_log_);
726 return rv; 726 return rv;
727 } 727 }
728 728
729 int HttpCache::Transaction::DoSendRequestComplete(int result) { 729 int HttpCache::Transaction::DoSendRequestComplete(int result) {
730 if (!cache_) 730 if (!cache_)
731 return ERR_UNEXPECTED; 731 return ERR_UNEXPECTED;
732 732
733 if (result == OK) { 733 if (result == OK) {
734 next_state_ = STATE_SUCCESSFUL_SEND_REQUEST; 734 next_state_ = STATE_SUCCESSFUL_SEND_REQUEST;
735 return OK; 735 return OK;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 } 791 }
792 mode_ = WRITE; 792 mode_ = WRITE;
793 } 793 }
794 794
795 next_state_ = STATE_OVERWRITE_CACHED_RESPONSE; 795 next_state_ = STATE_OVERWRITE_CACHED_RESPONSE;
796 return OK; 796 return OK;
797 } 797 }
798 798
799 int HttpCache::Transaction::DoNetworkRead() { 799 int HttpCache::Transaction::DoNetworkRead() {
800 next_state_ = STATE_NETWORK_READ_COMPLETE; 800 next_state_ = STATE_NETWORK_READ_COMPLETE;
801 return network_trans_->Read(read_buf_, io_buf_len_, &io_callback_); 801 return network_trans_->Read(read_buf_, io_buf_len_, io_callback_);
802 } 802 }
803 803
804 int HttpCache::Transaction::DoNetworkReadComplete(int result) { 804 int HttpCache::Transaction::DoNetworkReadComplete(int result) {
805 DCHECK(mode_ & WRITE || mode_ == NONE); 805 DCHECK(mode_ & WRITE || mode_ == NONE);
806 806
807 if (!cache_) 807 if (!cache_)
808 return ERR_UNEXPECTED; 808 return ERR_UNEXPECTED;
809 809
810 // If there is an error or we aren't saving the data, we are done; just wait 810 // If there is an error or we aren't saving the data, we are done; just wait
811 // until the destructor runs to see if we can keep the data. 811 // until the destructor runs to see if we can keep the data.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 } 983 }
984 return OK; 984 return OK;
985 } 985 }
986 986
987 // We may end up here multiple times for a given request. 987 // We may end up here multiple times for a given request.
988 int HttpCache::Transaction::DoStartPartialCacheValidation() { 988 int HttpCache::Transaction::DoStartPartialCacheValidation() {
989 if (mode_ == NONE) 989 if (mode_ == NONE)
990 return OK; 990 return OK;
991 991
992 next_state_ = STATE_COMPLETE_PARTIAL_CACHE_VALIDATION; 992 next_state_ = STATE_COMPLETE_PARTIAL_CACHE_VALIDATION;
993 return partial_->ShouldValidateCache(entry_->disk_entry, &io_callback_); 993 return partial_->ShouldValidateCache(entry_->disk_entry, io_callback_);
994 } 994 }
995 995
996 int HttpCache::Transaction::DoCompletePartialCacheValidation(int result) { 996 int HttpCache::Transaction::DoCompletePartialCacheValidation(int result) {
997 if (!result) { 997 if (!result) {
998 // This is the end of the request. 998 // This is the end of the request.
999 if (mode_ & WRITE) { 999 if (mode_ & WRITE) {
1000 DoneWritingToEntry(true); 1000 DoneWritingToEntry(true);
1001 } else { 1001 } else {
1002 cache_->DoneReadingFromEntry(entry_, this); 1002 cache_->DoneReadingFromEntry(entry_, this);
1003 entry_ = NULL; 1003 entry_ = NULL;
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 next_state_ = STATE_SEND_REQUEST; 1675 next_state_ = STATE_SEND_REQUEST;
1676 return OK; 1676 return OK;
1677 } 1677 }
1678 1678
1679 int HttpCache::Transaction::RestartNetworkRequest() { 1679 int HttpCache::Transaction::RestartNetworkRequest() {
1680 DCHECK(mode_ & WRITE || mode_ == NONE); 1680 DCHECK(mode_ & WRITE || mode_ == NONE);
1681 DCHECK(network_trans_.get()); 1681 DCHECK(network_trans_.get());
1682 DCHECK_EQ(STATE_NONE, next_state_); 1682 DCHECK_EQ(STATE_NONE, next_state_);
1683 1683
1684 next_state_ = STATE_SEND_REQUEST_COMPLETE; 1684 next_state_ = STATE_SEND_REQUEST_COMPLETE;
1685 int rv = network_trans_->RestartIgnoringLastError(&io_callback_); 1685 int rv = network_trans_->RestartIgnoringLastError(io_callback_);
1686 if (rv != ERR_IO_PENDING) 1686 if (rv != ERR_IO_PENDING)
1687 return DoLoop(rv); 1687 return DoLoop(rv);
1688 return rv; 1688 return rv;
1689 } 1689 }
1690 1690
1691 int HttpCache::Transaction::RestartNetworkRequestWithCertificate( 1691 int HttpCache::Transaction::RestartNetworkRequestWithCertificate(
1692 X509Certificate* client_cert) { 1692 X509Certificate* client_cert) {
1693 DCHECK(mode_ & WRITE || mode_ == NONE); 1693 DCHECK(mode_ & WRITE || mode_ == NONE);
1694 DCHECK(network_trans_.get()); 1694 DCHECK(network_trans_.get());
1695 DCHECK_EQ(STATE_NONE, next_state_); 1695 DCHECK_EQ(STATE_NONE, next_state_);
1696 1696
1697 next_state_ = STATE_SEND_REQUEST_COMPLETE; 1697 next_state_ = STATE_SEND_REQUEST_COMPLETE;
1698 int rv = network_trans_->RestartWithCertificate(client_cert, &io_callback_); 1698 int rv = network_trans_->RestartWithCertificate(client_cert, io_callback_);
1699 if (rv != ERR_IO_PENDING) 1699 if (rv != ERR_IO_PENDING)
1700 return DoLoop(rv); 1700 return DoLoop(rv);
1701 return rv; 1701 return rv;
1702 } 1702 }
1703 1703
1704 int HttpCache::Transaction::RestartNetworkRequestWithAuth( 1704 int HttpCache::Transaction::RestartNetworkRequestWithAuth(
1705 const AuthCredentials& credentials) { 1705 const AuthCredentials& credentials) {
1706 DCHECK(mode_ & WRITE || mode_ == NONE); 1706 DCHECK(mode_ & WRITE || mode_ == NONE);
1707 DCHECK(network_trans_.get()); 1707 DCHECK(network_trans_.get());
1708 DCHECK_EQ(STATE_NONE, next_state_); 1708 DCHECK_EQ(STATE_NONE, next_state_);
1709 1709
1710 next_state_ = STATE_SEND_REQUEST_COMPLETE; 1710 next_state_ = STATE_SEND_REQUEST_COMPLETE;
1711 int rv = network_trans_->RestartWithAuth(credentials, &io_callback_); 1711 int rv = network_trans_->RestartWithAuth(credentials, io_callback_);
1712 if (rv != ERR_IO_PENDING) 1712 if (rv != ERR_IO_PENDING)
1713 return DoLoop(rv); 1713 return DoLoop(rv);
1714 return rv; 1714 return rv;
1715 } 1715 }
1716 1716
1717 bool HttpCache::Transaction::RequiresValidation() { 1717 bool HttpCache::Transaction::RequiresValidation() {
1718 // TODO(darin): need to do more work here: 1718 // TODO(darin): need to do more work here:
1719 // - make sure we have a matching request method 1719 // - make sure we have a matching request method
1720 // - watch out for cached responses that depend on authentication 1720 // - watch out for cached responses that depend on authentication
1721 // In playback mode, nothing requires validation. 1721 // In playback mode, nothing requires validation.
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 return false; 2083 return false;
2084 2084
2085 return true; 2085 return true;
2086 } 2086 }
2087 2087
2088 void HttpCache::Transaction::OnIOComplete(int result) { 2088 void HttpCache::Transaction::OnIOComplete(int result) {
2089 DoLoop(result); 2089 DoLoop(result);
2090 } 2090 }
2091 2091
2092 } // namespace net 2092 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698