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

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

Issue 7648042: Change Chromoting logger to be setup in plugin's NP_Initialize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove comment Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_scriptable_object.h" 5 #include "remoting/client/plugin/chromoting_scriptable_object.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 // TODO(wez): Remove this when crbug.com/86353 is complete. 9 // TODO(wez): Remove this when crbug.com/86353 is complete.
10 #include "ppapi/cpp/private/var_private.h" 10 #include "ppapi/cpp/private/var_private.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 void ChromotingScriptableObject::LogDebugInfo(const std::string& info) { 247 void ChromotingScriptableObject::LogDebugInfo(const std::string& info) {
248 Var exception; 248 Var exception;
249 VarPrivate cb = GetProperty(Var(kDebugInfo), &exception); 249 VarPrivate cb = GetProperty(Var(kDebugInfo), &exception);
250 250
251 // Var() means call the object directly as a function rather than calling 251 // Var() means call the object directly as a function rather than calling
252 // a method in the object. 252 // a method in the object.
253 cb.Call(Var(), Var(info), &exception); 253 cb.Call(Var(), Var(info), &exception);
254 254
255 if (!exception.is_undefined()) { 255 if (!exception.is_undefined()) {
256 LOG(WARNING) << "Exception when invoking debugInfo JS callback: " 256 // Note that we cannot use LOG here because we're currently in the middle
257 << exception.DebugString(); 257 // of handling a LOG message.
Wez 2011/08/30 05:20:02 We've got a check that prevents recursive calling
garykac 2011/08/31 00:59:00 The previous checks didn't work because they were
258 printf("Exception when invoking debugInfo JS callback: %s\n",
259 exception.DebugString());
258 } 260 }
259 } 261 }
260 262
261 void ChromotingScriptableObject::SetDesktopSize(int width, int height) { 263 void ChromotingScriptableObject::SetDesktopSize(int width, int height) {
262 int width_index = property_names_[kDesktopWidth]; 264 int width_index = property_names_[kDesktopWidth];
263 int height_index = property_names_[kDesktopHeight]; 265 int height_index = property_names_[kDesktopHeight];
264 266
265 if (properties_[width_index].attribute.AsInt() != width || 267 if (properties_[width_index].attribute.AsInt() != width ||
266 properties_[height_index].attribute.AsInt() != height) { 268 properties_[height_index].attribute.AsInt() != height) {
267 properties_[width_index].attribute = Var(width); 269 properties_[width_index].attribute = Var(width);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 const std::vector<pp::Var>& args, pp::Var* exception) { 483 const std::vector<pp::Var>& args, pp::Var* exception) {
482 if (args.size() != 0) { 484 if (args.size() != 0) {
483 *exception = Var("Usage: DoReleaseAllKeys()"); 485 *exception = Var("Usage: DoReleaseAllKeys()");
484 return Var(); 486 return Var();
485 } 487 }
486 instance_->ReleaseAllKeys(); 488 instance_->ReleaseAllKeys();
487 return Var(); 489 return Var();
488 } 490 }
489 491
490 } // namespace remoting 492 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698