OLD | NEW |
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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 base::Bind(&DumpRenderersInBlockingPool, | 394 base::Bind(&DumpRenderersInBlockingPool, |
395 base::Owned(renderer_handles.release()))); | 395 base::Owned(renderer_handles.release()))); |
396 } | 396 } |
397 } | 397 } |
398 } | 398 } |
399 #endif | 399 #endif |
400 | 400 |
401 PluginStateMap::iterator found = hung_plugins_.find(child_id); | 401 PluginStateMap::iterator found = hung_plugins_.find(child_id); |
402 DCHECK(found != hung_plugins_.end()); | 402 DCHECK(found != hung_plugins_.end()); |
403 | 403 |
404 content::BrowserThread::PostTask(content::BrowserThread::IO, | 404 content::BrowserThread::PostTask( |
405 FROM_HERE, | 405 content::BrowserThread::IO, FROM_HERE, |
406 base::Bind(&KillPluginOnIOThread, child_id)); | 406 base::BindOnce(&KillPluginOnIOThread, child_id)); |
407 CloseBar(found->second.get()); | 407 CloseBar(found->second.get()); |
408 } | 408 } |
409 | 409 |
410 void HungPluginTabHelper::OnReshowTimer(int child_id) { | 410 void HungPluginTabHelper::OnReshowTimer(int child_id) { |
411 // The timer should have been cancelled if the record isn't in our map | 411 // The timer should have been cancelled if the record isn't in our map |
412 // anymore. | 412 // anymore. |
413 PluginStateMap::iterator found = hung_plugins_.find(child_id); | 413 PluginStateMap::iterator found = hung_plugins_.find(child_id); |
414 DCHECK(found != hung_plugins_.end()); | 414 DCHECK(found != hung_plugins_.end()); |
415 DCHECK(!found->second->infobar); | 415 DCHECK(!found->second->infobar); |
416 ShowBar(child_id, found->second.get()); | 416 ShowBar(child_id, found->second.get()); |
(...skipping 11 matching lines...) Expand all Loading... |
428 } | 428 } |
429 | 429 |
430 void HungPluginTabHelper::CloseBar(PluginState* state) { | 430 void HungPluginTabHelper::CloseBar(PluginState* state) { |
431 InfoBarService* infobar_service = | 431 InfoBarService* infobar_service = |
432 InfoBarService::FromWebContents(web_contents()); | 432 InfoBarService::FromWebContents(web_contents()); |
433 if (infobar_service && state->infobar) { | 433 if (infobar_service && state->infobar) { |
434 infobar_service->RemoveInfoBar(state->infobar); | 434 infobar_service->RemoveInfoBar(state->infobar); |
435 state->infobar = NULL; | 435 state->infobar = NULL; |
436 } | 436 } |
437 } | 437 } |
OLD | NEW |