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 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_LOOKUP_REQUEST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_LOOKUP_REQUEST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_LOOKUP_REQUEST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_LOOKUP_REQUEST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 request_info_(request_info), | 32 request_info_(request_info), |
33 priority_(priority), | 33 priority_(priority), |
34 bound_info_(bound_info), | 34 bound_info_(bound_info), |
35 callback_(callback) {} | 35 callback_(callback) {} |
36 | 36 |
37 void Start() { | 37 void Start() { |
38 int result = | 38 int result = |
39 resolver_->Resolve(request_info_, priority_, &addresses_, | 39 resolver_->Resolve(request_info_, priority_, &addresses_, |
40 base::Bind(&PepperLookupRequest<T>::OnLookupFinished, | 40 base::Bind(&PepperLookupRequest<T>::OnLookupFinished, |
41 base::Unretained(this)), | 41 base::Unretained(this)), |
42 &request_, net::BoundNetLog()); | 42 &request_, net::NetLogWithSource()); |
43 if (result != net::ERR_IO_PENDING) | 43 if (result != net::ERR_IO_PENDING) |
44 OnLookupFinished(result); | 44 OnLookupFinished(result); |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 void OnLookupFinished(int result) { | 48 void OnLookupFinished(int result) { |
49 callback_.Run(result, addresses_, *bound_info_); | 49 callback_.Run(result, addresses_, *bound_info_); |
50 delete this; | 50 delete this; |
51 } | 51 } |
52 | 52 |
53 net::HostResolver* resolver_; | 53 net::HostResolver* resolver_; |
54 std::unique_ptr<net::HostResolver::Request> request_; | 54 std::unique_ptr<net::HostResolver::Request> request_; |
55 net::HostResolver::RequestInfo request_info_; | 55 net::HostResolver::RequestInfo request_info_; |
56 net::RequestPriority priority_; | 56 net::RequestPriority priority_; |
57 std::unique_ptr<T> bound_info_; | 57 std::unique_ptr<T> bound_info_; |
58 LookupRequestCallback callback_; | 58 LookupRequestCallback callback_; |
59 | 59 |
60 net::AddressList addresses_; | 60 net::AddressList addresses_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(PepperLookupRequest); | 62 DISALLOW_COPY_AND_ASSIGN(PepperLookupRequest); |
63 }; | 63 }; |
64 | 64 |
65 } // namespace content | 65 } // namespace content |
66 | 66 |
67 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_LOOKUP_REQUEST_H_ | 67 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_LOOKUP_REQUEST_H_ |
OLD | NEW |