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

Side by Side Diff: remoting/protocol/chromium_socket_factory.cc

Issue 667123002: Standardize usage of virtual/override/final in remoting/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 "remoting/protocol/chromium_socket_factory.h" 5 #include "remoting/protocol/chromium_socket_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "jingle/glue/utils.h" 10 #include "jingle/glue/utils.h"
(...skipping 15 matching lines...) Expand all
26 26
27 // Maximum amount of data in the send buffers. This is necessary to 27 // Maximum amount of data in the send buffers. This is necessary to
28 // prevent out-of-memory crashes if the caller sends data faster than 28 // prevent out-of-memory crashes if the caller sends data faster than
29 // Pepper's UDP API can handle it. This maximum should never be 29 // Pepper's UDP API can handle it. This maximum should never be
30 // reached under normal conditions. 30 // reached under normal conditions.
31 const int kMaxSendBufferSize = 256 * 1024; 31 const int kMaxSendBufferSize = 256 * 1024;
32 32
33 class UdpPacketSocket : public rtc::AsyncPacketSocket { 33 class UdpPacketSocket : public rtc::AsyncPacketSocket {
34 public: 34 public:
35 UdpPacketSocket(); 35 UdpPacketSocket();
36 virtual ~UdpPacketSocket(); 36 ~UdpPacketSocket() override;
37 37
38 bool Init(const rtc::SocketAddress& local_address, 38 bool Init(const rtc::SocketAddress& local_address,
39 int min_port, int max_port); 39 int min_port, int max_port);
40 40
41 // rtc::AsyncPacketSocket interface. 41 // rtc::AsyncPacketSocket interface.
42 virtual rtc::SocketAddress GetLocalAddress() const override; 42 rtc::SocketAddress GetLocalAddress() const override;
43 virtual rtc::SocketAddress GetRemoteAddress() const override; 43 rtc::SocketAddress GetRemoteAddress() const override;
44 virtual int Send(const void* data, size_t data_size, 44 int Send(const void* data,
45 const rtc::PacketOptions& options) override; 45 size_t data_size,
46 virtual int SendTo(const void* data, size_t data_size, 46 const rtc::PacketOptions& options) override;
47 const rtc::SocketAddress& address, 47 int SendTo(const void* data,
48 const rtc::PacketOptions& options) override; 48 size_t data_size,
49 virtual int Close() override; 49 const rtc::SocketAddress& address,
50 virtual State GetState() const override; 50 const rtc::PacketOptions& options) override;
51 virtual int GetOption(rtc::Socket::Option option, int* value) override; 51 int Close() override;
52 virtual int SetOption(rtc::Socket::Option option, int value) override; 52 State GetState() const override;
53 virtual int GetError() const override; 53 int GetOption(rtc::Socket::Option option, int* value) override;
54 virtual void SetError(int error) override; 54 int SetOption(rtc::Socket::Option option, int value) override;
55 int GetError() const override;
56 void SetError(int error) override;
55 57
56 private: 58 private:
57 struct PendingPacket { 59 struct PendingPacket {
58 PendingPacket(const void* buffer, 60 PendingPacket(const void* buffer,
59 int buffer_size, 61 int buffer_size,
60 const net::IPEndPoint& address); 62 const net::IPEndPoint& address);
61 63
62 scoped_refptr<net::IOBufferWithSize> data; 64 scoped_refptr<net::IOBufferWithSize> data;
63 net::IPEndPoint address; 65 net::IPEndPoint address;
64 bool retried; 66 bool retried;
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 return NULL; 390 return NULL;
389 } 391 }
390 392
391 rtc::AsyncResolverInterface* 393 rtc::AsyncResolverInterface*
392 ChromiumPacketSocketFactory::CreateAsyncResolver() { 394 ChromiumPacketSocketFactory::CreateAsyncResolver() {
393 return new rtc::AsyncResolver(); 395 return new rtc::AsyncResolver();
394 } 396 }
395 397
396 } // namespace protocol 398 } // namespace protocol
397 } // namespace remoting 399 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/chromium_socket_factory.h ('k') | remoting/protocol/client_control_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698