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

Issue 666673007: [DevTools] Keep IP address of HttpServer as a member of DevToolsHttpHandlerImpl. (Closed)

Created:
6 years, 2 months ago by byungwoo
Modified:
6 years, 1 month ago
Reviewers:
vkuzkokov, dgozman, pfeldman
CC:
chromium-reviews, vsevik, jam, yurys, paulirish+reviews_chromium.org, darin-cc_chromium.org, devtools-reviews_chromium.org, aandrey+blink_chromium.org, pfeldman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

[DevTools] Keep IP address of HttpServer as a member of DevToolsHttpHandlerImpl. Fix the problem that loading inspector from content_shell is failing with thread_checker_.CalledOnValidThread() failed. At ShellDevToolsFrontend::Show(), DevToolsHttpHandlerImpl::GetFrontendURL() is called to get the frontend url, and inside the function, HttpServer::GetLocalAddress() is called directly which is expected to be called on the DevToolsHandler thread only. To prevent the DCHECK failure, this patch keeps the ip address of HttpServer as a member of DevToolsHttpHandlerImpl instance and use it. BUG=425423 Committed: https://crrev.com/9fd9f0a04570cefb62b18bdac864636fc7e05026 Cr-Commit-Position: refs/heads/master@{#301684}

Patch Set 1 #

Patch Set 2 : Move the server_ip_address declaration next to the server_ #

Total comments: 2

Patch Set 3 : Added a lock for server_ip_address_. #

Total comments: 2

Patch Set 4 : post ip_address to UI thread. #

Patch Set 5 : Remove unnecessary forward declaration. #

Total comments: 1

Patch Set 6 : clear server_ip_address_ at Teardown. #

Patch Set 7 : Move server_ip_address_.reset() from Teardown to StopHandlerThread #

Patch Set 8 : Move server_ip_address_.reset() to ResetHandlerThread() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -4 lines) Patch
M content/browser/devtools/devtools_http_handler_impl.h View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/devtools/devtools_http_handler_impl.cc View 1 2 3 4 5 6 7 4 chunks +15 lines, -4 lines 0 comments Download

Messages

Total messages: 31 (8 generated)
pfeldman
It still has a race since the server address is assigned on one thread and ...
6 years, 2 months ago (2014-10-21 11:32:47 UTC) #3
byungwoo
On 2014/10/21 11:32:47, pfeldman wrote: > It still has a race since the server address ...
6 years, 2 months ago (2014-10-21 11:52:02 UTC) #4
byungwoo
I updated the patch with adding lock for the server_ip_address_. Please take a look again ...
6 years, 2 months ago (2014-10-22 00:51:50 UTC) #5
vkuzkokov
https://codereview.chromium.org/666673007/diff/40001/content/browser/devtools/devtools_http_handler_impl.cc File content/browser/devtools/devtools_http_handler_impl.cc (right): https://codereview.chromium.org/666673007/diff/40001/content/browser/devtools/devtools_http_handler_impl.cc#newcode799 content/browser/devtools/devtools_http_handler_impl.cc:799: base::AutoLock locked(server_ip_address_lock_); Use of locks is very limited in ...
6 years, 2 months ago (2014-10-22 13:20:03 UTC) #7
byungwoo
https://codereview.chromium.org/666673007/diff/40001/content/browser/devtools/devtools_http_handler_impl.cc File content/browser/devtools/devtools_http_handler_impl.cc (right): https://codereview.chromium.org/666673007/diff/40001/content/browser/devtools/devtools_http_handler_impl.cc#newcode799 content/browser/devtools/devtools_http_handler_impl.cc:799: base::AutoLock locked(server_ip_address_lock_); On 2014/10/22 13:20:03, vkuzkokov wrote: > Use ...
6 years, 2 months ago (2014-10-23 02:10:20 UTC) #8
byungwoo
Could you please take a look?
6 years, 1 month ago (2014-10-27 00:43:49 UTC) #9
vkuzkokov
https://codereview.chromium.org/666673007/diff/80001/content/browser/devtools/devtools_http_handler_impl.cc File content/browser/devtools/devtools_http_handler_impl.cc (right): https://codereview.chromium.org/666673007/diff/80001/content/browser/devtools/devtools_http_handler_impl.cc#newcode830 content/browser/devtools/devtools_http_handler_impl.cc:830: thread_->message_loop()->PostTask( It seems like you could clear server_ip_address_ at ...
6 years, 1 month ago (2014-10-27 09:51:44 UTC) #10
byungwoo
On 2014/10/27 09:51:44, vkuzkokov wrote: > https://codereview.chromium.org/666673007/diff/80001/content/browser/devtools/devtools_http_handler_impl.cc#newcode830 > content/browser/devtools/devtools_http_handler_impl.cc:830: > thread_->message_loop()->PostTask( > It seems like ...
6 years, 1 month ago (2014-10-27 10:51:55 UTC) #11
vkuzkokov
On 2014/10/27 10:51:55, byungwoo wrote: > On 2014/10/27 09:51:44, vkuzkokov wrote: > > > https://codereview.chromium.org/666673007/diff/80001/content/browser/devtools/devtools_http_handler_impl.cc#newcode830 ...
6 years, 1 month ago (2014-10-27 11:31:58 UTC) #12
byungwoo
On 2014/10/27 11:31:58, vkuzkokov wrote: > On 2014/10/27 10:51:55, byungwoo wrote: > > On 2014/10/27 ...
6 years, 1 month ago (2014-10-27 11:48:26 UTC) #13
vkuzkokov
lgtm
6 years, 1 month ago (2014-10-27 13:09:58 UTC) #14
pfeldman
lgtm
6 years, 1 month ago (2014-10-27 13:43:01 UTC) #15
vkuzkokov
On 2014/10/27 13:09:58, vkuzkokov wrote: > lgtm My bad: StopHandlerThread doesn't run on UI - ...
6 years, 1 month ago (2014-10-27 13:52:00 UTC) #16
byungwoo
On 2014/10/27 13:52:00, vkuzkokov wrote: > So server_ip_address_ should be cleared even earlier: from Stop ...
6 years, 1 month ago (2014-10-27 15:31:32 UTC) #17
vkuzkokov
On 2014/10/27 15:31:32, byungwoo wrote: > On 2014/10/27 13:52:00, vkuzkokov wrote: > > So server_ip_address_ ...
6 years, 1 month ago (2014-10-27 15:36:27 UTC) #18
byungwoo
On 2014/10/27 15:36:27, vkuzkokov wrote: > On 2014/10/27 15:31:32, byungwoo wrote: > > On 2014/10/27 ...
6 years, 1 month ago (2014-10-27 15:53:01 UTC) #19
vkuzkokov
On 2014/10/27 15:53:01, byungwoo wrote: > On 2014/10/27 15:36:27, vkuzkokov wrote: > > On 2014/10/27 ...
6 years, 1 month ago (2014-10-27 15:55:47 UTC) #20
vkuzkokov
If you are ready to commit this feel free to do so.
6 years, 1 month ago (2014-10-28 15:57:11 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/666673007/140001
6 years, 1 month ago (2014-10-28 16:09:55 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_dbg/builds/12182) linux_chromium_gn_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_rel/builds/28911)
6 years, 1 month ago (2014-10-28 16:28:01 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/666673007/140001
6 years, 1 month ago (2014-10-28 18:22:18 UTC) #29
commit-bot: I haz the power
Committed patchset #8 (id:140001)
6 years, 1 month ago (2014-10-28 19:23:17 UTC) #30
commit-bot: I haz the power
6 years, 1 month ago (2014-10-28 19:24:02 UTC) #31
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/9fd9f0a04570cefb62b18bdac864636fc7e05026
Cr-Commit-Position: refs/heads/master@{#301684}

Powered by Google App Engine
This is Rietveld 408576698