Skip to content

Commit

Permalink
Close #50
Browse files Browse the repository at this point in the history
Runtime feature flag for what
can be controlled so.
  • Loading branch information
John-LittleBearLabs committed Oct 27, 2023
1 parent 0300694 commit c2de969
Show file tree
Hide file tree
Showing 21 changed files with 1,556 additions and 2,140 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Overview

See a [blog post](https://blog.ipfs.tech/2023-05-multigateway-chromium-client/) about it.
See a [blog post](https://blog.ipfs.tech/2023-05-multigateway-chromium-client/) about it.

The intended audience there was genpop & the IPFS-aware. If, however, you're more of a browser person, the [explainer](doc/explainer.md) might make more sense to you. Maybe.

Also, slides for a BlinkOn [lightning talk](doc/slides/blinkon23.md).

Expand Down
2 changes: 1 addition & 1 deletion cmake/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def electron_version(self, branch='main'):
def unavailable(self):
avail = list(map(as_int, self.available()))
version_set = {}
fuzz = 12339
fuzz = 121
def check(version, version_set, s):
i = as_int(version)
by = (fuzz,0)
Expand Down
58 changes: 32 additions & 26 deletions component/BUILD.gn.in
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
import("//testing/test.gni")
component("ipfs") {
sources = [
@gn_sources@
]
defines = [ ]
include_dirs = [
".",
"ipfs_client",
"ipfs_client/unix_fs",
]
deps = [
"//content",
"//crypto",
"//base",
"//components/cbor",
"//components/prefs",
"//components/webcrypto:webcrypto",
"//mojo/public/cpp/bindings",
"//services/network:network_service",
"//services/network/public/cpp:cpp",
"//services/network/public/mojom:url_loader_base",
"//url",
"//third_party/blink/public:blink",
"//third_party/ipfs_client",
]
defines = [ "IS_IPFS_IMPL" ]
import("//third_party/ipfs_client/args.gni")

if (enable_ipfs) {

component("ipfs") {
sources = [
@gn_sources@
]
defines = [ ]
include_dirs = [
".",
"ipfs_client",
"ipfs_client/unix_fs",
]
deps = [
"//content",
"//crypto",
"//base",
"//components/cbor",
"//components/prefs",
"//components/webcrypto:webcrypto",
"//mojo/public/cpp/bindings",
"//services/network:network_service",
"//services/network/public/cpp:cpp",
"//services/network/public/mojom:url_loader_base",
"//url",
"//third_party/blink/public:blink",
"//third_party/ipfs_client",
]
defines = [ "IS_IPFS_IMPL" ]
}

}
7 changes: 7 additions & 0 deletions component/ipfs_features.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "ipfs_features.h"

namespace ipfs {

BASE_FEATURE(kEnableIpfs, "EnableIpfs", base::FEATURE_DISABLED_BY_DEFAULT);

}
13 changes: 13 additions & 0 deletions component/ipfs_features.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef IPFS_IPFS_FEATURES_H_
#define IPFS_IPFS_FEATURES_H_

#include "base/component_export.h"
#include "base/feature_list.h"

namespace ipfs {

COMPONENT_EXPORT(IPFS) BASE_DECLARE_FEATURE(kEnableIpfs);

} // namespace ipfs

#endif // IPFS_IPFS_FEATURES_H_
5 changes: 2 additions & 3 deletions component/ipfs_url_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ void ipfs::IpfsUrlLoader::FollowRedirect(
}

void ipfs::IpfsUrlLoader::SetPriority(net::RequestPriority priority,
int32_t intra_priority_value) {
LOG(INFO) << "TODO SetPriority(" << priority << ',' << intra_priority_value
<< ')';
int32_t intra_prio_val) {
VLOG(1) << "TODO SetPriority(" << priority << ',' << intra_prio_val << ')';
}

void ipfs::IpfsUrlLoader::PauseReadingBodyFromNet() {
Expand Down
2 changes: 1 addition & 1 deletion component/ipns_url_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void ipfs::IpnsUrlLoader::Next() {
QueryDns(host_);
}
} else if (resolved == IpnsNames::kNoSuchName) {
LOG(INFO) << "We have given up on resolving DNSLink " << host_;
VLOG(1) << "We have given up on resolving DNSLink " << host_;
FailNameResolution();
} else if (request_ && resolved.substr(0, 5) == "ipfs/") {
DoIpfs();
Expand Down
Loading

0 comments on commit c2de969

Please sign in to comment.