Changeset 148887 in webkit
- Timestamp:
- Apr 22, 2013 9:03:21 AM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r148886 r148887 1 2013-04-22 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add webkit_web_context_set_disk_cache_directory to WebKit2 GTK+ API 4 https://bugs.webkit.org/show_bug.cgi?id=111848 5 6 Reviewed by Anders Carlsson. 7 8 This allow applications to set a custom directory for the disk 9 cache. 10 11 * UIProcess/API/gtk/WebKitWebContext.cpp: 12 (webkit_web_context_set_disk_cache_directory): 13 * UIProcess/API/gtk/WebKitWebContext.h: 14 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol. 15 * UIProcess/API/gtk/tests/TestMain.cpp: 16 (removeNonEmptyDirectory): 17 (main): Use a different temporary disk cache directory for every 18 test. 19 1 20 2013-04-22 Carlos Garcia Campos <cgarcia@igalia.com> 2 21 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
r145951 r148887 774 774 775 775 /** 776 * webkit_web_context_set_disk_cache_directory: 777 * @context: a #WebKitWebContext 778 * @directory: the directory to set 779 * 780 * Set the directory where disk cache files will be stored 781 * This method must be called before loading anything in this context, otherwise 782 * it will not have any effect. 783 */ 784 void webkit_web_context_set_disk_cache_directory(WebKitWebContext* context, const char* directory) 785 { 786 g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); 787 g_return_if_fail(directory); 788 789 context->priv->context->setDiskCacheDirectory(WebCore::filenameToString(directory)); 790 } 791 792 /** 776 793 * webkit_web_context_prefetch_dns: 777 794 * @context: a #WebKitWebContext -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
r141102 r148887 193 193 const gchar *hostname); 194 194 195 WEBKIT_API void 196 webkit_web_context_set_disk_cache_directory (WebKitWebContext *context, 197 const gchar *directory); 198 195 199 G_END_DECLS 196 200 -
trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
r148679 r148887 48 48 webkit_web_context_set_web_extensions_directory 49 49 webkit_web_context_prefetch_dns 50 webkit_web_context_set_disk_cache_directory 50 51 51 52 <SUBSECTION URI Scheme> -
trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestMain.cpp
r145508 r148887 21 21 #include "TestMain.h" 22 22 23 #include <glib/gstdio.h> 23 24 #include <gtk/gtk.h> 25 #include <webkit2/webkit2.h> 26 #include <wtf/gobject/GOwnPtr.h> 24 27 25 28 void beforeAll(); … … 36 39 } 37 40 41 static void removeNonEmptyDirectory(const char* directoryPath) 42 { 43 GDir* directory = g_dir_open(directoryPath, 0, 0); 44 g_assert(directory); 45 const char* fileName; 46 while ((fileName = g_dir_read_name(directory))) { 47 GOwnPtr<char> filePath(g_build_filename(directoryPath, fileName, NULL)); 48 g_unlink(filePath.get()); 49 } 50 g_dir_close(directory); 51 g_rmdir(directoryPath); 52 } 53 38 54 int main(int argc, char** argv) 39 55 { … … 46 62 registerGResource(); 47 63 64 GOwnPtr<char> diskCacheTempDirectory(g_dir_make_tmp("WebKit2TestsDiskCache-XXXXXX", 0)); 65 g_assert(diskCacheTempDirectory.get()); 66 webkit_web_context_set_disk_cache_directory(webkit_web_context_get_default(), diskCacheTempDirectory.get()); 67 48 68 beforeAll(); 49 69 int returnValue = g_test_run(); 50 70 afterAll(); 51 71 72 removeNonEmptyDirectory(diskCacheTempDirectory.get()); 73 52 74 return returnValue; 53 75 }
Note: See TracChangeset
for help on using the changeset viewer.