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

Issue 11573060: Remove VisitedLink dependency on rest of chrome (Closed)

Created:
8 years ago by boliu
Modified:
7 years, 11 months ago
CC:
chromium-reviews, browser-components-watch_chromium.org, tfarina
Visibility:
Public.

Description

Remove VisitedLink dependency on rest of chrome This is in preparation of componentizing VisitedLink implementation and be shared with Android WebView. * Added VisitedLinkDelegate which HistoryService implements. * Removed VisitedLinkMasterFactory and have HistoryService directly own VisitedLinkMaster. * Introduce URLIterator interface for DeleteURLs. Last committed in https://src.chromium.org/viewvc/chrome?view=rev&revision=175186 Reverted in https://src.chromium.org/viewvc/chrome?view=rev&revision=175217 due to memory leaks. Before this patch, VisitedLink was a ProfileKeyedService and some using HistoryService did not create VisitedLink at all. After this patch, VisitedLink is created and owned directly by HistoryService, so they are now created for some tests depending on which HistoryService constructor is used. First version was leaking URLEnumerator in HistoryService::RebuildTable which was doing manual ref counting (AddRef/Release) calls. Some tests do not start the background thread at all, so URLEnumerator::OnComplete is never called to delete itself. Fixed by properly ref-counting URLEnumerator with scoped_refptr in this path. BUG=168716 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175906

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use delegate instead #

Total comments: 16

Patch Set 3 : Remove chrome/ dependency from unittests. VisitedLinkTest passes. #

Patch Set 4 : unit tests should be passing #

Patch Set 5 : Move master init into history service init (fix test crash) #

Patch Set 6 : Hopefully last unittest crash. #

Patch Set 7 : Add documentation. #

Patch Set 8 : Fix unittest compile. #

Total comments: 15

Patch Set 9 : Address joth's comments #

Total comments: 4

Patch Set 10 : Address joth's comments round 2 #

Patch Set 11 : Address joth's comments round 2 (previous had gclient failure) #

Total comments: 5

Patch Set 12 : Address brett's comments #

Patch Set 13 : Avoid copying GURL and added comment. #

Patch Set 14 : Add virtual to ~TableBuilder (hopefully fix memory leak?) #

Patch Set 15 : null out visitedlink_master_ in tests to avoid leak #

Patch Set 16 : Move creating VisitedLinkMaster into HistoryService::Init (fix leaking TableBuilder in test destroy) #

Patch Set 17 : ref count URLEnumerator in HistoryService #

Total comments: 2

Patch Set 18 : Remove weird comments :) #

Patch Set 19 : Pass scoped_refptr<Enumerator> by const ref (instead of by value) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+337 lines, -310 lines) Patch
M chrome/browser/history/DEPS View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/history/history.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +15 lines, -26 lines 0 comments Download
M chrome/browser/history/history.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 10 chunks +65 lines, -30 lines 0 comments Download
M chrome/browser/history/history_backend.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/history/history_backend.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/profiles/profile_dependency_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +0 lines, -2 lines 0 comments Download
A chrome/browser/visitedlink/visitedlink_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +52 lines, -0 lines 0 comments Download
M chrome/browser/visitedlink/visitedlink_event_listener.h View 1 2 3 4 5 6 2 chunks +11 lines, -3 lines 0 comments Download
M chrome/browser/visitedlink/visitedlink_event_listener.cc View 1 2 3 4 4 chunks +15 lines, -21 lines 0 comments Download
M chrome/browser/visitedlink/visitedlink_master.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +41 lines, -20 lines 0 comments Download
M chrome/browser/visitedlink/visitedlink_master.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 14 chunks +36 lines, -58 lines 0 comments Download
D chrome/browser/visitedlink/visitedlink_master_factory.h View 1 1 chunk +0 lines, -38 lines 0 comments Download
D chrome/browser/visitedlink/visitedlink_master_factory.cc View 1 1 chunk +0 lines, -45 lines 0 comments Download
M chrome/browser/visitedlink/visitedlink_perftest.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/visitedlink/visitedlink_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 29 chunks +93 lines, -62 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 31 (0 generated)
boliu
FYI for now. First bullet point in mail.
8 years ago (2012-12-18 07:53:34 UTC) #1
Jói
Cool, one question for now. https://codereview.chromium.org/11573060/diff/1/chrome/browser/visitedlink/visitedlink_event_listener.cc File chrome/browser/visitedlink/visitedlink_event_listener.cc (right): https://codereview.chromium.org/11573060/diff/1/chrome/browser/visitedlink/visitedlink_event_listener.cc#newcode188 chrome/browser/visitedlink/visitedlink_event_listener.cc:188: case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: { I ...
8 years ago (2012-12-18 10:03:10 UTC) #2
boliu
I only compiled this and did not run/test it. And clearly from the massive trybot ...
8 years ago (2012-12-18 16:42:54 UTC) #3
boliu
Expanding scope of this. Still not for commit yet and only uploaded for early review. ...
8 years ago (2012-12-19 01:53:58 UTC) #4
Jói
Looks great, I think this is very much in the right direction. I agree ignoring ...
8 years ago (2012-12-19 14:07:20 UTC) #5
sky
sky->brettw
8 years ago (2012-12-19 16:26:33 UTC) #6
joth
Liking the look of this too. some passing comments - let us know when you ...
8 years ago (2012-12-20 01:39:29 UTC) #7
tfarina
https://codereview.chromium.org/11573060/diff/7001/chrome/browser/visitedlink/visitedlink_delegate.h File chrome/browser/visitedlink/visitedlink_delegate.h (right): https://codereview.chromium.org/11573060/diff/7001/chrome/browser/visitedlink/visitedlink_delegate.h#newcode8 chrome/browser/visitedlink/visitedlink_delegate.h:8: #include <vector> you don't use this include in this ...
8 years ago (2012-12-20 01:43:33 UTC) #8
boliu
Ready for review! chrome_frame_tests are still failing, but other than that, everything is ready. Happy ...
7 years, 11 months ago (2012-12-29 01:48:12 UTC) #9
joth
Generally looks good to me, thanks Bo! https://codereview.chromium.org/11573060/diff/23001/chrome/browser/visitedlink/visitedlink_delegate.h File chrome/browser/visitedlink/visitedlink_delegate.h (right): https://codereview.chromium.org/11573060/diff/23001/chrome/browser/visitedlink/visitedlink_delegate.h#newcode22 chrome/browser/visitedlink/visitedlink_delegate.h:22: class URLEnumerator ...
7 years, 11 months ago (2012-12-29 18:32:06 UTC) #10
boliu
Looks like chrome_frame_tests are just flaky/broken (very different results on the same patch set 9), ...
7 years, 11 months ago (2012-12-30 02:08:15 UTC) #11
joth
https://codereview.chromium.org/11573060/diff/23001/chrome/browser/visitedlink/visitedlink_master.h File chrome/browser/visitedlink/visitedlink_master.h (right): https://codereview.chromium.org/11573060/diff/23001/chrome/browser/visitedlink/visitedlink_master.h#newcode105 chrome/browser/visitedlink/visitedlink_master.h:105: virtual const GURL& NextURL() = 0; On 2012/12/30 02:08:15, ...
7 years, 11 months ago (2012-12-30 21:51:07 UTC) #12
Jói
LGTM once joth@'s comments are resolved to his satisfaction. On Dec 30, 2012 9:51 PM, ...
7 years, 11 months ago (2012-12-31 17:41:57 UTC) #13
boliu
+erikwright for DEPS https://codereview.chromium.org/11573060/diff/23001/chrome/browser/visitedlink/visitedlink_master.h File chrome/browser/visitedlink/visitedlink_master.h (right): https://codereview.chromium.org/11573060/diff/23001/chrome/browser/visitedlink/visitedlink_master.h#newcode105 chrome/browser/visitedlink/visitedlink_master.h:105: virtual const GURL& NextURL() = 0; ...
7 years, 11 months ago (2013-01-02 17:09:36 UTC) #14
erikwright (departed)
DEPS LGTM.
7 years, 11 months ago (2013-01-02 17:29:31 UTC) #15
brettw
lgtm https://codereview.chromium.org/11573060/diff/44001/chrome/browser/history/history.cc File chrome/browser/history/history.cc (right): https://codereview.chromium.org/11573060/diff/44001/chrome/browser/history/history.cc#newcode122 chrome/browser/history/history.cc:122: virtual GURL NextURL() { Since you're doing a ...
7 years, 11 months ago (2013-01-02 20:23:40 UTC) #16
joth
https://codereview.chromium.org/11573060/diff/44001/chrome/browser/history/history.cc File chrome/browser/history/history.cc (right): https://codereview.chromium.org/11573060/diff/44001/chrome/browser/history/history.cc#newcode122 chrome/browser/history/history.cc:122: virtual GURL NextURL() { On 2013/01/02 20:23:40, brettw wrote: ...
7 years, 11 months ago (2013-01-02 21:28:21 UTC) #17
boliu
https://chromiumcodereview.appspot.com/11573060/diff/44001/chrome/browser/history/history.cc File chrome/browser/history/history.cc (right): https://chromiumcodereview.appspot.com/11573060/diff/44001/chrome/browser/history/history.cc#newcode122 chrome/browser/history/history.cc:122: virtual GURL NextURL() { On 2013/01/02 21:28:21, joth wrote: ...
7 years, 11 months ago (2013-01-02 21:36:10 UTC) #18
boliu
Decided to avoid copying and added a comment to Iterator about lifetime of GURL. It's ...
7 years, 11 months ago (2013-01-04 07:27:47 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/11573060/56001
7 years, 11 months ago (2013-01-04 19:18:09 UTC) #20
commit-bot: I haz the power
Change committed as 175186
7 years, 11 months ago (2013-01-04 20:27:17 UTC) #21
boliu
Re-opening this since it has memory leaks and I reverted it here: https://codereview.chromium.org/11784006/
7 years, 11 months ago (2013-01-04 22:37:26 UTC) #22
boliu
brettw@ PTAL if my scoped_refptr usage is correct Some tests were leaking URLEnumerator/TableBuilder when RebuildTable ...
7 years, 11 months ago (2013-01-05 18:31:33 UTC) #23
boliu
ping!
7 years, 11 months ago (2013-01-07 23:07:52 UTC) #24
tfarina
https://codereview.chromium.org/11573060/diff/78001/chrome/browser/visitedlink/visitedlink_unittest.cc File chrome/browser/visitedlink/visitedlink_unittest.cc (right): https://codereview.chromium.org/11573060/diff/78001/chrome/browser/visitedlink/visitedlink_unittest.cc#newcode52 chrome/browser/visitedlink/visitedlink_unittest.cc:52: // ========================== TestVisitedLinkDelegate ========================== nit: what is up with ...
7 years, 11 months ago (2013-01-08 00:16:43 UTC) #25
tfarina
Could you also fill the BUG= with the corresponding number? Ahh, just saw this was ...
7 years, 11 months ago (2013-01-08 00:17:31 UTC) #26
boliu
On 2013/01/08 00:17:31, tfarina wrote: > Could you also fill the BUG= with the corresponding ...
7 years, 11 months ago (2013-01-08 00:29:03 UTC) #27
boliu
ping! Could someone double check my scoped_refptr usage follows style? I searched through chromium-dev and ...
7 years, 11 months ago (2013-01-09 19:57:35 UTC) #28
Jói
> Could someone double check my scoped_refptr usage follows style? I think const scoped_refptr<>& is ...
7 years, 11 months ago (2013-01-09 20:15:18 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/11573060/90001
7 years, 11 months ago (2013-01-09 20:47:41 UTC) #30
commit-bot: I haz the power
7 years, 11 months ago (2013-01-09 22:37:23 UTC) #31
Message was sent while issue was closed.
Change committed as 175906

Powered by Google App Engine
This is Rietveld 408576698