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

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

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase 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 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 return agent_host_.get() == agent_host; 1009 return agent_host_.get() == agent_host;
1010 } 1010 }
1011 1011
1012 void DevToolsUIBindings::CallClientFunction(const std::string& function_name, 1012 void DevToolsUIBindings::CallClientFunction(const std::string& function_name,
1013 const base::Value* arg1, 1013 const base::Value* arg1,
1014 const base::Value* arg2, 1014 const base::Value* arg2,
1015 const base::Value* arg3) { 1015 const base::Value* arg3) {
1016 std::string javascript = function_name + "("; 1016 std::string javascript = function_name + "(";
1017 if (arg1) { 1017 if (arg1) {
1018 std::string json; 1018 std::string json;
1019 base::JSONWriter::Write(arg1, &json); 1019 base::JSONWriter::Write(*arg1, &json);
1020 javascript.append(json); 1020 javascript.append(json);
1021 if (arg2) { 1021 if (arg2) {
1022 base::JSONWriter::Write(arg2, &json); 1022 base::JSONWriter::Write(*arg2, &json);
1023 javascript.append(", ").append(json); 1023 javascript.append(", ").append(json);
1024 if (arg3) { 1024 if (arg3) {
1025 base::JSONWriter::Write(arg3, &json); 1025 base::JSONWriter::Write(*arg3, &json);
1026 javascript.append(", ").append(json); 1026 javascript.append(", ").append(json);
1027 } 1027 }
1028 } 1028 }
1029 } 1029 }
1030 javascript.append(");"); 1030 javascript.append(");");
1031 web_contents_->GetMainFrame()->ExecuteJavaScript( 1031 web_contents_->GetMainFrame()->ExecuteJavaScript(
1032 base::UTF8ToUTF16(javascript)); 1032 base::UTF8ToUTF16(javascript));
1033 } 1033 }
1034 1034
1035 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() { 1035 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() {
(...skipping 13 matching lines...) Expand all
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 | « chrome/browser/devtools/devtools_protocol.cc ('k') | chrome/browser/extensions/api/debugger/debugger_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698