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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/event_router.cc

Issue 2581953002: Introduce ArcServiceManager::OnShutdown(). (Closed)
Patch Set: Created 4 years 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/chromeos/extensions/file_manager/event_router.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
index fe12c7bc18667d6e31f32679552819b7d5d7a3e4..b5d8605ab6ddcebac05b50b513bc0c8332ad1305 100644
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
@@ -401,6 +401,11 @@ EventRouter::EventRouter(Profile* profile)
EventRouter::~EventRouter() = default;
+void EventRouter::OnArcShutdown() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
Shuhei Takahashi 2016/12/16 13:36:13 DCHECK_CURRENTLY_ON() is better because it can lea
hidehiko 2016/12/16 17:14:17 Good catch. Done.
+ arc::ArcServiceManager::Get()->RemoveObserver(this);
+}
+
void EventRouter::OnIntentFiltersUpdated() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
BroadcastEvent(profile_,
@@ -412,9 +417,6 @@ void EventRouter::OnIntentFiltersUpdated() {
void EventRouter::Shutdown() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (arc::ArcServiceManager::IsInitialized())
- arc::ArcServiceManager::Get()->RemoveObserver(this);
-
chromeos::system::TimezoneSettings::GetInstance()->RemoveObserver(this);
DLOG_IF(WARNING, !file_watchers_.empty())

Powered by Google App Engine
This is Rietveld 408576698