| OLD | NEW |
| 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 #ifndef EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ |
| 6 #define EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ | 6 #define EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 ~SocketExtensionWithDnsLookupFunction() override; | 151 ~SocketExtensionWithDnsLookupFunction() override; |
| 152 | 152 |
| 153 // AsyncApiFunction: | 153 // AsyncApiFunction: |
| 154 bool PrePrepare() override; | 154 bool PrePrepare() override; |
| 155 | 155 |
| 156 void StartDnsLookup(const net::HostPortPair& host_port_pair); | 156 void StartDnsLookup(const net::HostPortPair& host_port_pair); |
| 157 virtual void AfterDnsLookup(int lookup_result) = 0; | 157 virtual void AfterDnsLookup(int lookup_result) = 0; |
| 158 | 158 |
| 159 net::AddressList addresses_; | 159 net::AddressList addresses_; |
| 160 | 160 |
| 161 std::unique_ptr<net::HostResolver::Request> request_; |
| 162 |
| 161 private: | 163 private: |
| 162 void OnDnsLookup(int resolve_result); | 164 void OnDnsLookup(int resolve_result); |
| 163 | 165 |
| 164 // Weak pointer to the resource context. | 166 // Weak pointer to the resource context. |
| 165 content::ResourceContext* resource_context_; | 167 content::ResourceContext* resource_context_; |
| 166 }; | 168 }; |
| 167 | 169 |
| 168 class SocketCreateFunction : public SocketAsyncApiFunction { | 170 class SocketCreateFunction : public SocketAsyncApiFunction { |
| 169 public: | 171 public: |
| 170 DECLARE_EXTENSION_FUNCTION("socket.create", SOCKET_CREATE) | 172 DECLARE_EXTENSION_FUNCTION("socket.create", SOCKET_CREATE) |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 | 553 |
| 552 std::unique_ptr<api::socket::Secure::Params> params_; | 554 std::unique_ptr<api::socket::Secure::Params> params_; |
| 553 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; | 555 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; |
| 554 | 556 |
| 555 DISALLOW_COPY_AND_ASSIGN(SocketSecureFunction); | 557 DISALLOW_COPY_AND_ASSIGN(SocketSecureFunction); |
| 556 }; | 558 }; |
| 557 | 559 |
| 558 } // namespace extensions | 560 } // namespace extensions |
| 559 | 561 |
| 560 #endif // EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ | 562 #endif // EXTENSIONS_BROWSER_API_SOCKET_SOCKET_API_H_ |
| OLD | NEW |