Title: [100096] trunk/Source/WebKit/efl
- Revision
- 100096
- Author
- [email protected]
- Date
- 2011-11-13 15:03:43 -0800 (Sun, 13 Nov 2011)
Log Message
[EFL] Simplify eina_stringshare usage in ewk_settings.
https://bugs.webkit.org/show_bug.cgi?id=72127
Patch by Raphael Kubo da Costa <[email protected]> on 2011-11-13
Reviewed by Kenneth Rohde Christiansen.
Actually use the eina_stringshare functions in a sane way.
* ewk/ewk_settings.cpp:
(ewk_settings_web_database_path_set): Just use
eina_stringshare_replace instead of doing needless checks and using
eina_stringshare_add.
(ewk_settings_cache_directory_path_set): Ditto.
(ewk_settings_icon_database_path_set): Ditto and always call
eina_stringshare_del, as passing NULL to it is just a NOP.
Modified Paths
Diff
Modified: trunk/Source/WebKit/efl/ChangeLog (100095 => 100096)
--- trunk/Source/WebKit/efl/ChangeLog 2011-11-13 22:44:16 UTC (rev 100095)
+++ trunk/Source/WebKit/efl/ChangeLog 2011-11-13 23:03:43 UTC (rev 100096)
@@ -1,3 +1,20 @@
+2011-11-13 Raphael Kubo da Costa <[email protected]>
+
+ [EFL] Simplify eina_stringshare usage in ewk_settings.
+ https://bugs.webkit.org/show_bug.cgi?id=72127
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Actually use the eina_stringshare functions in a sane way.
+
+ * ewk/ewk_settings.cpp:
+ (ewk_settings_web_database_path_set): Just use
+ eina_stringshare_replace instead of doing needless checks and using
+ eina_stringshare_add.
+ (ewk_settings_cache_directory_path_set): Ditto.
+ (ewk_settings_icon_database_path_set): Ditto and always call
+ eina_stringshare_del, as passing NULL to it is just a NOP.
+
2011-11-11 JungJik Lee <[email protected]>
[EFL] Remove unused flags in pre-render implementation
Modified: trunk/Source/WebKit/efl/ewk/ewk_settings.cpp (100095 => 100096)
--- trunk/Source/WebKit/efl/ewk/ewk_settings.cpp 2011-11-13 22:44:16 UTC (rev 100095)
+++ trunk/Source/WebKit/efl/ewk/ewk_settings.cpp 2011-11-13 23:03:43 UTC (rev 100096)
@@ -90,13 +90,8 @@
void ewk_settings_web_database_path_set(const char* path)
{
#if ENABLE(SQL_DATABASE)
- WTF::String corePath = WTF::String::fromUTF8(path);
- WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(corePath);
- if (!_ewk_default_web_database_path)
- _ewk_default_web_database_path = eina_stringshare_add(corePath.utf8().data());
- else
- eina_stringshare_replace(&_ewk_default_web_database_path, corePath.utf8().data());
-
+ WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(WTF::String::fromUTF8(path));
+ eina_stringshare_replace(&_ewk_default_web_database_path, path);
#endif
}
@@ -139,17 +134,14 @@
WebCore::iconDatabase().setEnabled(true);
WebCore::iconDatabase().open(WTF::String::fromUTF8(directory), WebCore::IconDatabase::defaultDatabaseFilename());
- if (!_ewk_icon_database_path)
- _ewk_icon_database_path = eina_stringshare_add(directory);
- else
- eina_stringshare_replace(&_ewk_icon_database_path, directory);
+
+ eina_stringshare_replace(&_ewk_icon_database_path, directory);
} else {
WebCore::iconDatabase().setEnabled(false);
WebCore::iconDatabase().close();
- if (_ewk_icon_database_path) {
- eina_stringshare_del(_ewk_icon_database_path);
- _ewk_icon_database_path = 0;
- }
+
+ eina_stringshare_del(_ewk_icon_database_path);
+ _ewk_icon_database_path = 0;
}
return true;
}
@@ -257,10 +249,8 @@
return false;
WebCore::cacheStorage().setCacheDirectory(WTF::String::fromUTF8(path));
- if (!_ewk_cache_directory_path)
- _ewk_cache_directory_path = eina_stringshare_add(path);
- else
- eina_stringshare_replace(&_ewk_cache_directory_path, path);
+ eina_stringshare_replace(&_ewk_cache_directory_path, path);
+
return true;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes