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

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

Issue 1106173002: [DevTools] Fix crash on console input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 766 }
767 767
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 frontend_host_->BadMessageRecieved(); 778 frontend_host_->BadMessageRecieved();
779 return; 779 return;
780 } 780 }
781 // Each histogram name must follow a different code path in 781 // Each histogram name must follow a different code path in
782 // order to UMA_HISTOGRAM_ENUMERATION work correctly. 782 // order to UMA_HISTOGRAM_ENUMERATION work correctly.
783 if (name == kDevToolsActionTakenHistogram) 783 if (name == kDevToolsActionTakenHistogram)
784 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); 784 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value);
785 else if (name == kDevToolsPanelShownHistogram) 785 else if (name == kDevToolsPanelShownHistogram)
786 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); 786 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value);
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 if (frontend_loaded_) 1049 if (frontend_loaded_)
1050 return; 1050 return;
1051 frontend_loaded_ = true; 1051 frontend_loaded_ = true;
1052 1052
1053 // Call delegate first - it seeds importants bit of information. 1053 // Call delegate first - it seeds importants bit of information.
1054 delegate_->OnLoadCompleted(); 1054 delegate_->OnLoadCompleted();
1055 1055
1056 UpdateTheme(); 1056 UpdateTheme();
1057 AddDevToolsExtensionsToClient(); 1057 AddDevToolsExtensionsToClient();
1058 } 1058 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698