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

Side by Side Diff: chrome/browser/lifetime/browser_close_manager.cc

Issue 2958223002: Use ContainsValue() instead of std::find() in chrome/browser and chrome/common (Closed)
Patch Set: Rebase patch. Created 3 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/lifetime/browser_close_manager.h" 5 #include "chrome/browser/lifetime/browser_close_manager.h"
6 6
7 #include <algorithm>
8 #include <iterator> 7 #include <iterator>
9 #include <vector> 8 #include <vector>
10 9
10 #include "base/stl_util.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "chrome/browser/background/background_mode_manager.h" 12 #include "chrome/browser/background/background_mode_manager.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/browser_shutdown.h" 14 #include "chrome/browser/browser_shutdown.h"
15 #include "chrome/browser/download/download_core_service.h" 15 #include "chrome/browser/download/download_core_service.h"
16 #include "chrome/browser/download/download_core_service_factory.h" 16 #include "chrome/browser/download/download_core_service_factory.h"
17 #include "chrome/browser/lifetime/application_lifetime.h" 17 #include "chrome/browser/lifetime/application_lifetime.h"
18 #include "chrome/browser/notifications/notification_ui_manager.h" 18 #include "chrome/browser/notifications/notification_ui_manager.h"
19 #include "chrome/browser/profiles/profile_manager.h" 19 #include "chrome/browser/profiles/profile_manager.h"
20 #include "chrome/browser/ui/browser.h" 20 #include "chrome/browser/ui/browser.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // a final message and so we force the browser to be deleted. 173 // a final message and so we force the browser to be deleted.
174 // Close doesn't immediately destroy the browser 174 // Close doesn't immediately destroy the browser
175 // (Browser::TabStripEmpty() uses invoke later) but when we're ending the 175 // (Browser::TabStripEmpty() uses invoke later) but when we're ending the
176 // session we need to make sure the browser is destroyed now. So, invoke 176 // session we need to make sure the browser is destroyed now. So, invoke
177 // DestroyBrowser to make sure the browser is deleted and cleanup can 177 // DestroyBrowser to make sure the browser is deleted and cleanup can
178 // happen. 178 // happen.
179 while (browser->tab_strip_model()->count()) 179 while (browser->tab_strip_model()->count())
180 delete browser->tab_strip_model()->GetWebContentsAt(0); 180 delete browser->tab_strip_model()->GetWebContentsAt(0);
181 browser->window()->DestroyBrowser(); 181 browser->window()->DestroyBrowser();
182 // Destroying the browser should have removed it from the browser list. 182 // Destroying the browser should have removed it from the browser list.
183 DCHECK(BrowserList::GetInstance()->end() == 183 DCHECK(!base::ContainsValue(*BrowserList::GetInstance(), browser));
184 std::find(BrowserList::GetInstance()->begin(),
185 BrowserList::GetInstance()->end(), browser));
186 } 184 }
187 } 185 }
188 186
189 g_browser_process->notification_ui_manager()->CancelAll(); 187 g_browser_process->notification_ui_manager()->CancelAll();
190 } 188 }
OLDNEW
« no previous file with comments | « chrome/browser/internal_auth.cc ('k') | chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698