зеркало из https://github.com/mozilla/pjs.git
Bug 562198: Namespace NSS & NSPR functions in ipc/chromium code, to avoid stomping on their Mozilla counterparts. r=bsmedberg
This commit is contained in:
Родитель
fe1c7792e3
Коммит
d020c86c3a
|
@ -9,6 +9,7 @@
|
|||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
using base::Time;
|
||||
using namespace nspr;
|
||||
|
||||
namespace {
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#include "base/third_party/nss/blapi.h"
|
||||
#include "base/third_party/nss/sha256.h"
|
||||
|
||||
using namespace nss;
|
||||
|
||||
namespace base {
|
||||
|
||||
void SHA256HashString(const std::string& str, void* output, size_t len) {
|
||||
|
|
|
@ -74,6 +74,8 @@
|
|||
#include <errno.h> /* for EINVAL */
|
||||
#include <time.h>
|
||||
|
||||
namespace nspr {
|
||||
|
||||
/* Implements the Unix localtime_r() function for windows */
|
||||
#if defined(OS_WIN)
|
||||
static void localtime_r(const time_t* secs, struct tm* time) {
|
||||
|
@ -1201,3 +1203,5 @@ PR_ParseTimeString(
|
|||
*result_imploded = PR_ImplodeTime(result);
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
} // namespace nspr
|
||||
|
|
|
@ -171,11 +171,17 @@ typedef struct PRExplodedTime {
|
|||
|
||||
typedef PRTimeParameters (PR_CALLBACK *PRTimeParamFn)(const PRExplodedTime *gmt);
|
||||
|
||||
#ifdef CHROMIUM_MOZILLA_BUILD
|
||||
PR_END_EXTERN_C
|
||||
#endif
|
||||
|
||||
namespace nspr {
|
||||
|
||||
/**********************************************************************/
|
||||
/****************************** FUNCTIONS *****************************/
|
||||
/**********************************************************************/
|
||||
|
||||
NSPR_API(PRTime)
|
||||
PRTime
|
||||
PR_ImplodeTime(const PRExplodedTime *exploded);
|
||||
|
||||
/*
|
||||
|
@ -190,15 +196,14 @@ PR_ImplodeTime(const PRExplodedTime *exploded);
|
|||
* should treat them as "read-only".
|
||||
*/
|
||||
|
||||
NSPR_API(void) PR_NormalizeTime(
|
||||
PRExplodedTime *exploded, PRTimeParamFn params);
|
||||
void PR_NormalizeTime(PRExplodedTime *exploded, PRTimeParamFn params);
|
||||
|
||||
/**********************************************************************/
|
||||
/*********************** TIME PARAMETER FUNCTIONS *********************/
|
||||
/**********************************************************************/
|
||||
|
||||
/* Time parameters that represent Greenwich Mean Time */
|
||||
NSPR_API(PRTimeParameters) PR_GMTParameters(const PRExplodedTime *gmt);
|
||||
PRTimeParameters PR_GMTParameters(const PRExplodedTime *gmt);
|
||||
|
||||
/*
|
||||
* This parses a time/date string into a PRTime
|
||||
|
@ -231,13 +236,11 @@ NSPR_API(PRTimeParameters) PR_GMTParameters(const PRExplodedTime *gmt);
|
|||
* the time string which you are parsing.
|
||||
*/
|
||||
|
||||
NSPR_API(PRStatus) PR_ParseTimeString (
|
||||
PRStatus PR_ParseTimeString (
|
||||
const char *string,
|
||||
PRBool default_to_gmt,
|
||||
PRTime *result);
|
||||
|
||||
#ifdef CHROMIUM_MOZILLA_BUILD
|
||||
PR_END_EXTERN_C
|
||||
#endif
|
||||
} // namespace nspr
|
||||
|
||||
#endif // BASE_PRTIME_H__
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
|
||||
#include "base/third_party/nss/blapit.h"
|
||||
|
||||
namespace nss {
|
||||
|
||||
/******************************************/
|
||||
|
||||
extern SHA256Context *SHA256_NewContext(void);
|
||||
|
@ -98,4 +100,6 @@ extern SECStatus SHA384_Flatten(SHA384Context *cx,unsigned char *space);
|
|||
extern SHA384Context * SHA384_Resurrect(unsigned char *space, void *arg);
|
||||
extern void SHA384_Clone(SHA384Context *dest, SHA384Context *src);
|
||||
|
||||
} // namespace nss
|
||||
|
||||
#endif /* _BLAPI_H_ */
|
||||
|
|
|
@ -57,6 +57,8 @@
|
|||
#define PORT_Strlen(s) static_cast<uint32>(strlen(s))
|
||||
#define PORT_Memcpy memcpy
|
||||
|
||||
namespace nss {
|
||||
|
||||
/* ============= Common constants and defines ======================= */
|
||||
|
||||
#define W ctx->u.w
|
||||
|
@ -1285,10 +1287,14 @@ void SHA384_Clone(SHA384Context *dest, SHA384Context *src)
|
|||
}
|
||||
#endif /* Comment out unused code. */
|
||||
|
||||
} // namespace nss
|
||||
|
||||
/* ======================================================================= */
|
||||
#ifdef SELFTEST
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace nss;
|
||||
|
||||
static const char abc[] = { "abc" };
|
||||
static const char abcdbc[] = {
|
||||
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
#include "base/logging.h"
|
||||
|
||||
using namespace nspr;
|
||||
|
||||
namespace base {
|
||||
|
||||
// TimeDelta ------------------------------------------------------------------
|
||||
|
|
Загрузка…
Ссылка в новой задаче