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

Issue 2115823004: Avoid using BrowserThread and ContentBrowserClient in NetLogObserver. (Closed)

Created:
4 years, 5 months ago by ananta
Modified:
4 years, 5 months ago
Reviewers:
jam, pfeldman
CC:
chromium-reviews, jam, Randy Smith (Not in Mondays), darin-cc_chromium.org, mmenke, devtools-reviews_chromium.org, loading-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid using BrowserThread and ContentBrowserClient in NetLogObserver. To avoid using the BrowserThread we instantiate a ThreadChecker instance on the NetLogObserver::Attach method and use this to validate that calls to the NetLogObserver instance occur on the same thread. To avoid using ContentBrowserClient, we pass the NetLog pointer in the NetLogObserver::Attach method. BUG=598073 Committed: https://crrev.com/92e2691c3adb201ba8889d6050ed34cbce8184bf Cr-Commit-Position: refs/heads/master@{#405284}

Patch Set 1 #

Patch Set 2 : Fix build error #

Total comments: 4

Patch Set 3 : Pass the IO thread task runnner in NetLogObserver::Attach #

Patch Set 4 : Fix build error #

Patch Set 5 : Fix content_unittests redness #

Patch Set 6 : Rebase to tip #

Total comments: 6

Patch Set 7 : Address review comments #

Patch Set 8 : Fix build error #

Total comments: 2

Patch Set 9 : Ensure that NetLogObserver::GetInstance does not crash if it is called before Attach or after Detach #

Patch Set 10 : Use ThreadChecker instead of task runner #

Patch Set 11 : Remove include #

Total comments: 2

Patch Set 12 : Fix leak #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -13 lines) Patch
M content/browser/devtools/devtools_manager.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/loader/netlog_observer.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +11 lines, -2 lines 0 comments Download
M content/browser/loader/netlog_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +17 lines, -10 lines 0 comments Download

Messages

Total messages: 30 (10 generated)
ananta
4 years, 5 months ago (2016-07-01 23:29:48 UTC) #2
pfeldman
https://codereview.chromium.org/2115823004/diff/20001/content/browser/devtools/devtools_manager.cc File content/browser/devtools/devtools_manager.cc (right): https://codereview.chromium.org/2115823004/diff/20001/content/browser/devtools/devtools_manager.cc#newcode25 content/browser/devtools/devtools_manager.cc:25: NetLogObserver::SetIOThreadTaskRunner( It is unclear why netlog observer is initialized ...
4 years, 5 months ago (2016-07-06 18:36:14 UTC) #4
ananta
https://codereview.chromium.org/2115823004/diff/20001/content/browser/devtools/devtools_manager.cc File content/browser/devtools/devtools_manager.cc (right): https://codereview.chromium.org/2115823004/diff/20001/content/browser/devtools/devtools_manager.cc#newcode25 content/browser/devtools/devtools_manager.cc:25: NetLogObserver::SetIOThreadTaskRunner( On 2016/07/06 18:36:14, pfeldman wrote: > It is ...
4 years, 5 months ago (2016-07-08 14:11:02 UTC) #5
ananta
On 2016/07/08 14:11:02, ananta wrote: > https://codereview.chromium.org/2115823004/diff/20001/content/browser/devtools/devtools_manager.cc > File content/browser/devtools/devtools_manager.cc (right): > > https://codereview.chromium.org/2115823004/diff/20001/content/browser/devtools/devtools_manager.cc#newcode25 > ...
4 years, 5 months ago (2016-07-08 15:31:13 UTC) #6
ananta
On 2016/07/08 15:31:13, ananta wrote: > On 2016/07/08 14:11:02, ananta wrote: > > > https://codereview.chromium.org/2115823004/diff/20001/content/browser/devtools/devtools_manager.cc ...
4 years, 5 months ago (2016-07-09 19:18:32 UTC) #7
pfeldman
> > Could you instantiate a thread checker in the ::Attach instead? > > Done. ...
4 years, 5 months ago (2016-07-11 20:56:15 UTC) #8
ananta
On 2016/07/11 20:56:15, pfeldman wrote: > > > Could you instantiate a thread checker in ...
4 years, 5 months ago (2016-07-13 11:38:26 UTC) #9
pfeldman
> The taskrunner for the IO thread is passed in via the Attach method. By ...
4 years, 5 months ago (2016-07-13 17:13:57 UTC) #10
pfeldman
https://codereview.chromium.org/2115823004/diff/100001/content/browser/loader/netlog_observer.cc File content/browser/loader/netlog_observer.cc (right): https://codereview.chromium.org/2115823004/diff/100001/content/browser/loader/netlog_observer.cc#newcode52 content/browser/loader/netlog_observer.cc:52: void NetLogObserver::OnAddURLRequestEntry(const net::NetLog::Entry& entry) { nit: seems like this ...
4 years, 5 months ago (2016-07-13 17:17:49 UTC) #11
ananta
https://codereview.chromium.org/2115823004/diff/100001/content/browser/loader/netlog_observer.cc File content/browser/loader/netlog_observer.cc (right): https://codereview.chromium.org/2115823004/diff/100001/content/browser/loader/netlog_observer.cc#newcode52 content/browser/loader/netlog_observer.cc:52: void NetLogObserver::OnAddURLRequestEntry(const net::NetLog::Entry& entry) { On 2016/07/13 17:17:49, pfeldman ...
4 years, 5 months ago (2016-07-13 18:12:26 UTC) #12
pfeldman
Also, you really want a ThreadChecker instead of passing the task runner. https://codereview.chromium.org/2115823004/diff/140001/content/browser/loader/netlog_observer.cc File content/browser/loader/netlog_observer.cc ...
4 years, 5 months ago (2016-07-13 18:16:19 UTC) #13
ananta
https://codereview.chromium.org/2115823004/diff/140001/content/browser/loader/netlog_observer.cc File content/browser/loader/netlog_observer.cc (right): https://codereview.chromium.org/2115823004/diff/140001/content/browser/loader/netlog_observer.cc#newcode185 content/browser/loader/netlog_observer.cc:185: DCHECK(io_thread_task_runner_.Get().get() && On 2016/07/13 18:16:19, pfeldman wrote: > Before ...
4 years, 5 months ago (2016-07-13 18:52:55 UTC) #14
pfeldman
lgtm % comment https://codereview.chromium.org/2115823004/diff/200001/content/browser/loader/netlog_observer.cc File content/browser/loader/netlog_observer.cc (right): https://codereview.chromium.org/2115823004/diff/200001/content/browser/loader/netlog_observer.cc#newcode172 content/browser/loader/netlog_observer.cc:172: io_thread_checker_.Get().release(); .reset, otherwise you leak it.
4 years, 5 months ago (2016-07-13 19:28:09 UTC) #17
ananta
https://codereview.chromium.org/2115823004/diff/200001/content/browser/loader/netlog_observer.cc File content/browser/loader/netlog_observer.cc (right): https://codereview.chromium.org/2115823004/diff/200001/content/browser/loader/netlog_observer.cc#newcode172 content/browser/loader/netlog_observer.cc:172: io_thread_checker_.Get().release(); On 2016/07/13 19:28:09, pfeldman wrote: > .reset, otherwise ...
4 years, 5 months ago (2016-07-13 19:34:58 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2115823004/220001
4 years, 5 months ago (2016-07-13 20:57:59 UTC) #23
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 5 months ago (2016-07-13 21:23:38 UTC) #25
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-13 21:24:23 UTC) #26
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/92e2691c3adb201ba8889d6050ed34cbce8184bf Cr-Commit-Position: refs/heads/master@{#405284}
4 years, 5 months ago (2016-07-13 21:25:17 UTC) #28
jam
update content/browser/loader/DEPS?
4 years, 5 months ago (2016-07-14 20:12:52 UTC) #29
ananta
4 years, 5 months ago (2016-07-14 22:10:47 UTC) #30
Message was sent while issue was closed.
On 2016/07/14 20:12:52, jam wrote:
> update content/browser/loader/DEPS?

Will look when I get back on Monday. It seems like the files removed from the
includes here are still used in other
places in the content/browser/loader directory

Powered by Google App Engine
This is Rietveld 408576698