gfx/angle/src/compiler/compiler_debug.cpp

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 //
     2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
     3 // Use of this source code is governed by a BSD-style license that can be
     4 // found in the LICENSE file.
     5 //
     7 // compiler_debug.cpp: Debugging utilities.
     9 #include "compiler/compiler_debug.h"
    11 #include <stdarg.h>
    12 #include <stdio.h>
    14 #include "compiler/InitializeParseContext.h"
    15 #include "compiler/ParseHelper.h"
    17 static const int kTraceBufferLen = 1024;
    19 #ifdef TRACE_ENABLED
    20 extern "C" {
    21 void Trace(const char *format, ...) {
    22     if (!format) return;
    24     TParseContext* parseContext = GetGlobalParseContext();
    25     if (parseContext) {
    26         char buf[kTraceBufferLen];
    27         va_list args;
    28         va_start(args, format);
    29         vsnprintf(buf, kTraceBufferLen, format, args);
    30         va_end(args);
    32         parseContext->trace(buf);
    33     }
    34 }
    35 }  // extern "C"
    36 #endif  // TRACE_ENABLED

mercurial