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

Unified Diff: chrome/browser/ui/views/hung_renderer_view.cc

Issue 2606293002: Remove ScopedVector from chrome/browser/ui. (Closed)
Patch Set: fix Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/hung_renderer_view.cc
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc
index 83ef593c26043be5b21da289a948062175b21908..9d615737e6f1968a0c868bd9be1599bb534396de 100644
--- a/chrome/browser/ui/views/hung_renderer_view.cc
+++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/views/hung_renderer_view.h"
#include "base/i18n/rtl.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -80,13 +81,14 @@ void HungPagesTableModel::InitForWebContents(WebContents* hung_contents) {
if (hung_contents) {
// Force hung_contents to be first.
if (hung_contents) {
- tab_observers_.push_back(new WebContentsObserverImpl(this,
- hung_contents));
+ tab_observers_.push_back(
+ base::MakeUnique<WebContentsObserverImpl>(this, hung_contents));
}
for (TabContentsIterator it; !it.done(); it.Next()) {
if (*it != hung_contents &&
it->GetRenderProcessHost() == hung_contents->GetRenderProcessHost())
- tab_observers_.push_back(new WebContentsObserverImpl(this, *it));
+ tab_observers_.push_back(
+ base::MakeUnique<WebContentsObserverImpl>(this, *it));
}
}
// The world is different.
@@ -134,8 +136,11 @@ void HungPagesTableModel::GetGroupRange(int model_index,
void HungPagesTableModel::TabDestroyed(WebContentsObserverImpl* tab) {
// Clean up tab_observers_ and notify our observer.
- TabObservers::iterator i = std::find(
- tab_observers_.begin(), tab_observers_.end(), tab);
+ auto i = tab_observers_.begin();
+ for (; i != tab_observers_.end(); ++i) {
+ if (i->get() == tab)
+ break;
+ }
DCHECK(i != tab_observers_.end());
int index = static_cast<int>(i - tab_observers_.begin());
Nico 2017/01/03 23:15:44 i meant this subtraction is kind of silly; if you
Avi (use Gerrit) 2017/01/04 00:04:50 Done.
tab_observers_.erase(i);
« no previous file with comments | « chrome/browser/ui/views/hung_renderer_view.h ('k') | chrome/browser/ui/website_settings/permission_bubble_browser_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698