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

Issue 8527011: The chromoting client sends simple logging to the server. (Closed)

Created:
9 years, 1 month ago by simonmorris
Modified:
9 years, 1 month ago
Reviewers:
Wez, Jamie
CC:
chromium-reviews, jamiewalch+watch_chromium.org, hclam+watch_chromium.org, simonmorris+watch_chromium.org, wez+watch_chromium.org, dmaclach+watch_chromium.org, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, ajwong+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

The chromoting client sends simple logging to the server. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=109712

Patch Set 1 #

Total comments: 26

Patch Set 2 : Review. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+349 lines, -1 line) Patch
M remoting/remoting.gyp View 1 2 chunks +2 lines, -0 lines 0 comments Download
M remoting/webapp/me2mom/choice.html View 1 1 chunk +2 lines, -0 lines 0 comments Download
M remoting/webapp/me2mom/client_session.js View 2 chunks +2 lines, -1 line 0 comments Download
A remoting/webapp/me2mom/log_to_server.js View 1 1 chunk +60 lines, -0 lines 1 comment Download
A remoting/webapp/me2mom/server_log_entry.js View 1 1 chunk +283 lines, -0 lines 1 comment Download

Messages

Total messages: 5 (0 generated)
simonmorris
PTAL
9 years, 1 month ago (2011-11-10 22:44:02 UTC) #1
Jamie
http://codereview.chromium.org/8527011/diff/1/remoting/webapp/me2mom/log_to_server.js File remoting/webapp/me2mom/log_to_server.js (right): http://codereview.chromium.org/8527011/diff/1/remoting/webapp/me2mom/log_to_server.js#newcode23 remoting/webapp/me2mom/log_to_server.js:23: remoting.LogToServer.prototype.VALUE_EVENT_NAME_SESSION_STATE = 'session-state'; Is it worth tagging these as ...
9 years, 1 month ago (2011-11-10 23:27:42 UTC) #2
Wez
http://codereview.chromium.org/8527011/diff/1/remoting/webapp/me2mom/log_to_server.js File remoting/webapp/me2mom/log_to_server.js (right): http://codereview.chromium.org/8527011/diff/1/remoting/webapp/me2mom/log_to_server.js#newcode141 remoting/webapp/me2mom/log_to_server.js:141: remoting.wcs.sendIq(stanza); If we're unable to send the stanza then ...
9 years, 1 month ago (2011-11-11 01:41:04 UTC) #3
simonmorris
PTAL http://codereview.chromium.org/8527011/diff/1/remoting/webapp/me2mom/log_to_server.js File remoting/webapp/me2mom/log_to_server.js (right): http://codereview.chromium.org/8527011/diff/1/remoting/webapp/me2mom/log_to_server.js#newcode23 remoting/webapp/me2mom/log_to_server.js:23: remoting.LogToServer.prototype.VALUE_EVENT_NAME_SESSION_STATE = 'session-state'; On 2011/11/10 23:27:43, Jamie wrote: ...
9 years, 1 month ago (2011-11-11 17:11:23 UTC) #4
Jamie
9 years, 1 month ago (2011-11-11 19:08:40 UTC) #5
Regarding the "private method" vs. "scoped global function" question, I think
it's largely philosophical so if you disagree, I'm not going to force the issue.
However, FWIW, I try to think how I'd do the same thing in C++. I always like to
keep my .h files small, so any function that doesn't act on an object's internal
state tends to get demoted to a static function in the corresponding .cxx file.
In Javascript we don't quite have the same separation, so it's less valuable,
but that's my reasoning.

Apart from that, LGTM.

http://codereview.chromium.org/8527011/diff/1/remoting/webapp/me2mom/log_to_s...
File remoting/webapp/me2mom/log_to_server.js (right):

http://codereview.chromium.org/8527011/diff/1/remoting/webapp/me2mom/log_to_s...
remoting/webapp/me2mom/log_to_server.js:203:
remoting.LogToServer.prototype.getHostData = function() {
On 2011/11/11 17:11:23, simonmorris wrote:
> On 2011/11/10 23:27:43, Jamie wrote:
> > This doesn't need to be a member function. Better to make it a simple
function
> > inside an enclosing anonymising function.
> 
> I don't understand why that would be better. Maybe this
> comment has been addressed by having a separate
> ServerLogEntry class?

I just meant that you don't need a LogToServer object in order to find out what
the local navigator info is. If it's something specific to this class, then it
belongs in this file, but making it a global function, scoped by an anonymous
function keeps it private.

The new implementation inside ServerLogEntry doesn't really address the problem,
although since that's a smaller class it bothers me less.

http://codereview.chromium.org/8527011/diff/1/remoting/webapp/me2mom/log_to_s...
remoting/webapp/me2mom/log_to_server.js:214:
remoting.LogToServer.prototype.extractHostDataFrom = function(s) {
On 2011/11/11 17:11:23, simonmorris wrote:
> On 2011/11/10 23:27:43, Jamie wrote:
> > Ditto. In fact, unless it's called with anything other than
> navigator.userAgent,
> > it can probably just be merged into getHostData.
> 
> When I tested the code, it was called with the strings
> listed in the next comment. When we get unit tests,
> they will call this function.
> 

Fair point, thanks for clarifying.

http://codereview.chromium.org/8527011/diff/4001/remoting/webapp/me2mom/log_t...
File remoting/webapp/me2mom/log_to_server.js (right):

http://codereview.chromium.org/8527011/diff/4001/remoting/webapp/me2mom/log_t...
remoting/webapp/me2mom/log_to_server.js:30: var entry =
remoting.ServerLogEntry.prototype.makeClientSessionStateChange(
If this is effectively a static function, there's no need to add it to the
prototype. I was actually thinking along the lines of a constructor function,
but since we'd want to overload it, a static factory method is probably cleaner.

http://codereview.chromium.org/8527011/diff/4001/remoting/webapp/me2mom/serve...
File remoting/webapp/me2mom/server_log_entry.js (right):

http://codereview.chromium.org/8527011/diff/4001/remoting/webapp/me2mom/serve...
remoting/webapp/me2mom/server_log_entry.js:42:
remoting.ServerLogEntry.prototype.getValueForSessionState = function(state) {
This also doesn't need to be a member function.

Powered by Google App Engine
This is Rietveld 408576698