-
Notifications
You must be signed in to change notification settings - Fork 921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebTorrent Support #356
Merged
Merged
WebTorrent Support #356
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a525d5b
Update package.json
yrliou 4ebe7e4
Implement webtorrent component
yrliou 3d47e30
Run pending connect and accept callbacks immediately when socket disc…
yrliou b092c34
Fix DCHECK for CreateTCPConnectedSocketCallback being destroyed befor…
yrliou f959d2e
Add basic frontend unit tests
yrliou 4267741
Address frontend review comments and adapt brave-ui upgrade
yrliou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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 |
---|---|---|
|
@@ -21,4 +21,5 @@ | |
"brave/app/theme/brave_unscaled_resources.grd": { | ||
"includes": [36500], | ||
}, | ||
# brave webtorrent 37500 | ||
} |
41 changes: 41 additions & 0 deletions
41
chromium_src/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
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,41 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#define IsComponentExtensionWhitelisted IsComponentExtensionWhitelisted_ChromiumImpl | ||
#include "../../../../../../chrome/browser/extensions/component_extensions_whitelist/whitelist.cc" | ||
#undef IsComponentExtensionWhitelisted | ||
|
||
#include "brave/common/extensions/extension_constants.h" | ||
#include "components/grit/brave_components_resources.h" | ||
#include "brave/components/brave_webtorrent/grit/brave_webtorrent_resources.h" | ||
|
||
namespace extensions { | ||
|
||
bool IsComponentExtensionWhitelisted(const std::string& extension_id) { | ||
const char* const kAllowed[] = { | ||
brave_extension_id, | ||
brave_webtorrent_extension_id | ||
}; | ||
|
||
for (size_t i = 0; i < arraysize(kAllowed); ++i) { | ||
if (extension_id == kAllowed[i]) | ||
return true; | ||
} | ||
|
||
return IsComponentExtensionWhitelisted_ChromiumImpl(extension_id); | ||
} | ||
|
||
bool IsComponentExtensionWhitelisted(int manifest_resource_id) { | ||
switch (manifest_resource_id) { | ||
// Please keep the list in alphabetical order. | ||
case IDR_BRAVE_EXTENSON: | ||
case IDR_BRAVE_WEBTORRENT: | ||
return true; | ||
} | ||
|
||
return IsComponentExtensionWhitelisted_ChromiumImpl(manifest_resource_id); | ||
} | ||
|
||
} // namespace extensions | ||
|
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,3 @@ | ||
#include "brave/browser/net/brave_profile_network_delegate.h" | ||
|
||
#include "../../../../../../chrome/browser/profiles/profile_io_data.cc" |
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,11 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
{ | ||
"sockets": { | ||
"channel": "stable", | ||
"extension_types": ["extension", "platform_app"], | ||
"whitelist": ["3D9518A72EB02667A773B69DBA9E72E0F4A37423"] | ||
} | ||
} |
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
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be here? Do we want it always loaded by default or on user activation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer loaded by default for now if that's OK.
And address it in a follow-up issue to make it able to be turned on and off by user at anytime.
AFAIK, if we want to disable a component extension from UI, it should probably go through chrome://extensions.
First, to see component extensions listed, we'll need to pass --show-component-extension-options when run it.
But it seems I can't toggle the on&off switch even if the component extension is shown for our current version.
I would like to address this in a separate issue.
@bridiver wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, it seems it is still loaded by default even when I remove this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't affect default loading, it only affects the ability to uninstall