Changeset 184851 in webkit
- Timestamp:
- May 25, 2015 8:15:38 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r184846 r184851 1 2015-05-25 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add construct property to WebKitWebContext to set the IndexedDB database directory 4 https://bugs.webkit.org/show_bug.cgi?id=140882 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Add WebKitWebContext:indexed-db-database-directory construct only property. 9 10 * UIProcess/API/gtk/WebKitWebContext.cpp: 11 (webkitWebContextGetProperty): 12 (webkitWebContextSetProperty): 13 (webkitWebContextConstructed): 14 (webkit_web_context_class_init): 15 1 16 2015-05-24 Sam Weinig <sam@webkit.org> 2 17 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
r184334 r184851 103 103 PROP_0, 104 104 105 PROP_LOCAL_STORAGE_DIRECTORY 105 PROP_LOCAL_STORAGE_DIRECTORY, 106 PROP_INDEXED_DB_DIRECTORY 106 107 }; 107 108 … … 183 184 184 185 CString localStorageDirectory; 186 CString indexedDBDirectory; 185 187 }; 186 188 … … 236 238 g_value_set_string(value, context->priv->localStorageDirectory.data()); 237 239 break; 240 case PROP_INDEXED_DB_DIRECTORY: 241 g_value_set_string(value, context->priv->indexedDBDirectory.data()); 242 break; 238 243 default: 239 244 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, paramSpec); … … 249 254 context->priv->localStorageDirectory = g_value_get_string(value); 250 255 break; 256 case PROP_INDEXED_DB_DIRECTORY: 257 context->priv->indexedDBDirectory = g_value_get_string(value); 258 break; 251 259 default: 252 260 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, paramSpec); … … 267 275 if (!priv->localStorageDirectory.isNull()) 268 276 configuration->setLocalStorageDirectory(WebCore::filenameToString(priv->localStorageDirectory.data())); 277 if (!priv->indexedDBDirectory.isNull()) 278 configuration->setIndexedDBDatabaseDirectory(WebCore::filenameToString(priv->indexedDBDirectory.data())); 269 279 270 280 priv->context = WebProcessPool::create(configuration.get()); … … 329 339 _("Local Storage Directory"), 330 340 _("The directory where local storage data will be saved"), 341 nullptr, 342 static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY))); 343 344 /** 345 * WebKitWebContext:indexed-db-directory: 346 * 347 * The directory where IndexedDB databases will be saved. 348 * 349 * Since: 2.10 350 */ 351 g_object_class_install_property( 352 gObjectClass, 353 PROP_INDEXED_DB_DIRECTORY, 354 g_param_spec_string( 355 "indexed-db-directory", 356 _("IndexedDB Directory"), 357 _("The directory where IndexedDB databases will be saved"), 331 358 nullptr, 332 359 static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY))); -
trunk/Tools/ChangeLog
r184850 r184851 1 2015-05-25 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add construct property to WebKitWebContext to set the IndexedDB database directory 4 https://bugs.webkit.org/show_bug.cgi?id=140882 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Make sure unit tests write IndexedDB databases to the temporary 9 directory, and add a test case to check that the directory is 10 correctly created at the expected path. 11 12 * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp: 13 (testWebContextConfiguration): 14 (serverCallback): 15 * TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h: 16 (Test::Test): 17 1 18 2015-05-25 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp
r183992 r184851 42 42 GUniquePtr<char> localStorageDirectory(g_build_filename(Test::dataDirectory(), "local-storage", nullptr)); 43 43 g_assert(g_file_test(localStorageDirectory.get(), G_FILE_TEST_IS_DIR)); 44 45 test->loadURI(kServer->getURIForPath("/empty").data()); 46 test->waitUntilLoadFinished(); 47 test->runJavaScriptAndWaitUntilFinished("window.indexedDB.open('TestDatabase');", nullptr); 48 GUniquePtr<char> indexedDBDirectory(g_build_filename(Test::dataDirectory(), "indexeddb", nullptr)); 49 g_assert(g_file_test(indexedDBDirectory.get(), G_FILE_TEST_IS_DIR)); 44 50 } 45 51 … … 331 337 soup_message_body_append(message->response_body, SOUP_MEMORY_COPY, acceptLanguage, strlen(acceptLanguage)); 332 338 soup_message_body_complete(message->response_body); 339 } else if (g_str_equal(path, "/empty")) { 340 const char* emptyHTML = "<html><body></body></html>"; 341 soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, emptyHTML, strlen(emptyHTML)); 342 soup_message_body_complete(message->response_body); 343 soup_message_set_status(message, SOUP_STATUS_OK); 333 344 } else 334 345 soup_message_set_status(message, SOUP_STATUS_NOT_FOUND); -
trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h
r177496 r184851 69 69 { 70 70 GUniquePtr<char> localStorageDirectory(g_build_filename(dataDirectory(), "local-storage", nullptr)); 71 m_webContext = adoptGRef(WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, "local-storage-directory", localStorageDirectory.get(), nullptr))); 71 GUniquePtr<char> indexedDBDirectory(g_build_filename(dataDirectory(), "indexeddb", nullptr)); 72 m_webContext = adoptGRef(WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, 73 "local-storage-directory", localStorageDirectory.get(), 74 "indexed-db-directory", indexedDBDirectory.get(), 75 nullptr))); 72 76 73 77 g_signal_connect(m_webContext.get(), "initialize-web-extensions", G_CALLBACK(initializeWebExtensionsCallback), this);
Note: See TracChangeset
for help on using the changeset viewer.