gfx/angle/src/compiler/preprocessor/Tokenizer.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) 2012 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_TOKENIZER_H_
     8 #define COMPILER_PREPROCESSOR_TOKENIZER_H_
    10 #include "Input.h"
    11 #include "Lexer.h"
    12 #include "pp_utils.h"
    14 namespace pp
    15 {
    17 class Diagnostics;
    19 class Tokenizer : public Lexer
    20 {
    21   public:
    22     struct Context
    23     {
    24         Diagnostics* diagnostics;
    26         Input input;
    27         // The location where yytext points to. Token location should track
    28         // scanLoc instead of Input::mReadLoc because they may not be the same
    29         // if text is buffered up in the scanner input buffer.
    30         Input::Location scanLoc;
    32         bool leadingSpace;
    33         bool lineStart;
    34     };
    35     static const std::size_t kMaxTokenLength;
    37     Tokenizer(Diagnostics* diagnostics);
    38     ~Tokenizer();
    40     bool init(size_t count, const char* const string[], const int length[]);
    42     void setFileNumber(int file);
    43     void setLineNumber(int line);
    45     virtual void lex(Token* token);
    47   private:
    48     PP_DISALLOW_COPY_AND_ASSIGN(Tokenizer);
    49     bool initScanner();
    50     void destroyScanner();
    52     void* mHandle;  // Scanner handle.
    53     Context mContext;  // Scanner extra.
    54 };
    56 }  // namespace pp
    57 #endif  // COMPILER_PREPROCESSOR_TOKENIZER_H_

mercurial