| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
| 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 // Only for responses. | 90 // Only for responses. |
| 91 std::string mime_type; | 91 std::string mime_type; |
| 92 bool was_cached; | 92 bool was_cached; |
| 93 GURL redirect_url; // Empty unless request was redirected to a valid url. | 93 GURL redirect_url; // Empty unless request was redirected to a valid url. |
| 94 | 94 |
| 95 bool has_validators; | 95 bool has_validators; |
| 96 bool always_revalidate; | 96 bool always_revalidate; |
| 97 | 97 |
| 98 // Initializes a |URLRequestSummary| from a |URLRequest| response. | 98 // Initializes a |URLRequestSummary| from a |URLRequest| response. |
| 99 // Returns true for success. | 99 // Returns true for success. Note: NavigationID is NOT initialized |
| 100 // by this function. |
| 100 static bool SummarizeResponse(const net::URLRequest& request, | 101 static bool SummarizeResponse(const net::URLRequest& request, |
| 101 URLRequestSummary* summary); | 102 URLRequestSummary* summary); |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 // Stores the data learned from a single navigation. | 105 // Stores the data learned from a single navigation. |
| 105 struct PageRequestSummary { | 106 struct PageRequestSummary { |
| 106 explicit PageRequestSummary(const GURL& main_frame_url); | 107 explicit PageRequestSummary(const GURL& main_frame_url); |
| 107 PageRequestSummary(const PageRequestSummary& other); | 108 PageRequestSummary(const PageRequestSummary& other); |
| 108 ~PageRequestSummary(); | 109 ~PageRequestSummary(); |
| 109 | 110 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 376 |
| 376 private: | 377 private: |
| 377 ResourcePrefetchPredictor* predictor_; | 378 ResourcePrefetchPredictor* predictor_; |
| 378 | 379 |
| 379 DISALLOW_COPY_AND_ASSIGN(TestObserver); | 380 DISALLOW_COPY_AND_ASSIGN(TestObserver); |
| 380 }; | 381 }; |
| 381 | 382 |
| 382 } // namespace predictors | 383 } // namespace predictors |
| 383 | 384 |
| 384 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 385 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
| OLD | NEW |