Skip to content
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

Hide "Trust Token" item from devtools #17118

Merged
merged 5 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build/commands/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,31 @@ async function applyPatches() {
const patchesPath = path.join(coreRepoPath, 'patches')
const v8PatchesPath = path.join(patchesPath, 'v8')
const catapultPatchesPath = path.join(patchesPath, 'third_party', 'catapult')
const devtoolsFrontendPatchesPath = path.join(patchesPath, 'third_party', 'devtools-frontend', 'src')

const chromiumRepoPath = config.srcDir
const v8RepoPath = path.join(chromiumRepoPath, 'v8')
const catapultRepoPath = path.join(chromiumRepoPath, 'third_party', 'catapult')
const devtoolsFrontendRepoPath = path.join(chromiumRepoPath, 'third_party', 'devtools-frontend', 'src')

const chromiumPatcher = new GitPatcher(patchesPath, chromiumRepoPath)
const v8Patcher = new GitPatcher(v8PatchesPath, v8RepoPath)
const catapultPatcher = new GitPatcher(catapultPatchesPath, catapultRepoPath)
const devtoolsFrontendPatcher = new GitPatcher(devtoolsFrontendPatchesPath, devtoolsFrontendRepoPath)

const chromiumPatchStatus = await chromiumPatcher.applyPatches()
const v8PatchStatus = await v8Patcher.applyPatches()
const catapultPatchStatus = await catapultPatcher.applyPatches()
const devtoolsFrontendPatchStatus = await devtoolsFrontendPatcher.applyPatches()

// Log status for all patches
// Differentiate entries for logging
v8PatchStatus.forEach(s => s.path = path.join('v8', s.path))
catapultPatchStatus.forEach(
s => s.path = path.join('third_party', 'catapult', s.path))
const allPatchStatus =
chromiumPatchStatus.concat(v8PatchStatus).concat(catapultPatchStatus)
devtoolsFrontendPatchStatus.forEach(
s => s.path = path.join('third_party', 'devtools-frontend', 'src', s.path))
const allPatchStatus = [...chromiumPatchStatus, ...v8PatchStatus, ...catapultPatchStatus, ...devtoolsFrontendPatchStatus]
Log.allPatchStatus(allPatchStatus, 'Chromium')

const hasPatchError = allPatchStatus.some(p => p.error)
Expand Down
4 changes: 4 additions & 0 deletions build/commands/scripts/updatePatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ module.exports = function RunCommand (options) {
const chromiumDir = config.srcDir
const v8Dir = path.join(config.srcDir, 'v8')
const catapultDir = path.join(config.srcDir, 'third_party', 'catapult')
const devtoolsFrontendDir = path.join(config.srcDir, 'third_party', 'devtools-frontend', 'src')
const patchDir = path.join(config.braveCoreDir, 'patches')
const v8PatchDir = path.join(patchDir, 'v8')
const catapultPatchDir = path.join(patchDir, 'third_party', 'catapult')
const devtoolsFrontendPatchDir = path.join(patchDir, 'third_party', 'devtools-frontend', 'src')

Promise.all([
// chromium
Expand All @@ -31,6 +33,8 @@ module.exports = function RunCommand (options) {
updatePatches(v8Dir, v8PatchDir),
// third_party/catapult
updatePatches(catapultDir, catapultPatchDir),
// third_party/devtools-frontend/src
updatePatches(devtoolsFrontendDir, devtoolsFrontendPatchDir),
])
.then(() => {
console.log('Done.')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/front_end/panels/application/ApplicationPanelSidebar.ts b/front_end/panels/application/ApplicationPanelSidebar.ts
index 9becc447d320e36196e7f475984d8b64899c0cdb..0838bd1ccc09d64190a52389fbfb7bdfadcccb4e 100644
--- a/front_end/panels/application/ApplicationPanelSidebar.ts
+++ b/front_end/panels/application/ApplicationPanelSidebar.ts
@@ -250,7 +250,7 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
interestGroupTreeElement: InterestGroupTreeElement;
databasesListTreeElement: ExpandableApplicationPanelTreeElement;
cookieListTreeElement: ExpandableApplicationPanelTreeElement;
- trustTokensTreeElement: TrustTokensTreeElement;
+ trustTokensTreeElement: TrustTokensTreeElement|undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, was this required because we commented out https://github.com/brave/brave-core/pull/17118/files#diff-23046df64bccd12252ff893d49474e6af4b2831de5d33efd50f3a8c4fc8c11c1R19 ? If so then go back to the original patch because we still end up with a modified line this way

Copy link
Contributor Author

@sangwoo108 sangwoo108 Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the link seems to be broken(Github are bad at these 😭) . This line was required because we commented out the initialization of this property, which seems to be what you linked. Reverted back to the very original patch - commenting out appendChild()

cacheStorageListTreeElement: ServiceWorkerCacheTreeElement;
sharedStorageListTreeElement: SharedStorageListTreeElement;
private backForwardCacheListTreeElement?: BackForwardCacheTreeElement;
@@ -351,8 +351,10 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
this.cookieListTreeElement.setLeadingIcons([cookieIcon]);
storageTreeElement.appendChild(this.cookieListTreeElement);

+ /* Exclude 'Trust token' Menu
this.trustTokensTreeElement = new TrustTokensTreeElement(panel);
storageTreeElement.appendChild(this.trustTokensTreeElement);
+ */

this.interestGroupTreeElement = new InterestGroupTreeElement(panel);
storageTreeElement.appendChild(this.interestGroupTreeElement);