Service CreateNewWindow on the UI thread with a new mojo interface
https://codereview.chromium.org/2821473002
This commit is contained in:
parent
b81ae1c36f
commit
ee9a547985
4 changed files with 8 additions and 15 deletions
|
@ -656,14 +656,11 @@ void App::OnCreateWindow(
|
||||||
WindowOpenDisposition disposition,
|
WindowOpenDisposition disposition,
|
||||||
const std::vector<std::string>& features,
|
const std::vector<std::string>& features,
|
||||||
const scoped_refptr<content::ResourceRequestBody>& body,
|
const scoped_refptr<content::ResourceRequestBody>& body,
|
||||||
int render_process_id,
|
content::RenderFrameHost* opener) {
|
||||||
int render_frame_id) {
|
|
||||||
v8::Locker locker(isolate());
|
v8::Locker locker(isolate());
|
||||||
v8::HandleScope handle_scope(isolate());
|
v8::HandleScope handle_scope(isolate());
|
||||||
content::RenderFrameHost* rfh =
|
|
||||||
content::RenderFrameHost::FromID(render_process_id, render_frame_id);
|
|
||||||
content::WebContents* web_contents =
|
content::WebContents* web_contents =
|
||||||
content::WebContents::FromRenderFrameHost(rfh);
|
content::WebContents::FromRenderFrameHost(opener);
|
||||||
if (web_contents) {
|
if (web_contents) {
|
||||||
auto api_web_contents = WebContents::CreateFrom(isolate(), web_contents);
|
auto api_web_contents = WebContents::CreateFrom(isolate(), web_contents);
|
||||||
api_web_contents->OnCreateWindow(target_url,
|
api_web_contents->OnCreateWindow(target_url,
|
||||||
|
|
|
@ -81,8 +81,7 @@ class App : public AtomBrowserClient::Delegate,
|
||||||
WindowOpenDisposition disposition,
|
WindowOpenDisposition disposition,
|
||||||
const std::vector<std::string>& features,
|
const std::vector<std::string>& features,
|
||||||
const scoped_refptr<content::ResourceRequestBody>& body,
|
const scoped_refptr<content::ResourceRequestBody>& body,
|
||||||
int render_process_id,
|
content::RenderFrameHost* opener);
|
||||||
int render_frame_id);
|
|
||||||
|
|
||||||
#if defined(USE_NSS_CERTS)
|
#if defined(USE_NSS_CERTS)
|
||||||
void OnCertificateManagerModelCreated(
|
void OnCertificateManagerModelCreated(
|
||||||
|
|
|
@ -333,8 +333,7 @@ void AtomBrowserClient::ResourceDispatcherHostCreated() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AtomBrowserClient::CanCreateWindow(
|
bool AtomBrowserClient::CanCreateWindow(
|
||||||
int opener_render_process_id,
|
content::RenderFrameHost* opener,
|
||||||
int opener_render_frame_id,
|
|
||||||
const GURL& opener_url,
|
const GURL& opener_url,
|
||||||
const GURL& opener_top_level_frame_url,
|
const GURL& opener_top_level_frame_url,
|
||||||
const GURL& source_origin,
|
const GURL& source_origin,
|
||||||
|
@ -348,10 +347,11 @@ bool AtomBrowserClient::CanCreateWindow(
|
||||||
const scoped_refptr<content::ResourceRequestBody>& body,
|
const scoped_refptr<content::ResourceRequestBody>& body,
|
||||||
bool user_gesture,
|
bool user_gesture,
|
||||||
bool opener_suppressed,
|
bool opener_suppressed,
|
||||||
content::ResourceContext* context,
|
|
||||||
bool* no_javascript_access) {
|
bool* no_javascript_access) {
|
||||||
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
||||||
|
|
||||||
|
int opener_render_process_id = opener->GetProcess()->GetID();
|
||||||
|
|
||||||
if (IsRendererSandboxed(opener_render_process_id)) {
|
if (IsRendererSandboxed(opener_render_process_id)) {
|
||||||
*no_javascript_access = false;
|
*no_javascript_access = false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -377,8 +377,7 @@ bool AtomBrowserClient::CanCreateWindow(
|
||||||
disposition,
|
disposition,
|
||||||
additional_features,
|
additional_features,
|
||||||
body,
|
body,
|
||||||
opener_render_process_id,
|
opener));
|
||||||
opener_render_frame_id));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -81,8 +81,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
||||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
|
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
|
||||||
void ResourceDispatcherHostCreated() override;
|
void ResourceDispatcherHostCreated() override;
|
||||||
bool CanCreateWindow(
|
bool CanCreateWindow(
|
||||||
int opener_render_process_id,
|
content::RenderFrameHost* opener,
|
||||||
int opener_render_frame_id,
|
|
||||||
const GURL& opener_url,
|
const GURL& opener_url,
|
||||||
const GURL& opener_top_level_frame_url,
|
const GURL& opener_top_level_frame_url,
|
||||||
const GURL& source_origin,
|
const GURL& source_origin,
|
||||||
|
@ -96,7 +95,6 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
||||||
const scoped_refptr<content::ResourceRequestBody>& body,
|
const scoped_refptr<content::ResourceRequestBody>& body,
|
||||||
bool user_gesture,
|
bool user_gesture,
|
||||||
bool opener_suppressed,
|
bool opener_suppressed,
|
||||||
content::ResourceContext* context,
|
|
||||||
bool* no_javascript_access) override;
|
bool* no_javascript_access) override;
|
||||||
void GetAdditionalAllowedSchemesForFileSystem(
|
void GetAdditionalAllowedSchemesForFileSystem(
|
||||||
std::vector<std::string>* schemes) override;
|
std::vector<std::string>* schemes) override;
|
||||||
|
|
Loading…
Reference in a new issue