summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-17 05:27:17 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-17 05:28:32 +0000
commit738c326307bb078f427b36a17a072bfce30fc584 (patch)
tree07b8e806bc44412d0e2455012ce22f78ebdc32ea /third_party
parent0165aa20fbf046467fd39b8cd300e5bf9ca357c2 (diff)
downloadchromium_src-738c326307bb078f427b36a17a072bfce30fc584.zip
chromium_src-738c326307bb078f427b36a17a072bfce30fc584.tar.gz
chromium_src-738c326307bb078f427b36a17a072bfce30fc584.tar.bz2
Roll harfbuzz to pick up this/NULL comparison fix.
BUG=403594 TBR=behdad@chromium.org Review URL: https://codereview.chromium.org/469573004 Cr-Commit-Position: refs/heads/master@{#290175} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r--third_party/harfbuzz-ng/README.chromium7
-rw-r--r--third_party/harfbuzz-ng/src/hb-face-private.hh2
-rw-r--r--third_party/harfbuzz-ng/src/hb-object-private.hh107
-rw-r--r--third_party/harfbuzz-ng/src/hb-set-private.hh2
4 files changed, 42 insertions, 76 deletions
diff --git a/third_party/harfbuzz-ng/README.chromium b/third_party/harfbuzz-ng/README.chromium
index 8124ef6..750b464 100644
--- a/third_party/harfbuzz-ng/README.chromium
+++ b/third_party/harfbuzz-ng/README.chromium
@@ -1,7 +1,7 @@
Name: harfbuzz-ng
Short Name: harfbuzz-ng
URL: http://harfbuzz.org
-Version: 0.9.35
+Version: 0d2c2f238bf0a847ecd55a70cc0f081f18a053ac
Date: 20140813
Security Critical: yes
License: MIT
@@ -11,9 +11,12 @@ Description:
This is harfbuzz-ng, a new implementation of harfbuzz with a different
API from the old one.
-This copy of harfbuzz is updated by downloading the release tarball
+This copy of harfbuzz is usually updated by downloading the release tarball
from http://www.freedesktop.org/software/harfbuzz/release/ , removing
files in src, copying *.h *.hh *.cc from the tarball's src folder
over to src, apply google.patch, then checking for removed or added
files and update our build recipes in BUILD.gn and harfbuzz.gyp
accordingly.
+
+Right now, it uses revision 0d2c2f238bf0a847ecd55a70cc0f081f18a053ac from
+https://github.com/behdad/harfbuzz
diff --git a/third_party/harfbuzz-ng/src/hb-face-private.hh b/third_party/harfbuzz-ng/src/hb-face-private.hh
index 6520d3d..c4266ff 100644
--- a/third_party/harfbuzz-ng/src/hb-face-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-face-private.hh
@@ -66,7 +66,7 @@ struct hb_face_t {
{
hb_blob_t *blob;
- if (unlikely (!this || !reference_table_func))
+ if (unlikely (!reference_table_func))
return hb_blob_get_empty ();
blob = reference_table_func (/*XXX*/const_cast<hb_face_t *> (this), tag, user_data);
diff --git a/third_party/harfbuzz-ng/src/hb-object-private.hh b/third_party/harfbuzz-ng/src/hb-object-private.hh
index 8a9ae34d..7bd0f16 100644
--- a/third_party/harfbuzz-ng/src/hb-object-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-object-private.hh
@@ -68,8 +68,6 @@ struct hb_reference_count_t
#define HB_USER_DATA_ARRAY_INIT {HB_MUTEX_INIT, HB_LOCKABLE_SET_INIT}
struct hb_user_data_array_t
{
- /* TODO Add tracing. */
-
struct hb_user_data_item_t {
hb_user_data_key_t *key;
void *data;
@@ -106,69 +104,6 @@ struct hb_object_header_t
#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INVALID, HB_USER_DATA_ARRAY_INIT}
- static inline void *create (unsigned int size) {
- hb_object_header_t *obj = (hb_object_header_t *) calloc (1, size);
-
- if (likely (obj))
- obj->init ();
-
- return obj;
- }
-
- inline void init (void) {
- ref_count.init (1);
- user_data.init ();
- }
-
- inline bool is_inert (void) const {
- return unlikely (ref_count.is_invalid ());
- }
-
- inline void reference (void) {
- if (unlikely (!this || this->is_inert ()))
- return;
- ref_count.inc ();
- }
-
- inline bool destroy (void) {
- if (unlikely (!this || this->is_inert ()))
- return false;
- if (ref_count.dec () != 1)
- return false;
-
- ref_count.finish (); /* Do this before user_data */
- user_data.finish ();
-
- return true;
- }
-
- inline bool set_user_data (hb_user_data_key_t *key,
- void * data,
- hb_destroy_func_t destroy_func,
- hb_bool_t replace) {
- if (unlikely (!this || this->is_inert ()))
- return false;
-
- return user_data.set (key, data, destroy_func, replace);
- }
-
- inline void *get_user_data (hb_user_data_key_t *key) {
- if (unlikely (!this || this->is_inert ()))
- return NULL;
-
- return user_data.get (key);
- }
-
- inline void trace (const char *function) const {
- if (unlikely (!this)) return;
- /* TODO We cannot use DEBUG_MSG_FUNC here since that one currently only
- * prints the class name and throws away the template info. */
- DEBUG_MSG (OBJECT, (void *) this,
- "%s refcount=%d",
- function,
- this ? ref_count.ref_count : 0);
- }
-
private:
ASSERT_POD ();
};
@@ -179,32 +114,56 @@ struct hb_object_header_t
template <typename Type>
static inline void hb_object_trace (const Type *obj, const char *function)
{
- obj->header.trace (function);
+ DEBUG_MSG (OBJECT, (void *) obj,
+ "%s refcount=%d",
+ function,
+ obj ? obj->header.ref_count.ref_count : 0);
}
+
template <typename Type>
static inline Type *hb_object_create (void)
{
- Type *obj = (Type *) hb_object_header_t::create (sizeof (Type));
+ Type *obj = (Type *) calloc (1, sizeof (Type));
+
+ if (unlikely (!obj))
+ return obj;
+
+ hb_object_init (obj);
hb_object_trace (obj, HB_FUNC);
return obj;
}
template <typename Type>
+static inline void hb_object_init (Type *obj)
+{
+ obj->header.ref_count.init (1);
+ obj->header.user_data.init ();
+}
+template <typename Type>
static inline bool hb_object_is_inert (const Type *obj)
{
- return unlikely (obj->header.is_inert ());
+ return unlikely (obj->header.ref_count.is_invalid ());
}
template <typename Type>
static inline Type *hb_object_reference (Type *obj)
{
hb_object_trace (obj, HB_FUNC);
- obj->header.reference ();
+ if (unlikely (!obj || hb_object_is_inert (obj)))
+ return obj;
+ obj->header.ref_count.inc ();
return obj;
}
template <typename Type>
static inline bool hb_object_destroy (Type *obj)
{
hb_object_trace (obj, HB_FUNC);
- return obj->header.destroy ();
+ if (unlikely (!obj || hb_object_is_inert (obj)))
+ return false;
+ if (obj->header.ref_count.dec () != 1)
+ return false;
+
+ obj->header.ref_count.finish (); /* Do this before user_data */
+ obj->header.user_data.finish ();
+ return true;
}
template <typename Type>
static inline bool hb_object_set_user_data (Type *obj,
@@ -213,14 +172,18 @@ static inline bool hb_object_set_user_data (Type *obj,
hb_destroy_func_t destroy,
hb_bool_t replace)
{
- return obj->header.set_user_data (key, data, destroy, replace);
+ if (unlikely (!obj || hb_object_is_inert (obj)))
+ return false;
+ return obj->header.user_data.set (key, data, destroy, replace);
}
template <typename Type>
static inline void *hb_object_get_user_data (Type *obj,
hb_user_data_key_t *key)
{
- return obj->header.get_user_data (key);
+ if (unlikely (!obj || hb_object_is_inert (obj)))
+ return NULL;
+ return obj->header.user_data.get (key);
}
diff --git a/third_party/harfbuzz-ng/src/hb-set-private.hh b/third_party/harfbuzz-ng/src/hb-set-private.hh
index 705f554..59e8f45 100644
--- a/third_party/harfbuzz-ng/src/hb-set-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-set-private.hh
@@ -150,7 +150,7 @@ struct hb_set_t
bool in_error;
inline void init (void) {
- header.init ();
+ hb_object_init (this);
clear ();
}
inline void fini (void) {