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

Side by Side Diff: content/browser/bluetooth/bluetooth_metrics.cc

Issue 1334763002: bluetooth: Subscribe to notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-origin
Patch Set: Fix global interface test Created 5 years, 2 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 "content/browser/bluetooth/bluetooth_metrics.h" 5 #include "content/browser/bluetooth/bluetooth_metrics.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 void RecordGATTOperationOutcome(UMAGATTOperation operation, 144 void RecordGATTOperationOutcome(UMAGATTOperation operation,
145 UMAGATTOperationOutcome outcome) { 145 UMAGATTOperationOutcome outcome) {
146 switch (operation) { 146 switch (operation) {
147 case UMAGATTOperation::CHARACTERISTIC_READ: 147 case UMAGATTOperation::CHARACTERISTIC_READ:
148 RecordCharacteristicReadValueOutcome(outcome); 148 RecordCharacteristicReadValueOutcome(outcome);
149 return; 149 return;
150 case UMAGATTOperation::CHARACTERISTIC_WRITE: 150 case UMAGATTOperation::CHARACTERISTIC_WRITE:
151 RecordCharacteristicWriteValueOutcome(outcome); 151 RecordCharacteristicWriteValueOutcome(outcome);
152 return; 152 return;
153 case UMAGATTOperation::START_NOTIFICATIONS:
154 RecordStartNotificationsOutcome(outcome);
155 return;
153 case UMAGATTOperation::COUNT: 156 case UMAGATTOperation::COUNT:
154 NOTREACHED(); 157 NOTREACHED();
155 return; 158 return;
156 } 159 }
157 NOTREACHED(); 160 NOTREACHED();
158 } 161 }
159 162
160 // Characteristic.readValue 163 // Characteristic.readValue
161 164
162 // static 165 // static
163 void RecordCharacteristicReadValueOutcome(UMAGATTOperationOutcome outcome) { 166 void RecordCharacteristicReadValueOutcome(UMAGATTOperationOutcome outcome) {
164 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.ReadValue.Outcome", 167 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.ReadValue.Outcome",
165 static_cast<int>(outcome), 168 static_cast<int>(outcome),
166 static_cast<int>(UMAGATTOperationOutcome::COUNT)); 169 static_cast<int>(UMAGATTOperationOutcome::COUNT));
167 } 170 }
168 171
169 // Characteristic.writeValue 172 // Characteristic.writeValue
170 173
171 void RecordCharacteristicWriteValueOutcome(UMAGATTOperationOutcome outcome) { 174 void RecordCharacteristicWriteValueOutcome(UMAGATTOperationOutcome outcome) {
172 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.WriteValue.Outcome", 175 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.WriteValue.Outcome",
173 static_cast<int>(outcome), 176 static_cast<int>(outcome),
174 static_cast<int>(UMAGATTOperationOutcome::COUNT)); 177 static_cast<int>(UMAGATTOperationOutcome::COUNT));
175 } 178 }
176 179
180 // Characteristic.startNotifications
181 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome) {
182 UMA_HISTOGRAM_ENUMERATION(
183 "Bluetooth.Web.Characteristic.StartNotifications.Outcome",
184 static_cast<int>(outcome),
185 static_cast<int>(UMAGATTOperationOutcome::COUNT));
186 }
187
177 } // namespace content 188 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.h ('k') | content/common/bluetooth/bluetooth_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698