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

Issue 10152007: Get host id via getDaemonConfig. (Closed)

Created:
8 years, 8 months ago by Jamie
Modified:
8 years, 8 months ago
Reviewers:
simonmorris
CC:
chromium-reviews, jamiewalch+watch_chromium.org, dcaiafa+watch_chromium.org, simonmorris+watch_chromium.org, hclam+watch_chromium.org, wez+watch_chromium.org, amit, sanjeevr, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, alexeypa+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

Get host id via getDaemonConfig. BUG=121518 TEST= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=133509

Patch Set 1 #

Total comments: 2

Patch Set 2 : Don't bother checking for the existence of 'host-id'. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -15 lines) Patch
M remoting/webapp/host_controller.js View 1 3 chunks +15 lines, -15 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Jamie
This is the web-app logic to get the host id from the host plugin. It ...
8 years, 8 months ago (2012-04-19 23:58:43 UTC) #1
simonmorris
lgtm after one comment is addressed. http://codereview.chromium.org/10152007/diff/1/remoting/webapp/host_controller.js File remoting/webapp/host_controller.js (right): http://codereview.chromium.org/10152007/diff/1/remoting/webapp/host_controller.js#newcode313 remoting/webapp/host_controller.js:313: var hostId = ...
8 years, 8 months ago (2012-04-23 17:29:18 UTC) #2
Jamie
8 years, 8 months ago (2012-04-23 20:24:24 UTC) #3
fyi

https://chromiumcodereview.appspot.com/10152007/diff/1/remoting/webapp/host_c...
File remoting/webapp/host_controller.js (right):

https://chromiumcodereview.appspot.com/10152007/diff/1/remoting/webapp/host_c...
remoting/webapp/host_controller.js:313: var hostId = config['host_id'];
On 2012/04/23 17:29:18, simonmorris wrote:
> It's less repetitive to test for hostId not being undefined. I think 'if
> (hostId) { ... }' can replace the previous 'if'. For optional awesomeness,
make
> getHostForId map undefined to null, and remove the 'if' entirely.

I want to check that host_id is a string, but you're right that there's no need
for an existence-check so I've removed that. I'm not sure I like the idea of
making getHostForId check for undefined, if only because it would effectively
make the hostId parameter optional (at least from a JSDoc point-of-view) and we
don't want that.

Of course, this is largely moot because getHostForId will return NULL for
anything the 'if' filters, and it's hard to imagine it ever doing anything else,
but I'd rather not rely on that.

Powered by Google App Engine
This is Rietveld 408576698