@@ -162,8 +162,8 @@ DomainBlockNavigationThrottle::WillProcessResponse() {
162
162
void DomainBlockNavigationThrottle::OnShouldBlockDomain (
163
163
std::pair<bool , std::string> block_result) {
164
164
const bool should_block = block_result.first ;
165
- const std::string new_url_spec = block_result.second ;
166
- if (!should_block && new_url_spec. empty ()) {
165
+ const GURL new_url ( block_result.second ) ;
166
+ if (!should_block && !new_url. is_valid ()) {
167
167
DomainBlockTabStorage* tab_storage = DomainBlockTabStorage::FromWebContents (
168
168
navigation_handle ()->GetWebContents ());
169
169
if (tab_storage)
@@ -172,7 +172,7 @@ void DomainBlockNavigationThrottle::OnShouldBlockDomain(
172
172
// runner, but now we know that we want to allow navigation to continue.
173
173
Resume ();
174
174
return ;
175
- } else if (!new_url_spec. empty ()) {
175
+ } else if (new_url. is_valid ()) {
176
176
content::NavigationHandle* handle = navigation_handle ();
177
177
178
178
content::WebContents* contents = handle->GetWebContents ();
@@ -182,8 +182,6 @@ void DomainBlockNavigationThrottle::OnShouldBlockDomain(
182
182
CancelDeferredNavigation (content::NavigationThrottle::ThrottleCheckResult (
183
183
content::NavigationThrottle::CANCEL));
184
184
185
- const GURL new_url (new_url_spec);
186
-
187
185
content::OpenURLParams params =
188
186
content::OpenURLParams::FromNavigationHandle (handle);
189
187
params.url = new_url;
0 commit comments