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 "chrome/browser/net/cookie_store_util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 | 94 |
95 const base::Callback<Profile*(void)> profile_getter_; | 95 const base::Callback<Profile*(void)> profile_getter_; |
96 }; | 96 }; |
97 | 97 |
98 } // namespace | 98 } // namespace |
99 | 99 |
100 namespace chrome_browser_net { | 100 namespace chrome_browser_net { |
101 | 101 |
102 bool IsCookieRecordMode() { | 102 bool IsCookieRecordMode() { |
103 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 103 const base::CommandLine& command_line = |
| 104 *base::CommandLine::ForCurrentProcess(); |
104 // Only allow Record Mode if we are in a Debug build or where we are running | 105 // Only allow Record Mode if we are in a Debug build or where we are running |
105 // a cycle, and the user has limited control. | 106 // a cycle, and the user has limited control. |
106 return command_line.HasSwitch(switches::kRecordMode) && | 107 return command_line.HasSwitch(switches::kRecordMode) && |
107 chrome::kRecordModeEnabled; | 108 chrome::kRecordModeEnabled; |
108 } | 109 } |
109 | 110 |
110 bool ShouldUseInMemoryCookiesAndCache() { | 111 bool ShouldUseInMemoryCookiesAndCache() { |
111 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 112 const base::CommandLine& command_line = |
| 113 *base::CommandLine::ForCurrentProcess(); |
112 return IsCookieRecordMode() || | 114 return IsCookieRecordMode() || |
113 command_line.HasSwitch(switches::kPlaybackMode); | 115 command_line.HasSwitch(switches::kPlaybackMode); |
114 } | 116 } |
115 | 117 |
116 net::CookieMonsterDelegate* CreateCookieDelegate(Profile* profile) { | 118 net::CookieMonsterDelegate* CreateCookieDelegate(Profile* profile) { |
117 return new EvictedDomainCookieCounter( | 119 return new EvictedDomainCookieCounter( |
118 new ChromeCookieMonsterDelegate(profile)); | 120 new ChromeCookieMonsterDelegate(profile)); |
119 } | 121 } |
120 | 122 |
121 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 123 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 content::CookieCryptoDelegate* GetCookieCryptoDelegate() { | 157 content::CookieCryptoDelegate* GetCookieCryptoDelegate() { |
156 return g_cookie_crypto_delegate.Pointer(); | 158 return g_cookie_crypto_delegate.Pointer(); |
157 } | 159 } |
158 #else // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 160 #else // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
159 content::CookieCryptoDelegate* GetCookieCryptoDelegate() { | 161 content::CookieCryptoDelegate* GetCookieCryptoDelegate() { |
160 return NULL; | 162 return NULL; |
161 } | 163 } |
162 #endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 164 #endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
163 | 165 |
164 } // namespace chrome_browser_net | 166 } // namespace chrome_browser_net |
OLD | NEW |