Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: patches/nspr-static.patch

Issue 2078763002: Delete bundled copy of NSS and replace with README. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss@master
Patch Set: Delete bundled copy of NSS and replace with README. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « patches/nspr-remove-io.patch ('k') | patches/nss-remove-fortezza.patch » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: patches/nspr-static.patch
diff --git a/patches/nspr-static.patch b/patches/nspr-static.patch
deleted file mode 100644
index aff0f8b32a8b01886f3444204a8f10dce794acf4..0000000000000000000000000000000000000000
--- a/patches/nspr-static.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-diff --git a/nspr/pr/include/prtypes.h b/nspr/pr/include/prtypes.h
-index 52b3ab0..d78f580 100644
---- a/nspr/pr/include/prtypes.h
-+++ b/nspr/pr/include/prtypes.h
-@@ -48,7 +48,23 @@
- **
- **
- ***********************************************************************/
--#if defined(WIN32)
-+#if defined(NSPR_STATIC)
-+
-+#define PR_EXPORT(__type) extern __type
-+#define PR_EXPORT_DATA(__type) extern __type
-+#define PR_IMPORT(__type) extern __type
-+#define PR_IMPORT_DATA(__type) extern __type
-+
-+#define PR_EXTERN(__type) extern __type
-+#define PR_IMPLEMENT(__type) __type
-+#define PR_EXTERN_DATA(__type) extern __type
-+#define PR_IMPLEMENT_DATA(__type) __type
-+
-+#define PR_CALLBACK
-+#define PR_CALLBACK_DECL
-+#define PR_STATIC_CALLBACK(__x) static __x
-+
-+#elif defined(WIN32)
-
- #define PR_EXPORT(__type) extern __declspec(dllexport) __type
- #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
-diff --git a/nspr/pr/src/md/windows/w95dllmain.c b/nspr/pr/src/md/windows/w95dllmain.c
-index 73707a6..90957c1 100644
---- a/nspr/pr/src/md/windows/w95dllmain.c
-+++ b/nspr/pr/src/md/windows/w95dllmain.c
-@@ -3,6 +3,8 @@
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-+#ifndef NSPR_STATIC /* See the end of w95thred.c. */
-+
- /*
- * The DLL entry point (DllMain) for NSPR.
- *
-@@ -37,3 +39,5 @@ PRThread *me;
- }
- return TRUE;
- }
-+
-+#endif
-diff --git a/nspr/pr/src/md/windows/w95thred.c b/nspr/pr/src/md/windows/w95thred.c
-index c27d982..52bfb02 100644
---- a/nspr/pr/src/md/windows/w95thred.c
-+++ b/nspr/pr/src/md/windows/w95thred.c
-@@ -323,3 +323,120 @@ PRThread *thread;
- PR_ASSERT(thread != NULL);
- return thread;
- }
-+
-+#ifdef NSPR_STATIC
-+
-+// The following code is from Chromium src/base/thread_local_storage_win.cc,
-+// r11329.
-+
-+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions are
-+// met:
-+//
-+// * Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// * Redistributions in binary form must reproduce the above
-+// copyright notice, this list of conditions and the following disclaimer
-+// in the documentation and/or other materials provided with the
-+// distribution.
-+// * Neither the name of Google Inc. nor the names of its
-+// contributors may be used to endorse or promote products derived from
-+// this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+// Thread Termination Callbacks.
-+// Windows doesn't support a per-thread destructor with its
-+// TLS primitives. So, we build it manually by inserting a
-+// function to be called on each thread's exit.
-+// This magic is from http://www.codeproject.com/threads/tls.asp
-+// and it works for VC++ 7.0 and later.
-+
-+// Force a reference to _tls_used to make the linker create the TLS directory
-+// if it's not already there. (e.g. if __declspec(thread) is not used).
-+// Force a reference to p_thread_callback_nspr to prevent whole program
-+// optimization from discarding the variable.
-+#ifdef _WIN64
-+
-+#pragma comment(linker, "/INCLUDE:_tls_used")
-+#pragma comment(linker, "/INCLUDE:p_thread_callback_nspr")
-+
-+#else // _WIN64
-+
-+#pragma comment(linker, "/INCLUDE:__tls_used")
-+#pragma comment(linker, "/INCLUDE:_p_thread_callback_nspr")
-+
-+#endif // _WIN64
-+
-+// Static callback function to call with each thread termination.
-+static void NTAPI PR_OnThreadExit(PVOID module, DWORD reason, PVOID reserved)
-+{
-+PRThread *me;
-+
-+ switch (reason) {
-+ case DLL_PROCESS_ATTACH:
-+ break;
-+ case DLL_THREAD_ATTACH:
-+ break;
-+ case DLL_THREAD_DETACH:
-+ if (_pr_initialized) {
-+ me = _MD_GET_ATTACHED_THREAD();
-+ if ((me != NULL) && (me->flags & _PR_ATTACHED))
-+ _PRI_DetachThread();
-+ }
-+ break;
-+ case DLL_PROCESS_DETACH:
-+ break;
-+ }
-+}
-+
-+// .CRT$XLA to .CRT$XLZ is an array of PIMAGE_TLS_CALLBACK pointers that are
-+// called automatically by the OS loader code (not the CRT) when the module is
-+// loaded and on thread creation. They are NOT called if the module has been
-+// loaded by a LoadLibrary() call. It must have implicitly been loaded at
-+// process startup.
-+// By implicitly loaded, I mean that it is directly referenced by the main EXE
-+// or by one of its dependent DLLs. Delay-loaded DLL doesn't count as being
-+// implicitly loaded.
-+//
-+// See VC\crt\src\tlssup.c for reference.
-+
-+// The linker must not discard p_thread_callback_nspr. (We force a reference
-+// to this variable with a linker /INCLUDE:symbol pragma to ensure that.) If
-+// this variable is discarded, the PR_OnThreadExit function will never be
-+// called.
-+#ifdef _WIN64
-+
-+// .CRT section is merged with .rdata on x64 so it must be constant data.
-+#pragma const_seg(".CRT$XLB")
-+// When defining a const variable, it must have external linkage to be sure the
-+// linker doesn't discard it.
-+extern const PIMAGE_TLS_CALLBACK p_thread_callback_nspr;
-+const PIMAGE_TLS_CALLBACK p_thread_callback_nspr = PR_OnThreadExit;
-+
-+// Reset the default section.
-+#pragma const_seg()
-+
-+#else // _WIN64
-+
-+#pragma data_seg(".CRT$XLB")
-+PIMAGE_TLS_CALLBACK p_thread_callback_nspr = PR_OnThreadExit;
-+
-+// Reset the default section.
-+#pragma data_seg()
-+
-+#endif // _WIN64
-+
-+#endif // NSPR_STATIC
« no previous file with comments | « patches/nspr-remove-io.patch ('k') | patches/nss-remove-fortezza.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698