-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Begin moving http to a helper class.
- Loading branch information
1 parent
bd479a7
commit 33700c6
Showing
17 changed files
with
398 additions
and
1,194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "chromium_http.h" | ||
|
||
#include "block_http_request.h" | ||
|
||
using Self = ipfs::ChromiumHttp; | ||
|
||
Self::ChromiumHttp(network::mojom::URLLoaderFactory& lf) | ||
: loader_factory_{&lf} {} | ||
|
||
void Self::SendHttpRequest(ipfs::ctx::HttpApi::HttpRequestDescription desc, | ||
ipfs::ctx::HttpApi::HttpCompleteCallback cb) const { | ||
auto ptr = std::make_shared<BlockHttpRequest>(desc, cb); | ||
ptr->send(loader_factory_); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef IPFS_CHROMIUM_CHROMIUM_HTTP_H | ||
#define IPFS_CHROMIUM_CHROMIUM_HTTP_H | ||
|
||
#include <ipfs_client/ctx/http_api.h> | ||
|
||
#include <vocab/raw_ptr.h> | ||
|
||
namespace network::mojom { | ||
class URLLoaderFactory; | ||
} // namespace network::mojom | ||
|
||
namespace ipfs { | ||
class ChromiumHttp : public ctx::HttpApi { | ||
raw_ptr<network::mojom::URLLoaderFactory> loader_factory_ = nullptr; | ||
|
||
public: | ||
void SendHttpRequest(HttpRequestDescription, | ||
HttpCompleteCallback cb) const override; | ||
ChromiumHttp(network::mojom::URLLoaderFactory&); | ||
}; | ||
} // namespace ipfs | ||
|
||
#endif // IPFS_CHROMIUM_CHROMIUM_HTTP_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.