gfx/angle/src/compiler/preprocessor/Preprocessor.h

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) 2011 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 #ifndef COMPILER_PREPROCESSOR_PREPROCESSOR_H_
     8 #define COMPILER_PREPROCESSOR_PREPROCESSOR_H_
    10 #include <stddef.h>
    12 #include "pp_utils.h"
    14 namespace pp
    15 {
    17 class Diagnostics;
    18 class DirectiveHandler;
    19 struct PreprocessorImpl;
    20 struct Token;
    22 class Preprocessor
    23 {
    24   public:
    25     Preprocessor(Diagnostics* diagnostics, DirectiveHandler* directiveHandler);
    26     ~Preprocessor();
    28     // count: specifies the number of elements in the string and length arrays.
    29     // string: specifies an array of pointers to strings.
    30     // length: specifies an array of string lengths.
    31     // If length is NULL, each string is assumed to be null terminated.
    32     // If length is a value other than NULL, it points to an array containing
    33     // a string length for each of the corresponding elements of string.
    34     // Each element in the length array may contain the length of the
    35     // corresponding string or a value less than 0 to indicate that the string
    36     // is null terminated.
    37     bool init(size_t count, const char* const string[], const int length[]);
    38     // Adds a pre-defined macro.
    39     void predefineMacro(const char* name, int value);
    41     void lex(Token* token);
    43   private:
    44     PP_DISALLOW_COPY_AND_ASSIGN(Preprocessor);
    46     PreprocessorImpl* mImpl;
    47 };
    49 }  // namespace pp
    50 #endif  // COMPILER_PREPROCESSOR_PREPROCESSOR_H_

mercurial