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 tempfile | 6 import tempfile |
6 import os | |
7 | 7 |
8 from profile_creators import fast_navigation_profile_extender | 8 from profile_creators import fast_navigation_profile_extender |
9 | 9 |
10 | 10 |
11 class HistoryProfileExtender( | 11 class HistoryProfileExtender( |
12 fast_navigation_profile_extender.FastNavigationProfileExtender): | 12 fast_navigation_profile_extender.FastNavigationProfileExtender): |
13 """This extender navigates Chrome to a large number of URIs pointing to local | 13 """This extender navigates Chrome to a large number of URIs pointing to local |
14 files. It continues running until the history DB becomes full.""" | 14 files. It continues running until the history DB becomes full.""" |
15 _HISTORY_DB_MAX_SIZE_IN_MB = 10 | 15 _HISTORY_DB_MAX_SIZE_IN_MB = 10 |
16 | 16 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 """Whether the history DB has reached its maximum size.""" | 81 """Whether the history DB has reached its maximum size.""" |
82 history_db_path = os.path.join(self.profile_path, "Default", "History") | 82 history_db_path = os.path.join(self.profile_path, "Default", "History") |
83 stat_info = os.stat(history_db_path) | 83 stat_info = os.stat(history_db_path) |
84 size = stat_info.st_size | 84 size = stat_info.st_size |
85 | 85 |
86 max_size_threshold = 0.95 | 86 max_size_threshold = 0.95 |
87 bytes_in_megabyte = 2**20 | 87 bytes_in_megabyte = 2**20 |
88 max_size = (bytes_in_megabyte * | 88 max_size = (bytes_in_megabyte * |
89 HistoryProfileExtender._HISTORY_DB_MAX_SIZE_IN_MB * max_size_threshold) | 89 HistoryProfileExtender._HISTORY_DB_MAX_SIZE_IN_MB * max_size_threshold) |
90 return size > max_size | 90 return size > max_size |
OLD | NEW |