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

Side by Side Diff: chrome/browser/ui/hung_plugin_tab_helper.cc

Issue 11820009: Distinguish plugin disconnections from plugin crashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 "chrome/browser/ui/hung_plugin_tab_helper.h" 5 #include "chrome/browser/ui/hung_plugin_tab_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/process.h" 9 #include "base/process.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 HungPluginTabHelper::HungPluginTabHelper(content::WebContents* contents) 205 HungPluginTabHelper::HungPluginTabHelper(content::WebContents* contents)
206 : content::WebContentsObserver(contents) { 206 : content::WebContentsObserver(contents) {
207 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, 207 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
208 content::NotificationService::AllSources()); 208 content::NotificationService::AllSources());
209 } 209 }
210 210
211 HungPluginTabHelper::~HungPluginTabHelper() { 211 HungPluginTabHelper::~HungPluginTabHelper() {
212 } 212 }
213 213
214 void HungPluginTabHelper::PluginCrashed(const FilePath& plugin_path) { 214 void HungPluginTabHelper::PluginCrashed(const FilePath& plugin_path,
215 base::ProcessId plugin_pid) {
215 // TODO(brettw) ideally this would take the child process ID. When we do this 216 // TODO(brettw) ideally this would take the child process ID. When we do this
216 // for NaCl plugins, we'll want to know exactly which process it was since 217 // for NaCl plugins, we'll want to know exactly which process it was since
217 // the path won't be useful. 218 // the path won't be useful.
218 InfoBarService* infobar_service = 219 InfoBarService* infobar_service =
219 InfoBarService::FromWebContents(web_contents()); 220 InfoBarService::FromWebContents(web_contents());
220 if (!infobar_service) 221 if (!infobar_service)
221 return; 222 return;
222 223
223 // For now, just do a brute-force search to see if we have this plugin. Since 224 // For now, just do a brute-force search to see if we have this plugin. Since
224 // we'll normally have 0 or 1, this is fast. 225 // we'll normally have 0 or 1, this is fast.
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 InfoBarService* infobar_service = 372 InfoBarService* infobar_service =
372 InfoBarService::FromWebContents(web_contents()); 373 InfoBarService::FromWebContents(web_contents());
373 if (!infobar_service) 374 if (!infobar_service)
374 return; 375 return;
375 376
376 if (state->info_bar) { 377 if (state->info_bar) {
377 infobar_service->RemoveInfoBar(state->info_bar); 378 infobar_service->RemoveInfoBar(state->info_bar);
378 state->info_bar = NULL; 379 state->info_bar = NULL;
379 } 380 }
380 } 381 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698