OLD | NEW |
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 "chrome/browser/extensions/api/socket/udp_socket.h" | 5 #include "chrome/browser/extensions/api/socket/udp_socket.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "chrome/browser/extensions/api/api_resource.h" | 9 #include "chrome/browser/extensions/api/api_resource.h" |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "net/udp/datagram_socket.h" | 12 #include "net/udp/datagram_socket.h" |
13 #include "net/udp/udp_client_socket.h" | 13 #include "net/udp/udp_client_socket.h" |
14 | 14 |
15 namespace extensions { | 15 namespace extensions { |
16 | 16 |
17 static base::LazyInstance<ProfileKeyedAPIFactory< | 17 static base::LazyInstance< |
18 ApiResourceManager<ResumableUDPSocket> > > | 18 BrowserContextKeyedAPIFactory<ApiResourceManager<ResumableUDPSocket> > > |
19 g_factory = LAZY_INSTANCE_INITIALIZER; | 19 g_factory = LAZY_INSTANCE_INITIALIZER; |
20 | 20 |
21 // static | 21 // static |
22 template <> | 22 template <> |
23 ProfileKeyedAPIFactory<ApiResourceManager<ResumableUDPSocket> >* | 23 BrowserContextKeyedAPIFactory<ApiResourceManager<ResumableUDPSocket> >* |
24 ApiResourceManager<ResumableUDPSocket>::GetFactoryInstance() { | 24 ApiResourceManager<ResumableUDPSocket>::GetFactoryInstance() { |
25 return g_factory.Pointer(); | 25 return g_factory.Pointer(); |
26 } | 26 } |
27 | 27 |
28 UDPSocket::UDPSocket(const std::string& owner_extension_id) | 28 UDPSocket::UDPSocket(const std::string& owner_extension_id) |
29 : Socket(owner_extension_id), | 29 : Socket(owner_extension_id), |
30 socket_(net::DatagramSocket::DEFAULT_BIND, | 30 socket_(net::DatagramSocket::DEFAULT_BIND, |
31 net::RandIntCallback(), | 31 net::RandIntCallback(), |
32 NULL, | 32 NULL, |
33 net::NetLog::Source()) { | 33 net::NetLog::Source()) { |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 persistent_(false), | 303 persistent_(false), |
304 buffer_size_(0), | 304 buffer_size_(0), |
305 paused_(false) { | 305 paused_(false) { |
306 } | 306 } |
307 | 307 |
308 bool ResumableUDPSocket::IsPersistent() const { | 308 bool ResumableUDPSocket::IsPersistent() const { |
309 return persistent(); | 309 return persistent(); |
310 } | 310 } |
311 | 311 |
312 } // namespace extensions | 312 } // namespace extensions |
OLD | NEW |