Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1034)

Unified Diff: remoting/protocol/http_ice_config_request.h

Issue 1707223002: Implement HttpIceConfigRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/BUILD.gn ('k') | remoting/protocol/http_ice_config_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/http_ice_config_request.h
diff --git a/remoting/protocol/http_ice_config_request.h b/remoting/protocol/http_ice_config_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..3610e92881f0803a65ae6d9c1909fb903debce0e
--- /dev/null
+++ b/remoting/protocol/http_ice_config_request.h
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium 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 REMOTING_PROTOCOL_HTTP_ICE_CONFIG_REQUEST_H_
+#define REMOTING_PROTOCOL_HTTP_ICE_CONFIG_REQUEST_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "remoting/base/url_request.h"
+#include "remoting/protocol/ice_config_request.h"
+
+namespace remoting {
+namespace protocol {
+
+// IceConfigRequest that fetches IceConfig from using HTTP. If the config has
+// been fetched succesfully but some parts couldn't be parsed then the returned
+// config contains all entries that were parsed successfully and
+// |expiration_time| is set to Now, i.e. the config is considered expired.
+class HttpIceConfigRequest : public IceConfigRequest {
+ public:
+ HttpIceConfigRequest(UrlRequestFactory* url_request_factory,
+ const std::string& url);
+ ~HttpIceConfigRequest() override;
+
+ // IceConfigRequest interface.
+ void Send(const OnIceConfigCallback& callback) override;
+
+ private:
+ void OnResponse(const UrlRequest::Result& result);
+
+ std::string url_;
+ scoped_ptr<UrlRequest> url_request_;
+ OnIceConfigCallback on_ice_config_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(HttpIceConfigRequest);
+};
+
+} // namespace protocol
+} // namespace remoting
+
+#endif // REMOTING_PROTOCOL_HTTP_ICE_CONFIG_REQUEST_H_
« no previous file with comments | « remoting/protocol/BUILD.gn ('k') | remoting/protocol/http_ice_config_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698