diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-node.c | 10 | ||||
-rw-r--r-- | lib/ephy-node.h | 2 | ||||
-rw-r--r-- | lib/ephy-types.h | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/lib/ephy-node.c b/lib/ephy-node.c index 19ca32a15..44ae48c2e 100644 --- a/lib/ephy-node.c +++ b/lib/ephy-node.c @@ -96,14 +96,12 @@ enum LAST_SIGNAL }; -#define RESERVED_IDS 10 - static GObjectClass *parent_class = NULL; static guint ephy_node_signals[LAST_SIGNAL] = { 0 }; static GMutex *id_factory_lock = NULL; -static long id_factory = RESERVED_IDS; +static long id_factory; static GStaticRWLock *id_to_node_lock = NULL; static GPtrArray *id_to_node; @@ -399,8 +397,6 @@ ephy_node_new_with_id (gulong reserved_id) { EphyNode *node; - g_return_val_if_fail (reserved_id < RESERVED_IDS, NULL); - node = EPHY_NODE (g_object_new (EPHY_TYPE_NODE, "id", reserved_id, NULL)); @@ -1376,7 +1372,7 @@ ephy_node_get_previous_child (EphyNode *node, } void -ephy_node_system_init (void) +ephy_node_system_init (gulong reserved_ids) { /* id to node */ id_to_node = g_ptr_array_new (); @@ -1385,7 +1381,7 @@ ephy_node_system_init (void) g_static_rw_lock_init (id_to_node_lock); /* id factory */ - id_factory = RESERVED_IDS; + id_factory = reserved_ids; id_factory_lock = g_mutex_new (); } diff --git a/lib/ephy-node.h b/lib/ephy-node.h index 5a3413617..f257ebb1e 100644 --- a/lib/ephy-node.h +++ b/lib/ephy-node.h @@ -136,7 +136,7 @@ EphyNode *ephy_node_get_previous_child (EphyNode *node, EphyNode *child); /* node id services */ -void ephy_node_system_init (void); +void ephy_node_system_init (gulong reserved_ids); void ephy_node_system_shutdown (void); long ephy_node_new_id (void); diff --git a/lib/ephy-types.h b/lib/ephy-types.h index 3d8b6be06..f489081e8 100644 --- a/lib/ephy-types.h +++ b/lib/ephy-types.h @@ -30,6 +30,8 @@ typedef enum G_NOT_IMPLEMENTED } gresult; +#define EPHY_NODE_RESERVED_IDS 100 + /* Ids of the root nodes of history, * bookmarks and favicon cache */ enum |