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

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

Issue 14625012: net: Return LoadTiming information in the case of a cache hit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Small fix Created 7 years, 7 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
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 // This file declares HttpCache::Transaction, a private class of HttpCache so 5 // This file declares HttpCache::Transaction, a private class of HttpCache so
6 // it should only be included by http_cache.cc 6 // it should only be included by http_cache.cc
7 7
8 #ifndef NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 8 #ifndef NET_HTTP_HTTP_CACHE_TRANSACTION_H_
9 #define NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 9 #define NET_HTTP_HTTP_CACHE_TRANSACTION_H_
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/time.h" 13 #include "base/time.h"
14 #include "net/base/completion_callback.h" 14 #include "net/base/completion_callback.h"
15 #include "net/base/net_log.h" 15 #include "net/base/net_log.h"
16 #include "net/base/request_priority.h" 16 #include "net/base/request_priority.h"
gavinp 2013/05/10 20:23:03 #include "net/base/load_timing_info.h"
mmenke 2013/05/10 20:44:00 Since we just have a scoped_ptr, forward declared
17 #include "net/http/http_cache.h" 17 #include "net/http/http_cache.h"
18 #include "net/http/http_response_info.h" 18 #include "net/http/http_response_info.h"
19 #include "net/http/http_request_headers.h" 19 #include "net/http/http_request_headers.h"
20 #include "net/http/http_transaction.h" 20 #include "net/http/http_transaction.h"
21 21
22 namespace net { 22 namespace net {
23 23
24 class PartialData; 24 class PartialData;
25 struct HttpRequestInfo; 25 struct HttpRequestInfo;
26 class HttpTransactionDelegate; 26 class HttpTransactionDelegate;
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 // Resets cache_io_start_ to the current time, if |return_value| is 379 // Resets cache_io_start_ to the current time, if |return_value| is
380 // ERR_IO_PENDING. 380 // ERR_IO_PENDING.
381 // Returns |return_value|. 381 // Returns |return_value|.
382 int ResetCacheIOStart(int return_value); 382 int ResetCacheIOStart(int return_value);
383 383
384 void ScheduleDelayedLoop(base::TimeDelta delay, int result); 384 void ScheduleDelayedLoop(base::TimeDelta delay, int result);
385 void RunDelayedLoop(base::TimeTicks delay_start_time, 385 void RunDelayedLoop(base::TimeTicks delay_start_time,
386 base::TimeDelta intended_delay, int result); 386 base::TimeDelta intended_delay, int result);
387 387
388 // Updates |last_network_trans_load_timing_| from |network_trans_|, which must
389 // be non-NULL. Only called before deleting the old transaction.
gavinp 2013/05/10 20:23:03 I think "old network transaction" would make thing
mmenke 2013/05/10 20:44:00 Done. I agree that "old" is clearer.
390 void CacheLoadTimingInformation();
gavinp 2013/05/10 20:23:03 In that vein, using "Cache" here to mean "make a c
mmenke 2013/05/10 20:44:00 Switched to ResetNetworkTransaction, since we alwa
391
388 State next_state_; 392 State next_state_;
389 const HttpRequestInfo* request_; 393 const HttpRequestInfo* request_;
390 RequestPriority priority_; 394 RequestPriority priority_;
391 BoundNetLog net_log_; 395 BoundNetLog net_log_;
392 scoped_ptr<HttpRequestInfo> custom_request_; 396 scoped_ptr<HttpRequestInfo> custom_request_;
393 HttpRequestHeaders request_headers_copy_; 397 HttpRequestHeaders request_headers_copy_;
394 // If extra_headers specified a "if-modified-since" or "if-none-match", 398 // If extra_headers specified a "if-modified-since" or "if-none-match",
395 // |external_validation_| contains the value of those headers. 399 // |external_validation_| contains the value of those headers.
396 ValidationHeaders external_validation_; 400 ValidationHeaders external_validation_;
397 base::WeakPtr<HttpCache> cache_; 401 base::WeakPtr<HttpCache> cache_;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 // a delay on return, we must defer that delay until AddToEntry has been 444 // a delay on return, we must defer that delay until AddToEntry has been
441 // called, to avoid a race condition on the address returned. 445 // called, to avoid a race condition on the address returned.
442 base::TimeDelta deferred_cache_sensitivity_delay_; 446 base::TimeDelta deferred_cache_sensitivity_delay_;
443 bool defer_cache_sensitivity_delay_; 447 bool defer_cache_sensitivity_delay_;
444 448
445 // For sensitivity analysis, the simulated increase in cache service times, 449 // For sensitivity analysis, the simulated increase in cache service times,
446 // in percent. 450 // in percent.
447 int sensitivity_analysis_percent_increase_; 451 int sensitivity_analysis_percent_increase_;
448 452
449 HttpTransactionDelegate* transaction_delegate_; 453 HttpTransactionDelegate* transaction_delegate_;
454
455 // Load timing information for the last network request, if any. Set in the
456 // 304 and 206 response cases, as the network transaction may be destroyed
457 // before the caller requests load timing information.
458 scoped_ptr<LoadTimingInfo> last_network_trans_load_timing_;
450 }; 459 };
451 460
452 } // namespace net 461 } // namespace net
453 462
454 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 463 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698