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

Side by Side Diff: components/cookie_config/cookie_store_util.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 "components/cookie_config/cookie_store_util.h" 5 #include "components/cookie_config/cookie_store_util.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "components/os_crypt/os_crypt.h" 9 #include "components/os_crypt/os_crypt.h"
10 #include "net/extras/sqlite/cookie_crypto_delegate.h" 10 #include "net/extras/sqlite/cookie_crypto_delegate.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return OSCrypt::EncryptString(plaintext, ciphertext); 48 return OSCrypt::EncryptString(plaintext, ciphertext);
49 } 49 }
50 50
51 bool CookieOSCryptoDelegate::DecryptString(const std::string& ciphertext, 51 bool CookieOSCryptoDelegate::DecryptString(const std::string& ciphertext,
52 std::string* plaintext) { 52 std::string* plaintext) {
53 return OSCrypt::DecryptString(ciphertext, plaintext); 53 return OSCrypt::DecryptString(ciphertext, plaintext);
54 } 54 }
55 55
56 // Using a LazyInstance is safe here because this class is stateless and 56 // Using a LazyInstance is safe here because this class is stateless and
57 // requires 0 initialization. 57 // requires 0 initialization.
58 base::LazyInstance<CookieOSCryptoDelegate> g_cookie_crypto_delegate = 58 base::LazyInstance<CookieOSCryptoDelegate>::DestructorAtExit
59 LAZY_INSTANCE_INITIALIZER; 59 g_cookie_crypto_delegate = LAZY_INSTANCE_INITIALIZER;
60 60
61 } // namespace 61 } // namespace
62 62
63 net::CookieCryptoDelegate* GetCookieCryptoDelegate() { 63 net::CookieCryptoDelegate* GetCookieCryptoDelegate() {
64 return g_cookie_crypto_delegate.Pointer(); 64 return g_cookie_crypto_delegate.Pointer();
65 } 65 }
66 #else // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) 66 #else // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
67 net::CookieCryptoDelegate* GetCookieCryptoDelegate() { 67 net::CookieCryptoDelegate* GetCookieCryptoDelegate() {
68 return NULL; 68 return NULL;
69 } 69 }
70 #endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) 70 #endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
71 71
72 } // namespace cookie_config 72 } // namespace cookie_config
OLDNEW
« no previous file with comments | « components/content_settings/core/browser/website_settings_registry.cc ('k') | components/crash/content/app/breakpad_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698