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

Side by Side Diff: content/public/browser/web_contents_observer.cc

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/lkgr Created 6 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/public/browser/web_contents_observer.h" 5 #include "content/public/browser/web_contents_observer.h"
6 6
7 #include "content/browser/web_contents/web_contents_impl.h" 7 #include "content/browser/web_contents/web_contents_impl.h"
8 #include "content/public/browser/navigation_details.h" 8 #include "content/public/browser/navigation_details.h"
9 #include "content/public/browser/render_view_host.h" 9 #include "content/public/browser/render_view_host.h"
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 return web_contents_->Send(message); 54 return web_contents_->Send(message);
55 } 55 }
56 56
57 int WebContentsObserver::routing_id() const { 57 int WebContentsObserver::routing_id() const {
58 if (!web_contents_) 58 if (!web_contents_)
59 return MSG_ROUTING_NONE; 59 return MSG_ROUTING_NONE;
60 60
61 return web_contents_->GetRoutingID(); 61 return web_contents_->GetRoutingID();
62 } 62 }
63 63
64 void WebContentsObserver::WebContentsImplDestroyed() {
65 // Do cleanup so that 'this' can safely be deleted from WebContentsDestroyed.
66 web_contents_->RemoveObserver(this);
67 WebContentsImpl* contents = web_contents_;
68 web_contents_ = NULL;
69 WebContentsDestroyed(contents);
70 }
71
72 } // namespace content 64 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698