js/xpconnect/wrappers/FilteringWrapper.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.

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* vim: set ts=8 sts=4 et sw=4 tw=99: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef __FilteringWrapper_h__
michael@0 8 #define __FilteringWrapper_h__
michael@0 9
michael@0 10 #include "mozilla/Attributes.h"
michael@0 11 #include "jswrapper.h"
michael@0 12 #include "js/CallNonGenericMethod.h"
michael@0 13
michael@0 14 struct JSPropertyDescriptor;
michael@0 15
michael@0 16 namespace JS {
michael@0 17 class AutoIdVector;
michael@0 18 }
michael@0 19
michael@0 20 namespace xpc {
michael@0 21
michael@0 22 template <typename Base, typename Policy>
michael@0 23 class FilteringWrapper : public Base {
michael@0 24 public:
michael@0 25 FilteringWrapper(unsigned flags);
michael@0 26 virtual ~FilteringWrapper();
michael@0 27
michael@0 28 virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper,
michael@0 29 JS::Handle<jsid> id,
michael@0 30 JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE;
michael@0 31 virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper,
michael@0 32 JS::Handle<jsid> id,
michael@0 33 JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE;
michael@0 34 virtual bool getOwnPropertyNames(JSContext *cx, JS::Handle<JSObject*> wrapper,
michael@0 35 JS::AutoIdVector &props) MOZ_OVERRIDE;
michael@0 36 virtual bool enumerate(JSContext *cx, JS::Handle<JSObject*> wrapper,
michael@0 37 JS::AutoIdVector &props) MOZ_OVERRIDE;
michael@0 38 virtual bool keys(JSContext *cx, JS::Handle<JSObject*> wrapper,
michael@0 39 JS::AutoIdVector &props) MOZ_OVERRIDE;
michael@0 40 virtual bool iterate(JSContext *cx, JS::Handle<JSObject*> wrapper, unsigned flags,
michael@0 41 JS::MutableHandle<JS::Value> vp) MOZ_OVERRIDE;
michael@0 42 virtual bool nativeCall(JSContext *cx, JS::IsAcceptableThis test, JS::NativeImpl impl,
michael@0 43 JS::CallArgs args) MOZ_OVERRIDE;
michael@0 44
michael@0 45 virtual bool defaultValue(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint, JS::MutableHandleValue vp) MOZ_OVERRIDE;
michael@0 46
michael@0 47 virtual bool enter(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
michael@0 48 js::Wrapper::Action act, bool *bp) MOZ_OVERRIDE;
michael@0 49
michael@0 50 static FilteringWrapper singleton;
michael@0 51 };
michael@0 52
michael@0 53 }
michael@0 54
michael@0 55 #endif /* __FilteringWrapper_h__ */

mercurial