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

Side by Side Diff: chrome/browser/chromeos/ownership/owner_settings_service_chromeos.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/ownership/owner_settings_service_chromeos.h" 5 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h"
6 6
7 #include <keyhi.h> 7 #include <keyhi.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 CHECK(tentative_settings_->ParseFromString(policy->policy_value())); 338 CHECK(tentative_settings_->ParseFromString(policy->policy_value()));
339 StorePendingChanges(); 339 StorePendingChanges();
340 return true; 340 return true;
341 } 341 }
342 342
343 void OwnerSettingsServiceChromeOS::Observe( 343 void OwnerSettingsServiceChromeOS::Observe(
344 int type, 344 int type,
345 const content::NotificationSource& source, 345 const content::NotificationSource& source,
346 const content::NotificationDetails& details) { 346 const content::NotificationDetails& details) {
347 DCHECK(thread_checker_.CalledOnValidThread()); 347 DCHECK(thread_checker_.CalledOnValidThread());
348 if (type != chrome::NOTIFICATION_PROFILE_CREATED) { 348 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CREATED, type);
349 NOTREACHED();
350 return;
351 }
352 349
353 Profile* profile = content::Source<Profile>(source).ptr(); 350 Profile* profile = content::Source<Profile>(source).ptr();
354 if (profile != profile_) { 351 if (profile != profile_) {
355 NOTREACHED(); 352 NOTREACHED();
356 return; 353 return;
357 } 354 }
358 355
359 waiting_for_profile_creation_ = false; 356 waiting_for_profile_creation_ = false;
360 ReloadKeypair(); 357 ReloadKeypair();
361 } 358 }
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 std::vector<OnManagementSettingsSetCallback> callbacks; 813 std::vector<OnManagementSettingsSetCallback> callbacks;
817 pending_management_settings_callbacks_.swap(callbacks); 814 pending_management_settings_callbacks_.swap(callbacks);
818 for (const auto& callback : callbacks) { 815 for (const auto& callback : callbacks) {
819 if (!callback.is_null()) 816 if (!callback.is_null())
820 callback.Run(success); 817 callback.Run(success);
821 } 818 }
822 StorePendingChanges(); 819 StorePendingChanges();
823 } 820 }
824 821
825 } // namespace chromeos 822 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698