-
Notifications
You must be signed in to change notification settings - Fork 867
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
Include component versions in webcompat reports #25688
base: master
Are you sure you want to change the base?
Include component versions in webcompat reports #25688
Conversation
9a6a930
to
dc56223
Compare
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
…d to add unittests Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
ea63de7
to
b54f416
Compare
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: vadym <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
@@ -50,12 +52,14 @@ namespace { | |||
constexpr char kUISourceHistogramName[] = "Brave.Webcompat.UISource"; | |||
constexpr int kMaxScreenshotPixelCount = 1280 * 720; | |||
|
|||
const std::string BoolToString(bool value) { |
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.
const std::string BoolToString(bool value) { | |
std::string BoolToString(bool value) { |
content::BrowserContext* | ||
WebcompatReporterServiceFactory::GetBrowserContextToUse( | ||
content::BrowserContext* context) const { | ||
return chrome::GetBrowserContextRedirectedInIncognito(context); |
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.
pls use ProfileKeyedServiceFactory
configured for incognito appropriately.
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.
now that you have ProfileKeyedServiceFactory
, you need to remove GetBrowserContextToUse
override.
@@ -63,7 +63,8 @@ class WebcompatReporterDOMHandler : public content::WebUIMessageHandler { | |||
|
|||
raw_ptr<content::RenderWidgetHostView> render_widget_host_view_; | |||
scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | |||
std::unique_ptr<webcompat_reporter::WebcompatReportUploader> uploader_; | |||
std::unique_ptr<webcompat_reporter::WebcompatReporterService> | |||
reporter_service_; |
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.
is this variable used somehow or is it a leftover? It looks wrong, because you should never own a KeyedService
.
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.
it was leftover
|
||
private: | ||
raw_ptr<component_updater::ComponentUpdateService> component_update_service_; | ||
raw_ptr<brave_shields::AdBlockService> adblock_service_; |
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.
const raw_ptr<...>
both members.
|
||
// static | ||
mojo::PendingRemote<mojom::WebcompatReporterHandler> | ||
WebcompatReporterServiceFactory::GetForContext( |
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.
GetMojoReportHandlerForContext
format: "%@ (%@)", | ||
AppInfo.appVersion, | ||
AppInfo.buildNumber | ||
), |
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.
channel is missing?
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.
no, channel has separate property: "channel": "developer"
mentioned code helps to combine version value. ex: "version": "1.73 (0)"
] | ||
|
||
deps = [ | ||
":webcompat_reporter_mojom_wrappers", |
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.
shouldn't this be a public_deps
instead?
std::optional<std::vector<ComponentInfo>> GetComponentInfos() const override; | ||
|
||
private: | ||
raw_ptr<component_updater::ComponentUpdateService> component_update_service_; |
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.
const
|
||
std::optional<std::vector<std::string>> | ||
WebcompatReporterServiceDelegateImpl::GetAdblockFilterListNames() const { | ||
return std::nullopt; |
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.
is this accessible in some other way on iOS? If so, this should have a comment.
return std::nullopt; | ||
} | ||
|
||
return result; |
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.
seems like this exact code is duplicated. Pls create a base delegate impl that will be shared on iOS and desktop/android.
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
...oid/java/org/chromium/chrome/browser/webcompat_reporter/WebcompatReporterServiceFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Vadym Struts <[email protected]>
public WebcompatReporterHandler getWebcompatReporterHandler( | ||
ConnectionErrorHandler connectionErrorHandler) { | ||
Profile profile = Utils.getProfile(false); // Always use regular profile | ||
if (profile == null) { |
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.
Utils.getProfile
is marked as @NonNull
and it tries to get the profile in several different ways, so I would not use the null check
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.
Android Java code lgtm.
These imports look strange:
import org.chromium.chrome.browser.crypto_wallet.util.Utils;
at src/brave/android/java/org/chromium/chrome/browser/webcompat_reporter/WebcompatReporterServiceFactory.java
and
import org.chromium.chrome.browser.BraveRewardsHelper;
import org.chromium.chrome.browser.BraveRewardsNativeWorker;
at src/brave/android/java/org/chromium/chrome/browser/shields/BraveShieldsHandler.java
And this is an issue beyond the current PR, crypto_wallet.util.Utils
and BraveRewardsHelper
are widely used beyond rewards/wallet.
Follow-up issues:
brave/brave-browser#41689
brave/brave-browser#41690
auto service = | ||
webcompat_reporter::WebcompatReporterServiceFactory::GetForBrowserState( | ||
browserState); | ||
if (!service) { |
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 is a mojo interface, not a keyed service.
I think the variable and the method name GetForBrowserState
should be renamed accordingly to not confuse people.
content::BrowserContext* | ||
WebcompatReporterServiceFactory::GetBrowserContextToUse( | ||
content::BrowserContext* context) const { | ||
return chrome::GetBrowserContextRedirectedInIncognito(context); |
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.
now that you have ProfileKeyedServiceFactory
, you need to remove GetBrowserContextToUse
override.
"//brave/components/brave_shields/core/common:mojom", | ||
"//brave/components/brave_stats/browser", | ||
"//brave/components/constants", | ||
"//brave/components/version_info", | ||
"//brave/components/webcompat_reporter/buildflags", | ||
"//content/public/browser", |
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.
let's also do "-content"
in components/webcompat_reporter/browser/DEPS
.
if (!is_ios) { | ||
deps += [ | ||
"//brave/components/brave_shields/content/browser", | ||
"//chrome/test:test_support", |
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.
what is it for? you shouldn't have //chrome
in components
.
std::optional<std::string> brave_vpn_connected; | ||
std::optional<std::string> details; | ||
std::optional<std::string> contact; | ||
std::optional<base::Value> ad_block_components; |
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.
you added a mojo structure that's just similar to this one. Do we really need to have both? Why not just use mojo structure everywhere from now on? Seems like the right thing to do.
Signed-off-by: Vadym Struts <[email protected]>
[puLL-Merge] - brave/brave-core@25688 DescriptionThis PR introduces a new WebcompatReporter service for reporting web compatibility issues in the Brave browser. The changes span across multiple platforms (Android, iOS, and desktop) and include the implementation of a new mojo interface for handling webcompat reports. Possible Issues
Security Hotspots
ChangesChanges
Overall, this PR introduces a more unified and structured approach to handling webcompat reports across different platforms in the Brave browser. |
Resolves brave/brave-browser#35674
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Make sure that Webcompat Report contains the
component versions
information.Steps:
component versions
information.