Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
2 /*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
11 #include "SkTypes.h"
13 static const size_t kBufferSize = 2048;
15 #include <stdarg.h>
16 #include <stdio.h>
18 #include "ppapi/cpp/instance.h"
19 #include "ppapi/cpp/var.h"
21 extern pp::Instance* gPluginInstance;
23 namespace {
24 static const char* kLogPrefix = "SkDebugf:";
25 }
27 void SkDebugf(const char format[], ...) {
28 if (gPluginInstance) {
29 char buffer[kBufferSize + 1];
30 va_list args;
31 va_start(args, format);
32 sprintf(buffer, kLogPrefix);
33 vsnprintf(buffer + strlen(kLogPrefix), kBufferSize, format, args);
34 va_end(args);
35 pp::Var msg = pp::Var(buffer);
36 gPluginInstance->PostMessage(msg);
37 }
38 }