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 2011 Google Inc. |
michael@0 | 3 | * Copyright 2012 Mozilla Foundation |
michael@0 | 4 | * |
michael@0 | 5 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 6 | * found in the LICENSE file. |
michael@0 | 7 | */ |
michael@0 | 8 | |
michael@0 | 9 | #include "SkTypes.h" |
michael@0 | 10 | |
michael@0 | 11 | #include "mozilla/mozalloc.h" |
michael@0 | 12 | #include "mozilla/mozalloc_abort.h" |
michael@0 | 13 | #include "mozilla/mozalloc_oom.h" |
michael@0 | 14 | |
michael@0 | 15 | void sk_throw() { |
michael@0 | 16 | SkDEBUGFAIL("sk_throw"); |
michael@0 | 17 | mozalloc_abort("Abort from sk_throw"); |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | void sk_out_of_memory(void) { |
michael@0 | 21 | SkDEBUGFAIL("sk_out_of_memory"); |
michael@0 | 22 | mozalloc_handle_oom(0); |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | void* sk_malloc_throw(size_t size) { |
michael@0 | 26 | return sk_malloc_flags(size, SK_MALLOC_THROW); |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | void* sk_realloc_throw(void* addr, size_t size) { |
michael@0 | 30 | return moz_xrealloc(addr, size); |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | void sk_free(void* p) { |
michael@0 | 34 | moz_free(p); |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | void* sk_malloc_flags(size_t size, unsigned flags) { |
michael@0 | 38 | return (flags & SK_MALLOC_THROW) ? moz_xmalloc(size) : moz_malloc(size); |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | void* sk_calloc(size_t size) { |
michael@0 | 42 | return moz_calloc(size, 1); |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | void* sk_calloc_throw(size_t size) { |
michael@0 | 46 | return moz_xcalloc(size, 1); |
michael@0 | 47 | } |