OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Brought to you by the letter D and the number 2. | 5 // Brought to you by the letter D and the number 2. |
6 | 6 |
7 #ifndef NET_COOKIES_COOKIE_MONSTER_H_ | 7 #ifndef NET_COOKIES_COOKIE_MONSTER_H_ |
8 #define NET_COOKIES_COOKIE_MONSTER_H_ | 8 #define NET_COOKIES_COOKIE_MONSTER_H_ |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 int DeleteSessionCookies(); | 424 int DeleteSessionCookies(); |
425 | 425 |
426 bool HasCookiesForETLDP1(const std::string& etldp1); | 426 bool HasCookiesForETLDP1(const std::string& etldp1); |
427 | 427 |
428 // Called by all non-static functions to ensure that the cookies store has | 428 // Called by all non-static functions to ensure that the cookies store has |
429 // been initialized. This is not done during creating so it doesn't block | 429 // been initialized. This is not done during creating so it doesn't block |
430 // the window showing. | 430 // the window showing. |
431 // Note: this method should always be called with lock_ held. | 431 // Note: this method should always be called with lock_ held. |
432 void InitIfNecessary() { | 432 void InitIfNecessary() { |
433 if (!initialized_) { | 433 if (!initialized_) { |
434 if (store_) { | 434 if (store_.get()) { |
435 InitStore(); | 435 InitStore(); |
436 } else { | 436 } else { |
437 loaded_ = true; | 437 loaded_ = true; |
438 } | 438 } |
439 initialized_ = true; | 439 initialized_ = true; |
440 } | 440 } |
441 } | 441 } |
442 | 442 |
443 // Initializes the backing store and reads existing cookies from it. | 443 // Initializes the backing store and reads existing cookies from it. |
444 // Should only be called by InitIfNecessary(). | 444 // Should only be called by InitIfNecessary(). |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 virtual ~PersistentCookieStore() {} | 740 virtual ~PersistentCookieStore() {} |
741 | 741 |
742 private: | 742 private: |
743 friend class base::RefCountedThreadSafe<PersistentCookieStore>; | 743 friend class base::RefCountedThreadSafe<PersistentCookieStore>; |
744 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); | 744 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); |
745 }; | 745 }; |
746 | 746 |
747 } // namespace net | 747 } // namespace net |
748 | 748 |
749 #endif // NET_COOKIES_COOKIE_MONSTER_H_ | 749 #endif // NET_COOKIES_COOKIE_MONSTER_H_ |
OLD | NEW |