summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-07-26 14:48:26 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-07-26 14:48:26 +0100
commit2bd587add5912c02db71746e83eda47b66fb80af (patch)
tree78001a9ca490a883c23c5dcd735b58585899c74d /content
parentbb870de150eb3c38a76daa802c82a6383a483a1d (diff)
downloadnetsurf-2bd587add5912c02db71746e83eda47b66fb80af.tar.gz
netsurf-2bd587add5912c02db71746e83eda47b66fb80af.tar.bz2
Make the parasitic hack of the old tree code more robust. Now if the temp_treeview_test option is set, the global history and cookie manager will be replaced with their respective new implementations.
Diffstat (limited to 'content')
-rw-r--r--content/urldb.c59
1 files changed, 48 insertions, 11 deletions
diff --git a/content/urldb.c b/content/urldb.c
index f2f9c0a24..feb7c6f81 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -101,6 +101,7 @@
#include "content/content.h"
#include "content/urldb.h"
#include "desktop/cookies_old.h"
+#include "desktop/cookie_manager.h"
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils/corestrings.h"
@@ -2540,7 +2541,13 @@ char *urldb_get_cookie(nsurl *url, bool include_http_only)
version = c->version;
c->last_used = now;
- cookies_schedule_update((struct cookie_data *)c);
+
+ if (nsoption_bool(temp_treeview_test) == false)
+ cookies_schedule_update(
+ (struct cookie_data *)c);
+ else
+ cookie_manager_add(
+ (struct cookie_data *)c);
}
}
}
@@ -2575,7 +2582,13 @@ char *urldb_get_cookie(nsurl *url, bool include_http_only)
version = c->version;
c->last_used = now;
- cookies_schedule_update((struct cookie_data *)c);
+
+ if (nsoption_bool(temp_treeview_test) == false)
+ cookies_schedule_update(
+ (struct cookie_data *)c);
+ else
+ cookie_manager_add(
+ (struct cookie_data *)c);
}
}
@@ -2618,7 +2631,12 @@ char *urldb_get_cookie(nsurl *url, bool include_http_only)
version = c->version;
c->last_used = now;
- cookies_schedule_update((struct cookie_data *)c);
+
+ if (nsoption_bool(temp_treeview_test) == false)
+ cookies_schedule_update(
+ (struct cookie_data *)c);
+ else
+ cookie_manager_add((struct cookie_data *)c);
}
}
@@ -2651,7 +2669,12 @@ char *urldb_get_cookie(nsurl *url, bool include_http_only)
version = c->version;
c->last_used = now;
- cookies_schedule_update((struct cookie_data *)c);
+
+ if (nsoption_bool(temp_treeview_test) == false)
+ cookies_schedule_update(
+ (struct cookie_data *)c);
+ else
+ cookie_manager_add((struct cookie_data *)c);
}
}
@@ -3405,8 +3428,12 @@ bool urldb_insert_cookie(struct cookie_internal_data *c, lwc_string *scheme,
d->prev->next = d->next;
else
p->cookies = d->next;
-
- cookies_remove((struct cookie_data *)d);
+
+ if (nsoption_bool(temp_treeview_test) == false)
+ cookies_remove((struct cookie_data *)d);
+ else
+ cookie_manager_remove((struct cookie_data *)d);
+
urldb_free_cookie(d);
urldb_free_cookie(c);
} else {
@@ -3421,11 +3448,18 @@ bool urldb_insert_cookie(struct cookie_internal_data *c, lwc_string *scheme,
c->prev->next = c;
else
p->cookies = c;
-
- cookies_remove((struct cookie_data *)d);
+
+ if (nsoption_bool(temp_treeview_test) == false)
+ cookies_remove((struct cookie_data *)d);
+ else
+ cookie_manager_remove((struct cookie_data *)d);
urldb_free_cookie(d);
-
- cookies_schedule_update((struct cookie_data *)c);
+
+ if (nsoption_bool(temp_treeview_test) == false)
+ cookies_schedule_update(
+ (struct cookie_data *)c);
+ else
+ cookie_manager_add((struct cookie_data *)c);
}
} else {
c->prev = p->cookies_end;
@@ -3436,7 +3470,10 @@ bool urldb_insert_cookie(struct cookie_internal_data *c, lwc_string *scheme,
p->cookies = c;
p->cookies_end = c;
- cookies_schedule_update((struct cookie_data *)c);
+ if (nsoption_bool(temp_treeview_test) == false)
+ cookies_schedule_update((struct cookie_data *)c);
+ else
+ cookie_manager_add((struct cookie_data *)c);
}
return true;