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

Side by Side Diff: components/devtools_http_handler/devtools_http_handler.cc

Issue 2287733002: Switch //components away from base::ListValue::Append(Value*) overload. (Closed)
Patch Set: rebase Created 4 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 int connection_id, 880 int connection_id,
881 const net::HttpServerRequestInfo& request) { 881 const net::HttpServerRequestInfo& request) {
882 if (!thread_) 882 if (!thread_)
883 return; 883 return;
884 thread_->task_runner()->PostTask( 884 thread_->task_runner()->PostTask(
885 FROM_HERE, 885 FROM_HERE,
886 base::Bind(&ServerWrapper::AcceptWebSocket, 886 base::Bind(&ServerWrapper::AcceptWebSocket,
887 base::Unretained(server_wrapper_), connection_id, request)); 887 base::Unretained(server_wrapper_), connection_id, request));
888 } 888 }
889 889
890 base::DictionaryValue* DevToolsHttpHandler::SerializeDescriptor( 890 std::unique_ptr<base::DictionaryValue> DevToolsHttpHandler::SerializeDescriptor(
891 scoped_refptr<DevToolsAgentHost> agent_host, 891 scoped_refptr<DevToolsAgentHost> agent_host,
892 const std::string& host) { 892 const std::string& host) {
893 base::DictionaryValue* dictionary = new base::DictionaryValue; 893 std::unique_ptr<base::DictionaryValue> dictionary(new base::DictionaryValue);
894 std::string id = agent_host->GetId(); 894 std::string id = agent_host->GetId();
895 dictionary->SetString(kTargetIdField, id); 895 dictionary->SetString(kTargetIdField, id);
896 std::string parent_id = agent_host->GetParentId(); 896 std::string parent_id = agent_host->GetParentId();
897 if (!parent_id.empty()) 897 if (!parent_id.empty())
898 dictionary->SetString(kTargetParentIdField, parent_id); 898 dictionary->SetString(kTargetParentIdField, parent_id);
899 dictionary->SetString(kTargetTypeField, agent_host->GetType()); 899 dictionary->SetString(kTargetTypeField, agent_host->GetType());
900 dictionary->SetString(kTargetTitleField, 900 dictionary->SetString(kTargetTitleField,
901 net::EscapeForHTML(agent_host->GetTitle())); 901 net::EscapeForHTML(agent_host->GetTitle()));
902 dictionary->SetString(kTargetDescriptionField, agent_host->GetDescription()); 902 dictionary->SetString(kTargetDescriptionField, agent_host->GetDescription());
903 903
(...skipping 19 matching lines...) Expand all
923 id.c_str(), 923 id.c_str(),
924 host); 924 host);
925 dictionary->SetString( 925 dictionary->SetString(
926 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); 926 kTargetDevtoolsFrontendUrlField, devtools_frontend_url);
927 } 927 }
928 928
929 return dictionary; 929 return dictionary;
930 } 930 }
931 931
932 } // namespace devtools_http_handler 932 } // namespace devtools_http_handler
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698