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

Side by Side Diff: chrome/browser/prerender/prerender_histograms.cc

Issue 45693002: Add ExternalPrerenderRequestHandler and related API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit fixes and fixing the test Created 7 years, 1 month 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 #include "chrome/browser/prerender/prerender_histograms.h" 5 #include "chrome/browser/prerender/prerender_histograms.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 case ORIGIN_OMNIBOX: 51 case ORIGIN_OMNIBOX:
52 return ComposeHistogramName("omnibox", name); 52 return ComposeHistogramName("omnibox", name);
53 case ORIGIN_NONE: 53 case ORIGIN_NONE:
54 return ComposeHistogramName("none", name); 54 return ComposeHistogramName("none", name);
55 case ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN: 55 case ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN:
56 return ComposeHistogramName("websame", name); 56 return ComposeHistogramName("websame", name);
57 case ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN: 57 case ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN:
58 return ComposeHistogramName("webcross", name); 58 return ComposeHistogramName("webcross", name);
59 case ORIGIN_LOCAL_PREDICTOR: 59 case ORIGIN_LOCAL_PREDICTOR:
60 return ComposeHistogramName("localpredictor", name); 60 return ComposeHistogramName("localpredictor", name);
61 case ORIGIN_EXTERNAL_REQUEST:
62 return ComposeHistogramName("externalrequest", name);
61 case ORIGIN_GWS_PRERENDER: // Handled above. 63 case ORIGIN_GWS_PRERENDER: // Handled above.
62 default: 64 default:
63 NOTREACHED(); 65 NOTREACHED();
64 break; 66 break;
65 }; 67 };
66 68
67 // Dummy return value to make the compiler happy. 69 // Dummy return value to make the compiler happy.
68 NOTREACHED(); 70 NOTREACHED();
69 return ComposeHistogramName("wash", name); 71 return ComposeHistogramName("wash", name);
70 } 72 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } else if (origin == ORIGIN_OMNIBOX) { \ 112 } else if (origin == ORIGIN_OMNIBOX) { \
111 HISTOGRAM; \ 113 HISTOGRAM; \
112 } else if (origin == ORIGIN_NONE) { \ 114 } else if (origin == ORIGIN_NONE) { \
113 HISTOGRAM; \ 115 HISTOGRAM; \
114 } else if (origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) { \ 116 } else if (origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) { \
115 HISTOGRAM; \ 117 HISTOGRAM; \
116 } else if (origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN) { \ 118 } else if (origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN) { \
117 HISTOGRAM; \ 119 HISTOGRAM; \
118 } else if (origin == ORIGIN_LOCAL_PREDICTOR) { \ 120 } else if (origin == ORIGIN_LOCAL_PREDICTOR) { \
119 HISTOGRAM; \ 121 HISTOGRAM; \
122 } else if (origin == ORIGIN_EXTERNAL_REQUEST) { \
123 HISTOGRAM; \
120 } else if (experiment != kNoExperiment) { \ 124 } else if (experiment != kNoExperiment) { \
121 HISTOGRAM; \ 125 HISTOGRAM; \
122 } else { \ 126 } else { \
123 HISTOGRAM; \ 127 HISTOGRAM; \
124 } \ 128 } \
125 } 129 }
126 130
127 PrerenderHistograms::PrerenderHistograms() 131 PrerenderHistograms::PrerenderHistograms()
128 : last_experiment_id_(kNoExperiment), 132 : last_experiment_id_(kNoExperiment),
129 last_origin_(ORIGIN_MAX), 133 last_origin_(ORIGIN_MAX),
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 return last_experiment_id_; 389 return last_experiment_id_;
386 } 390 }
387 391
388 bool PrerenderHistograms::IsOriginExperimentWash() const { 392 bool PrerenderHistograms::IsOriginExperimentWash() const {
389 if (!WithinWindow()) 393 if (!WithinWindow())
390 return false; 394 return false;
391 return origin_experiment_wash_; 395 return origin_experiment_wash_;
392 } 396 }
393 397
394 } // namespace prerender 398 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698