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

Side by Side Diff: jingle/glue/utils.cc

Issue 10382003: Changes needed to roll libjingle r141 (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
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 "jingle/glue/utils.h" 5 #include "jingle/glue/utils.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 24 matching lines...) Expand all
35 net::IPAddressNumber address; 35 net::IPAddressNumber address;
36 address.resize(net::kIPv4AddressSize); 36 address.resize(net::kIPv4AddressSize);
37 memcpy(&address[0], &ip, net::kIPv4AddressSize); 37 memcpy(&address[0], &ip, net::kIPv4AddressSize);
38 *address_chrome = net::IPEndPoint(address, address_lj.port()); 38 *address_chrome = net::IPEndPoint(address, address_lj.port());
39 return true; 39 return true;
40 } 40 }
41 41
42 std::string SerializeP2PCandidate(const cricket::Candidate& candidate) { 42 std::string SerializeP2PCandidate(const cricket::Candidate& candidate) {
43 // TODO(sergeyu): Use SDP to format candidates? 43 // TODO(sergeyu): Use SDP to format candidates?
44 DictionaryValue value; 44 DictionaryValue value;
45 value.SetString("ip", candidate.address().IPAsString()); 45 value.SetString("ip", candidate.address().ipaddr().ToString());
46 value.SetInteger("port", candidate.address().port()); 46 value.SetInteger("port", candidate.address().port());
47 value.SetString("type", candidate.type()); 47 value.SetString("type", candidate.type());
48 value.SetString("protocol", candidate.protocol()); 48 value.SetString("protocol", candidate.protocol());
49 value.SetString("username", candidate.username()); 49 value.SetString("username", candidate.username());
50 value.SetString("password", candidate.password()); 50 value.SetString("password", candidate.password());
51 value.SetDouble("preference", candidate.preference()); 51 value.SetDouble("preference", candidate.preference());
52 value.SetInteger("generation", candidate.generation()); 52 value.SetInteger("generation", candidate.generation());
53 53
54 std::string result; 54 std::string result;
55 base::JSONWriter::Write(&value, &result); 55 base::JSONWriter::Write(&value, &result);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 candidate->set_protocol(protocol); 91 candidate->set_protocol(protocol);
92 candidate->set_username(username); 92 candidate->set_username(username);
93 candidate->set_password(password); 93 candidate->set_password(password);
94 candidate->set_preference(static_cast<float>(preference)); 94 candidate->set_preference(static_cast<float>(preference));
95 candidate->set_generation(generation); 95 candidate->set_generation(generation);
96 96
97 return true; 97 return true;
98 } 98 }
99 99
100 } // namespace jingle_glue 100 } // namespace jingle_glue
OLDNEW
« no previous file with comments | « jingle/glue/channel_socket_adapter_unittest.cc ('k') | jingle/notifier/base/gaia_token_pre_xmpp_auth.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698