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

Side by Side Diff: chrome/browser/chromeos/login/signed_settings_helper.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/login/signed_settings_helper.h" 5 #include "chrome/browser/chromeos/login/signed_settings_helper.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 void AddOpContext(OpContext* context); 324 void AddOpContext(OpContext* context);
325 void ClearAll(); 325 void ClearAll();
326 326
327 std::vector<OpContext*> pending_contexts_; 327 std::vector<OpContext*> pending_contexts_;
328 328
329 friend struct base::DefaultLazyInstanceTraits<SignedSettingsHelperImpl>; 329 friend struct base::DefaultLazyInstanceTraits<SignedSettingsHelperImpl>;
330 DISALLOW_COPY_AND_ASSIGN(SignedSettingsHelperImpl); 330 DISALLOW_COPY_AND_ASSIGN(SignedSettingsHelperImpl);
331 }; 331 };
332 332
333 static base::LazyInstance<SignedSettingsHelperImpl> 333 static base::LazyInstance<SignedSettingsHelperImpl>
334 g_signed_settings_helper_impl(base::LINKER_INITIALIZED); 334 g_signed_settings_helper_impl = LAZY_INSTANCE_INITIALIZER;
335 335
336 SignedSettingsHelperImpl::SignedSettingsHelperImpl() { 336 SignedSettingsHelperImpl::SignedSettingsHelperImpl() {
337 } 337 }
338 338
339 SignedSettingsHelperImpl::~SignedSettingsHelperImpl() { 339 SignedSettingsHelperImpl::~SignedSettingsHelperImpl() {
340 if (!pending_contexts_.empty()) { 340 if (!pending_contexts_.empty()) {
341 LOG(WARNING) << "SignedSettingsHelperImpl shutdown with pending ops, " 341 LOG(WARNING) << "SignedSettingsHelperImpl shutdown with pending ops, "
342 << "changes will be lost."; 342 << "changes will be lost.";
343 ClearAll(); 343 ClearAll();
344 } 344 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 446
447 if (test_delegate_) 447 if (test_delegate_)
448 test_delegate_->OnOpCompleted(context->op()); 448 test_delegate_->OnOpCompleted(context->op());
449 } 449 }
450 450
451 SignedSettingsHelper* SignedSettingsHelper::Get() { 451 SignedSettingsHelper* SignedSettingsHelper::Get() {
452 return g_signed_settings_helper_impl.Pointer(); 452 return g_signed_settings_helper_impl.Pointer();
453 } 453 }
454 454
455 } // namespace chromeos 455 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698