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

Issue 8468015: The host sends simple log entries to the server. (Closed)

Created:
9 years, 1 month ago by simonmorris
Modified:
9 years, 1 month ago
Reviewers:
Sergey Ulanov
CC:
chromium-reviews, jamiewalch+watch_chromium.org, hclam+watch_chromium.org, simonmorris+watch_chromium.org, wez+watch_chromium.org, Paweł Hajdan Jr., dmaclach+watch_chromium.org, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, ajwong+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

The host sends simple log entries to the server. BUG= TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=111239

Patch Set 1 #

Patch Set 2 : Trybots. #

Patch Set 3 : Mac trybot. #

Total comments: 36

Patch Set 4 : Review. #

Total comments: 24

Patch Set 5 : Review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+530 lines, -3 lines) Patch
A remoting/host/log_to_server.h View 1 2 3 4 1 chunk +63 lines, -0 lines 0 comments Download
A remoting/host/log_to_server.cc View 1 2 3 4 1 chunk +97 lines, -0 lines 0 comments Download
A remoting/host/log_to_server_unittest.cc View 1 2 3 4 1 chunk +93 lines, -0 lines 0 comments Download
M remoting/host/plugin/host_script_object.h View 1 2 3 3 chunks +6 lines, -1 line 0 comments Download
M remoting/host/plugin/host_script_object.cc View 1 2 3 4 2 chunks +6 lines, -1 line 0 comments Download
A remoting/host/server_log_entry.h View 1 2 3 4 1 chunk +45 lines, -0 lines 0 comments Download
A remoting/host/server_log_entry.cc View 1 2 3 4 1 chunk +103 lines, -0 lines 0 comments Download
A remoting/host/server_log_entry_unittest.cc View 1 2 3 4 1 chunk +105 lines, -0 lines 0 comments Download
M remoting/host/simple_host_process.cc View 1 2 3 4 chunks +5 lines, -0 lines 0 comments Download
M remoting/remoting.gyp View 1 2 3 4 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
simonmorris
PTAL
9 years, 1 month ago (2011-11-15 23:00:04 UTC) #1
Sergey Ulanov
http://codereview.chromium.org/8468015/diff/3001/remoting/host/log_to_server.cc File remoting/host/log_to_server.cc (right): http://codereview.chromium.org/8468015/diff/3001/remoting/host/log_to_server.cc#newcode24 remoting/host/log_to_server.cc:24: } // namespace http://codereview.chromium.org/8468015/diff/3001/remoting/host/log_to_server.cc#newcode67 remoting/host/log_to_server.cc:67: if (!message_loop_->BelongsToCurrentThread()) { Currently ...
9 years, 1 month ago (2011-11-17 01:16:33 UTC) #2
simonmorris
PTAL http://codereview.chromium.org/8468015/diff/3001/remoting/host/log_to_server.cc File remoting/host/log_to_server.cc (right): http://codereview.chromium.org/8468015/diff/3001/remoting/host/log_to_server.cc#newcode24 remoting/host/log_to_server.cc:24: } On 2011/11/17 01:16:33, sergeyu wrote: > // ...
9 years, 1 month ago (2011-11-18 19:23:04 UTC) #3
Sergey Ulanov
LGTM, but please see my nits. http://codereview.chromium.org/8468015/diff/3001/remoting/host/log_to_server.cc File remoting/host/log_to_server.cc (right): http://codereview.chromium.org/8468015/diff/3001/remoting/host/log_to_server.cc#newcode67 remoting/host/log_to_server.cc:67: if (!message_loop_->BelongsToCurrentThread()) { ...
9 years, 1 month ago (2011-11-22 02:01:43 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonmorris@chromium.org/8468015/18001
9 years, 1 month ago (2011-11-22 21:00:14 UTC) #5
commit-bot: I haz the power
Change committed as 111239
9 years, 1 month ago (2011-11-22 22:48:58 UTC) #6
simonmorris
9 years, 1 month ago (2011-11-22 23:27:35 UTC) #7
FYI

http://codereview.chromium.org/8468015/diff/3001/remoting/host/log_to_server.cc
File remoting/host/log_to_server.cc (right):

http://codereview.chromium.org/8468015/diff/3001/remoting/host/log_to_server....
remoting/host/log_to_server.cc:67: if (!message_loop_->BelongsToCurrentThread())
{
On 2011/11/22 02:01:43, sergeyu wrote:
> On 2011/11/18 19:23:04, simonmorris wrote:
> > On 2011/11/17 01:16:33, sergeyu wrote:
> > > Currently this method is called only on network thread. So I don't think
we
> > > really need this trampoline, and probably won't need it in the future.
> > 
> > Is it very unlikely that we'll ever want to log an event from another
thread?
> > If not, I think the cost of the trampoline is very low compared to the cost
> > of getting threading wrong.
> 
> There is no risk in not having this trampoline as long as you add DCHECK to
> verify that this method runs on correct thread, e.g. as in
> OnSignallingConnected().
> We get most of events on the network thread, so probably we will not need to
log
> anything from other threads.  In any case, calling code can jump to network
> thread if it needs to.
> Code gets hard to maintain when threading is mixed with other logic, so when
it
> comes to threading, I'd like each class falls in one of the following
> categories:
>  1. Non ref-counted classes that always run on the same thread (preferably
> marked as NonThreadSafe).
>  2. Ref-counted, thread-safe objects that may jump from one thread to another,
> but don't contain much logic beside that.
> This approach allows to separate threading details from everything else.
> This particular class falls in the first category. If we ever need to log
> something from other threads we can add LogToServerProxy that would know how
to
> switch threads.

Sounds like a good pattern.

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/log_to_server...
File remoting/host/log_to_server_unittest.cc (right):

http://codereview.chromium.org/8468015/diff/11001/remoting/host/log_to_server...
remoting/host/log_to_server_unittest.cc:24: }
On 2011/11/22 02:01:43, sergeyu wrote:
> // namespace 

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/plugin/host_s...
File remoting/host/plugin/host_script_object.cc (right):

http://codereview.chromium.org/8468015/diff/11001/remoting/host/plugin/host_s...
remoting/host/plugin/host_script_object.cc:516: if (enable_log_to_server_) {
On 2011/11/22 02:01:43, sergeyu wrote:
> nit: please remove brackets for consistency with other code in this file.

Merged with another if, so braces are now needed.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/plugin/host_s...
remoting/host/plugin/host_script_object.cc:527: if (log_to_server_.get()) {
On 2011/11/22 02:01:43, sergeyu wrote:
> nit: I think you can merge this if and the previous one together.

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
File remoting/host/server_log_entry.h (right):

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
remoting/host/server_log_entry.h:33: typedef std::map<std::string, std::string>
KeyValuePairs;
On 2011/11/22 02:01:43, sergeyu wrote:
> nit: ValuesMap?

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
remoting/host/server_log_entry.h:36: void Set(const char* key, const char*
value);
On 2011/11/22 02:01:43, sergeyu wrote:
> nit: Should this be public

No. This way the ServerLogEntry class controls the set of
keys and values that can be used, which makes it easier to
verify that only keys and values compatible with the
backend will be used.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
File remoting/host/server_log_entry_unittest.cc (right):

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
remoting/host/server_log_entry_unittest.cc:21: static bool verifyStanza(
On 2011/11/22 02:01:43, sergeyu wrote:
> nit:VerifyStanza

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
remoting/host/server_log_entry_unittest.cc:22: const std::map<std::string,
std::string>& keyValuePairs,
On 2011/11/22 02:01:43, sergeyu wrote:
> nit:key_value_pair

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
remoting/host/server_log_entry_unittest.cc:31: + attr->Name().Namespace();
On 2011/11/22 02:01:43, sergeyu wrote:
> nit: + must be on the previous line. We have different rules for operator
> wrapping in C++ and Java :(

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
remoting/host/server_log_entry_unittest.cc:46: + ": expected " + value;
On 2011/11/22 02:01:43, sergeyu wrote:
> nit: + must be on the previous line.

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
remoting/host/server_log_entry_unittest.cc:51: int attrCountExpected =
keyValuePairs.size() + keys.size();
On 2011/11/22 02:01:43, sergeyu wrote:
> attr_count_expected

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
remoting/host/server_log_entry_unittest.cc:68: std::map<std::string,
std::string> keyValuePairs;
On 2011/11/22 02:01:43, sergeyu wrote:
> not: key_value_pairs

Done.

http://codereview.chromium.org/8468015/diff/11001/remoting/host/server_log_en...
remoting/host/server_log_entry_unittest.cc:82: std::map<std::string,
std::string> keyValuePairs;
On 2011/11/22 02:01:43, sergeyu wrote:
> same here

Done.

Powered by Google App Engine
This is Rietveld 408576698