refactor: move set_owned_by_client calls to base View (#22739)

* refactor: move set_owned_by_client() to WebContentsView

* refactor: do set_owned_by_client() in View
This commit is contained in:
Cheng Zhao 2020-03-20 15:41:41 +09:00 committed by GitHub
parent aa15a2cc03
commit 42f138282f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 18 deletions

View file

@ -53,12 +53,10 @@ WebContentsView::WebContentsView(v8::Isolate* isolate,
#endif
web_contents_(isolate, web_contents->GetWrapper()),
api_web_contents_(web_contents.get()) {
#if defined(OS_MACOSX)
// On macOS a View is created to wrap the NSView, and its lifetime is managed
// by us.
view()->set_owned_by_client();
#else
// On other platforms the View is managed by InspectableWebContents.
#if !defined(OS_MACOSX)
// On macOS the View is a newly-created |DelayedNativeViewHost| and it is our
// responsibility to delete it. On other platforms the View is created and
// managed by InspectableWebContents.
set_delete_view(false);
#endif
WebContentsViewRelay::CreateForWebContents(web_contents->web_contents());