| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_BASE_HTTPCLIENT_H__ | 11 #ifndef WEBRTC_BASE_HTTPCLIENT_H__ |
| 12 #define WEBRTC_BASE_HTTPCLIENT_H__ | 12 #define WEBRTC_BASE_HTTPCLIENT_H__ |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 | 15 |
| 16 #include "webrtc/base/checks.h" |
| 16 #include "webrtc/base/common.h" | 17 #include "webrtc/base/common.h" |
| 17 #include "webrtc/base/httpbase.h" | 18 #include "webrtc/base/httpbase.h" |
| 18 #include "webrtc/base/nethelpers.h" | 19 #include "webrtc/base/nethelpers.h" |
| 19 #include "webrtc/base/proxyinfo.h" | 20 #include "webrtc/base/proxyinfo.h" |
| 20 #include "webrtc/base/sigslot.h" | 21 #include "webrtc/base/sigslot.h" |
| 21 #include "webrtc/base/socketaddress.h" | 22 #include "webrtc/base/socketaddress.h" |
| 22 #include "webrtc/base/socketpool.h" | 23 #include "webrtc/base/socketpool.h" |
| 23 | 24 |
| 24 namespace rtc { | 25 namespace rtc { |
| 25 | 26 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 size_t request_retries() const { return retries_; } | 83 size_t request_retries() const { return retries_; } |
| 83 | 84 |
| 84 enum RedirectAction { REDIRECT_DEFAULT, REDIRECT_ALWAYS, REDIRECT_NEVER }; | 85 enum RedirectAction { REDIRECT_DEFAULT, REDIRECT_ALWAYS, REDIRECT_NEVER }; |
| 85 void set_redirect_action(RedirectAction action) { redirect_action_ = action; } | 86 void set_redirect_action(RedirectAction action) { redirect_action_ = action; } |
| 86 RedirectAction redirect_action() const { return redirect_action_; } | 87 RedirectAction redirect_action() const { return redirect_action_; } |
| 87 | 88 |
| 88 enum UriForm { URI_DEFAULT, URI_ABSOLUTE, URI_RELATIVE }; | 89 enum UriForm { URI_DEFAULT, URI_ABSOLUTE, URI_RELATIVE }; |
| 89 void set_uri_form(UriForm form) { uri_form_ = form; } | 90 void set_uri_form(UriForm form) { uri_form_ = form; } |
| 90 UriForm uri_form() const { return uri_form_; } | 91 UriForm uri_form() const { return uri_form_; } |
| 91 | 92 |
| 92 void set_cache(DiskCache* cache) { ASSERT(!IsCacheActive()); cache_ = cache; } | 93 void set_cache(DiskCache* cache) { |
| 94 RTC_DCHECK(!IsCacheActive()); |
| 95 cache_ = cache; |
| 96 } |
| 93 bool cache_enabled() const { return (NULL != cache_); } | 97 bool cache_enabled() const { return (NULL != cache_); } |
| 94 | 98 |
| 95 // reset clears the server, request, and response structures. It will also | 99 // reset clears the server, request, and response structures. It will also |
| 96 // abort an active request. | 100 // abort an active request. |
| 97 void reset(); | 101 void reset(); |
| 98 | 102 |
| 99 void set_server(const SocketAddress& address); | 103 void set_server(const SocketAddress& address); |
| 100 const SocketAddress& server() const { return server_; } | 104 const SocketAddress& server() const { return server_; } |
| 101 | 105 |
| 102 // Note: in order for HttpClient to retry a POST in response to | 106 // Note: in order for HttpClient to retry a POST in response to |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 public: | 191 public: |
| 188 HttpClientDefault(SocketFactory* factory, const std::string& agent, | 192 HttpClientDefault(SocketFactory* factory, const std::string& agent, |
| 189 HttpTransaction* transaction = NULL); | 193 HttpTransaction* transaction = NULL); |
| 190 }; | 194 }; |
| 191 | 195 |
| 192 ////////////////////////////////////////////////////////////////////// | 196 ////////////////////////////////////////////////////////////////////// |
| 193 | 197 |
| 194 } // namespace rtc | 198 } // namespace rtc |
| 195 | 199 |
| 196 #endif // WEBRTC_BASE_HTTPCLIENT_H__ | 200 #endif // WEBRTC_BASE_HTTPCLIENT_H__ |
| OLD | NEW |