handles destroyed renderer process
This commit is contained in:
parent
976277ffbf
commit
916063f370
4 changed files with 8 additions and 23 deletions
|
@ -402,14 +402,6 @@ void WebContents::OnCreateWindow(const GURL& target_url,
|
||||||
Emit("new-window", target_url, frame_name, disposition);
|
Emit("new-window", target_url, frame_name, disposition);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::RenderViewReady() {
|
|
||||||
// if (IsOffScreen()) {
|
|
||||||
// const auto rwhv = web_contents()->GetRenderWidgetHostView();
|
|
||||||
// auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView *>(rwhv);
|
|
||||||
// osr_rwhv->SetPaintCallback(&paint_callback_);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
content::WebContents* WebContents::OpenURLFromTab(
|
content::WebContents* WebContents::OpenURLFromTab(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
const content::OpenURLParams& params) {
|
const content::OpenURLParams& params) {
|
||||||
|
@ -445,12 +437,6 @@ void WebContents::MoveContents(content::WebContents* source,
|
||||||
void WebContents::CloseContents(content::WebContents* source) {
|
void WebContents::CloseContents(content::WebContents* source) {
|
||||||
Emit("close");
|
Emit("close");
|
||||||
|
|
||||||
if (IsOffScreen()) {
|
|
||||||
const auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
|
||||||
web_contents()->GetRenderWidgetHostView());
|
|
||||||
osr_rwhv->SetPainting(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) && owner_window())
|
if ((type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) && owner_window())
|
||||||
owner_window()->CloseContents(source);
|
owner_window()->CloseContents(source);
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,7 +278,6 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
void MediaStartedPlaying(const MediaPlayerId& id) override;
|
void MediaStartedPlaying(const MediaPlayerId& id) override;
|
||||||
void MediaStoppedPlaying(const MediaPlayerId& id) override;
|
void MediaStoppedPlaying(const MediaPlayerId& id) override;
|
||||||
void DidChangeThemeColor(SkColor theme_color) override;
|
void DidChangeThemeColor(SkColor theme_color) override;
|
||||||
void RenderViewReady() override;
|
|
||||||
|
|
||||||
// brightray::InspectableWebContentsDelegate:
|
// brightray::InspectableWebContentsDelegate:
|
||||||
void DevToolsReloadPage() override;
|
void DevToolsReloadPage() override;
|
||||||
|
|
|
@ -619,6 +619,7 @@ void OffScreenRenderWidgetHostView::RenderProcessGone(base::TerminationStatus,in
|
||||||
}
|
}
|
||||||
|
|
||||||
void OffScreenRenderWidgetHostView::Destroy() {
|
void OffScreenRenderWidgetHostView::Destroy() {
|
||||||
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OffScreenRenderWidgetHostView::SetTooltipText(const base::string16 &) {
|
void OffScreenRenderWidgetHostView::SetTooltipText(const base::string16 &) {
|
||||||
|
@ -740,7 +741,7 @@ void OffScreenRenderWidgetHostView::DelegatedFrameHostSendCompositorSwapAck(
|
||||||
}
|
}
|
||||||
|
|
||||||
void OffScreenRenderWidgetHostView::DelegatedFrameHostSendReclaimCompositorResources(
|
void OffScreenRenderWidgetHostView::DelegatedFrameHostSendReclaimCompositorResources(
|
||||||
int output_surface_id, const cc::CompositorFrameAck& ack) {
|
int output_surface_id, const cc::CompositorFrameAck& ack) {
|
||||||
render_widget_host_->Send(new ViewMsg_ReclaimCompositorResources(
|
render_widget_host_->Send(new ViewMsg_ReclaimCompositorResources(
|
||||||
render_widget_host_->GetRoutingID(),
|
render_widget_host_->GetRoutingID(),
|
||||||
output_surface_id, ack));
|
output_surface_id, ack));
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
|
// Copyright (c) 2013 GitHub, Inc.
|
||||||
|
// Use of this source code is governed by the MIT license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "atom/browser/osr_render_widget_host_view.h"
|
#include "atom/browser/osr_render_widget_host_view.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@ -20,7 +23,8 @@ ui::AcceleratedWidgetMac* atom::OffScreenRenderWidgetHostView::GetAcceleratedWid
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSView* atom::OffScreenRenderWidgetHostView::AcceleratedWidgetGetNSView() const {
|
NSView* atom::OffScreenRenderWidgetHostView::AcceleratedWidgetGetNSView()
|
||||||
|
const {
|
||||||
return [window_ contentView];
|
return [window_ contentView];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,13 +79,11 @@ void atom::OffScreenRenderWidgetHostView::SelectionChanged(
|
||||||
}
|
}
|
||||||
|
|
||||||
void atom::OffScreenRenderWidgetHostView::CreatePlatformWidget() {
|
void atom::OffScreenRenderWidgetHostView::CreatePlatformWidget() {
|
||||||
// Create a borderless non-visible 1x1 window.
|
|
||||||
window_ = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1)
|
window_ = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1)
|
||||||
styleMask:NSBorderlessWindowMask
|
styleMask:NSBorderlessWindowMask
|
||||||
backing:NSBackingStoreBuffered
|
backing:NSBackingStoreBuffered
|
||||||
defer:NO];
|
defer:NO];
|
||||||
|
|
||||||
// Create a CALayer which is used by BrowserCompositorViewMac for rendering.
|
|
||||||
background_layer_ = [[[CALayer alloc] init] retain];
|
background_layer_ = [[[CALayer alloc] init] retain];
|
||||||
[background_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorClear)];
|
[background_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorClear)];
|
||||||
NSView* content_view = [window_ contentView];
|
NSView* content_view = [window_ contentView];
|
||||||
|
@ -95,9 +97,6 @@ void atom::OffScreenRenderWidgetHostView::CreatePlatformWidget() {
|
||||||
browser_compositor_->accelerated_widget_mac()->SetNSView(this);
|
browser_compositor_->accelerated_widget_mac()->SetNSView(this);
|
||||||
browser_compositor_->compositor()->SetVisible(true);
|
browser_compositor_->compositor()->SetVisible(true);
|
||||||
|
|
||||||
// CEF needs the browser compositor to remain responsive whereas normal
|
|
||||||
// rendering on OS X does not. This effectively reverts the changes from
|
|
||||||
// https://crbug.com/463988#c6
|
|
||||||
compositor_->SetLocksWillTimeOut(true);
|
compositor_->SetLocksWillTimeOut(true);
|
||||||
browser_compositor_->Unsuspend();
|
browser_compositor_->Unsuspend();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue