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

Side by Side Diff: chrome/browser/jumplist_win.cc

Issue 2063863002: Use DCHECKs when observing only a single notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/jumplist_win.h" 5 #include "chrome/browser/jumplist_win.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 // static 312 // static
313 bool JumpList::Enabled() { 313 bool JumpList::Enabled() {
314 return JumpListUpdater::IsEnabled(); 314 return JumpListUpdater::IsEnabled();
315 } 315 }
316 316
317 void JumpList::Observe(int type, 317 void JumpList::Observe(int type,
318 const content::NotificationSource& source, 318 const content::NotificationSource& source,
319 const content::NotificationDetails& details) { 319 const content::NotificationDetails& details) {
320 DCHECK(CalledOnValidThread()); 320 DCHECK(CalledOnValidThread());
321 DCHECK_EQ(type, chrome::NOTIFICATION_PROFILE_DESTROYED); 321 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type);
322 // Profile was destroyed, do clean-up. 322 // Profile was destroyed, do clean-up.
323 Terminate(); 323 Terminate();
324 } 324 }
325 325
326 void JumpList::CancelPendingUpdate() { 326 void JumpList::CancelPendingUpdate() {
327 DCHECK(CalledOnValidThread()); 327 DCHECK(CalledOnValidThread());
328 if (task_id_ != base::CancelableTaskTracker::kBadTaskId) { 328 if (task_id_ != base::CancelableTaskTracker::kBadTaskId) {
329 cancelable_task_tracker_.TryCancel(task_id_); 329 cancelable_task_tracker_.TryCancel(task_id_);
330 task_id_ = base::CancelableTaskTracker::kBadTaskId; 330 task_id_ = base::CancelableTaskTracker::kBadTaskId;
331 } 331 }
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 void JumpList::TopSitesLoaded(history::TopSites* top_sites) { 581 void JumpList::TopSitesLoaded(history::TopSites* top_sites) {
582 } 582 }
583 583
584 void JumpList::TopSitesChanged(history::TopSites* top_sites, 584 void JumpList::TopSitesChanged(history::TopSites* top_sites,
585 ChangeReason change_reason) { 585 ChangeReason change_reason) {
586 top_sites->GetMostVisitedURLs( 586 top_sites->GetMostVisitedURLs(
587 base::Bind(&JumpList::OnMostVisitedURLsAvailable, 587 base::Bind(&JumpList::OnMostVisitedURLsAvailable,
588 weak_ptr_factory_.GetWeakPtr()), 588 weak_ptr_factory_.GetWeakPtr()),
589 false); 589 false);
590 } 590 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698