-
Notifications
You must be signed in to change notification settings - Fork 114
Conversation
atom/browser/browser.cc
Outdated
@@ -156,6 +156,8 @@ void Browser::WillFinishLaunching() { | |||
|
|||
void Browser::DidFinishLaunching(const base::DictionaryValue& launch_info) { | |||
is_ready_ = true; | |||
sb_service = safe_browsing::SafeBrowsingService::CreateSafeBrowsingService(); |
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 think this should go in chromium_src/chrome/browser/browser_process_impl.cc to match the implementation in src/chrome/browser/browser_process_impl.cc
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 am working on the changes, I realized this yesterday. This is still in progress. Should've added the WIP tag to the header.
chromium_src/BUILD.gn
Outdated
@@ -290,6 +295,113 @@ source_set("browser") { | |||
"chrome/browser/content_settings/host_content_settings_map_factory.cc", | |||
"chrome/browser/content_settings/host_content_settings_map_factory.h", | |||
|
|||
"//chrome/browser/renderer_preferences_util.cc", |
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.
can we add //chrome/browser/safe_browsing
as a dep instead?
@@ -0,0 +1,60 @@ | |||
// Copyright 2014 The Chromium Authors. All rights reserved. |
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.
why are these copied instead of using chrome src? Are there differences?
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.
see comments
I added the wip label, so just remove that when you're ready to review again |
7671fc4
to
e3896f2
Compare
aac0a4d
to
5046ff0
Compare
atom/browser/BUILD.gn
Outdated
":importer", | ||
"//electron/vendor/ad-block/muon:ad_block", | ||
"//electron/vendor/tracking-protection/muon:tp_node_addon", | ||
] | ||
|
||
sources = [ | ||
"//chrome/browser/loader/safe_browsing_resource_throttle.h", |
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.
these should go in chromium_src/BUILD.gn prerender target
atom/browser/BUILD.gn
Outdated
"//electron:common", | ||
"//electron/muon/app", | ||
# @todo(bridiver) fix circular dep | ||
# "//electron/muon/browser", | ||
"//base", | ||
"//chrome/browser:resource_prefetch_predictor_proto", |
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.
these should be deps of the the chromium_src prerender target
atom/browser/BUILD.gn
Outdated
@@ -21,22 +21,29 @@ source_set("browser") { | |||
] | |||
|
|||
deps = [ | |||
"../../chromium_src/chrome/browser/prerender", |
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.
deps should always absolute paths //electron/chromium_src...
chromium_src/BUILD.gn
Outdated
"//chrome/browser/renderer_preferences_util.cc", | ||
"//chrome/browser/renderer_preferences_util.h", | ||
|
||
"//chrome/browser/safe_browsing/chunk_range.cc", |
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 put these in a separate safe_browsing target and make that a dep of browser
f3d07e6
to
2e34198
Compare
03257a7
to
c6d2aa0
Compare
|
||
SafeBrowsingState::~SafeBrowsingState() {} | ||
|
||
void CheckDownloadUrlDone( |
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 we're copying a lot of code from src/chrome here which we really try to avoid. Can we subclass or use some other method to reuse the existing code?
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.
Most of the code is similar to chrome_download_manager_delegate.cc
. I optimized some of it, let me know if you think we can optimize more.
patches/master_patch.patch
Outdated
|
||
next_state_ = STATE_RESERVE_VIRTUAL_PATH; | ||
- | ||
- if (!should_notify_extensions_ || |
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.
can you provide some explanation for these? This is adding a lot of patches and it doesn't seem like they should all be necessary
@@ -58,9 +93,20 @@ MuonBrowserProcessImpl::component_updater() { | |||
return component_updater(component_updater_, false); | |||
} | |||
|
|||
void MuonBrowserProcessImpl::ApplyAllowCrossOriginAuthPromptPolicy() { |
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 part of safe browsing?
chromium_src/BUILD.gn
Outdated
@@ -599,6 +612,144 @@ source_set("browser") { | |||
} | |||
} | |||
|
|||
source_set("safe_browsing") { | |||
sources = [ | |||
"//chrome/browser/download/download_completion_blocker.cc", |
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.
safe browsing has an existing target in chrome so I don't think we should have to add all these files individually
@@ -658,7 +658,9 @@ void BraveContentBrowserClient::OverrideWebkitPrefs( | |||
prefs->hyperlink_auditing_enabled = false; | |||
// Custom preferences of guest page. | |||
auto web_contents = content::WebContents::FromRenderViewHost(host); | |||
atom::WebContentsPreferences::OverrideWebkitPrefs(web_contents, prefs); | |||
if (web_contents) { |
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.
when is this null?
@@ -395,8 +395,11 @@ void BravePasswordManagerClient::CheckSafeBrowsingReputation( | |||
const GURL& form_action, | |||
const GURL& frame_url) {} | |||
|
|||
void BravePasswordManagerClient::LogPasswordReuseDetectedEvent() {} |
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.
? cc @darkdh
#include "native_mate/dictionary.h" | ||
#include "net/base/filename_util.h" | ||
|
||
#include "atom/common/node_includes.h" |
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 intentionally added at the end of the list
@@ -67,12 +67,10 @@ | |||
#include "base/strings/string_number_conversions.h" | |||
#include "base/strings/stringprintf.h" | |||
#include "chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.h" | |||
#include "extensions/common/file_util.h" |
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.
these are also here intentionally to group them with other URLResourceRequestBundleJob headers
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's best not to mix in unrelated changes because it just confuses the purpose of the PR. Unrelated changes should be put in a separate PR
patches/master_patch.patch
Outdated
#define DUMMY_API_TOKEN "dummytoken" | ||
|
||
#if !defined(GOOGLE_API_KEY) | ||
-#define GOOGLE_API_KEY DUMMY_API_TOKEN |
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.
we don't want to hard code keys like this, what is the purpose of this change?
@@ -1,19 +1,44 @@ | |||
source_set("install_verification") { | |||
sources = [ |
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.
same thing with source set configs here
patches/master_patch.patch
Outdated
danger_level_ = GetDangerLevel( | ||
visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER); | ||
if (danger_level_ != DownloadFileType::NOT_DANGEROUS && | ||
+ danger_level_ != DownloadFileType::ALLOW_ON_USER_GESTURE && |
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.
can you explain this change? We can set the user gesture just like chrome does
patches/master_patch.patch
Outdated
return false; | ||
} | ||
// This check should be last, so we know the earlier checks passed. | ||
+#if defined(MUON_CHROMIUM_BUILD) |
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.
also why this change?
115f4ec
to
7198582
Compare
@@ -11,6 +11,7 @@ | |||
#include "chrome/browser/io_thread.h" | |||
#include "chrome/browser/profiles/profile.h" | |||
#include "chrome/browser/profiles/profile_manager.h" | |||
#include "chrome/browser/safe_browsing/safe_browsing_service.h" |
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.
?
@@ -52,6 +52,10 @@ Browser::CreateParams::CreateParams(Type type, Profile* profile) | |||
|
|||
Browser::CreateParams::CreateParams(const CreateParams& other) = default; | |||
|
|||
content::WebContents* Browser::OpenURL(const content::OpenURLParams& params) { | |||
return 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.
I'm a little worried about this one causing a crash. Where does it get called from? Is it just windows doing its usual terrible job of dead code elimination or is there an actual legit code path that leads here?
7198582
to
d871145
Compare
974749e
to
66439d7
Compare
resource_context, | ||
resource_type, | ||
throttles); | ||
#if BUILDFLAG(ENABLE_NACL) |
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 don't think this block should be here
c61e04d
to
8e83a50
Compare
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.
++
9c28546
to
3eb006d
Compare
No description provided.