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.
michael@0 | 1 | // |
michael@0 | 2 | // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. |
michael@0 | 3 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | // found in the LICENSE file. |
michael@0 | 5 | // |
michael@0 | 6 | |
michael@0 | 7 | #ifndef COMPILER_PREPROCESSOR_DIAGNOSTICS_H_ |
michael@0 | 8 | #define COMPILER_PREPROCESSOR_DIAGNOSTICS_H_ |
michael@0 | 9 | |
michael@0 | 10 | #include <string> |
michael@0 | 11 | |
michael@0 | 12 | // Windows.h #defines ERROR. |
michael@0 | 13 | #ifdef ERROR |
michael@0 | 14 | #undef ERROR |
michael@0 | 15 | #endif |
michael@0 | 16 | |
michael@0 | 17 | namespace pp |
michael@0 | 18 | { |
michael@0 | 19 | |
michael@0 | 20 | struct SourceLocation; |
michael@0 | 21 | |
michael@0 | 22 | // Base class for reporting diagnostic messages. |
michael@0 | 23 | // Derived classes are responsible for formatting and printing the messages. |
michael@0 | 24 | class Diagnostics |
michael@0 | 25 | { |
michael@0 | 26 | public: |
michael@0 | 27 | enum Severity |
michael@0 | 28 | { |
michael@0 | 29 | ERROR, |
michael@0 | 30 | WARNING |
michael@0 | 31 | }; |
michael@0 | 32 | enum ID |
michael@0 | 33 | { |
michael@0 | 34 | ERROR_BEGIN, |
michael@0 | 35 | INTERNAL_ERROR, |
michael@0 | 36 | OUT_OF_MEMORY, |
michael@0 | 37 | INVALID_CHARACTER, |
michael@0 | 38 | INVALID_NUMBER, |
michael@0 | 39 | INTEGER_OVERFLOW, |
michael@0 | 40 | FLOAT_OVERFLOW, |
michael@0 | 41 | TOKEN_TOO_LONG, |
michael@0 | 42 | INVALID_EXPRESSION, |
michael@0 | 43 | DIVISION_BY_ZERO, |
michael@0 | 44 | EOF_IN_COMMENT, |
michael@0 | 45 | UNEXPECTED_TOKEN, |
michael@0 | 46 | DIRECTIVE_INVALID_NAME, |
michael@0 | 47 | MACRO_NAME_RESERVED, |
michael@0 | 48 | MACRO_REDEFINED, |
michael@0 | 49 | MACRO_PREDEFINED_REDEFINED, |
michael@0 | 50 | MACRO_PREDEFINED_UNDEFINED, |
michael@0 | 51 | MACRO_UNTERMINATED_INVOCATION, |
michael@0 | 52 | MACRO_TOO_FEW_ARGS, |
michael@0 | 53 | MACRO_TOO_MANY_ARGS, |
michael@0 | 54 | CONDITIONAL_ENDIF_WITHOUT_IF, |
michael@0 | 55 | CONDITIONAL_ELSE_WITHOUT_IF, |
michael@0 | 56 | CONDITIONAL_ELSE_AFTER_ELSE, |
michael@0 | 57 | CONDITIONAL_ELIF_WITHOUT_IF, |
michael@0 | 58 | CONDITIONAL_ELIF_AFTER_ELSE, |
michael@0 | 59 | CONDITIONAL_UNTERMINATED, |
michael@0 | 60 | INVALID_EXTENSION_NAME, |
michael@0 | 61 | INVALID_EXTENSION_BEHAVIOR, |
michael@0 | 62 | INVALID_EXTENSION_DIRECTIVE, |
michael@0 | 63 | INVALID_VERSION_NUMBER, |
michael@0 | 64 | INVALID_VERSION_DIRECTIVE, |
michael@0 | 65 | VERSION_NOT_FIRST_STATEMENT, |
michael@0 | 66 | INVALID_LINE_NUMBER, |
michael@0 | 67 | INVALID_FILE_NUMBER, |
michael@0 | 68 | INVALID_LINE_DIRECTIVE, |
michael@0 | 69 | ERROR_END, |
michael@0 | 70 | |
michael@0 | 71 | WARNING_BEGIN, |
michael@0 | 72 | EOF_IN_DIRECTIVE, |
michael@0 | 73 | CONDITIONAL_UNEXPECTED_TOKEN, |
michael@0 | 74 | UNRECOGNIZED_PRAGMA, |
michael@0 | 75 | WARNING_END |
michael@0 | 76 | }; |
michael@0 | 77 | |
michael@0 | 78 | virtual ~Diagnostics(); |
michael@0 | 79 | |
michael@0 | 80 | void report(ID id, const SourceLocation& loc, const std::string& text); |
michael@0 | 81 | |
michael@0 | 82 | protected: |
michael@0 | 83 | Severity severity(ID id); |
michael@0 | 84 | std::string message(ID id); |
michael@0 | 85 | |
michael@0 | 86 | virtual void print(ID id, |
michael@0 | 87 | const SourceLocation& loc, |
michael@0 | 88 | const std::string& text) = 0; |
michael@0 | 89 | }; |
michael@0 | 90 | |
michael@0 | 91 | } // namespace pp |
michael@0 | 92 | #endif // COMPILER_PREPROCESSOR_DIAGNOSTICS_H_ |