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

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

Issue 1145013004: Introduce bad_message.h for chrome and NaCl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove newline Created 5 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
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 void DevToolsUIBindings::SendMessageToBrowser(const std::string& message) { 768 void DevToolsUIBindings::SendMessageToBrowser(const std::string& message) {
769 if (agent_host_.get()) 769 if (agent_host_.get())
770 agent_host_->DispatchProtocolMessage(message); 770 agent_host_->DispatchProtocolMessage(message);
771 } 771 }
772 772
773 void DevToolsUIBindings::RecordEnumeratedHistogram(const std::string& name, 773 void DevToolsUIBindings::RecordEnumeratedHistogram(const std::string& name,
774 int sample, 774 int sample,
775 int boundary_value) { 775 int boundary_value) {
776 if (!(boundary_value >= 0 && boundary_value <= 100 && sample >= 0 && 776 if (!(boundary_value >= 0 && boundary_value <= 100 && sample >= 0 &&
777 sample < boundary_value)) { 777 sample < boundary_value)) {
778 // TODO(nick): Replace with chrome::bad_message::ReceivedBadMessage()
Charlie Reis 2015/05/22 20:55:51 nit: End with period. (I'm fine with leaving a TO
ncarter (slow) 2015/05/26 22:59:03 Done.
778 frontend_host_->BadMessageRecieved(); 779 frontend_host_->BadMessageRecieved();
779 return; 780 return;
780 } 781 }
781 // Each histogram name must follow a different code path in 782 // Each histogram name must follow a different code path in
782 // order to UMA_HISTOGRAM_ENUMERATION work correctly. 783 // order to UMA_HISTOGRAM_ENUMERATION work correctly.
783 if (name == kDevToolsActionTakenHistogram) 784 if (name == kDevToolsActionTakenHistogram)
784 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); 785 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value);
785 else if (name == kDevToolsPanelShownHistogram) 786 else if (name == kDevToolsPanelShownHistogram)
786 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); 787 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value);
787 else 788 else
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 if (frontend_loaded_) 1050 if (frontend_loaded_)
1050 return; 1051 return;
1051 frontend_loaded_ = true; 1052 frontend_loaded_ = true;
1052 1053
1053 // Call delegate first - it seeds importants bit of information. 1054 // Call delegate first - it seeds importants bit of information.
1054 delegate_->OnLoadCompleted(); 1055 delegate_->OnLoadCompleted();
1055 1056
1056 UpdateTheme(); 1057 UpdateTheme();
1057 AddDevToolsExtensionsToClient(); 1058 AddDevToolsExtensionsToClient();
1058 } 1059 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698