summaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-02-05 09:46:23 -0800
committerTom Sepez <tsepez@chromium.org>2015-02-05 09:46:23 -0800
commitdabc5d57bf473708295800a7991bc1fafdf76288 (patch)
tree9dfb8313596dd61e2c600cf02548b191f9753daf /third_party
parent7061d1af45752617fafa85e2242dc5b2844650b5 (diff)
downloadpdfium-dabc5d57bf473708295800a7991bc1fafdf76288.tar.xz
Add namespace and-re-arrange PDFium's local copy of chromium /base.
Any projects DEPS'd into chromium and requiring a /base subset should have a local copy of that subset in a separate namespace. This will avoid future naming conflicts. Re-arrange the directory structure to better identify what came from chromium's base, and to make drop-in replacement easier for files that contain hard-coded "base/" in their #include directives. R=jam@chromium.org Review URL: https://codereview.chromium.org/900753002
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)6
-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, 48 insertions, 39 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 b1b8c10888..05c3132e46 100644
--- a/third_party/macros.h
+++ b/third_party/base/macros.h
@@ -7,8 +7,8 @@
// that are closely related to things that are commonly used that belong in this
// file.)
-#ifndef BASE_MACROS_H_
-#define BASE_MACROS_H_
+#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
@@ -28,4 +28,4 @@
#undef COMPILE_ASSERT
#define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg)
-#endif // BASE_MACROS_H_
+#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',
],
},
],