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

Side by Side Diff: chrome/browser/infobars/infobar_service.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/infobars/infobar_service.h" 5 #include "chrome/browser/infobars/infobar_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h" 9 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 void InfoBarService::RenderProcessGone(base::TerminationStatus status) { 101 void InfoBarService::RenderProcessGone(base::TerminationStatus status) {
102 RemoveAllInfoBars(true); 102 RemoveAllInfoBars(true);
103 } 103 }
104 104
105 void InfoBarService::NavigationEntryCommitted( 105 void InfoBarService::NavigationEntryCommitted(
106 const content::LoadCommittedDetails& load_details) { 106 const content::LoadCommittedDetails& load_details) {
107 OnNavigation(NavigationDetailsFromLoadCommittedDetails(load_details)); 107 OnNavigation(NavigationDetailsFromLoadCommittedDetails(load_details));
108 } 108 }
109 109
110 void InfoBarService::WebContentsDestroyed(content::WebContents* web_contents) { 110 void InfoBarService::WebContentsDestroyed() {
111 // The WebContents is going away; be aggressively paranoid and delete 111 // The WebContents is going away; be aggressively paranoid and delete
112 // ourselves lest other parts of the system attempt to add infobars or use 112 // ourselves lest other parts of the system attempt to add infobars or use
113 // us otherwise during the destruction. 113 // us otherwise during the destruction.
114 web_contents->RemoveUserData(UserDataKey()); 114 web_contents()->RemoveUserData(UserDataKey());
115 // That was the equivalent of "delete this". This object is now destroyed; 115 // That was the equivalent of "delete this". This object is now destroyed;
116 // returning from this function is the only safe thing to do. 116 // returning from this function is the only safe thing to do.
117 } 117 }
118 118
119 bool InfoBarService::OnMessageReceived(const IPC::Message& message) { 119 bool InfoBarService::OnMessageReceived(const IPC::Message& message) {
120 bool handled = true; 120 bool handled = true;
121 IPC_BEGIN_MESSAGE_MAP(InfoBarService, message) 121 IPC_BEGIN_MESSAGE_MAP(InfoBarService, message)
122 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockDisplayingInsecureContent, 122 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockDisplayingInsecureContent,
123 OnDidBlockDisplayingInsecureContent) 123 OnDidBlockDisplayingInsecureContent)
124 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockRunningInsecureContent, 124 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockRunningInsecureContent,
125 OnDidBlockRunningInsecureContent) 125 OnDidBlockRunningInsecureContent)
126 IPC_MESSAGE_UNHANDLED(handled = false) 126 IPC_MESSAGE_UNHANDLED(handled = false)
127 IPC_END_MESSAGE_MAP() 127 IPC_END_MESSAGE_MAP()
128 return handled; 128 return handled;
129 } 129 }
130 130
131 void InfoBarService::OnDidBlockDisplayingInsecureContent() { 131 void InfoBarService::OnDidBlockDisplayingInsecureContent() {
132 InsecureContentInfoBarDelegate::Create( 132 InsecureContentInfoBarDelegate::Create(
133 this, InsecureContentInfoBarDelegate::DISPLAY); 133 this, InsecureContentInfoBarDelegate::DISPLAY);
134 } 134 }
135 135
136 void InfoBarService::OnDidBlockRunningInsecureContent() { 136 void InfoBarService::OnDidBlockRunningInsecureContent() {
137 InsecureContentInfoBarDelegate::Create(this, 137 InsecureContentInfoBarDelegate::Create(this,
138 InsecureContentInfoBarDelegate::RUN); 138 InsecureContentInfoBarDelegate::RUN);
139 } 139 }
OLDNEW
« no previous file with comments | « chrome/browser/infobars/infobar_service.h ('k') | chrome/browser/media/media_stream_capture_indicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698