build/stlport/src/dll_main.cpp

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.

     1  /*
     2  *
     3  * Copyright (c) 1994
     4  * Hewlett-Packard Company
     5  *
     6  * Copyright (c) 1996,1997
     7  * Silicon Graphics Computer Systems, Inc.
     8  *
     9  * Copyright (c) 1997
    10  * Moscow Center for SPARC Technology
    11  *
    12  * Copyright (c) 1999
    13  * Boris Fomitchev
    14  *
    15  * This material is provided "as is", with absolutely no warranty expressed
    16  * or implied. Any use is at your own risk.
    17  *
    18  * Permission to use or copy this software for any purpose is hereby granted
    19  * without fee, provided the above notices are retained on all copies.
    20  * Permission to modify the code and to distribute modified code is granted,
    21  * provided the above notices are retained, and a notice that the code was
    22  * modified is included with the above copyright notice.
    23  *
    24  */
    26 #define _STLP_EXPOSE_GLOBALS_IMPLEMENTATION
    28 #include "stlport_prefix.h"
    30 #if !defined (_STLP_DEBUG) && ! defined (_STLP_ASSERTIONS)
    31 #  if !defined (__APPLE__) || !defined (__GNUC__) || (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3))
    32 /* dums: Please if the following code was being uncommented please explain why
    33  * as for the moment it only looks like a source of inconsistency in the way
    34  * STLport different translation units are compiled.
    35  */
    36 //#    define _STLP_ASSERTIONS 1
    37 #  endif
    38 #endif
    40 #include <utility>
    41 #include <memory>
    42 #include <vector>
    43 #include <set>
    44 #include <list>
    45 #include <slist>
    46 #include <deque>
    47 #include <hash_map>
    48 #include <limits>
    49 #include <string>
    50 #include <stdexcept>
    51 #include <bitset>
    52 #include <locale>
    54 #if defined (__DMC__)
    55 // for rope static members
    56 #  include <rope>
    57 #endif
    59 #include <stl/_range_errors.c>
    61 _STLP_BEGIN_NAMESPACE
    63 #if defined (_STLP_NO_EXCEPTION_HEADER) || defined (_STLP_BROKEN_EXCEPTION_CLASS)
    64 exception::exception() _STLP_NOTHROW {}
    65 exception::~exception() _STLP_NOTHROW {}
    66 bad_exception::bad_exception() _STLP_NOTHROW {}
    67 bad_exception::~bad_exception() _STLP_NOTHROW {}
    68 const char* exception::what() const _STLP_NOTHROW { return "class exception"; }
    69 const char* bad_exception::what() const _STLP_NOTHROW { return "class bad_exception"; }
    70 #endif
    72 #if defined (_STLP_OWN_STDEXCEPT)
    73 #  include <stl/_stdexcept_base.c>
    75 // boris : those are needed to force typeinfo nodes to be created in here only
    76 logic_error::~logic_error() _STLP_NOTHROW_INHERENTLY {}
    77 runtime_error::~runtime_error() _STLP_NOTHROW_INHERENTLY {}
    78 domain_error::~domain_error() _STLP_NOTHROW_INHERENTLY {}
    79 invalid_argument::~invalid_argument() _STLP_NOTHROW_INHERENTLY {}
    80 length_error::~length_error() _STLP_NOTHROW_INHERENTLY {}
    81 out_of_range::~out_of_range() _STLP_NOTHROW_INHERENTLY {}
    82 range_error::~range_error() _STLP_NOTHROW_INHERENTLY {}
    83 overflow_error::~overflow_error() _STLP_NOTHROW_INHERENTLY {}
    84 underflow_error::~underflow_error() _STLP_NOTHROW_INHERENTLY {}
    86 #endif
    88 #if !defined(_STLP_WCE_EVC3)
    89 #  if defined (_STLP_NO_BAD_ALLOC)
    90 const nothrow_t nothrow /* = {} */;
    91 #  endif
    92 #endif
    94 #if !defined (_STLP_NO_FORCE_INSTANTIATE)
    96 #  if defined (_STLP_DEBUG) || defined (_STLP_ASSERTIONS)
    97 _STLP_MOVE_TO_PRIV_NAMESPACE
    98 template class _STLP_CLASS_DECLSPEC __stl_debug_engine<bool>;
    99 _STLP_MOVE_TO_STD_NAMESPACE
   100 #  endif
   102 template class _STLP_CLASS_DECLSPEC __debug_alloc<__node_alloc>;
   103 template class _STLP_CLASS_DECLSPEC __debug_alloc<__new_alloc>;
   105 //Export of the types used to represent buckets in the hashtable implementation.
   106 /*
   107  * For the vector class we do not use any MSVC6 workaround even if we export it from
   108  * the STLport dynamic libraries because we know what methods are called and none is
   109  * a template method. Moreover the exported class is an instanciation of vector with
   110  * _Slist_node_base struct that is an internal STLport class that no user should ever
   111  * use.
   112  */
   113 #  if !defined (_STLP_USE_PTR_SPECIALIZATIONS)
   114 template class _STLP_CLASS_DECLSPEC allocator<_STLP_PRIV _Slist_node_base*>;
   116 _STLP_MOVE_TO_PRIV_NAMESPACE
   117 template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<_Slist_node_base**, _Slist_node_base*,
   118                                                       allocator<_Slist_node_base*> >;
   119 template class _STLP_CLASS_DECLSPEC _Vector_base<_Slist_node_base*,
   120                                                  allocator<_Slist_node_base*> >;
   121 _STLP_MOVE_TO_STD_NAMESPACE
   122 #  endif
   124 #  if defined (_STLP_DEBUG)
   125 _STLP_MOVE_TO_PRIV_NAMESPACE
   126 template class _STLP_CLASS_DECLSPEC _STLP_NON_DBG_NAME(vector)<_Slist_node_base*,
   127                                                                allocator<_Slist_node_base*> >;
   128 _STLP_MOVE_TO_STD_NAMESPACE
   129 #  endif
   131 template class _STLP_CLASS_DECLSPEC vector<_STLP_PRIV _Slist_node_base*,
   132                                            allocator<_STLP_PRIV _Slist_node_base*> >;
   133 //End of hashtable bucket types export.
   135 //Export of _Locale_impl facets container:
   136 #  if !defined (_STLP_USE_PTR_SPECIALIZATIONS)
   137 template class _STLP_CLASS_DECLSPEC allocator<locale::facet*>;
   139 _STLP_MOVE_TO_PRIV_NAMESPACE
   140 template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<locale::facet**, locale::facet*, allocator<locale::facet*> >;
   141 template class _STLP_CLASS_DECLSPEC _Vector_base<locale::facet*, allocator<locale::facet*> >;
   142 _STLP_MOVE_TO_STD_NAMESPACE
   144 #  endif
   145 #  if defined (_STLP_DEBUG)
   146 _STLP_MOVE_TO_PRIV_NAMESPACE
   147 #    define _STLP_NON_DBG_VECTOR _STLP_NON_DBG_NAME(vector)
   148 template class _STLP_CLASS_DECLSPEC __construct_checker<_STLP_PRIV _STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> > >;
   149 template class _STLP_CLASS_DECLSPEC _STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> >;
   150 #    undef _STLP_NON_DBG_VECTOR
   151 _STLP_MOVE_TO_STD_NAMESPACE
   152 #  endif
   154 template class _STLP_CLASS_DECLSPEC vector<locale::facet*, allocator<locale::facet*> >;
   155 //End of export of _Locale_impl facets container.
   157 #  if defined (_STLP_USE_PTR_SPECIALIZATIONS)
   158 template class _STLP_CLASS_DECLSPEC allocator<void*>;
   160 typedef _STLP_PRIV _List_node<void*> _VoidPtr_Node;
   161 template class _STLP_CLASS_DECLSPEC allocator<_VoidPtr_Node>;
   163 _STLP_MOVE_TO_PRIV_NAMESPACE
   165 template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<void**, void*, allocator<void*> >;
   166 template class _STLP_CLASS_DECLSPEC _Vector_base<void*, allocator<void*> >;
   167 template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(vector)<void*, allocator<void*> >;
   169 template class _STLP_CLASS_DECLSPEC _List_node<void*>;
   170 template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<_List_node_base, _VoidPtr_Node, allocator<_VoidPtr_Node> >;
   171 template class _STLP_CLASS_DECLSPEC _List_base<void*, allocator<void*> >;
   172 template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(list)<void*, allocator<void*> >;
   174 template class _STLP_CLASS_DECLSPEC _Slist_node<void*>;
   175 template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<_Slist_node_base, _Slist_node<void*>, allocator<_Slist_node<void*> > >;
   176 template class _STLP_CLASS_DECLSPEC _Slist_base<void*, allocator<void*> >;
   177 template class _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(slist)<void*, allocator<void*> >;
   179 template class  _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<size_t, void*, allocator<void*> >;
   180 template class  _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<void***, void**, allocator<void**> >;
   181 template struct _STLP_CLASS_DECLSPEC _Deque_iterator<void*, _Nonconst_traits<void*> >;
   182 template class  _STLP_CLASS_DECLSPEC _Deque_base<void*, allocator<void*> >;
   183 template class  _STLP_CLASS_DECLSPEC _STLP_PTR_IMPL_NAME(deque)<void*, allocator<void*> >;
   185 _STLP_MOVE_TO_STD_NAMESPACE
   187 #  endif /* _STLP_USE_PTR_SPECIALIZATIONS */
   189 _STLP_MOVE_TO_PRIV_NAMESPACE
   191 template class _STLP_CLASS_DECLSPEC _Rb_global<bool>;
   192 template class _STLP_CLASS_DECLSPEC _List_global<bool>;
   194 template class _STLP_CLASS_DECLSPEC _Sl_global<bool>;
   195 template class _STLP_CLASS_DECLSPEC _Stl_prime<bool>;
   197 template class _STLP_CLASS_DECLSPEC _LimG<bool>;
   199 _STLP_MOVE_TO_STD_NAMESPACE
   201 #endif /* _STLP_NO_FORCE_INSTANTIATE */
   203 _STLP_END_NAMESPACE
   205 #if defined (_STLP_SIGNAL_RUNTIME_COMPATIBILITY)
   206 extern "C" void _STLP_DECLSPEC _STLP_CALL _STLP_SIGNAL_RUNTIME_COMPATIBILITY() {}
   207 #endif
   209 #define FORCE_SYMBOL extern
   211 #if defined (_WIN32) && defined (_STLP_USE_DECLSPEC) && !defined (_STLP_USE_STATIC_LIB)
   212 // stlportmt.cpp : Defines the entry point for the DLL application.
   213 //
   214 #  undef FORCE_SYMBOL
   215 #  define FORCE_SYMBOL APIENTRY
   217 extern "C" {
   219 BOOL APIENTRY DllMain( HANDLE hModule,
   220                        DWORD  ul_reason_for_call,
   221                        LPVOID) {
   222   switch (ul_reason_for_call) {
   223     case DLL_PROCESS_ATTACH:
   224       DisableThreadLibraryCalls((HINSTANCE)hModule);
   225     case DLL_THREAD_ATTACH:
   226     case DLL_THREAD_DETACH:
   227     case DLL_PROCESS_DETACH:
   228       break;
   229     }
   230   return TRUE;
   231 }
   233 } /* extern "C" */
   235 #if !defined (_STLP_MSVC) && !defined (__MINGW32__)
   236 _STLP_BEGIN_NAMESPACE
   238 static void FORCE_SYMBOL
   239 force_link() {
   240   set<int>::iterator iter;
   241   // _M_increment; _M_decrement instantiation
   242   ++iter;
   243   --iter;
   244 }
   246 _STLP_END_NAMESPACE
   247 #endif
   249 #endif /* _WIN32 */
   251 #if defined (__ICL) && (__ICL >= 900) && (_STLP_MSVC_LIB < 1300)
   252 #  undef std
   254 namespace std
   255 {
   256   void _STLP_CALL unexpected() {
   257     unexpected_handler hdl;
   258     set_unexpected(hdl = set_unexpected((unexpected_handler)0));
   259     hdl();
   260   }
   261 }
   262 #endif

mercurial