-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2336 from brave/pr2229_fix_brave_crash_url_0.64.x
Fix loading brave crash url doesn't cause renderer crash (uplift to 0.64.x)
- Loading branch information
Showing
4 changed files
with
61 additions
and
11 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc | ||
index cd2ade8119331caa626270056a1863165afd3fb4..33d15bbf371940d35b73f2b8bca81bb6ebfef3ec 100644 | ||
index cd2ade8119331caa626270056a1863165afd3fb4..f3691ded29969615dd7225246467da8a62d0b8fe 100644 | ||
--- a/chrome/browser/ui/browser_navigator.cc | ||
+++ b/chrome/browser/ui/browser_navigator.cc | ||
@@ -723,6 +723,9 @@ void Navigate(NavigateParams* params) { | ||
@@ -106,6 +106,7 @@ Browser* GetOrCreateBrowser(Profile* profile, bool user_gesture) { | ||
// Returns true on success. Otherwise, if changing params leads the browser into | ||
// an erroneous state, returns false. | ||
bool AdjustNavigateParamsForURL(NavigateParams* params) { | ||
+ AdjustNavigateParamsForURLBraveImpl(params); | ||
if (params->contents_to_insert || params->switch_to_singleton_tab || | ||
IsURLAllowedInIncognito(params->url, params->initiating_profile) || | ||
params->initiating_profile->IsGuestSession()) { | ||
@@ -723,6 +724,7 @@ void Navigate(NavigateParams* params) { | ||
bool IsHostAllowedInIncognito(const GURL& url) { | ||
std::string scheme = url.scheme(); | ||
base::StringPiece host = url.host_piece(); | ||
+#if defined(BRAVE_CHROMIUM_BUILD) | ||
+ if (!IsHostAllowedInIncognitoBraveImpl(&scheme, host)) return false; | ||
+#endif | ||
+ if (!IsHostAllowedInIncognitoBraveImpl(host)) return false; | ||
if (scheme == chrome::kChromeSearchScheme) { | ||
return host != chrome::kChromeUIThumbnailHost && | ||
host != chrome::kChromeUIThumbnailHost2 && |
25 changes: 25 additions & 0 deletions
25
patches/content-browser-frame_host-navigation_controller_impl.cc.patch
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,25 @@ | ||
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc | ||
index 90cfe806ba0bef2182f7a1cc7ad02c0010dc2136..86a096b70e3df14d247da8a37359411cbb373c1c 100644 | ||
--- a/content/browser/frame_host/navigation_controller_impl.cc | ||
+++ b/content/browser/frame_host/navigation_controller_impl.cc | ||
@@ -2765,16 +2765,17 @@ void NavigationControllerImpl::NavigateWithoutEntry( | ||
// Note: we intentionally leave the pending entry in place for renderer debug | ||
// URLs, unlike the cases below where we clear it if the navigation doesn't | ||
// proceed. | ||
- if (IsRendererDebugURL(params.url)) { | ||
+ const GURL url = params.url.SchemeIs(url::kJavaScriptScheme) ? params.url : pending_entry_->GetURL(); | ||
+ if (IsRendererDebugURL(url)) { | ||
// Renderer-debug URLs won't go through NavigationThrottlers so we have to | ||
// check them explicitly. See bug 913334. | ||
if (GetContentClient()->browser()->IsRendererDebugURLBlacklisted( | ||
- params.url, browser_context_)) { | ||
+ url, browser_context_)) { | ||
DiscardPendingEntry(false); | ||
return; | ||
} | ||
|
||
- HandleRendererDebugURL(node, params.url); | ||
+ HandleRendererDebugURL(node, url); | ||
return; | ||
} | ||
|