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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 796493004: Remove FrameDetached and FrameWillClose listeners from AutofillAgent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test and fix code Created 6 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 bool is_subframe = !!frame->parent(); 1990 bool is_subframe = !!frame->parent();
1991 1991
1992 Send(new FrameHostMsg_Detach(routing_id_)); 1992 Send(new FrameHostMsg_Detach(routing_id_));
1993 1993
1994 // The |is_detaching_| flag disables Send(). FrameHostMsg_Detach must be 1994 // The |is_detaching_| flag disables Send(). FrameHostMsg_Detach must be
1995 // sent before setting |is_detaching_| to true. In contrast, Observers 1995 // sent before setting |is_detaching_| to true. In contrast, Observers
1996 // should only be notified afterwards so they cannot call back into here and 1996 // should only be notified afterwards so they cannot call back into here and
1997 // have IPCs fired off. 1997 // have IPCs fired off.
1998 is_detaching_ = true; 1998 is_detaching_ = true;
1999 1999
2000 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, FrameDetached());
2000 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), 2001 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(),
2001 FrameDetached(frame)); 2002 FrameDetached(frame));
2002 2003
2003 // We need to clean up subframes by removing them from the map and deleting 2004 // We need to clean up subframes by removing them from the map and deleting
2004 // the RenderFrameImpl. In contrast, the main frame is owned by its 2005 // the RenderFrameImpl. In contrast, the main frame is owned by its
2005 // containing RenderViewHost (so that they have the same lifetime), so only 2006 // containing RenderViewHost (so that they have the same lifetime), so only
2006 // removal from the map is needed and no deletion. 2007 // removal from the map is needed and no deletion.
2007 FrameMap::iterator it = g_frame_map.Get().find(frame); 2008 FrameMap::iterator it = g_frame_map.Get().find(frame);
2008 CHECK(it != g_frame_map.Get().end()); 2009 CHECK(it != g_frame_map.Get().end());
2009 CHECK_EQ(it->second, this); 2010 CHECK_EQ(it->second, this);
(...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after
4319 4320
4320 #if defined(ENABLE_BROWSER_CDMS) 4321 #if defined(ENABLE_BROWSER_CDMS)
4321 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 4322 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
4322 if (!cdm_manager_) 4323 if (!cdm_manager_)
4323 cdm_manager_ = new RendererCdmManager(this); 4324 cdm_manager_ = new RendererCdmManager(this);
4324 return cdm_manager_; 4325 return cdm_manager_;
4325 } 4326 }
4326 #endif // defined(ENABLE_BROWSER_CDMS) 4327 #endif // defined(ENABLE_BROWSER_CDMS)
4327 4328
4328 } // namespace content 4329 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698