Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Issue 10837244: Replace HistoryQuickProvider protobuf-based caching with an SQLite-based database. (Closed)

Created:
8 years, 4 months ago by mrossetti
Modified:
8 years, 4 months ago
Reviewers:
sky
CC:
chromium-reviews, James Su, brettw-cc_chromium.org
Visibility:
Public.

Description

Replace HistoryQuickProvider protobuf-based caching with an SQLite-based database. The protobuf-based cache was only being read at startup and written at shutdown. (Except that when the cache could not be read at startup the cache would immediately be saved upon private data reconstruction from the History database.) With the new implementation using an SQLite database for the HQP cache the private data will be restored from the cache database at startup and continually updated during normal operation. There is no need to flush or write the cache at shutdown as it is constantly kept up-to-date. Detailed comments about the changes made in this CL can be found in the document shared separately. Previous reviewers: sky, pkasting, shess. BUG=95686, 95876, 131668 TEST=New tests added, old tests updated, all tests pass. To manually verify changes: NOTE: For tests using chrome://omnibox be sure to check the "Show results per provider" and then look at the results for the HistoryQuickProvider. 1) New visits: Type an URL never visited before. Bring up new tab. Start typing the URL or parts of the page title or both and verify that the page is offered as a suggestion. 2) New visits: Type an URL never visited before. Do search using chrome://omnibox. New visit should show. 3) Delete visit: Visit some pages and verify they have been recorded. Bring up history and delete one of the visits. Check via chrome://omnibox that it was deleted. 4) Clear history: Visit some pages. Clear the visit history. Check via chrome://omnibox that none of the visits are still returned by the HQP. 5) Updated site: Create a local page and visit it. Search using chrome://omnibox by page title and verify it can be found. Change the page title dramatically and revisit the page. Verify via chrome://oomnibox that the page can be found by words from the new title. Previously reviewed as: http://codereview.chromium.org/10477018/. 10477018 was reverted due to memory leaks detected by build bots. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=152946

Patch Set 1 #

Patch Set 2 : Adjust guard locks. #

Patch Set 3 : Use different WeakPtr approach with InMemoryURLIndex class. #

Patch Set 4 : Flush BlockingPool for unit tests. #

Patch Set 5 : Trying out worker pool synchronization for unit test leak prevention. #

Patch Set 6 : Back out the trial code. Didn't work. #

Patch Set 7 : Try a WaitableEvent to block before shutting down the DB thread. #

Patch Set 8 : Fix stupid errors. #

Patch Set 9 : Leakage: Wait for history and blocking pool to flush. #

Patch Set 10 : Suppress remaining leaks. #

Patch Set 11 : Tweak suppression. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+3770 lines, -2186 lines) Patch
M chrome/browser/autocomplete/history_provider.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/history_provider.cc View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/history_quick_provider.cc View 1 chunk +7 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/history_quick_provider_unittest.cc View 4 chunks +16 lines, -196 lines 0 comments Download
M chrome/browser/diagnostics/diagnostics_model.cc View 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/diagnostics/diagnostics_model_unittest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/diagnostics/sqlite_diagnostics.h View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/diagnostics/sqlite_diagnostics.cc View 3 chunks +12 lines, -1 line 0 comments Download
M chrome/browser/history/history.h View 8 chunks +23 lines, -8 lines 0 comments Download
M chrome/browser/history/history.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/history/history_backend.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/history/history_backend_unittest.cc View 9 chunks +182 lines, -114 lines 0 comments Download
M chrome/browser/history/history_browsertest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/history/history_database.h View 1 chunk +4 lines, -1 line 0 comments Download
A chrome/browser/history/in_memory_url_cache_database.h View 1 chunk +218 lines, -0 lines 0 comments Download
A chrome/browser/history/in_memory_url_cache_database.cc View 1 chunk +692 lines, -0 lines 0 comments Download
M chrome/browser/history/in_memory_url_index.h View 1 2 5 7 chunks +134 lines, -127 lines 0 comments Download
M chrome/browser/history/in_memory_url_index.cc View 1 2 5 5 chunks +204 lines, -156 lines 0 comments Download
A chrome/browser/history/in_memory_url_index_base_unittest.h View 1 2 3 4 1 chunk +91 lines, -0 lines 0 comments Download
A chrome/browser/history/in_memory_url_index_base_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +143 lines, -0 lines 0 comments Download
M chrome/browser/history/in_memory_url_index_types.h View 2 chunks +1 line, -18 lines 0 comments Download
M chrome/browser/history/in_memory_url_index_types_unittest.cc View 4 chunks +22 lines, -19 lines 0 comments Download
M chrome/browser/history/in_memory_url_index_unittest.cc View 1 2 3 4 5 6 7 8 9 chunks +647 lines, -627 lines 0 comments Download
M chrome/browser/history/scored_history_match.h View 1 chunk +5 lines, -8 lines 0 comments Download
M chrome/browser/history/scored_history_match_unittest.cc View 4 chunks +16 lines, -9 lines 0 comments Download
M chrome/browser/history/top_sites_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/history/url_index_private_data.h View 1 5 6 chunks +186 lines, -136 lines 0 comments Download
M chrome/browser/history/url_index_private_data.cc View 1 2 3 4 5 6 7 8 10 chunks +655 lines, -715 lines 1 comment Download
A chrome/browser/history/url_index_private_data_unittest.cc View 1 chunk +283 lines, -0 lines 0 comments Download
M chrome/browser/visitedlink/visitedlink_master.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/common/chrome_constants.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/chrome_constants.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/chrome_notification_types.h View 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.h View 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 chunk +10 lines, -5 lines 0 comments Download
A chrome/test/data/History/history_quick_provider_ordering_test.db.txt View 1 chunk +49 lines, -0 lines 0 comments Download
A chrome/test/data/History/history_quick_provider_test.db.txt View 1 chunk +62 lines, -0 lines 0 comments Download
M chrome/test/data/History/url_history_provider_test.db.txt View 1 chunk +28 lines, -28 lines 0 comments Download
M chrome/test/data/History/url_history_provider_test_limited.db.txt View 1 chunk +1 line, -1 line 0 comments Download
M sql/diagnostic_error_delegate.h View 2 chunks +5 lines, -3 lines 0 comments Download
M tools/valgrind/memcheck/suppressions.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
mrossetti
You may have heard that there were a dozen or more leaks reported by the ...
8 years, 4 months ago (2012-08-22 19:04:18 UTC) #1
sky
8 years, 4 months ago (2012-08-22 19:42:34 UTC) #2
LGTM

http://codereview.chromium.org/10837244/diff/36006/chrome/browser/history/url...
File chrome/browser/history/url_index_private_data.cc (right):

http://codereview.chromium.org/10837244/diff/36006/chrome/browser/history/url...
chrome/browser/history/url_index_private_data.cc:655: return shutdown_;
nit: spacing.

Powered by Google App Engine
This is Rietveld 408576698