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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix installation_validator_unittest Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/tools/stress_cache/stress_cache.cc ('k') | remoting/host/logging_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/client/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <nacl_io/nacl_io.h> 7 #include <nacl_io/nacl_io.h>
8 #include <sys/mount.h> 8 #include <sys/mount.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 data->SetDouble("maxRoundtripLatency", perf_tracker_.round_trip_ms().Max()); 1027 data->SetDouble("maxRoundtripLatency", perf_tracker_.round_trip_ms().Max());
1028 PostLegacyJsonMessage("onPerfStats", std::move(data)); 1028 PostLegacyJsonMessage("onPerfStats", std::move(data));
1029 } 1029 }
1030 1030
1031 // static 1031 // static
1032 void ChromotingInstance::RegisterLogMessageHandler() { 1032 void ChromotingInstance::RegisterLogMessageHandler() {
1033 base::AutoLock lock(g_logging_lock.Get()); 1033 base::AutoLock lock(g_logging_lock.Get());
1034 1034
1035 // Set up log message handler. 1035 // Set up log message handler.
1036 // This is not thread-safe so we need it within our lock. 1036 // This is not thread-safe so we need it within our lock.
1037 logging::SetLogMessageHandler(&LogToUI); 1037 logging::PushLogMessageHandler(&LogToUI);
Dan Beam 2016/06/09 18:52:50 does this call ever need to be balanced by a PopLo
wychen 2016/06/09 21:04:17 I was a bit curious when I changed this. The handl
1038 } 1038 }
1039 1039
1040 void ChromotingInstance::RegisterLoggingInstance() { 1040 void ChromotingInstance::RegisterLoggingInstance() {
1041 base::AutoLock lock(g_logging_lock.Get()); 1041 base::AutoLock lock(g_logging_lock.Get());
1042 g_logging_instance = pp_instance(); 1042 g_logging_instance = pp_instance();
1043 } 1043 }
1044 1044
1045 void ChromotingInstance::UnregisterLoggingInstance() { 1045 void ChromotingInstance::UnregisterLoggingInstance() {
1046 base::AutoLock lock(g_logging_lock.Get()); 1046 base::AutoLock lock(g_logging_lock.Get());
1047 1047
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 if (is_custom_counts_histogram) { 1118 if (is_custom_counts_histogram) {
1119 uma.HistogramCustomCounts(histogram_name, value, histogram_min, 1119 uma.HistogramCustomCounts(histogram_name, value, histogram_min,
1120 histogram_max, histogram_buckets); 1120 histogram_max, histogram_buckets);
1121 } else { 1121 } else {
1122 uma.HistogramCustomTimes(histogram_name, value, histogram_min, 1122 uma.HistogramCustomTimes(histogram_name, value, histogram_min,
1123 histogram_max, histogram_buckets); 1123 histogram_max, histogram_buckets);
1124 } 1124 }
1125 } 1125 }
1126 1126
1127 } // namespace remoting 1127 } // namespace remoting
OLDNEW
« no previous file with comments | « net/tools/stress_cache/stress_cache.cc ('k') | remoting/host/logging_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698