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

Side by Side Diff: chrome/browser/predictors/glowplug_collector.cc

Issue 2896713003: Create LoadingDataCollector class and have observers rely on it instead of ResourcePrefetchPredictor (Closed)
Patch Set: Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/predictors/glowplug_collector.h"
6 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
7 #include "content/public/browser/resource_request_info.h"
8 #include "content/public/common/resource_type.h"
9 #include "net/url_request/url_request.h"
10
11 namespace predictors {
12
13 // static
14 bool GlowplugCollector::ShouldRecordRequest(
Benoit L 2017/05/22 13:37:16 nit: Can you migrate the logic, instead of just fo
trevordixon 2017/05/24 20:39:24 Moved the static methods over. I'll look into the
trevordixon 2017/05/24 20:39:24 Moved the static methods over. I'll look into the
15 net::URLRequest* request,
16 content::ResourceType resource_type) {
17 return ResourcePrefetchPredictor::ShouldRecordRequest(request, resource_type);
18 }
19
20 // static
21 bool GlowplugCollector::ShouldRecordResponse(net::URLRequest* response) {
22 return ResourcePrefetchPredictor::ShouldRecordResponse(response);
23 }
24
25 // static
26 bool GlowplugCollector::ShouldRecordRedirect(net::URLRequest* response) {
27 return ResourcePrefetchPredictor::ShouldRecordResponse(response);
28 }
29
30 ////////////////////////////////////////////////////////////////////////////////
Benoit L 2017/05/22 13:37:16 nit: Remove this. It was in the code initially, an
trevordixon 2017/05/23 13:05:15 Done.
31 // GlowplugCollector
32
33 GlowplugCollector::GlowplugCollector(ResourcePrefetchPredictor* predictor)
34 : predictor_(predictor) {}
35
36 GlowplugCollector::~GlowplugCollector() {}
37
38 void GlowplugCollector::RecordURLRequest(
39 const ResourcePrefetchPredictor::URLRequestSummary& request) {
40 predictor_->RecordURLRequest(request);
41 }
42
43 void GlowplugCollector::RecordURLResponse(
44 const ResourcePrefetchPredictor::URLRequestSummary& response) {
45 predictor_->RecordURLResponse(response);
46 }
47
48 void GlowplugCollector::RecordURLRedirect(
49 const ResourcePrefetchPredictor::URLRequestSummary& response) {
50 predictor_->RecordURLRedirect(response);
51 }
52
53 void GlowplugCollector::RecordMainFrameLoadComplete(
54 const NavigationID& navigation_id) {
55 predictor_->RecordMainFrameLoadComplete(navigation_id);
56 }
57
58 void GlowplugCollector::RecordFirstContentfulPaint(
59 const NavigationID& navigation_id,
60 const base::TimeTicks& first_contentful_paint) {
61 predictor_->RecordFirstContentfulPaint(navigation_id, first_contentful_paint);
62 }
63
64 } // namespace predictors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698