Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
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 }