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 /*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
8 #ifndef SkThreadUtils_PThreadData_DEFINED
9 #define SkThreadUtils_PThreadData_DEFINED
11 #include "SkThreadUtils.h"
12 #include <pthread.h>
14 class PThreadEvent : SkNoncopyable {
15 public:
16 PThreadEvent();
17 ~PThreadEvent();
18 void trigger();
19 void wait();
20 bool isTriggered();
22 private:
23 pthread_cond_t fCondition;
24 pthread_mutex_t fConditionMutex;
25 bool fConditionFlag;
26 };
28 class SkThread_PThreadData : SkNoncopyable {
29 public:
30 SkThread_PThreadData(SkThread::entryPointProc entryPoint, void* data);
31 ~SkThread_PThreadData();
32 pthread_t fPThread;
33 bool fValidPThread;
34 PThreadEvent fStarted;
35 PThreadEvent fCanceled;
37 pthread_attr_t fAttr;
39 void* fParam;
40 SkThread::entryPointProc fEntryPoint;
41 };
43 #endif