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

Side by Side Diff: webrtc/examples/peerconnection/server/peer_channel.cc

Issue 1789463002: Update examples GYP to avoid rtc_base_approved warning. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix usage string. Created 4 years, 9 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 | « webrtc/examples/peerconnection/server/main.cc ('k') | webrtc/webrtc_examples.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/examples/peerconnection/server/peer_channel.h" 11 #include "webrtc/examples/peerconnection/server/peer_channel.h"
12 12
13 #include <stdio.h> 13 #include <stdio.h>
14 #include <stdlib.h> 14 #include <stdlib.h>
15 #include <string.h> 15 #include <string.h>
16 16
17 #include <algorithm> 17 #include <algorithm>
18 18
19 #include "webrtc/examples/peerconnection/server/data_socket.h" 19 #include "webrtc/examples/peerconnection/server/data_socket.h"
20 #include "webrtc/examples/peerconnection/server/utils.h" 20 #include "webrtc/examples/peerconnection/server/utils.h"
21 #include "webrtc/base/stringencode.h"
21 #include "webrtc/base/stringutils.h" 22 #include "webrtc/base/stringutils.h"
22 #include "webrtc/base/urlencode.h"
23 23
24 using rtc::sprintfn; 24 using rtc::sprintfn;
25 25
26 // Set to the peer id of the originator when messages are being 26 // Set to the peer id of the originator when messages are being
27 // exchanged between peers, but set to the id of the receiving peer 27 // exchanged between peers, but set to the id of the receiving peer
28 // itself when notifications are sent from the server about the state 28 // itself when notifications are sent from the server about the state
29 // of other peers. 29 // of other peers.
30 // 30 //
31 // WORKAROUND: Since support for CORS varies greatly from one browser to the 31 // WORKAROUND: Since support for CORS varies greatly from one browser to the
32 // next, we don't use a custom name for our peer-id header (originally it was 32 // next, we don't use a custom name for our peer-id header (originally it was
(...skipping 20 matching lines...) Expand all
53 // 53 //
54 54
55 int ChannelMember::s_member_id_ = 0; 55 int ChannelMember::s_member_id_ = 0;
56 56
57 ChannelMember::ChannelMember(DataSocket* socket) 57 ChannelMember::ChannelMember(DataSocket* socket)
58 : waiting_socket_(NULL), id_(++s_member_id_), 58 : waiting_socket_(NULL), id_(++s_member_id_),
59 connected_(true), timestamp_(time(NULL)) { 59 connected_(true), timestamp_(time(NULL)) {
60 assert(socket); 60 assert(socket);
61 assert(socket->method() == DataSocket::GET); 61 assert(socket->method() == DataSocket::GET);
62 assert(socket->PathEquals("/sign_in")); 62 assert(socket->PathEquals("/sign_in"));
63 name_ = rtc::UrlDecodeString(socket->request_arguments()); 63 name_ = rtc::s_url_decode(socket->request_arguments());
64 if (name_.empty()) 64 if (name_.empty())
65 name_ = "peer_" + int2str(id_); 65 name_ = "peer_" + int2str(id_);
66 else if (name_.length() > kMaxNameLength) 66 else if (name_.length() > kMaxNameLength)
67 name_.resize(kMaxNameLength); 67 name_.resize(kMaxNameLength);
68 68
69 std::replace(name_.begin(), name_.end(), ',', '_'); 69 std::replace(name_.begin(), name_.end(), ',', '_');
70 } 70 }
71 71
72 ChannelMember::~ChannelMember() { 72 ChannelMember::~ChannelMember() {
73 } 73 }
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 std::string response(member.GetEntry()); 355 std::string response(member.GetEntry());
356 for (Members::iterator i = members_.begin(); i != members_.end(); ++i) { 356 for (Members::iterator i = members_.begin(); i != members_.end(); ++i) {
357 if (member.id() != (*i)->id()) { 357 if (member.id() != (*i)->id()) {
358 assert((*i)->connected()); 358 assert((*i)->connected());
359 response += (*i)->GetEntry(); 359 response += (*i)->GetEntry();
360 } 360 }
361 } 361 }
362 362
363 return response; 363 return response;
364 } 364 }
OLDNEW
« no previous file with comments | « webrtc/examples/peerconnection/server/main.cc ('k') | webrtc/webrtc_examples.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698