Switch to using scoped_ptr with UserData
https://codereview.chromium.org/2815913005
This commit is contained in:
parent
fe952d5c65
commit
971002a197
2 changed files with 5 additions and 4 deletions
|
@ -180,12 +180,12 @@ void CommonWebContentsDelegate::SetOwnerWindow(NativeWindow* owner_window) {
|
|||
void CommonWebContentsDelegate::SetOwnerWindow(
|
||||
content::WebContents* web_contents, NativeWindow* owner_window) {
|
||||
owner_window_ = owner_window ? owner_window->GetWeakPtr() : nullptr;
|
||||
NativeWindowRelay* relay = new NativeWindowRelay(owner_window_);
|
||||
auto relay = base::MakeUnique<NativeWindowRelay>(owner_window_);
|
||||
if (owner_window) {
|
||||
web_contents->SetUserData(relay->key, relay);
|
||||
web_contents->SetUserData(relay->key, std::move(relay));
|
||||
} else {
|
||||
web_contents->RemoveUserData(relay->key);
|
||||
delete relay;
|
||||
relay.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue