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

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api.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/master again, resolved conflicts 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 // Implements the Chrome Extensions WebNavigation API. 5 // Implements the Chrome Extensions WebNavigation API.
6 6
7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" 7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 web_contents(), 639 web_contents(),
640 render_view_host->GetProcess()->GetID(), 640 render_view_host->GetProcess()->GetID(),
641 navigation_state_.GetUrl(frame_id), 641 navigation_state_.GetUrl(frame_id),
642 frame_num, 642 frame_num,
643 navigation_state_.IsMainFrame(frame_id), 643 navigation_state_.IsMainFrame(frame_id),
644 net::ERR_ABORTED); 644 net::ERR_ABORTED);
645 } 645 }
646 navigation_state_.FrameDetached(frame_id); 646 navigation_state_.FrameDetached(frame_id);
647 } 647 }
648 648
649 void WebNavigationTabObserver::WebContentsDestroyed(content::WebContents* tab) { 649 void WebNavigationTabObserver::WebContentsDestroyed() {
650 g_tab_observer.Get().erase(tab); 650 g_tab_observer.Get().erase(web_contents());
651 registrar_.RemoveAll(); 651 registrar_.RemoveAll();
652 SendErrorEvents(tab, NULL, FrameNavigationState::FrameID()); 652 SendErrorEvents(web_contents(), NULL, FrameNavigationState::FrameID());
653 } 653 }
654 654
655 void WebNavigationTabObserver::SendErrorEvents( 655 void WebNavigationTabObserver::SendErrorEvents(
656 content::WebContents* web_contents, 656 content::WebContents* web_contents,
657 content::RenderViewHost* render_view_host, 657 content::RenderViewHost* render_view_host,
658 FrameNavigationState::FrameID id_to_skip) { 658 FrameNavigationState::FrameID id_to_skip) {
659 for (FrameNavigationState::const_iterator frame = navigation_state_.begin(); 659 for (FrameNavigationState::const_iterator frame = navigation_state_.begin();
660 frame != navigation_state_.end(); ++frame) { 660 frame != navigation_state_.end(); ++frame) {
661 if (!navigation_state_.GetNavigationCompleted(*frame) && 661 if (!navigation_state_.GetNavigationCompleted(*frame) &&
662 navigation_state_.CanSendEvents(*frame) && 662 navigation_state_.CanSendEvents(*frame) &&
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 837
838 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { 838 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) {
839 web_navigation_event_router_.reset(new WebNavigationEventRouter( 839 web_navigation_event_router_.reset(new WebNavigationEventRouter(
840 Profile::FromBrowserContext(browser_context_))); 840 Profile::FromBrowserContext(browser_context_)));
841 EventRouter::Get(browser_context_)->UnregisterObserver(this); 841 EventRouter::Get(browser_context_)->UnregisterObserver(this);
842 } 842 }
843 843
844 #endif // OS_ANDROID 844 #endif // OS_ANDROID
845 845
846 } // namespace extensions 846 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_navigation/web_navigation_api.h ('k') | chrome/browser/extensions/extension_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698