Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: components/guest_view/browser/guest_view_base.cc

Issue 1641563002: Remove linked_ptr usage in //base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/guest_view/browser/guest_view_base.cc
diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc
index 634b1f7900b7eb7b5798e865f6de57b17037a76e..64b33d55a25da94119471a7492738f48368ca646 100644
--- a/components/guest_view/browser/guest_view_base.cc
+++ b/components/guest_view/browser/guest_view_base.cc
@@ -758,7 +758,7 @@ void GuestViewBase::DispatchEventToGuestProxy(GuestViewEvent* event) {
void GuestViewBase::DispatchEventToView(GuestViewEvent* event) {
if (!attached() &&
(!CanRunInDetachedState() || !can_owner_receive_events())) {
- pending_events_.push_back(linked_ptr<GuestViewEvent>(event));
+ pending_events_.push_back(make_scoped_ptr(event));
return;
}
@@ -769,9 +769,9 @@ void GuestViewBase::SendQueuedEvents() {
if (!attached())
return;
while (!pending_events_.empty()) {
- linked_ptr<GuestViewEvent> event_ptr = pending_events_.front();
+ scoped_ptr<GuestViewEvent> event_ptr = std::move(pending_events_.front());
pending_events_.pop_front();
- event_ptr.release()->Dispatch(this, view_instance_id_);
vmpstr 2016/01/28 19:53:34 Just out of curiosity, was this leaking before? My
dcheng 2016/01/28 20:32:14 I believe you are correct: the original code leake
Fady Samuel 2016/01/28 23:29:33 No, it wasn't. the event self-destructs on dispatc
+ event_ptr->Dispatch(this, view_instance_id_);
}
}
« no previous file with comments | « components/guest_view/browser/guest_view_base.h ('k') | extensions/browser/guest_view/web_view/web_view_find_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698