| OLD | NEW |
| 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/net/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 "chrome/browser/browser_process.h" | |
| 9 #include "chrome/common/chrome_constants.h" | |
| 10 #include "chrome/common/chrome_switches.h" | |
| 11 #include "components/os_crypt/os_crypt.h" | 8 #include "components/os_crypt/os_crypt.h" |
| 12 #include "content/public/common/content_constants.h" | |
| 13 #include "extensions/common/constants.h" | |
| 14 #include "net/extras/sqlite/cookie_crypto_delegate.h" | 9 #include "net/extras/sqlite/cookie_crypto_delegate.h" |
| 15 | 10 |
| 16 namespace chrome_browser_net { | 11 namespace cookie_config { |
| 17 | 12 |
| 18 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 13 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
| 19 namespace { | 14 namespace { |
| 20 | 15 |
| 21 // Use the operating system's mechanisms to encrypt cookies before writing | 16 // Use the operating system's mechanisms to encrypt cookies before writing |
| 22 // them to persistent store. Currently this only is done with desktop OS's | 17 // them to persistent store. Currently this only is done with desktop OS's |
| 23 // because ChromeOS and Android already protect the entire profile contents. | 18 // because ChromeOS and Android already protect the entire profile contents. |
| 24 class CookieOSCryptoDelegate : public net::CookieCryptoDelegate { | 19 class CookieOSCryptoDelegate : public net::CookieCryptoDelegate { |
| 25 public: | 20 public: |
| 26 bool ShouldEncrypt() override; | 21 bool ShouldEncrypt() override; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Using a LazyInstance is safe here because this class is stateless and | 55 // Using a LazyInstance is safe here because this class is stateless and |
| 61 // requires 0 initialization. | 56 // requires 0 initialization. |
| 62 base::LazyInstance<CookieOSCryptoDelegate> g_cookie_crypto_delegate = | 57 base::LazyInstance<CookieOSCryptoDelegate> g_cookie_crypto_delegate = |
| 63 LAZY_INSTANCE_INITIALIZER; | 58 LAZY_INSTANCE_INITIALIZER; |
| 64 | 59 |
| 65 } // namespace | 60 } // namespace |
| 66 | 61 |
| 67 net::CookieCryptoDelegate* GetCookieCryptoDelegate() { | 62 net::CookieCryptoDelegate* GetCookieCryptoDelegate() { |
| 68 return g_cookie_crypto_delegate.Pointer(); | 63 return g_cookie_crypto_delegate.Pointer(); |
| 69 } | 64 } |
| 70 #else // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 65 #else // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
| 71 net::CookieCryptoDelegate* GetCookieCryptoDelegate() { | 66 net::CookieCryptoDelegate* GetCookieCryptoDelegate() { |
| 72 return NULL; | 67 return NULL; |
| 73 } | 68 } |
| 74 #endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 69 #endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
| 75 | 70 |
| 76 } // namespace chrome_browser_net | 71 } // namespace cookie_config |
| OLD | NEW |