Skip to content

Commit

Permalink
fix: enable workaround for nativeWindowOpen hang
Browse files Browse the repository at this point in the history
  • Loading branch information
loc committed Dec 12, 2019
1 parent 8f728af commit 09b17c8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
19 changes: 19 additions & 0 deletions shell/browser/api/atom_api_web_contents.cc
Expand Up @@ -598,6 +598,25 @@ void WebContents::WebContentsCreated(content::WebContents* source_contents,
tracker->frame_name = frame_name;
}

bool WebContents::ShouldCreateWebContents(
content::WebContents* web_contents,
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
int32_t route_id,
int32_t main_frame_route_id,
int32_t main_frame_widget_route_id,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) {
if (Emit("-will-add-new-contents", target_url, frame_name)) {
return false;
}
return true;
}

void WebContents::AddNewContents(
content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
Expand Down
13 changes: 13 additions & 0 deletions shell/browser/api/atom_api_web_contents.h
Expand Up @@ -346,6 +346,19 @@ class WebContents : public mate::TrackableObject<WebContents>,
const base::string16& message,
int32_t line_no,
const base::string16& source_id) override;
bool ShouldCreateWebContents(
content::WebContents* web_contents,
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
int32_t route_id,
int32_t main_frame_route_id,
int32_t main_frame_widget_route_id,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) override;
void WebContentsCreated(content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
Expand Down

0 comments on commit 09b17c8

Please sign in to comment.