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

Issue 140553005: Add Windows utillity function to verify if a computer is part of a domain. (Closed)

Created:
6 years, 11 months ago by pastarmovj
Modified:
6 years, 10 months ago
Reviewers:
cpu_(ooo_6.6-7.5), gab
CC:
chromium-reviews, erikwright+watch_chromium.org
Visibility:
Public.

Description

Add Windows utillity function to verify if a computer is part of a domain. BUG=none TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=246600

Patch Set 1 #

Total comments: 5

Patch Set 2 : Addressed the nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -0 lines) Patch
M base/win/win_util.h View 1 chunk +3 lines, -0 lines 0 comments Download
M base/win/win_util.cc View 1 2 chunks +11 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
pastarmovj
Hi Carlos, After verifying that this check returns reasonable results we would like to start ...
6 years, 11 months ago (2014-01-21 14:41:46 UTC) #1
gab
Thanks! Some run-by nits. https://codereview.chromium.org/140553005/diff/1/base/win/win_util.cc File base/win/win_util.cc (right): https://codereview.chromium.org/140553005/diff/1/base/win/win_util.cc#newcode362 base/win/win_util.cc:362: if(NERR_Success != ::NetGetJoinInformation(NULL, &domain, &join_status)) ...
6 years, 11 months ago (2014-01-21 15:04:53 UTC) #2
pastarmovj
Thanks for the drive-by! :) https://codereview.chromium.org/140553005/diff/1/base/win/win_util.cc File base/win/win_util.cc (right): https://codereview.chromium.org/140553005/diff/1/base/win/win_util.cc#newcode362 base/win/win_util.cc:362: if(NERR_Success != ::NetGetJoinInformation(NULL, &domain, ...
6 years, 11 months ago (2014-01-21 15:30:30 UTC) #3
cpu_(ooo_6.6-7.5)
is the dll we are calling delay loaded? Are we going to call this at ...
6 years, 11 months ago (2014-01-22 00:18:47 UTC) #4
pastarmovj
It is delay-loaded according to the dependency walker. The function I call is in netapi32.dll. ...
6 years, 11 months ago (2014-01-22 08:48:03 UTC) #5
gab
On 2014/01/22 08:48:03, pastarmovj wrote: > It is delay-loaded according to the dependency walker. The ...
6 years, 11 months ago (2014-01-22 14:04:47 UTC) #6
cpu_(ooo_6.6-7.5)
code lgtm put please don't regress startup time. My guess is that this call is ...
6 years, 11 months ago (2014-01-22 20:31:02 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pastarmovj@chromium.org/140553005/90001
6 years, 11 months ago (2014-01-23 13:59:02 UTC) #8
commit-bot: I haz the power
Change committed as 246600
6 years, 11 months ago (2014-01-23 15:40:22 UTC) #9
gab
On 2014/01/22 20:31:02, cpu wrote: > code lgtm put please don't regress startup time. My ...
6 years, 10 months ago (2014-02-07 21:47:18 UTC) #10
pastarmovj
On 2014/02/07 21:47:18, gab wrote: > On 2014/01/22 20:31:02, cpu wrote: > > code lgtm ...
6 years, 10 months ago (2014-02-07 22:18:12 UTC) #11
gab
6 years, 10 months ago (2014-02-07 23:05:15 UTC) #12
Message was sent while issue was closed.
On 2014/02/07 22:18:12, pastarmovj wrote:
> On 2014/02/07 21:47:18, gab wrote:
> > On 2014/01/22 20:31:02, cpu wrote:
> > > code lgtm put please don't regress startup time. My guess is that this
call
> is
> > > going to do a sync ipc to csrss or another service.
> > 
> > Follow-up here; this is now on the startup path (added by Julian in
> > crrev.com/248957).
> > 
> > I just timed this via TRACE_EVENT in a Release build on my Z620; the first
> call
> > to IsEnrolledToDomain takes 0.38ms and follow-up calls are ~0.16ms (there
are
> 4
> > calls total on startup in my build -- should the caller re-use the result
> rather
> > than call this API multiple times?).
> > 
> > I also need to call this on startup, I would make this call later than the
> > current calls; I'm on another thread so caching from the original call
doesn't
> > make sense here. My call also takes ~0.16ms.
> > 
> > So only the first call is a bit longer (initializing the DLL I guess?).
> > 
> > @cpu: if it looks sane on my machine any worries with performance on
lower-end
> > machines?
> 
> There is a CL in review to cache the results after the first call. We were
> discussing the need for thread safety but with these numbers maybe we don't
need
> to prematurely optimize?

I still think it's worth caching the result on the caller side; making an API
call is still very slow (3.7 million CPU cycles as analyzed by SyzyProf for
these 4 calls... 1.7 million of which are in the first call -- whereas checking
a bool is 1 cycle!).

I don't think it should be cached as a static in IsEnrolledDomain() or anything,
then there are thread-safety concerns (i.e., I know for sure that I need this on
another thread than the one you're originally calling it on).

After discussing with cpu offline; since you merged to beta, you should keep an
eye on the beta stats for Startup.BrowserMessageLoopStartTime:
https://uma.googleplex.com/timeline/#metric=Startup.BrowserMessageLoopStartTi...

The next beta won't contain a big diff and if this spikes, we'll know it's
related to your change (i.e. it's very fast on my machine, but perhaps in some
configurations it's very slow -- we should look not to affect the 90'th or even
99'th percentile with this (especially since we don't get much stats from
enterprise configurations which are likely to be hit the hardest out of anybody
else by this...).

Cheers!
Gab

Powered by Google App Engine
This is Rietveld 408576698