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

Unified Diff: remoting/host/plugin/host_plugin_logger.cc

Issue 7262015: Conenct Chromoting plugin debug log to JS UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing host logging files Created 9 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/plugin/host_plugin_logger.cc
diff --git a/remoting/client/plugin/pepper_client_logger.cc b/remoting/host/plugin/host_plugin_logger.cc
similarity index 53%
copy from remoting/client/plugin/pepper_client_logger.cc
copy to remoting/host/plugin/host_plugin_logger.cc
index c2fab45ef8b1c972f2f6edb4c852523665f365cb..09cc21df3f77929fe3e4c806d3a6c2f95e6f7ba0 100644
--- a/remoting/client/plugin/pepper_client_logger.cc
+++ b/remoting/host/plugin/host_plugin_logger.cc
@@ -2,31 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/client/plugin/pepper_client_logger.h"
+#include "remoting/host/plugin/host_plugin_logger.h"
#include <stdarg.h> // va_list
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/stringprintf.h"
-#include "remoting/client/plugin/chromoting_instance.h"
+#include "remoting/host/plugin/host_script_object.h"
namespace remoting {
-PepperClientLogger::PepperClientLogger(ChromotingInstance* instance)
- : instance_(instance),
+HostPluginLogger::HostPluginLogger(HostNPScriptObject* scriptable)
+ : scriptable_object_(scriptable),
message_loop_(MessageLoop::current()) {
}
-PepperClientLogger::~PepperClientLogger() {
+HostPluginLogger::~HostPluginLogger() {
}
-// Copied from base/logging.cc.
-const char* const log_severity_names[logging::LOG_NUM_SEVERITIES] = {
- "INFO", "WARNING", "ERROR", "ERROR_REPORT", "FATAL" };
-
-void PepperClientLogger::va_Log(logging::LogSeverity severity,
- const char* format, va_list ap) {
+void HostPluginLogger::va_Log(logging::LogSeverity severity,
+ const char* format, va_list ap) {
DCHECK(severity >= 0 && severity <= logging::LOG_NUM_SEVERITIES);
// Based in LOG_IS_ON macro in base/logging.h.
@@ -39,16 +35,16 @@ void PepperClientLogger::va_Log(logging::LogSeverity severity,
// Send log message to the Chromoting instance so that it can be sent to the
// client UI.
dmac 2011/06/26 14:34:44 fix up comment.
garykac 2011/06/27 21:24:20 Done.
- LogToClientUI(StringPrintf("LOG(%s) %s",
- log_severity_names[severity], message.c_str()));
+ LogToHostUI(StringPrintf("LOG(%s) %s",
+ log_severity_names[severity], message.c_str()));
}
va_end(ap);
}
-void PepperClientLogger::va_VLog(int verboselevel,
- const char* format,
- va_list ap) {
+void HostPluginLogger::va_VLog(int verboselevel,
+ const char* format,
+ va_list ap) {
if (VLOG_IS_ON(verboselevel)) {
std::string message;
base::StringAppendV(&message, format, ap);
@@ -58,19 +54,19 @@ void PepperClientLogger::va_VLog(int verboselevel,
// Send log message to the Chromoting instance so that it can be sent to the
// client UI.
dmac 2011/06/26 14:34:44 fix up comment
garykac 2011/06/27 21:24:20 Done.
- LogToClientUI(StringPrintf("VLOG(%d) %s", verboselevel, message.c_str()));
+ LogToHostUI(StringPrintf("VLOG(%d) %s", verboselevel, message.c_str()));
}
}
-void PepperClientLogger::LogToClientUI(const std::string& message) {
+void HostPluginLogger::LogToHostUI(const std::string& message) {
if (message_loop_ != MessageLoop::current()) {
message_loop_->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &PepperClientLogger::LogToClientUI, message));
+ NewRunnableMethod(this, &HostPluginLogger::LogToHostUI, message));
return;
}
- instance_->GetScriptableObject()->LogDebugInfo(message);
+ scriptable_object_->LogDebugInfo(message);
}
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698