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.
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * vim: set ts=8 sts=4 et sw=4 tw=99:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef frontend_BytecodeCompiler_h
8 #define frontend_BytecodeCompiler_h
10 #include "NamespaceImports.h"
12 class JSLinearString;
14 namespace js {
16 class AutoNameVector;
17 class LazyScript;
18 class LifoAlloc;
19 struct SourceCompressionTask;
21 namespace frontend {
23 JSScript *
24 CompileScript(ExclusiveContext *cx, LifoAlloc *alloc,
25 HandleObject scopeChain, HandleScript evalCaller,
26 const ReadOnlyCompileOptions &options, SourceBufferHolder &srcBuf,
27 JSString *source_ = nullptr, unsigned staticLevel = 0,
28 SourceCompressionTask *extraSct = nullptr);
30 bool
31 CompileLazyFunction(JSContext *cx, Handle<LazyScript*> lazy, const jschar *chars, size_t length);
33 bool
34 CompileFunctionBody(JSContext *cx, MutableHandleFunction fun,
35 const ReadOnlyCompileOptions &options,
36 const AutoNameVector &formals, JS::SourceBufferHolder &srcBuf);
37 bool
38 CompileStarGeneratorBody(JSContext *cx, MutableHandleFunction fun,
39 const ReadOnlyCompileOptions &options,
40 const AutoNameVector &formals, JS::SourceBufferHolder &srcBuf);
42 ScriptSourceObject *
43 CreateScriptSourceObject(ExclusiveContext *cx, const ReadOnlyCompileOptions &options);
45 /*
46 * This should be called while still on the main thread if compilation will
47 * occur on a worker thread.
48 */
49 void
50 MaybeCallSourceHandler(JSContext *cx, const ReadOnlyCompileOptions &options,
51 JS::SourceBufferHolder &srcBuf);
53 /*
54 * True if str consists of an IdentifierStart character, followed by one or
55 * more IdentifierPart characters, i.e. it matches the IdentifierName production
56 * in the language spec.
57 *
58 * This returns true even if str is a keyword like "if".
59 *
60 * Defined in TokenStream.cpp.
61 */
62 bool
63 IsIdentifier(JSLinearString *str);
65 /* True if str is a keyword. Defined in TokenStream.cpp. */
66 bool
67 IsKeyword(JSLinearString *str);
69 /* GC marking. Defined in Parser.cpp. */
70 void
71 MarkParser(JSTracer *trc, AutoGCRooter *parser);
73 } /* namespace frontend */
74 } /* namespace js */
76 #endif /* frontend_BytecodeCompiler_h */