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

Side by Side Diff: components/data_use_measurement/core/data_use_user_data.cc

Issue 2756373003: Record the data use of service worker initiated requests (Closed)
Patch Set: Fix unittest Created 3 years, 9 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/data_use_measurement/core/data_use_user_data.h" 5 #include "components/data_use_measurement/core/data_use_user_data.h"
6 6
7 #if defined(OS_ANDROID) 7 #if defined(OS_ANDROID)
8 #include "base/android/application_status_listener.h" 8 #include "base/android/application_status_listener.h"
9 #endif 9 #endif
10 10
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 case NTP_SNIPPETS_SUGGESTIONS: 121 case NTP_SNIPPETS_SUGGESTIONS:
122 return "NTPSnippetsSuggestions"; 122 return "NTPSnippetsSuggestions";
123 case NTP_SNIPPETS_THUMBNAILS: 123 case NTP_SNIPPETS_THUMBNAILS:
124 return "NTPSnippetsThumbnails"; 124 return "NTPSnippetsThumbnails";
125 case DOODLE: 125 case DOODLE:
126 return "Doodle"; 126 return "Doodle";
127 case UKM: 127 case UKM:
128 return "UKM"; 128 return "UKM";
129 case PAYMENTS: 129 case PAYMENTS:
130 return "Payments"; 130 return "Payments";
131 case SERVICE_WORKER:
132 return "ServiceWorker";
131 } 133 }
132 return "INVALID"; 134 return "INVALID";
133 } 135 }
134 136
135 // static 137 // static
136 void DataUseUserData::AttachToFetcher(net::URLFetcher* fetcher, 138 void DataUseUserData::AttachToFetcher(net::URLFetcher* fetcher,
137 ServiceName service_name) { 139 ServiceName service_name) {
138 fetcher->SetURLRequestUserData(kUserDataKey, 140 fetcher->SetURLRequestUserData(kUserDataKey,
139 base::Bind(&Create, service_name)); 141 base::Bind(&Create, service_name));
140 } 142 }
141 143
142 } // namespace data_use_measurement 144 } // namespace data_use_measurement
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698