| // Copyright 2015 The Weave Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef LIBWEAVE_EXAMPLES_PROVIDER_EVENT_HTTP_CLIENT_H_ |
| #define LIBWEAVE_EXAMPLES_PROVIDER_EVENT_HTTP_CLIENT_H_ |
| #include <base/memory/weak_ptr.h> |
| #include <weave/provider/http_client.h> |
| // Basic implementation of weave::HttpClient using libevent. |
| class EventHttpClient : public provider::HttpClient { |
| explicit EventHttpClient(EventTaskRunner* task_runner); |
| void SendRequest(Method method, |
| const SendRequestCallback& callback) override; |
| EventTaskRunner* task_runner_{nullptr}; |
| base::WeakPtrFactory<EventHttpClient> weak_ptr_factory_{this}; |
| #endif // LIBWEAVE_EXAMPLES_PROVIDER_EVENT_HTTP_CLIENT_H_ |