OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_PROTOCOL_HTTP_ICE_CONFIG_REQUEST_H_ |
| 6 #define REMOTING_PROTOCOL_HTTP_ICE_CONFIG_REQUEST_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "remoting/base/url_request.h" |
| 12 #include "remoting/protocol/ice_config_request.h" |
| 13 |
| 14 namespace remoting { |
| 15 namespace protocol { |
| 16 |
| 17 // IceConfigRequest that fetches IceConfig from using HTTP. If the config has |
| 18 // been fetched succesfully but some parts couldn't be parsed then the returned |
| 19 // config contains all entries that were parsed successfully and |
| 20 // |expiration_time| is set to Now, i.e. the config is considered expired. |
| 21 class HttpIceConfigRequest : public IceConfigRequest { |
| 22 public: |
| 23 HttpIceConfigRequest(UrlRequestFactory* url_request_factory, |
| 24 const std::string& url); |
| 25 ~HttpIceConfigRequest() override; |
| 26 |
| 27 // IceConfigRequest interface. |
| 28 void Send(const OnIceConfigCallback& callback) override; |
| 29 |
| 30 private: |
| 31 void OnResponse(const UrlRequest::Result& result); |
| 32 |
| 33 std::string url_; |
| 34 scoped_ptr<UrlRequest> url_request_; |
| 35 OnIceConfigCallback on_ice_config_callback_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(HttpIceConfigRequest); |
| 38 }; |
| 39 |
| 40 } // namespace protocol |
| 41 } // namespace remoting |
| 42 |
| 43 #endif // REMOTING_PROTOCOL_HTTP_ICE_CONFIG_REQUEST_H_ |
OLD | NEW |