fix: destroy WebContents synchronously on shutdown (#15541)

This commit is contained in:
Cheng Zhao 2018-11-09 00:57:28 +09:00 committed by Shelley Vohr
parent 6162d9090d
commit 746beb0d8b
12 changed files with 122 additions and 13 deletions

View file

@ -10,6 +10,7 @@
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/native_browser_view.h"
#include "content/public/browser/web_contents_observer.h"
#include "native_mate/handle.h"
namespace gfx {
@ -29,7 +30,8 @@ namespace api {
class WebContents;
class BrowserView : public mate::TrackableObject<BrowserView> {
class BrowserView : public mate::TrackableObject<BrowserView>,
public content::WebContentsObserver {
public:
static mate::WrappableBase* New(mate::Arguments* args);
@ -47,6 +49,9 @@ class BrowserView : public mate::TrackableObject<BrowserView> {
const mate::Dictionary& options);
~BrowserView() override;
// content::WebContentsObserver:
void WebContentsDestroyed() override;
private:
void Init(v8::Isolate* isolate,
v8::Local<v8::Object> wrapper,