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:
parent
aa15a2cc03
commit
42f138282f
6 changed files with 9 additions and 18 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue