Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import multiprocessing | 4 import multiprocessing |
| 5 import os | 5 import os |
| 6 import sqlite3 | 6 |
| 7 try: | |
|
cylee1
2015/05/04 11:16:59
Please leave some comment/reference here so people
achuithb
2015/05/04 19:48:00
Done.
| |
| 8 import sqlite3 | |
| 9 except ImportError: | |
| 10 pass | |
| 7 | 11 |
| 8 import page_sets | 12 import page_sets |
| 9 | 13 |
| 10 from profile_creators import fast_navigation_profile_extender | 14 from profile_creators import fast_navigation_profile_extender |
| 11 | 15 |
| 12 class CookieProfileExtender( | 16 class CookieProfileExtender( |
| 13 fast_navigation_profile_extender.FastNavigationProfileExtender): | 17 fast_navigation_profile_extender.FastNavigationProfileExtender): |
| 14 """This extender fills in the cookie database. | 18 """This extender fills in the cookie database. |
| 15 | 19 |
| 16 By default, Chrome purges the cookie DB down to 3300 cookies. However, it | 20 By default, Chrome purges the cookie DB down to 3300 cookies. However, it |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 that this method will return a false negative.""" | 75 that this method will return a false negative.""" |
| 72 cookie_db_path = os.path.join(self.profile_path, "Default", "Cookies") | 76 cookie_db_path = os.path.join(self.profile_path, "Default", "Cookies") |
| 73 try: | 77 try: |
| 74 cookie_count = CookieProfileExtender._CookieCountInDB(cookie_db_path) | 78 cookie_count = CookieProfileExtender._CookieCountInDB(cookie_db_path) |
| 75 except sqlite3.OperationalError: | 79 except sqlite3.OperationalError: |
| 76 # There will occasionally be contention for the SQLite database. This | 80 # There will occasionally be contention for the SQLite database. This |
| 77 # shouldn't happen often, so ignore the errors. | 81 # shouldn't happen often, so ignore the errors. |
| 78 return False | 82 return False |
| 79 | 83 |
| 80 return cookie_count > CookieProfileExtender._COOKIE_DB_EXPECTED_SIZE | 84 return cookie_count > CookieProfileExtender._COOKIE_DB_EXPECTED_SIZE |
| OLD | NEW |