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

Side by Side Diff: util/net/http_transport.h

Issue 885183004: HTTPTransport: callers should be able to obtain the HTTP response body (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Update other comment Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | util/net/http_transport_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void SetBodyStream(scoped_ptr<HTTPBodyStream> stream); 67 void SetBodyStream(scoped_ptr<HTTPBodyStream> stream);
68 68
69 //! \brief Sets the timeout for the HTTP request. The default is 15 seconds. 69 //! \brief Sets the timeout for the HTTP request. The default is 15 seconds.
70 //! 70 //!
71 //! \param[in] timeout The request timeout, in seconds. 71 //! \param[in] timeout The request timeout, in seconds.
72 void SetTimeout(double timeout); 72 void SetTimeout(double timeout);
73 73
74 //! \brief Performs the HTTP request with the configured parameters and waits 74 //! \brief Performs the HTTP request with the configured parameters and waits
75 //! for the execution to complete. 75 //! for the execution to complete.
76 //! 76 //!
77 //! \param[out] response On success, this will be set to the HTTP response
78 //! body. This parameter is optional and may be set to `nullptr` if the
79 //! response body is not required.
80 //!
77 //! \return Whether or not the request was successful, defined as returning 81 //! \return Whether or not the request was successful, defined as returning
78 //! a HTTP status 200 (OK) code. 82 //! a HTTP status 200 (OK) code.
79 virtual bool ExecuteSynchronously() = 0; 83 virtual bool ExecuteSynchronously(std::string* response_body) = 0;
80 84
81 protected: 85 protected:
82 HTTPTransport(); 86 HTTPTransport();
83 87
84 const std::string& url() const { return url_; } 88 const std::string& url() const { return url_; }
85 const std::string& method() const { return method_; } 89 const std::string& method() const { return method_; }
86 const HTTPHeaders& headers() const { return headers_; } 90 const HTTPHeaders& headers() const { return headers_; }
87 HTTPBodyStream* body_stream() const { return body_stream_.get(); } 91 HTTPBodyStream* body_stream() const { return body_stream_.get(); }
88 double timeout() const { return timeout_; } 92 double timeout() const { return timeout_; }
89 93
90 private: 94 private:
91 std::string url_; 95 std::string url_;
92 std::string method_; 96 std::string method_;
93 HTTPHeaders headers_; 97 HTTPHeaders headers_;
94 scoped_ptr<HTTPBodyStream> body_stream_; 98 scoped_ptr<HTTPBodyStream> body_stream_;
95 double timeout_; 99 double timeout_;
96 100
97 DISALLOW_COPY_AND_ASSIGN(HTTPTransport); 101 DISALLOW_COPY_AND_ASSIGN(HTTPTransport);
98 }; 102 };
99 103
100 } // namespace crashpad 104 } // namespace crashpad
101 105
102 #endif // CRASHPAD_UTIL_NET_HTTP_TRANSPORT_H_ 106 #endif // CRASHPAD_UTIL_NET_HTTP_TRANSPORT_H_
OLDNEW
« no previous file with comments | « no previous file | util/net/http_transport_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698