summaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-02-05 10:03:18 -0800
committerTom Sepez <tsepez@chromium.org>2015-02-05 10:03:18 -0800
commit35425896b07b5124651c249d6ce29285cf71ea3b (patch)
tree0cd30ec338fffdebb3aee6a899beeb3835c6f194 /third_party
parent53476d6956781ceb252e1ae5e01f83a48bcb4908 (diff)
downloadpdfium-35425896b07b5124651c249d6ce29285cf71ea3b.tar.xz
Merge to XFA: Add namespace and-re-arrange PDFium's local copy of /base.
Original revieww URL: https://codereview.chromium.org/900753002 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/880603004
Diffstat (limited to 'third_party')
-rw-r--r--third_party/BUILD.gn18
-rw-r--r--third_party/base/logging.h (renamed from third_party/logging.h)6
-rw-r--r--third_party/base/macros.h (renamed from third_party/macros.h)62
-rw-r--r--third_party/base/numerics/OWNERS (renamed from third_party/numerics/OWNERS)0
-rw-r--r--third_party/base/numerics/safe_conversions.h (renamed from third_party/numerics/safe_conversions.h)8
-rw-r--r--third_party/base/numerics/safe_conversions_impl.h (renamed from third_party/numerics/safe_conversions_impl.h)8
-rw-r--r--third_party/base/numerics/safe_math.h (renamed from third_party/numerics/safe_math.h)9
-rw-r--r--third_party/base/numerics/safe_math_impl.h (renamed from third_party/numerics/safe_math_impl.h)8
-rw-r--r--third_party/base/template_util.h (renamed from third_party/template_util.h)8
-rw-r--r--third_party/third_party.gyp16
10 files changed, 76 insertions, 67 deletions
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index df02938a93..fcb09c4b47 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -6,7 +6,7 @@ group("third_party") {
deps = [
":bigint",
":freetype",
- ":safemath",
+ ":pdfium_base",
]
}
@@ -69,20 +69,20 @@ static_library("freetype") {
]
}
-component("safemath") {
+component("pdfium_base") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//third_party/pdfium:pdfium_config",
"//build/config/compiler:no_chromium_code",
]
sources = [
- "logging.h",
- "macros.h",
- "template_util.h",
- "numerics/safe_conversions.h",
- "numerics/safe_conversions_impl.h",
- "numerics/safe_math.h",
- "numerics/safe_math_impl.h",
+ "base/logging.h",
+ "base/macros.h",
+ "base/template_util.h",
+ "base/numerics/safe_conversions.h",
+ "base/numerics/safe_conversions_impl.h",
+ "base/numerics/safe_math.h",
+ "base/numerics/safe_math_impl.h",
]
}
diff --git a/third_party/logging.h b/third_party/base/logging.h
index 3629e84d4a..d24f93b2a1 100644
--- a/third_party/logging.h
+++ b/third_party/base/logging.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_LOGGING_H_
-#define BASE_LOGGING_H_
+#ifndef PDFIUM_THIRD_PARTY_BASE_LOGGING_H_
+#define PDFIUM_THIRD_PARTY_BASE_LOGGING_H_
#include <stdlib.h>
@@ -15,4 +15,4 @@
#define NOTREACHED() abort()
-#endif // BASE_LOGGING_H_
+#endif // PDFIUM_THIRD_PARTY_BASE_LOGGING_H_
diff --git a/third_party/macros.h b/third_party/base/macros.h
index 92d4f34bda..05c3132e46 100644
--- a/third_party/macros.h
+++ b/third_party/base/macros.h
@@ -1,31 +1,31 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file contains macros and macro-like constructs (e.g., templates) that
-// are commonly used throughout Chromium source. (It may also contain things
-// that are closely related to things that are commonly used that belong in this
-// file.)
-
-#ifndef BASE_MACROS_H_
-#define BASE_MACROS_H_
-
-// The COMPILE_ASSERT macro can be used to verify that a compile time
-// expression is true. For example, you could use it to verify the
-// size of a static array:
-//
-// COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES,
-// content_type_names_incorrect_size);
-//
-// or to make sure a struct is smaller than a certain size:
-//
-// COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large);
-//
-// The second argument to the macro is the name of the variable. If
-// the expression is false, most compilers will issue a warning/error
-// containing the name of the variable.
-
-#undef COMPILE_ASSERT
-#define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg)
-
-#endif // BASE_MACROS_H_
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file contains macros and macro-like constructs (e.g., templates) that
+// are commonly used throughout Chromium source. (It may also contain things
+// that are closely related to things that are commonly used that belong in this
+// file.)
+
+#ifndef PDFIUM_THIRD_PARTY_BASE_MACROS_H_
+#define PDFIUM_THIRD_PARTY_BASE_MACROS_H_
+
+// The COMPILE_ASSERT macro can be used to verify that a compile time
+// expression is true. For example, you could use it to verify the
+// size of a static array:
+//
+// COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES,
+// content_type_names_incorrect_size);
+//
+// or to make sure a struct is smaller than a certain size:
+//
+// COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large);
+//
+// The second argument to the macro is the name of the variable. If
+// the expression is false, most compilers will issue a warning/error
+// containing the name of the variable.
+
+#undef COMPILE_ASSERT
+#define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg)
+
+#endif // PDFIUM_THIRD_PARTY_BASE_MACROS_H_
diff --git a/third_party/numerics/OWNERS b/third_party/base/numerics/OWNERS
index f7816afe81..f7816afe81 100644
--- a/third_party/numerics/OWNERS
+++ b/third_party/base/numerics/OWNERS
diff --git a/third_party/numerics/safe_conversions.h b/third_party/base/numerics/safe_conversions.h
index 681dc0a9cc..e95608e0a5 100644
--- a/third_party/numerics/safe_conversions.h
+++ b/third_party/base/numerics/safe_conversions.h
@@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_SAFE_CONVERSIONS_H_
-#define BASE_SAFE_CONVERSIONS_H_
+#ifndef PDFIUM_THIRD_PARTY_BASE_SAFE_CONVERSIONS_H_
+#define PDFIUM_THIRD_PARTY_BASE_SAFE_CONVERSIONS_H_
#include <limits>
#include "../logging.h"
#include "safe_conversions_impl.h"
+namespace pdfium {
namespace base {
// Convenience function that returns true if the supplied value is in range
@@ -59,6 +60,7 @@ inline Dst saturated_cast(Src value) {
}
} // namespace base
+} // namespace pdfium
-#endif // BASE_SAFE_CONVERSIONS_H_
+#endif // PDFIUM_THIRD_PARTY_BASE_SAFE_CONVERSIONS_H_
diff --git a/third_party/numerics/safe_conversions_impl.h b/third_party/base/numerics/safe_conversions_impl.h
index a357e518d1..7c88dda0a8 100644
--- a/third_party/numerics/safe_conversions_impl.h
+++ b/third_party/base/numerics/safe_conversions_impl.h
@@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_SAFE_CONVERSIONS_IMPL_H_
-#define BASE_SAFE_CONVERSIONS_IMPL_H_
+#ifndef PDFIUM_THIRD_PARTY_BASE_SAFE_CONVERSIONS_IMPL_H_
+#define PDFIUM_THIRD_PARTY_BASE_SAFE_CONVERSIONS_IMPL_H_
#include <limits>
#include "../macros.h"
#include "../template_util.h"
+namespace pdfium {
namespace base {
namespace internal {
@@ -212,6 +213,7 @@ inline RangeConstraint DstRangeRelationToSrcRange(Src value) {
} // namespace internal
} // namespace base
+} // namespace pdfium
-#endif // BASE_SAFE_CONVERSIONS_IMPL_H_
+#endif // PDFIUM_THIRD_PARTY_BASE_SAFE_CONVERSIONS_IMPL_H_
diff --git a/third_party/numerics/safe_math.h b/third_party/base/numerics/safe_math.h
index 4b38ff2b1f..9540e83321 100644
--- a/third_party/numerics/safe_math.h
+++ b/third_party/base/numerics/safe_math.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_SAFE_MATH_H_
-#define BASE_SAFE_MATH_H_
+#ifndef PDFIUM_THIRD_PARTY_BASE_SAFE_MATH_H_
+#define PDFIUM_THIRD_PARTY_BASE_SAFE_MATH_H_
#include "safe_math_impl.h"
+namespace pdfium {
namespace base {
-
namespace internal {
// CheckedNumeric implements all the logic and operators for detecting integer
@@ -267,5 +267,6 @@ BASE_NUMERIC_ARITHMETIC_OPERATORS(Mod, %, %= )
using internal::CheckedNumeric;
} // namespace base
+} // namespace pdfium
-#endif // BASE_SAFE_MATH_H_
+#endif // PDFIUM_THIRD_PARTY_BASE_SAFE_MATH_H_
diff --git a/third_party/numerics/safe_math_impl.h b/third_party/base/numerics/safe_math_impl.h
index 4bf59e64e0..f9a4a71570 100644
--- a/third_party/numerics/safe_math_impl.h
+++ b/third_party/base/numerics/safe_math_impl.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef SAFE_MATH_IMPL_H_
-#define SAFE_MATH_IMPL_H_
+#ifndef PDFIUM_THIRD_PARTY_SAFE_MATH_IMPL_H_
+#define PDFIUM_THIRD_PARTY_SAFE_MATH_IMPL_H_
#include <stdint.h>
@@ -15,6 +15,7 @@
#include "../template_util.h"
#include "safe_conversions.h"
+namespace pdfium {
namespace base {
namespace internal {
@@ -498,5 +499,6 @@ struct IsIntegerArithmeticSafe {
} // namespace internal
} // namespace base
+} // namespace pdfium
-#endif // SAFE_MATH_IMPL_H_
+#endif // PDFIUM_THIRD_PARTY_SAFE_MATH_IMPL_H_
diff --git a/third_party/template_util.h b/third_party/base/template_util.h
index d4508dd696..ab660940f0 100644
--- a/third_party/template_util.h
+++ b/third_party/base/template_util.h
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_TEMPLATE_UTIL_H_
-#define BASE_TEMPLATE_UTIL_H_
+#ifndef PDFIUM_THIRD_PARTY_BASE_TEMPLATE_UTIL_H_
+#define PDFIUM_THIRD_PARTY_BASE_TEMPLATE_UTIL_H_
#include <cstddef> // For size_t.
+namespace pdfium {
namespace base {
template<class T, T v>
@@ -29,5 +30,6 @@ template<class T>
struct enable_if<true, T> { typedef T type; };
} // namespace base
+} // namespace pdfium
-#endif // BASE_TEMPLATE_UTIL_H_
+#endif // PDFIUM_THIRD_PARTY_BASE_TEMPLATE_UTIL_H_
diff --git a/third_party/third_party.gyp b/third_party/third_party.gyp
index ac7fb7792a..d54905c022 100644
--- a/third_party/third_party.gyp
+++ b/third_party/third_party.gyp
@@ -61,16 +61,16 @@
],
},
{
- 'target_name': 'safemath',
+ 'target_name': 'pdfium_base',
'type': 'none',
'sources': [
- 'logging.h',
- 'macros.h',
- 'template_util.h',
- 'numerics/safe_conversions.h',
- 'numerics/safe_conversions_impl.h',
- 'numerics/safe_math.h',
- 'numerics/safe_math_impl.h',
+ 'base/logging.h',
+ 'base/macros.h',
+ 'base/template_util.h',
+ 'base/numerics/safe_conversions.h',
+ 'base/numerics/safe_conversions_impl.h',
+ 'base/numerics/safe_math.h',
+ 'base/numerics/safe_math_impl.h',
],
},
],