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

Side by Side Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: Add comments Created 3 years, 8 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 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 #include "chrome/browser/devtools/devtools_ui_bindings.h" 5 #include "chrome/browser/devtools/devtools_ui_bindings.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 int boundary_value) { 1054 int boundary_value) {
1055 if (!frontend_host_) 1055 if (!frontend_host_)
1056 return; 1056 return;
1057 if (!(boundary_value >= 0 && boundary_value <= 100 && sample >= 0 && 1057 if (!(boundary_value >= 0 && boundary_value <= 100 && sample >= 0 &&
1058 sample < boundary_value)) { 1058 sample < boundary_value)) {
1059 // TODO(nick): Replace with chrome::bad_message::ReceivedBadMessage(). 1059 // TODO(nick): Replace with chrome::bad_message::ReceivedBadMessage().
1060 frontend_host_->BadMessageRecieved(); 1060 frontend_host_->BadMessageRecieved();
1061 return; 1061 return;
1062 } 1062 }
1063 // Each histogram name must follow a different code path in 1063 // Each histogram name must follow a different code path in
1064 // order to UMA_HISTOGRAM_ENUMERATION work correctly. 1064 // order to UMA_HISTOGRAM_EXACT_LINEAR work correctly.
1065 if (name == kDevToolsActionTakenHistogram) 1065 if (name == kDevToolsActionTakenHistogram)
1066 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); 1066 UMA_HISTOGRAM_EXACT_LINEAR(name, sample, boundary_value);
1067 else if (name == kDevToolsPanelShownHistogram) 1067 else if (name == kDevToolsPanelShownHistogram)
1068 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); 1068 UMA_HISTOGRAM_EXACT_LINEAR(name, sample, boundary_value);
1069 else 1069 else
1070 frontend_host_->BadMessageRecieved(); 1070 frontend_host_->BadMessageRecieved();
1071 } 1071 }
1072 1072
1073 void DevToolsUIBindings::SendJsonRequest(const DispatchCallback& callback, 1073 void DevToolsUIBindings::SendJsonRequest(const DispatchCallback& callback,
1074 const std::string& browser_id, 1074 const std::string& browser_id,
1075 const std::string& url) { 1075 const std::string& url) {
1076 if (!android_bridge_) { 1076 if (!android_bridge_) {
1077 callback.Run(nullptr); 1077 callback.Run(nullptr);
1078 return; 1078 return;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 void DevToolsUIBindings::FrontendLoaded() { 1370 void DevToolsUIBindings::FrontendLoaded() {
1371 if (frontend_loaded_) 1371 if (frontend_loaded_)
1372 return; 1372 return;
1373 frontend_loaded_ = true; 1373 frontend_loaded_ = true;
1374 1374
1375 // Call delegate first - it seeds importants bit of information. 1375 // Call delegate first - it seeds importants bit of information.
1376 delegate_->OnLoadCompleted(); 1376 delegate_->OnLoadCompleted();
1377 1377
1378 AddDevToolsExtensionsToClient(); 1378 AddDevToolsExtensionsToClient();
1379 } 1379 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698