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

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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.

     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