1. 25 Sep, 2011 1 commit
    • mrowe@apple.com's avatar
      <rdar://problem/10177824> IconDatabase’s use of ThreadCondition leads to... · 245b8e62
      mrowe@apple.com authored
      <rdar://problem/10177824> IconDatabase’s use of ThreadCondition leads to assertion failures in the face of spurious wakeups
      
      It's possible for ThreadCondition::wait to return spuriously without the condition having been signaled.
      When that happens we should immediately return to waiting rather than doing our normal work, as some of that
      work relies on wakeSyncThread having been called to signal the condition.
      
      Reviewed by Sam Weinig.
      
      * loader/icon/IconDatabase.cpp:
      (WebCore::IconDatabase::IconDatabase):
      (WebCore::IconDatabase::wakeSyncThread): Note that we have work for the sync thread to do.
      (WebCore::IconDatabase::syncThreadMainLoop): If we were woken with no work to do, immediately
      go back to waiting on the condition variable. Otherwise, reset m_syncThreadHasWorkToDo and then
      do that work. We also switch to moving m_disabledSuddenTerminationForSyncThread immediately in to
      our local shouldReenableSuddenTermination variable since it can be updated by other threads while
      we don't hold the lock. This makes it inappropriate to make assumptions about its value after dropping
      and reacquiring the lock.
      * loader/icon/IconDatabase.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      245b8e62
  2. 06 Aug, 2011 1 commit
  3. 21 Jul, 2011 1 commit
    • commit-queue@webkit.org's avatar
      Local files cannot load icons. · e490d080
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=62459
      
      Previous policy only allowed favicons for pages whose protocol was part of HTTP family.
      Changed that to allow to any url that's not empty and whose protocol is not "about".
      Also added this check where it attempts to start loading the favicon, so it can avoid
      wasting time downloading a resource that won't be stored and won't be used.
      
      Patch by Rafael Brandao <rafael.lobo@openbossa.org> on 2011-07-21
      Reviewed by Adam Barth.
      
      Test: manual-tests/resources/favicon-loads-for-local-files.html
      
      * loader/icon/IconController.cpp:
      (WebCore::IconController::startLoader): Added check to avoid to request a favicon
      when there's no way to store it.
      
      * loader/icon/IconDatabase.cpp:
      (WebCore::IconDatabase::documentCanHaveIcon): Renamed function "pageCanHaveIcon"
      to reflect better which url we're handling.
      
      (WebCore::IconDatabase::synchronousIconForPageURL): Ditto.
      (WebCore::IconDatabase::synchronousIconURLForPageURL): Ditto.
      (WebCore::IconDatabase::retainIconForPageURL): Ditto.
      (WebCore::IconDatabase::releaseIconForPageURL): Ditto.
      (WebCore::IconDatabase::setIconURLForPageURL): Ditto.
      (WebCore::IconDatabase::getOrCreatePageURLRecord): Ditto.
      (WebCore::IconDatabase::importIconURLForPageURL): Ditto.
      (WebCore::IconDatabase::performURLImport): Ditto.
      * loader/icon/IconDatabase.h:
      * loader/icon/IconDatabaseBase.h:
      (WebCore::IconDatabaseBase::documentCanHaveIcon): Added it as virtual to replace its
      default behavior of not allowing favicons when we have IconDatabase enabled.
      
      * manual-tests/resources/favicon-loads-for-local-files.html: Added.
      * manual-tests/resources/favicon.png: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e490d080
  4. 26 Apr, 2011 1 commit
    • levin@chromium.org's avatar
      Fix a few OwnPtr strict errors in WebCore headers. · 38484e0d
      levin@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=59431
      
      Reviewed by Adam Barth.
      
      * bindings/js/ScheduledAction.cpp:
      (WebCore::ScheduledAction::create):
      * css/MediaQueryMatcher.cpp:
      (WebCore::MediaQueryMatcher::prepareEvaluator):
      * dom/NodeRareData.h:
      (WebCore::NodeListsNodeData::create):
      * dom/ScriptRunner.h:
      (WebCore::ScriptRunner::create):
      * inspector/WorkerInspectorController.cpp:
      (WebCore::WorkerInspectorController::connectFrontend):
      * loader/icon/IconDatabase.h:
      (WebCore::IconDatabase::create):
      * platform/graphics/SimpleFontData.cpp:
      (WebCore::SimpleFontData::verticalRightOrientationFontData):
      (WebCore::SimpleFontData::uprightOrientationFontData):
      (WebCore::SimpleFontData::brokenIdeographFontData):
      * rendering/style/StyleRareInheritedData.cpp:
      (WebCore::StyleRareInheritedData::StyleRareInheritedData):
      * rendering/svg/SVGResources.h:
      (WebCore::SVGResources::ClipperFilterMaskerData::create):
      (WebCore::SVGResources::MarkerData::create):
      (WebCore::SVGResources::FillStrokeData::create):
      * storage/StorageSyncManager.cpp:
      (WebCore::StorageSyncManager::close):
      * workers/WorkerContext.cpp:
      (WebCore::CloseWorkerContextTask::create):
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::MessageWorkerContextTask::create):
      (WebCore::MessageWorkerTask::create):
      (WebCore::WorkerExceptionTask::create):
      (WebCore::WorkerContextDestroyedTask::create):
      (WebCore::WorkerTerminateTask::create):
      (WebCore::WorkerThreadActivityReportTask::create):
      * workers/WorkerRunLoop.cpp:
      (WebCore::WorkerRunLoop::Task::create):
      * workers/WorkerThread.cpp:
      (WebCore::WorkerThreadStartupData::create):
      (WebCore::WorkerThreadShutdownFinishTask::create):
      (WebCore::WorkerThreadShutdownStartTask::create):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@84892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      38484e0d
  5. 24 Mar, 2011 1 commit
    • beidson@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=57058 · 3b040610
      beidson@apple.com authored
      Hookup the UIProcess WebIconDatabase to a WebCore::IconDatabase as its implementation
      
      Reviewed by Sam Weinig.
      
      ../WebCore: 
      
      * loader/icon/IconDatabase.cpp:
      (WebCore::IconDatabase::synchronousLoadDecisionForIconURL): Only add the DocumentLoader to the set if it's non-zero.
      (WebCore::IconDatabase::IconDatabase): Add more logging.
      (WebCore::IconDatabase::performURLImport): Dispatch the "didFinishURLImport" client callback using the following 3 methods.
      (WebCore::FinishedURLImport::FinishedURLImport):
      (WebCore::FinishedURLImport::performWork):
      (WebCore::IconDatabase::dispatchDidFinishURLImportOnMainThread):
      
      * loader/icon/IconDatabase.h:
      (WebCore::IconDatabase::create): Expose a PassOwnPtr<> creator.
      
      * WebCore.exp.in:
      
      ../WebKit2: 
      
      * UIProcess/WebIconDatabase.cpp:
      (WebKit::WebIconDatabase::WebIconDatabase):
      (WebKit::WebIconDatabase::setDatabasePath): Create a new WebCore::IconDatabase and open it to this path.
      (WebKit::WebIconDatabase::retainIconForPageURL): Actually retain the url, using the impl.
      (WebKit::WebIconDatabase::releaseIconForPageURL): Actually release the url, using the impl.
      (WebKit::WebIconDatabase::setIconURLForPageURL): Actually set the url, using the impl.
      (WebKit::WebIconDatabase::setIconDataForIconURL): Actually set the data, using the impl.
      (WebKit::WebIconDatabase::getLoadDecisionForIconURL): Actually ask for a load decision to call back with.
      (WebKit::WebIconDatabase::performImport):
      (WebKit::WebIconDatabase::didImportIconURLForPageURL):
      (WebKit::WebIconDatabase::didImportIconDataForPageURL):
      (WebKit::WebIconDatabase::didChangeIconForPageURL):
      (WebKit::WebIconDatabase::didRemoveAllIcons):
      (WebKit::WebIconDatabase::didFinishURLImport): Notify all the pending callbacks what their load decisions
        are now that they're available.
      * UIProcess/WebIconDatabase.h:
      
      Add an IconDatabase logging channel:
      * Platform/Logging.cpp:
      (WebKit::initializeLogChannelsIfNecessary):
      * Platform/Logging.h:
      
      * UIProcess/WebContext.cpp:
      (WebKit::WebContext::setIconDatabasePath): Pass the new path on to the WebIconDatabase, possibly
        opening it.
      * UIProcess/WebContext.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3b040610
  6. 23 Mar, 2011 2 commits
  7. 22 Mar, 2011 1 commit
    • beidson@apple.com's avatar
      <rdar://problem/8648311> and https://bugs.webkit.org/show_bug.cgi?id=56876 · ccb0e20f
      beidson@apple.com authored
      WK2 Icon DB: Expand IconDatabaseClient interface and move it to the main thread
      
      Reviewed by Sam Weinig.
      
      ../WebCore: 
      
      * loader/icon/IconDatabase.cpp:
      Add a dummy client implementation for non-Mac, non-Win ports:
      (WebCore::DefaultIconDatabaseClient::performImport):
      (WebCore::DefaultIconDatabaseClient::didImportIconURLForPageURL):
      (WebCore::DefaultIconDatabaseClient::didImportIconDataForPageURL):
      (WebCore::DefaultIconDatabaseClient::didChangeIconForPageURL):
      (WebCore::DefaultIconDatabaseClient::didRemoveAllIcons):
      (WebCore::DefaultIconDatabaseClient::didFinishURLImport):
      (WebCore::defaultClient):
      
      Either call the client directly when on the main thread, or use the dispatch functions below
      if on the background thread:
      (WebCore::IconDatabase::setIconDataForIconURL):
      (WebCore::IconDatabase::setIconURLForPageURL):
      (WebCore::IconDatabase::performURLImport):
      (WebCore::IconDatabase::readFromDatabase):
      (WebCore::IconDatabase::removeAllIconsOnThread):
      
      Add a very targeted WorkItem interface for dispatching client calls on the main thread:
      (WebCore::ClientWorkItem::ClientWorkItem):
      (WebCore::ClientWorkItem::~ClientWorkItem):
      (WebCore::ImportedIconURLForPageURLWorkItem::ImportedIconURLForPageURLWorkItem):
      (WebCore::ImportedIconURLForPageURLWorkItem::~ImportedIconURLForPageURLWorkItem):
      (WebCore::ImportedIconURLForPageURLWorkItem::performWork):
      (WebCore::ImportedIconDataForPageURLWorkItem::ImportedIconDataForPageURLWorkItem):
      (WebCore::ImportedIconDataForPageURLWorkItem::~ImportedIconDataForPageURLWorkItem):
      (WebCore::ImportedIconDataForPageURLWorkItem::performWork):
      (WebCore::RemovedAllIconsWorkItem::RemovedAllIconsWorkItem):
      (WebCore::RemovedAllIconsWorkItem::performWork):
      (WebCore::performWorkItem):
      
      Use the client WorkItem interface to perform these callbacks on the main thread:
      (WebCore::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread):
      (WebCore::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread):
      (WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread):
      * loader/icon/IconDatabase.h:
      * loader/icon/IconDatabaseClient.h:
      
      ../WebKit/mac: 
      
      Note that while the new client calls always come through on the main thread, our mechanisms to
      route dispatches to the main thread are still valid and will still work.
      
      Update to the new IconDatabaseClient interface:
      * WebCoreSupport/WebIconDatabaseClient.h:
      * WebCoreSupport/WebIconDatabaseClient.mm:
      (WebIconDatabaseClient::didRemoveAllIcons):
      (WebIconDatabaseClient::didImportIconURLForPageURL):
      (WebIconDatabaseClient::didImportIconDataForPageURL):
      (WebIconDatabaseClient::didChangeIconForPageURL):
      (WebIconDatabaseClient::didFinishURLImport):
      
      ../WebKit/win: 
      
      Note that while the new client calls always come through on the main thread, our mechanisms to
      route dispatches to the main thread are still valid and will still work.
      
      Update to the new IconDatabaseClient interface:
      * WebIconDatabase.cpp:
      (WebIconDatabase::performImport):
      (WebIconDatabase::didRemoveAllIcons):
      (WebIconDatabase::didImportIconURLForPageURL):
      (WebIconDatabase::didImportIconDataForPageURL):
      (WebIconDatabase::didChangeIconForPageURL):
      (WebIconDatabase::didFinishURLImport):
      * WebIconDatabase.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ccb0e20f
  8. 18 Mar, 2011 1 commit
    • beidson@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=56425 · 82f96c84
      beidson@apple.com authored
      More groundwork for WebKit2 IconDatabase
      
      Reviewed by Sam Weinig.
      
      ../WebCore: 
      
      -Update the synchronous method names to be prefixed with "synchronous."
      -Call asynchronous versions of the appropriate methods if the IconDatabase supports them.
      
      Update icon database calls to be prefixed with "synchronous":
      * loader/archive/cf/LegacyWebArchive.cpp:
      (WebCore::LegacyWebArchive::create):
      * loader/icon/IconDatabaseBase.h:
      (WebCore::IconDatabaseBase::synchronousIconDataKnownForIconURL):
      (WebCore::IconDatabaseBase::synchronousLoadDecisionForIconURL):
      (WebCore::IconDatabaseBase::synchronousIconForPageURL):
      * loader/icon/IconDatabase.cpp:
      (WebCore::IconDatabase::synchronousIconForPageURL):
      (WebCore::IconDatabase::readIconForPageURLFromDisk):
      (WebCore::IconDatabase::synchronousIconURLForPageURL):
      (WebCore::IconDatabase::synchronousLoadDecisionForIconURL):
      (WebCore::IconDatabase::synchronousIconDataKnownForIconURL):
      * loader/icon/IconDatabase.h:
      * loader/icon/IconDatabaseBase.cpp:
      (WebCore::IconDatabaseBase::synchronousIconURLForPageURL):
      
      Add nascent support for an asynchronous icon database mode:
      * loader/icon/IconDatabaseBase.h:
      (WebCore::EnumCallback::create):
      (WebCore::EnumCallback::~EnumCallback):
      (WebCore::EnumCallback::performCallback):
      (WebCore::EnumCallback::invalidate):
      (WebCore::EnumCallback::EnumCallback):
      (WebCore::ObjectCallback::create):
      (WebCore::ObjectCallback::~ObjectCallback):
      (WebCore::ObjectCallback::performCallback):
      (WebCore::ObjectCallback::invalidate):
      (WebCore::ObjectCallback::ObjectCallback):
      (WebCore::IconDatabaseBase::supportsAsynchronousMode):
      (WebCore::IconDatabaseBase::loadDecisionForIconURL):
      (WebCore::IconDatabaseBase::iconDataForIconURL):
      
      Add interfaces to use the asynchronous versions of certain IconDatabase calls:
      * loader/DocumentLoader.cpp:
      (WebCore::DocumentLoader::~DocumentLoader):
      (WebCore::DocumentLoader::iconLoadDecisionAvailable):
      (WebCore::iconLoadDecisionCallback):
      (WebCore::DocumentLoader::getIconLoadDecisionForIconURL):
      (WebCore::DocumentLoader::continueIconLoadWithDecision):
      (WebCore::iconDataCallback):
      (WebCore::DocumentLoader::getIconDataForIconURL):
      * loader/DocumentLoader.h:
      
      Break "startIconLoader" into two pieces so it can be used from both the synchronous and asynchronous 
      icon database modes:
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::iconLoadDecisionReceived):
      (WebCore::FrameLoader::startIconLoader):
      (WebCore::FrameLoader::continueIconLoadWithDecision):
      * loader/FrameLoader.h:
      
      * WebCore.exp.in:
      
      ../WebKit/efl: 
      
      Update already-used function names:
      * ewk/ewk_history.cpp:
      (ewk_history_item_icon_surface_get):
      (ewk_history_item_icon_object_add):
      * ewk/ewk_settings.cpp:
      (ewk_settings_icon_database_icon_surface_get):
      (ewk_settings_icon_database_icon_object_add):
      
      ../WebKit/gtk: 
      
      Update already-used function names:
      * webkit/webkiticondatabase.cpp:
      (webkit_icon_database_get_icon_uri):
      (webkit_icon_database_get_icon_pixbuf):
      * webkit/webkitwebview.cpp:
      (webkit_web_view_get_icon_uri):
      
      ../WebKit/mac: 
      
      Update already-used function names:
      * Misc/WebIconDatabase.mm:
      (-[WebIconDatabase iconForURL:withSize:cache:]):
      (-[WebIconDatabase iconURLForURL:]):
      * WebView/WebView.mm:
      (-[WebView _dispatchDidReceiveIconFromWebFrame:]):
      
      ../WebKit/qt: 
      
      Update already-used function names:
      * Api/qwebhistory.cpp:
      (QWebHistoryItem::icon):
      * Api/qwebsettings.cpp:
      (QWebSettings::iconForUrl):
      
      ../WebKit/win: 
      
      Update already-used function names:
      * WebIconDatabase.cpp:
      (WebIconDatabase::iconForURL):
      (WebIconDatabase::iconURLForURL):
      (WebIconDatabase::hasIconForURL):
      
      ../WebKit2: 
      
      -Update the synchronous method names to be prefixed with "synchronous."
      -Add empty implementations for the asynchronous accessors.
      
      * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
      (WebKit::WebIconDatabaseProxy::setEnabled):
      (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL):
      (WebKit::WebIconDatabaseProxy::synchronousIconURLForPageURL):
      (WebKit::WebIconDatabaseProxy::synchronousIconDataKnownForIconURL):
      (WebKit::WebIconDatabaseProxy::synchronousLoadDecisionForIconURL):
      (WebKit::WebIconDatabaseProxy::supportsAsynchronousMode):
      (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
      (WebKit::WebIconDatabaseProxy::iconDataForIconURL):
      * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      82f96c84
  9. 14 Mar, 2011 1 commit
    • beidson@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=56296 · 306e1f97
      beidson@apple.com authored
      Clean up IconDatabaseBase header.
      
      Reviewed by Sam Weinig.
      
      -Get rid of the "PlatformString.h" include and replace it with a forward declaration.
      -Group methods by which are used in WebCore directly and which are used in WebKit ports.
      
      This'll make it easier to use in external frameworks (like WebKit2).
      
      * loader/icon/IconDatabase.h:
      * loader/icon/IconDatabaseBase.h:
      (WebCore::IconDatabaseBase::retainIconForPageURL):
      (WebCore::IconDatabaseBase::releaseIconForPageURL):
      (WebCore::IconDatabaseBase::iconForPageURL):
      (WebCore::IconDatabaseBase::setIconURLForPageURL):
      (WebCore::IconDatabaseBase::setIconDataForIconURL):
      (WebCore::IconDatabaseBase::iconDataKnownForIconURL):
      (WebCore::IconDatabaseBase::loadDecisionForIconURL):
      (WebCore::IconDatabaseBase::importIconURLForPageURL):
      (WebCore::IconDatabaseBase::importIconDataForIconURL):
      (WebCore::IconDatabaseBase::open):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      306e1f97
  10. 11 Mar, 2011 4 commits
    • beidson@apple.com's avatar
      Attempted Qt build fix for https://bugs.webkit.org/show_bug.cgi?id=56216 · ffb18bab
      beidson@apple.com authored
      * loader/icon/IconDatabase.h: Make this guy public.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ffb18bab
    • beidson@apple.com's avatar
      Attempted Qt build fix for https://bugs.webkit.org/show_bug.cgi?id=56216 · da2ce3b7
      beidson@apple.com authored
      * loader/icon/IconDatabase.h:
      (WebCore::IconDatabase::delayDatabaseCleanup): Maybe Qt has Icon Database disabled, so we need to define this here?
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      da2ce3b7
    • beidson@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=56216 · 1138f382
      beidson@apple.com authored
      Fix the Qt build following the same pattern of the patch.
      
      ../WebCore: 
      
      * loader/icon/IconDatabase.h:
      * loader/icon/IconDatabaseBase.cpp:
      (WebCore::IconDatabaseBase::databasePath): Added to the virtual base.
      * loader/icon/IconDatabaseBase.h:
      (WebCore::IconDatabaseBase::isOpen): Ditto.
      
      ../WebKit/qt: 
      
      Reviewed by attempt at build fix!
      
      * Api/qwebsettings.cpp:
      (QWebSettings::setIconDatabasePath): Call the static method via IconDatabase:: and not via iconDatabase()
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1138f382
    • beidson@apple.com's avatar
      <rdar://problem/8648311> and https://bugs.webkit.org/show_bug.cgi?id=56216 · 3180d973
      beidson@apple.com authored
      Rework disabled IconDatabase builds while allowing for a pluggable icon database implementation.
      
      ../WebCore: 
      
      Reviewed by Sam Weinig.
      
      Project file stuff:
      * Android.mk:
      * CMakeLists.txt:
      * GNUmakefile.am:
      * WebCore.gyp/WebCore.gyp:
      * WebCore.gypi:
      * WebCore.pro:
      * WebCore.xcodeproj/project.pbxproj:
      * WebCore.vcproj/WebCore.vcproj:
      
      * loader/icon/IconDatabase.cpp:
      * loader/icon/IconDatabase.h: Inherit from IconDatabaseBase.
      
      * loader/icon/IconDatabaseBase.cpp: Added.
      (WebCore::IconDatabaseBase::iconURLForPageURL):
      (WebCore::iconDatabase):
      (WebCore::setGlobalIconDatabase):
      * loader/icon/IconDatabaseBase.h: Added.
      (WebCore::IconDatabaseBase::IconDatabaseBase):
      (WebCore::IconDatabaseBase::~IconDatabaseBase):
      (WebCore::IconDatabaseBase::setEnabled):
      (WebCore::IconDatabaseBase::isEnabled):
      (WebCore::IconDatabaseBase::defaultIcon):
      (WebCore::IconDatabaseBase::retainIconForPageURL):
      (WebCore::IconDatabaseBase::releaseIconForPageURL):
      (WebCore::IconDatabaseBase::iconForPageURL):
      (WebCore::IconDatabaseBase::setIconURLForPageURL):
      (WebCore::IconDatabaseBase::setIconDataForIconURL):
      (WebCore::IconDatabaseBase::iconDataKnownForIconURL):
      (WebCore::IconDatabaseBase::loadDecisionForIconURL):
      (WebCore::IconDatabaseBase::pageURLMappingCount):
      (WebCore::IconDatabaseBase::retainedPageURLCount):
      (WebCore::IconDatabaseBase::iconRecordCount):
      (WebCore::IconDatabaseBase::iconRecordCountWithData):
      (WebCore::IconDatabaseBase::importIconURLForPageURL):
      (WebCore::IconDatabaseBase::importIconDataForIconURL):
      (WebCore::IconDatabaseBase::shouldStopThreadActivity):
      (WebCore::IconDatabaseBase::open):
      (WebCore::IconDatabaseBase::close):
      (WebCore::IconDatabaseBase::removeAllIcons):
      (WebCore::IconDatabaseBase::setPrivateBrowsingEnabled):
      (WebCore::IconDatabaseBase::setClient):
      
      * loader/icon/IconDatabaseNone.cpp: Removed.
      
      ../WebKit/mac: 
      
      Reviewed by Anders Carlsson
      
      * Misc/WebIconDatabase.mm:
      (+[WebIconDatabase _checkIntegrityBeforeOpening]): Call these static methods on IconDatabase::, not iconDatabase().
      (-[WebIconDatabase _startUpIconDatabase]): Ditto.
      (importToWebCoreFormat):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3180d973
  11. 03 Mar, 2011 1 commit
    • beidson@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=55721 · 43d2443f
      beidson@apple.com authored
      Global IconDatabase should be returned by reference, not as a pointer
      
      Reviewed by Darin Adler.
      
      ../WebCore: 
      
      * history/HistoryItem.cpp:
      (WebCore::HistoryItem::HistoryItem):
      (WebCore::HistoryItem::~HistoryItem):
      (WebCore::HistoryItem::reset):
      (WebCore::HistoryItem::icon):
      (WebCore::HistoryItem::setURLString):
      
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::startIconLoader):
      (WebCore::FrameLoader::commitIconURLToIconDatabase):
      
      * loader/archive/cf/LegacyWebArchive.cpp:
      (WebCore::LegacyWebArchive::create):
      
      * loader/icon/IconDatabase.cpp:
      (WebCore::iconDatabase):
      * loader/icon/IconDatabase.h:
      * loader/icon/IconDatabaseNone.cpp:
      (WebCore::iconDatabase):
      * loader/icon/wince/IconDatabaseWinCE.cpp:
      (WebCore::iconDatabase):
      
      * loader/icon/IconLoader.cpp:
      (WebCore::IconLoader::finishLoading):
      
      ../WebKit/efl: 
      
      * ewk/ewk_settings.cpp:
      (ewk_settings_icon_database_path_set):
      (ewk_settings_icon_database_path_get):
      (ewk_settings_icon_database_clear):
      (ewk_settings_icon_database_icon_surface_get):
      (ewk_settings_icon_database_icon_object_add):
      
      ../WebKit/gtk: 
      
      * webkit/webkitglobals.cpp:
      (closeIconDatabaseOnExit):
      (WebKit::setIconDatabaseEnabled):
      * webkit/webkitwebview.cpp:
      (webkit_web_view_get_icon_uri):
      
      ../WebKit/mac: 
      
      * Misc/WebCoreStatistics.mm:
      (+[WebCoreStatistics iconPageURLMappingCount]):
      (+[WebCoreStatistics iconRetainedPageURLCount]):
      (+[WebCoreStatistics iconRecordCount]):
      (+[WebCoreStatistics iconsWithDataCount]):
      * Misc/WebIconDatabase.mm:
      (-[WebIconDatabase init]):
      (-[WebIconDatabase iconForURL:withSize:cache:]):
      (-[WebIconDatabase iconURLForURL:]):
      (-[WebIconDatabase defaultIconWithSize:]):
      (-[WebIconDatabase retainIconForURL:]):
      (-[WebIconDatabase releaseIconForURL:]):
      (-[WebIconDatabase isEnabled]):
      (-[WebIconDatabase setEnabled:]):
      (-[WebIconDatabase removeAllIcons]):
      (+[WebIconDatabase _checkIntegrityBeforeOpening]):
      (-[WebIconDatabase _startUpIconDatabase]):
      (-[WebIconDatabase _applicationWillTerminate:]):
      (-[WebIconDatabase _resetCachedWebPreferences:]):
      (importToWebCoreFormat):
      * WebView/WebView.mm:
      (-[WebView _dispatchDidReceiveIconFromWebFrame:]):
      
      ../WebKit/qt: 
      
      * Api/qwebsettings.cpp:
      (QWebSettings::setIconDatabasePath):
      (QWebSettings::iconDatabasePath):
      (QWebSettings::clearIconDatabase):
      (QWebSettings::iconForUrl):
      
      ../WebKit/win: 
      
      * WebCoreStatistics.cpp:
      (WebCoreStatistics::iconPageURLMappingCount):
      (WebCoreStatistics::iconRetainedPageURLCount):
      (WebCoreStatistics::iconRecordCount):
      (WebCoreStatistics::iconsWithDataCount):
      * WebIconDatabase.cpp:
      (WebIconDatabase::init):
      (WebIconDatabase::startUpIconDatabase):
      (WebIconDatabase::iconForURL):
      (WebIconDatabase::retainIconForURL):
      (WebIconDatabase::releaseIconForURL):
      (WebIconDatabase::removeAllIcons):
      (WebIconDatabase::iconURLForURL):
      (WebIconDatabase::isEnabled):
      (WebIconDatabase::setEnabled):
      (WebIconDatabase::hasIconForURL):
      (WebIconDatabase::getOrCreateDefaultIconBitmap):
      * WebKitDLL.cpp:
      (shutDownWebKit):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      43d2443f
  12. 25 Jan, 2011 1 commit
    • darin@apple.com's avatar
      2011-01-25 Darin Adler <darin@apple.com> · c58ff503
      darin@apple.com authored
              Reviewed by Anders Carlsson.
      
              WebKit is using CSBackupSetItemExcluded incorrectly
              https://bugs.webkit.org/show_bug.cgi?id=53095
              rdar://problem/8790540
      
              * Misc/WebIconDatabase.mm:
              (importToWebCoreFormat): Removed code that was calling CSBackupSetItemExcluded.
              It was incorrect, and this responsibility has been moved to WebCore.
      2011-01-25  Darin Adler  <darin@apple.com>
      
              Reviewed by Anders Carlsson.
      
              WebKit is using CSBackupSetItemExcluded incorrectly
              https://bugs.webkit.org/show_bug.cgi?id=53095
              rdar://problem/8790540
      
              * loader/icon/IconDatabase.cpp:
              (WebCore::IconDatabase::performOpenInitialization): Added code to
              exclude the database from backup one time, and record inside the
              database that this has been done.
              (WebCore::IconDatabase::wasExcludedFromBackup): Added.
              (WebCore::IconDatabase::setWasExcludedFromBackup): Added.
              * loader/icon/IconDatabase.h: Added new functions above.
      
              * platform/FileSystem.cpp:
              (WebCore::canExcludeFromBackup): Added.
              (WebCore::excludeFromBackup): Added.
      
              * platform/FileSystem.h: Added canExcludeFromBackup, excludeFromBackup,
              and pathAsURL functions. Cleaned up ifdefs and comments a bit and sorted
              things alphabetically, particularly platform-specific sections.
      
              * platform/cf/FileSystemCF.cpp:
              (WebCore::pathAsURL): Added.
      
              * platform/mac/FileSystemMac.mm:
              (WebCore::canExcludeFromBackup): Added.
              (WebCore::excludeFromBackup): Added.
      
              * platform/network/cf/FormDataStreamCFNet.cpp:
              (WebCore::advanceCurrentStream): Changed to call pathAsURL.
              * platform/network/mac/FormDataStreamMac.mm:
              (WebCore::advanceCurrentStream): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c58ff503
  13. 20 Jan, 2011 1 commit
    • ossy@webkit.org's avatar
      Refactoring of the custom allocation framework · 95c1bc42
      ossy@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=49897
      
      Patch by Zoltan Horvath <zoltan@webkit.org> on 2011-01-20
      Reviewed by Csaba Osztrogonác.
      
      Source/JavaScriptCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      * wtf/FastAllocBase.h: Turn FastAllocBase's implementation into a macro.
      
      Source/WebCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit2:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Tools:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      95c1bc42
  14. 08 Jan, 2011 1 commit
  15. 25 Aug, 2010 1 commit
    • mrowe@apple.com's avatar
      <rdar://problem/8205479> WebCore's icon database often prevents Safari from... · 4a63af98
      mrowe@apple.com authored
      <rdar://problem/8205479> WebCore's icon database often prevents Safari from being killable via sudden termination
      
      Reviewed by Dan Bernstein.
      
      We need to ensure that each call to disableSuddenTermination is balanced by a corresponding call to enableSuddenTermination.
      It's possbile for several calls to IconDatabase::wakeSyncThread to correspond to only a single iteration of the loop within
      IconDatabase::syncThreadMainLoop. This results in the sudden termination disable count growing without bound rather than
      being balanced when the work completes. We can prevent this by ensuring that we only disable sudden termination once for each
      corresponding iteration of the sync thread's main loop.
      
      * loader/icon/IconDatabase.cpp:
      (WebCore::IconDatabase::IconDatabase):
      (WebCore::IconDatabase::wakeSyncThread): Only disable sudden termination if it has not yet been disabled for this iteration of
      the sync thread's main loop.
      (WebCore::IconDatabase::syncThreadMainLoop): Clear the flag indicating that sudden termination has been disabled after reenabling it
      so that future calls to wakeSyncThread disable sudden termination once more.
      * loader/icon/IconDatabase.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4a63af98
  16. 10 Aug, 2010 1 commit
    • barraclough@apple.com's avatar
      Bug 43786 - Move AtomicStringHash from WebCore to WTF · bbb3cd43
      barraclough@apple.com authored
      Also remove deprecated string headers from WebCore/platform/text.
      
      Rubber stamped by Sam Weinig.
      
      JavaScriptCore: 
      
      * GNUmakefile.am:
      * JavaScriptCore.gypi:
      * JavaScriptCore.vcproj/WTF/WTF.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * wtf/text/AtomicString.h:
      * wtf/text/AtomicStringHash.h: Copied from WebCore/platform/text/AtomicStringHash.h.
      
      WebCore: 
      
      * ForwardingHeaders/wtf/text/AtomicStringHash.h: Added.
      * GNUmakefile.am:
      * WebCore.gypi:
      * WebCore.pro:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
      * bindings/cpp/WebDOMHTMLCollectionCustom.cpp:
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      * bindings/js/JSClipboardCustom.cpp:
      * bindings/js/JSDOMApplicationCacheCustom.cpp:
      * bindings/js/JSDOMMimeTypeArrayCustom.cpp:
      * bindings/js/JSDOMPluginArrayCustom.cpp:
      * bindings/js/JSDOMPluginCustom.cpp:
      * bindings/js/JSDOMStringMapCustom.cpp:
      * bindings/js/JSDOMWindowCustom.cpp:
      * bindings/js/JSDataGridColumnListCustom.cpp:
      * bindings/js/JSHTMLAllCollectionCustom.cpp:
      * bindings/js/JSHTMLCollectionCustom.cpp:
      * bindings/js/JSMessagePortCustom.cpp:
      * bindings/js/JSNodeListCustom.cpp:
      * bindings/scripts/CodeGeneratorCPP.pm:
      * bindings/scripts/CodeGeneratorJS.pm:
      * bindings/scripts/CodeGeneratorV8.pm:
      * bindings/scripts/test/CPP/WebDOMTestCallback.cpp:
      * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
      * bindings/scripts/test/V8/V8TestInterface.h:
      * bindings/scripts/test/V8/V8TestObj.h:
      * bindings/v8/ScriptDebugServer.h:
      * bindings/v8/V8Binding.cpp:
      * bindings/v8/V8Binding.h:
      * bridge/jni/v8/JavaClassV8.h:
      * css/CSSFontFaceSource.h:
      * css/CSSFontSelector.cpp:
      * css/CSSFontSelector.h:
      * css/CSSNamespace.h:
      * css/CSSParser.cpp:
      * css/CSSParser.h:
      * css/CSSParserValues.h:
      * css/CSSStyleSelector.h:
      * css/CSSVariablesDeclaration.h:
      * css/MediaFeatureNames.h:
      * css/MediaQueryExp.h:
      * css/WebKitCSSKeyframesRule.h:
      * dom/CustomEvent.h:
      * dom/Document.cpp:
      * dom/Event.cpp:
      * dom/Event.h:
      * dom/EventNames.h:
      * dom/EventTarget.h:
      * dom/InputElement.h:
      * dom/MessagePort.cpp:
      * dom/MessagePort.h:
      * dom/NameNodeList.h:
      * dom/NodeRareData.h:
      * dom/QualifiedName.h:
      * dom/ScriptElement.cpp:
      * dom/SpaceSplitString.h:
      * dom/TagNodeList.h:
      * dom/XMLDocumentParser.h:
      * editing/EditorCommand.cpp:
      * history/mac/HistoryItemMac.mm:
      * html/BlobBuilder.cpp:
      * html/DataGridColumn.h:
      * html/DataGridColumnList.cpp:
      * html/HTMLDocument.h:
      * html/HTMLInputElement.cpp:
      * html/HTMLTokenizer.cpp:
      * html/HTMLTokenizer.h:
      * html/LegacyPreloadScanner.cpp:
      * html/LegacyPreloadScanner.h:
      * inspector/InspectorCSSStore.h:
      * inspector/InspectorController.h:
      * inspector/InspectorDOMAgent.cpp:
      * inspector/InspectorDOMAgent.h:
      * inspector/InspectorDebuggerAgent.h:
      * inspector/InspectorValues.h:
      * loader/Cache.h:
      * loader/CrossOriginAccessControl.cpp:
      * loader/CrossOriginPreflightResultCache.h:
      * loader/DocLoader.h:
      * loader/ImageLoader.h:
      * loader/appcache/ApplicationCache.h:
      * loader/appcache/ApplicationCacheStorage.h:
      * loader/appcache/DOMApplicationCache.h:
      * loader/icon/IconDatabase.h:
      * loader/icon/IconRecord.h:
      * loader/loader.h:
      * notifications/Notification.h:
      * page/FrameTree.h:
      * page/Page.cpp:
      * page/PageGroup.h:
      * page/SecurityOrigin.h:
      * page/Settings.h:
      * page/WindowFeatures.cpp:
      * page/animation/AnimationBase.h:
      * page/animation/AnimationControllerPrivate.h:
      * page/animation/CompositeAnimation.h:
      * platform/Cookie.h:
      * platform/KURL.cpp:
      * platform/KURLGoogle.cpp:
      * platform/KURLHash.h:
      * platform/Length.cpp:
      * platform/LinkHash.cpp:
      * platform/LinkHash.h:
      * platform/MIMETypeRegistry.cpp:
      * platform/MIMETypeRegistry.h:
      * platform/SchemeRegistry.h:
      * platform/ThreadGlobalData.cpp:
      * platform/ThreadGlobalData.h:
      * platform/cf/BinaryPropertyList.cpp:
      * platform/chromium/SearchPopupMenuChromium.cpp:
      * platform/efl/ClipboardEfl.cpp:
      * platform/efl/CookieJarEfl.cpp:
      * platform/efl/PlatformKeyboardEventEfl.cpp:
      * platform/graphics/FontCache.cpp:
      * platform/graphics/FontFamily.h:
      * platform/graphics/MediaPlayer.h:
      * platform/graphics/cg/ImageSourceCGWin.cpp:
      * platform/graphics/chromium/FontCacheChromiumWin.cpp:
      * platform/graphics/chromium/FontCacheLinux.cpp:
      * platform/graphics/chromium/FontUtilsChromiumWin.cpp:
      * platform/graphics/chromium/LayerChromium.h:
      * platform/graphics/filters/Filter.h:
      * platform/graphics/mac/FontPlatformData.h:
      * platform/graphics/mac/GraphicsLayerCA.h:
      * platform/graphics/qt/FontCacheQt.cpp:
      * platform/graphics/win/FontCacheWin.cpp:
      * platform/graphics/win/FontPlatformDataCGWin.cpp:
      * platform/graphics/win/FontPlatformDataCairoWin.cpp:
      * platform/graphics/win/FontPlatformDataWin.cpp:
      * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
      * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
      * platform/graphics/win/WKCACFLayer.h:
      * platform/graphics/wince/FontPlatformData.cpp:
      * platform/graphics/wx/FontPlatformData.h:
      * platform/gtk/ClipboardGtk.cpp:
      * platform/gtk/DataObjectGtk.h:
      * platform/haiku/ClipboardHaiku.cpp:
      * platform/haiku/CookieJarHaiku.cpp:
      * platform/haiku/SearchPopupMenuHaiku.cpp:
      * platform/mac/SearchPopupMenuMac.mm:
      * platform/mac/ThreadCheck.mm:
      * platform/network/CredentialStorage.cpp:
      * platform/network/HTTPHeaderMap.h:
      * platform/network/cf/DNSCFNet.cpp:
      * platform/network/curl/CookieJarCurl.cpp:
      * platform/qt/ClipboardQt.cpp:
      * platform/text/AtomicString.h: Removed.
      * platform/text/AtomicStringHash.h: Removed.
      * platform/text/AtomicStringImpl.h: Removed.
      * platform/text/AtomicStringKeyedMRUCache.h:
      * platform/text/StringBuilder.cpp:
      * platform/text/StringHash.h: Removed.
      * platform/text/StringImpl.h: Removed.
      * platform/text/TextCodecLatin1.cpp:
      * platform/text/TextCodecUTF16.cpp:
      * platform/text/TextCodecUserDefined.cpp:
      * platform/text/cf/HyphenationCF.cpp:
      * platform/text/cf/StringImplCF.cpp:
      * platform/text/mac/HyphenationMac.mm:
      * platform/text/mac/StringImplMac.mm:
      * platform/text/transcoder/FontTranscoder.h:
      * platform/text/wince/TextCodecWinCE.cpp:
      * platform/win/BString.cpp:
      * platform/win/ClipboardWin.cpp:
      * platform/win/SearchPopupMenuWin.cpp:
      * platform/wince/SearchPopupMenuWince.cpp:
      * platform/wx/ClipboardWx.cpp:
      * plugins/DOMMimeTypeArray.cpp:
      * plugins/DOMPlugin.cpp:
      * plugins/DOMPluginArray.cpp:
      * plugins/PluginDatabase.h:
      * plugins/PluginPackage.h:
      * plugins/PluginStream.h:
      * rendering/RenderApplet.h:
      * rendering/RenderText.cpp:
      * rendering/style/BindingURI.h:
      * rendering/style/ContentData.cpp:
      * rendering/style/CounterContent.h:
      * rendering/style/CounterDirectives.h:
      * rendering/style/KeyframeList.h:
      * rendering/style/StyleRareInheritedData.h:
      * storage/AbstractDatabase.cpp:
      * storage/DatabaseAuthorizer.h:
      * storage/DatabaseTracker.h:
      * storage/IDBDatabaseBackendImpl.h:
      * storage/IDBFactoryBackendImpl.h:
      * storage/IDBObjectStoreBackendImpl.h:
      * storage/OriginQuotaManager.h:
      * storage/OriginUsageRecord.h:
      * storage/SQLTransactionCoordinator.h:
      * storage/StorageAreaSync.h:
      * storage/StorageMap.h:
      * storage/StorageNamespaceImpl.cpp:
      * storage/chromium/QuotaTracker.h:
      * svg/SVGAltGlyphElement.h:
      * svg/SVGDocumentExtensions.cpp:
      * svg/SVGDocumentExtensions.h:
      * svg/SVGFitToViewBox.cpp:
      * svg/SVGLangSpace.h:
      * svg/animation/SMILTimeContainer.h:
      * svg/graphics/filters/SVGFilterBuilder.h:
      * websockets/WebSocket.h:
      * websockets/WebSocketChannel.cpp:
      * websockets/WebSocketHandshake.cpp:
      * websockets/WebSocketHandshakeResponse.cpp:
      * wml/WMLPageState.h:
      * workers/AbstractWorker.h:
      * workers/DefaultSharedWorkerRepository.h:
      * workers/Worker.h:
      * workers/WorkerContext.h:
      * xml/XMLHttpRequest.h:
      * xml/XMLHttpRequestUpload.cpp:
      * xml/XMLHttpRequestUpload.h:
      * xml/XPathExpressionNode.h:
      * xml/XPathNamespace.h:
      * xml/XPathParser.cpp:
      * xml/XSLTProcessor.h:
      
      WebKit/chromium: 
      
      * src/WebKit.cpp:
      * src/WebPageSerializerImpl.h:
      * src/WebString.cpp:
      
      WebKit/gtk: 
      
      * gdom/ConvertToGCharPrivate.h:
      
      WebKit/wx: 
      
      * WebEdit.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bbb3cd43
  17. 14 Jul, 2009 1 commit
    • bfulgham@webkit.org's avatar
      JavaScriptCore: · 8a8a2f45
      bfulgham@webkit.org authored
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * bytecode/SamplingTool.h:
              * bytecompiler/RegisterID.h:
              * interpreter/CachedCall.h:
              * interpreter/RegisterFile.h:
              * parser/Lexer.h:
              * parser/Parser.h:
              * runtime/ArgList.h:
              * runtime/BatchedTransitionOptimizer.h:
              * runtime/Collector.h:
              * runtime/CommonIdentifiers.h:
              * runtime/JSCell.h:
              * runtime/JSGlobalObject.h:
              * runtime/JSLock.h:
              * runtime/JSONObject.cpp:
              * runtime/SmallStrings.cpp:
              * runtime/SmallStrings.h:
              * wtf/CrossThreadRefCounted.h:
              * wtf/GOwnPtr.h:
              * wtf/Locker.h:
              * wtf/MessageQueue.h:
              * wtf/OwnArrayPtr.h:
              * wtf/OwnFastMallocPtr.h:
              * wtf/OwnPtr.h:
              * wtf/RefCounted.h:
              * wtf/ThreadSpecific.h:
              * wtf/Threading.h:
              * wtf/Vector.h:
              * wtf/unicode/Collator.h:
      
      WebCore:
      
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * bindings/js/GCController.h:
              * bindings/js/WorkerScriptController.h:
              * bindings/v8/V8DOMMap.cpp:
              (WebCore::):
              * bridge/runtime.h:
              * css/CSSSelector.h:
              * css/CSSSelectorList.h:
              * css/CSSStyleSelector.h:
              * dom/ClassNames.h:
              * dom/MessagePortChannel.h:
              * dom/XMLTokenizerLibxml2.cpp:
              * dom/XMLTokenizerScope.h:
              * editing/ReplaceSelectionCommand.cpp:
              * editing/SelectionController.h:
              * editing/TextIterator.cpp:
              * history/PageCache.h:
              * html/CanvasRenderingContext2D.h:
              * html/HTMLParser.h:
              * html/HTMLParserQuirks.h:
              * html/PreloadScanner.h:
              * loader/Cache.h:
              * loader/CrossOriginPreflightResultCache.h:
              * loader/FrameLoader.h:
              * loader/ProgressTracker.h:
              * loader/ThreadableLoader.h:
              * loader/appcache/ApplicationCacheGroup.h:
              * loader/archive/ArchiveResourceCollection.h:
              * loader/icon/IconDatabase.h:
              * loader/icon/IconLoader.h:
              * loader/icon/PageURLRecord.h:
              * loader/loader.h:
              * page/ContextMenuController.h:
              * page/EventHandler.h:
              * page/FrameTree.h:
              * page/Page.h:
              * page/PageGroup.h:
              * page/PageGroupLoadDeferrer.h:
              * page/mac/EventHandlerMac.mm:
              * platform/AutodrainedPool.h:
              * platform/ContextMenu.h:
              * platform/EventLoop.h:
              * platform/HostWindow.h:
              * platform/Pasteboard.h:
              * platform/PurgeableBuffer.h:
              * platform/RunLoopTimer.h:
              * platform/ThreadGlobalData.h:
              * platform/ThreadTimers.h:
              * platform/Timer.h:
              * platform/TreeShared.h:
              * platform/graphics/FontData.h:
              * platform/graphics/GlyphWidthMap.h:
              * platform/graphics/GraphicsContext.h:
              * platform/graphics/ImageBuffer.h:
              * platform/graphics/ImageSource.h:
              * platform/graphics/MediaPlayer.h:
              * platform/graphics/skia/GraphicsContextPlatformPrivate.h:
              * platform/graphics/skia/PlatformContextSkia.h:
              * platform/graphics/win/QTMovieWin.cpp:
              * platform/mac/LocalCurrentGraphicsContext.h:
              * platform/network/FormDataBuilder.h:
              * platform/network/ResourceHandleInternal.h:
              * platform/network/soup/ResourceHandleSoup.cpp:
              * platform/text/StringBuffer.h:
              * platform/text/TextCodec.h:
              * platform/win/WindowMessageBroadcaster.h:
              * rendering/CounterNode.h:
              * rendering/LayoutState.h:
              * rendering/RenderFrameSet.h:
              * rendering/RenderView.h:
              * rendering/TransformState.h:
              * svg/SVGAnimatedProperty.h:
              * svg/SynchronizableTypeWrapper.h:
              * workers/WorkerMessagingProxy.h:
              * workers/WorkerRunLoop.cpp:
              * xml/XPathExpressionNode.h:
              * xml/XPathParser.h:
              * xml/XPathPredicate.h:
              * xml/XPathStep.h:
      
      WebKit/gtk:
      
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * webkit/webkitdownload.cpp:
      
      WebKit/win:
      
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * COMEnumVariant.h:
              * WebDatabaseManager.cpp:
              * WebInspector.h:
              * WebLocalizableStrings.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8a8a2f45
  18. 11 Jul, 2009 1 commit
    • ddkilzer@apple.com's avatar
      Bug 27007: Build fixes when ICONDATABASE is disabled · 8c80d4f2
      ddkilzer@apple.com authored
              <https://bugs.webkit.org/show_bug.cgi?id=27007>
      
              Reviewed by Sam Weinig.
      
      WebCore:
      
              * WebCore.xcodeproj/project.pbxproj: Added IconDatabaseNone.cpp
              to the project.
              * loader/icon/IconDatabase.cpp: Added
              #if ENABLE(ICONDATABASE)/#endif macro guard.
              * loader/icon/IconDatabase.h: Removed three public methods from
              #if ENABLE(ICONDATABASE)/#endif macro so that they may be
              stubbed out in IconDatabaseNone.cpp.
              * loader/icon/IconDatabaseNone.cpp: Added
              #if !ENABLE(ICONDATABASE)/#endif macro guard.
              (WebCore::IconDatabase::importIconURLForPageURL): Added.
              (WebCore::IconDatabase::importIconDataForIconURL): Added.
              (WebCore::IconDatabase::shouldStopThreadActivity): Added.
      
      WebKit/mac:
      
              * Misc/WebIconDatabase.mm:
              (defaultClient): Return 0 if ICONDATABASE is disabled.
              * WebCoreSupport/WebFrameLoaderClient.mm:
              (WebFrameLoaderClient::dispatchDidReceiveIcon): Commented out
              the body of the method if ICONDATABASE is disabled.
              (WebFrameLoaderClient::registerForIconNotification): Ditto.
              * WebCoreSupport/WebIconDatabaseClient.mm: Added #if
              ENABLE(ICONDATABASE)/#endif guard to source.
              * WebView/WebView.mm:
              (-[WebView setFrameLoadDelegate:]): Wrapped code that starts the
              icon database machinery in #if ENABLE(ICONDATABASE)/#endif.
              (-[WebView _registerForIconNotification:]): Wrapped method in
              #if ENABLE(ICONDATABASE)/#endif guard.
              (-[WebView _dispatchDidReceiveIconFromWebFrame:]): Ditto.
              * WebView/WebViewInternal.h: Wrapped methods in #if
              ENABLE(ICONDATABASE)/#endif guard.
              (-[WebView _registerForIconNotification:]):
              (-[WebView _dispatchDidReceiveIconFromWebFrame:]):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8c80d4f2
  19. 19 Apr, 2009 1 commit
    • darin@apple.com's avatar
      2009-04-19 Darin Adler <darin@apple.com> · 3b2486e3
      darin@apple.com authored
              Reviewed by Sam Weinig.
      
              Add hoooks so sudden termination will not cause loss of icons or local storage.
              rdar://problem/5951701
      
              * loader/icon/IconDatabase.cpp: Marked various constants static to give them
              internal linkage.
              (WebCore::IconDatabase::IconDatabase): Added initial value for m_syncTimer.
              Removed unneeded initial value for m_defaultIconRecord. Changed assertion to
              work cross-platform.
              (WebCore::IconDatabase::wakeSyncThread): Added disableSuddenTermination, so
              we won't terminate until the sync thread has done its thing.
              (WebCore::IconDatabase::scheduleOrDeferSyncTimer): Added disableSuddenTermination,
              so we won't terminate if we have an outstanding sync timer.
              (WebCore::IconDatabase::syncTimerFired): Added enableSuddenTermination, to
              balance the one in scheduleOrDeferSyncTimer.
              (WebCore::IconDatabase::syncThreadMainLoop): Added enableSuddenTermination, to
              balance the one in wakeSyncThread.
              (WebCore::IconDatabase::deleteAllPreparedStatements): Use clear() instead of set(0).
      
              * loader/icon/IconDatabase.h: Use a Timer instead of an OwnPtr<Timer>.
      
              * storage/LocalStorageArea.cpp:
              (WebCore::LocalStorageArea::scheduleFinalSync): Added disableSuddenTermination.
              (WebCore::LocalStorageArea::scheduleItemForSync): Ditto.
              (WebCore::LocalStorageArea::scheduleClear): Ditto.
              (WebCore::LocalStorageArea::syncTimerFired): Added a disableSuddenTermination if
              we schedule a performSync callback for later and an unconditional
              enableSuddenTermination to balance the ones in the schedule calls above.
              (WebCore::LocalStorageArea::sync): Factored out the work of the sync function so it
              can continue to use early return idiom.
              (WebCore::LocalStorageArea::performSync): Added a call to enableSuddenTermination.
      
              * storage/LocalStorageArea.h: Added declaration of the sync function.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3b2486e3
  20. 01 Oct, 2008 1 commit
  21. 14 Jun, 2008 1 commit
    • darin@apple.com's avatar
      JavaScriptCore: · d5ceaf86
      darin@apple.com authored
      2008-06-14  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam.
      
              - more of https://bugs.webkit.org/show_bug.cgi?id=17257
                start ref counts at 1 instead of 0 for speed
      
              * kjs/nodes.cpp:
              (KJS::ParserRefCounted::hasOneRef): Added. Replaces refcount.
              * kjs/nodes.h: Replaced refcount with hasOneRef.
      
              * wtf/ListRefPtr.h:
              (WTF::ListRefPtr::~ListRefPtr): Changed to use hasOneRef instead of
              refcount, so this class can be used with the RefCounted template.
      
              * wtf/RefCounted.h:
              (WTF::RefCounted::hasOneRef): Made const, since there's no reason for
              it to be non-const.
      
      WebCore:
      
      2008-06-14  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam.
      
              - more work on https://bugs.webkit.org/show_bug.cgi?id=17257
                start ref counts at 1 instead of 0 for speed
      
              * WebCore.base.exp: Added some new exports needed for functions that are now
              non-virtual.
      
              * WebCore.xcodeproj/project.pbxproj: Moved the "icon" group to the correct
              location in the project. Before it was inside "appcache"!
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::applyProperty):
              * dom/Clipboard.cpp:
              (WebCore::Clipboard::Clipboard):
              * editing/mac/EditorMac.mm:
              (WebCore::Editor::newGeneralClipboard):
              * editing/qt/EditorQt.cpp:
              (WebCore::Editor::newGeneralClipboard):
              * editing/wx/EditorWx.cpp:
              (WebCore::Editor::newGeneralClipboard):
              * loader/DocumentLoader.cpp:
              (WebCore::DocumentLoader::DocumentLoader):
              * loader/DocumentLoader.h:
              (WebCore::DocumentLoader::create):
              * loader/icon/IconDatabase.cpp:
              (WebCore::IconDatabase::defaultIcon):
              (WebCore::IconDatabase::setIconDataForIconURL):
              (WebCore::IconDatabase::setIconURLForPageURL):
              (WebCore::IconDatabase::getOrCreateIconRecord):
              (WebCore::IconDatabase::performURLImport):
              * loader/icon/IconDatabase.h:
              * loader/icon/IconRecord.cpp:
              (WebCore::IconRecord::IconRecord):
              * loader/icon/IconRecord.h:
              (WebCore::IconRecord::create):
              * page/EventHandler.h:
              * page/Frame.cpp:
              (WebCore::Frame::Frame):
              * page/Frame.h:
              (WebCore::Frame::create):
              * page/gtk/EventHandlerGtk.cpp:
              (WebCore::EventHandler::createDraggingClipboard):
              * page/mac/EventHandlerMac.mm:
              (WebCore::EventHandler::createDraggingClipboard):
              * page/qt/EventHandlerQt.cpp:
              (WebCore::EventHandler::createDraggingClipboard):
              * page/win/EventHandlerWin.cpp:
              (WebCore::EventHandler::createDraggingClipboard):
              * page/wx/EventHandlerWx.cpp:
              (WebCore::EventHandler::createDraggingClipboard):
              * platform/Cursor.h:
              (WebCore::SharedCursor::create):
              (WebCore::SharedCursor::~SharedCursor):
              (WebCore::SharedCursor::SharedCursor):
              * platform/DragData.h:
              * platform/PopupMenu.h:
              (WebCore::PopupMenu::create):
              (WebCore::PopupMenu::isActive):
              * platform/ScrollBar.cpp:
              (WebCore::Scrollbar::Scrollbar):
              * platform/SearchPopupMenu.h:
              (WebCore::SearchPopupMenu::create):
              * platform/graphics/FontFamily.cpp:
              (WebCore::FontFamily::FontFamily):
              (WebCore::operator==):
              * platform/graphics/FontFamily.h:
              (WebCore::FontFamily::FontFamily):
              (WebCore::SharedFontFamily::create):
              (WebCore::SharedFontFamily::SharedFontFamily):
              (WebCore::operator!=):
              (WebCore::FontFamily::next):
              (WebCore::FontFamily::appendFamily):
              (WebCore::FontFamily::releaseNext):
              * platform/graphics/Icon.h:
              * platform/graphics/gtk/IconGtk.cpp:
              (WebCore::Icon::Icon):
              (WebCore::Icon::~Icon):
              (WebCore::Icon::newIconForFile):
              * platform/graphics/mac/IconMac.mm:
              (WebCore::Icon::Icon):
              (WebCore::Icon::newIconForFile):
              * platform/graphics/qt/IconQt.cpp:
              (WebCore::Icon::Icon):
              (WebCore::Icon::newIconForFile):
              * platform/graphics/win/IconWin.cpp:
              (WebCore::Icon::Icon):
              (WebCore::Icon::~Icon):
              (WebCore::Icon::newIconForFile):
              * platform/gtk/ClipboardGtk.cpp:
              (WebCore::Editor::newGeneralClipboard):
              * platform/gtk/ClipboardGtk.h:
              (WebCore::ClipboardGtk::create):
              * platform/gtk/PlatformScrollBar.h:
              (WebCore::PlatformScrollbar::create):
              * platform/gtk/PopupMenuGtk.cpp:
              (WebCore::PopupMenu::PopupMenu):
              * platform/gtk/ScrollViewGtk.cpp:
              (WebCore::ScrollViewScrollbar::create):
              (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
              (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
              * platform/mac/ClipboardMac.h:
              (WebCore::ClipboardMac::create):
              * platform/mac/DragDataMac.mm:
              (WebCore::DragData::createClipboard):
              (WebCore::DragData::containsCompatibleContent):
              * platform/mac/PlatformScrollBar.h:
              (WebCore::PlatformScrollbar::create):
              (WebCore::PlatformScrollbar::horizontalScrollbarHeight):
              (WebCore::PlatformScrollbar::verticalScrollbarWidth):
              * platform/mac/PopupMenuMac.mm:
              (WebCore::PopupMenu::PopupMenu):
              * platform/qt/ClipboardQt.h:
              (WebCore::ClipboardQt::create):
              * platform/qt/DragDataQt.cpp:
              (WebCore::DragData::createClipboard):
              * platform/qt/PlatformScrollBar.h:
              (WebCore::PlatformScrollbar::create):
              * platform/qt/PopupMenuQt.cpp:
              (WebCore::PopupMenu::PopupMenu):
              * platform/qt/ScrollViewQt.cpp:
              (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
              (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
              * platform/win/ClipboardWin.h:
              (WebCore::ClipboardWin::create):
              * platform/win/CursorWin.cpp:
              (WebCore::Cursor::Cursor):
              (WebCore::loadSharedCursor):
              * platform/win/DragDataWin.cpp:
              (WebCore::DragData::createClipboard):
              * platform/win/EditorWin.cpp:
              (WebCore::Editor::newGeneralClipboard):
              * platform/win/PlatformScrollBar.h:
              (WebCore::PlatformScrollbar::create):
              * platform/win/PopupMenuWin.cpp:
              (WebCore::PopupMenu::PopupMenu):
              (WebCore::PopupMenu::show):
              * platform/win/ScrollViewWin.cpp:
              (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
              (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
              * platform/wx/ClipboardWx.h:
              (WebCore::ClipboardWx::create):
              * platform/wx/PlatformScrollBar.h:
              (WebCore::PlatformScrollbar::create):
              * platform/wx/PopupMenuWx.cpp:
              (WebCore::PopupMenu::PopupMenu):
              * platform/wx/TemporaryLinkStubs.cpp:
              (Icon::Icon):
              (Icon::newIconForFile):
              * rendering/RenderLayer.cpp:
              (WebCore::RenderLayer::createScrollbar):
              * rendering/RenderListBox.cpp:
              (WebCore::RenderListBox::updateFromElement):
              * svg/graphics/SVGImage.cpp:
              (WebCore::SVGImage::dataChanged):
              * svg/graphics/SVGImageEmptyClients.h:
              (WebCore::SVGEmptyFrameLoaderClient::createDocumentLoader):
      
      WebKit/gtk:
      
      2008-06-14  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam.
      
              - more https://bugs.webkit.org/show_bug.cgi?id=17257
                start ref counts at 1 instead of 0 for speed
      
              * WebCoreSupport/FrameLoaderClientGtk.cpp:
              (WebKit::FrameLoaderClient::createDocumentLoader): Use create instead of new.
              * webkit/webkitwebframe.cpp:
              (webkit_web_frame_new): Ditto.
              (webkit_web_frame_init_with_web_view): Ditto.
      
      WebKit/mac:
      
      2008-06-14  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam.
      
              - more of https://bugs.webkit.org/show_bug.cgi?id=17257
                start ref counts at 1 instead of 0 for speed
      
              * WebCoreSupport/WebFrameLoaderClient.mm:
              (WebFrameLoaderClient::createDocumentLoader): Use create instead of new.
              (WebFrameLoaderClient::createFrame): Remove now-obsolete adoptRef that was balanced by
              a ref call inside the Frame constructor. The lifetime rules for Frame are now the
              conventional ones without a special case.
      
              * WebView/WebDataSource.mm:
              (-[WebDataSource _initWithDocumentLoader:]): Changed argument to be a PassRefPtr, since
              this function takes ownership of the DocumentLoader.
              (-[WebDataSource initWithRequest:]): Use create instead of new.
              * WebView/WebDataSourceInternal.h: Changed _initWithDocumentLoader argument to be a
              PassRefPtr and also cleaned up the header a bit.
      
              * WebView/WebDocumentLoaderMac.h:
              (WebDocumentLoaderMac::create): Added. Also made the constructor and a couple of virtual
              functions private.
      
              * WebView/WebFrame.mm:
              (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): Use create instead
              of new.
      
      WebKit/qt:
      
      2008-06-14  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam.
      
              - more https://bugs.webkit.org/show_bug.cgi?id=17257
                start ref counts at 1 instead of 0 for speed
      
              * Api/qwebframe.cpp:
              (QWebFramePrivate::init): Use create instead of new.
              * WebCoreSupport/FrameLoaderClientQt.cpp:
              (WebCore::FrameLoaderClientQt::createDocumentLoader): Ditto.
      
      WebKit/win:
      
      2008-06-14  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam.
      
              - more of https://bugs.webkit.org/show_bug.cgi?id=17257
                start ref counts at 1 instead of 0 for speed
      
              * WebCoreSupport/WebFrameLoaderClient.cpp:
              (WebFrameLoaderClient::createFrame): Remove now-obsolete adoptRef that was balanced by
              a ref call inside the Frame constructor. The lifetime rules for Frame are now the
              conventional ones without a special case.
      
              * WebFrame.cpp:
              (WebFrame::init): Renamed function from initWithWebFrameView and removed the unused
              IWebFrameView argument (every caller was passing 0). Also changed this to return the
              WebCore Frame object, which is needed to straighten out the lifetime and ownership
              issues.
              * WebFrame.h: Ditto.
      
              * WebView.cpp:
              (WebView::initWithFrame): Changed to call new init function and use the return value.
      
      WebKit/wx:
      
      2008-06-14  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam.
      
              - more https://bugs.webkit.org/show_bug.cgi?id=17257
                start ref counts at 1 instead of 0 for speed
      
              * WebKitSupport/FrameLoaderClientWx.cpp:
              (WebCore::FrameLoaderClientWx::createDocumentLoader): Use create function
              instead of new.
      
      LayoutTests:
      
      2008-06-14  Darin Adler  <darin@apple.com>
      
              Reviewed by Maciej.
      
              - test for https://bugs.webkit.org/show_bug.cgi?id=19538
                <rdar://problem/5957595> Reading transition property from the style JS gives the wrong value
      
              * fast/dom/CSSStyleDeclaration/resources/transition-property-names.js: Added.
              * fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt: Added.
              * fast/dom/CSSStyleDeclaration/transition-property-names.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d5ceaf86
  22. 03 Apr, 2008 3 commits
  23. 23 Feb, 2008 1 commit
  24. 01 Feb, 2008 1 commit
    • darin@apple.com's avatar
      WebCore: · 381f8145
      darin@apple.com authored
              Reviewed by Geoff and Brady.
      
              - fix <rdar://problem/5680469> Each database worker thread takes a JSLock,
                which slows down all JavaScript execution until the thread terminates
      
              * bindings/js/JSCustomSQLTransactionCallback.cpp:
              (WebCore::JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback):
              Explicitly gcProtect, since we aren't using ProtectedPtr any more.
              (WebCore::unprotectOnMainThread): Added.
              (WebCore::JSCustomSQLTransactionCallback::~JSCustomSQLTransactionCallback):
              Use unprotectOnMainThread rather than doing a gcUnprotect here.
              * bindings/js/JSCustomSQLTransactionCallback.h: Changed m_callback from
              a ProtectedPtr to a plain old JSObject*; we gcProtect by hand now.
      
              * loader/icon/IconDatabase.cpp:
              (WebCore::IconDatabase::notifyPendingLoadDecisionsOnMainThread):
              Renamed. Changed to takea a void* with the icon database pointer.
              (WebCore::IconDatabase::notifyPendingLoadDecisions): Renamed.
              (WebCore::IconDatabase::performURLImport): Updated name, and pass the
              icon database pointer in.
              * loader/icon/IconDatabase.h: Renamed and added void* parameter.
      
              * platform/Threading.h: Changed callOnMainThread to take a function with a
              single parameter rather than a function with no parameters. Added a typedef.
      
              * platform/gtk/ThreadingGtk.cpp:
              (WebCore::callFunctionOnMainThread): Changed to use a structure with both
              a function pointer and a context pointer, and delete it after calling.
              (WebCore::callOnMainThread): Changed to create the structure with both
              the function and context pointer.
      
              * platform/mac/Threading.mm:
              (-[WebCoreFunctionWrapper initWithFunction:context:]): Added context.
              (-[WebCoreFunctionWrapper invoke]): Updated to do both function and context.
              Renamed from _call.
              (WebCore::callOnMainThread): Updated to take both function and context.
      
              * platform/qt/ThreadingQt.cpp:
              (WebCore::PerformFunctionEvent::PerformFunctionEvent): Added context.
              (WebCore::PerformFunctionEvent::invoke): Added. Calls function with context pointer.
              (WebCore::MainThreadInvoker::event): Changed to call invoke.
              (WebCore::callOnMainThread): Updated to take both function and context.
      
              * platform/win/ThreadingWin.cpp: Added FunctionWithContext.
              (WebCore::callFunctionsOnMainThread): Changed to pass call function with context.
              (WebCore::callOnMainThread): Updated to queue both function and context.
      
              * platform/wx/ThreadingWx.cpp:
              (WebCore::callOnMainThread): Updated to take both function and context.
      
              * storage/Database.cpp:
              (WebCore::Database::scheduleTransactionCallback): Pass 0 for context.
              (WebCore::Database::deliverAllPendingCallbacks): Changed to take ignored context pointer.
              * storage/Database.h: Added void* parameter to deliverAllPendingCallbacks.
      
              * storage/DatabaseTracker.cpp:
              (WebCore::DatabaseTracker::scheduleForNotification): Pass 0 for context.
              (WebCore::DatabaseTracker::notifyDatabasesChanged): Changed to take ignored context pointer.
              * storage/DatabaseTracker.h: Added void* parameter to notifyDatabasesChanged.
      
      WebKit/win:
      
              - fix <rdar://problem/5680469> Each database worker thread takes a JSLock,
                which slows down all JavaScript execution until the thread terminates
      
              * WebIconDatabase.cpp:
              (WebIconDatabase::scheduleNotificationDelivery): Updated for new callOnMainThread.
              (WebIconDatabase::deliverNotifications): Ditto.
              * WebIconDatabase.h: Ditto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      381f8145
  25. 29 Dec, 2007 1 commit
  26. 12 Nov, 2007 1 commit
  27. 25 Oct, 2007 1 commit
    • beidson's avatar
      Reviewed by Anders · 250d101e
      beidson authored
              Bulk rename of platform/sql/SQL* to platform/sql/SQLite*
      
              This is more accurate in that there is no realistic "SQL" abstraction, the classes are obviously
              tied extremely close to SQLite, and is necessitated by the introduction of "SQLTransaction" in
              the HTML5 database API which we are adopting.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      250d101e
  28. 19 Sep, 2007 1 commit
  29. 12 Sep, 2007 1 commit
    • beidson's avatar
      Reviewed by Geoff Garen · 799fac2b
      beidson authored
              <rdar://problem/5478577> - Further improve cold launch time with Icon Database changes
      
              * loader/icon/IconDatabase.cpp:
              (WebCore::IconDatabase::open): Store the directory and full path for later usage and access in the API, respectively
                Move the makeAllDirectories() call to the background thread.
              (WebCore::IconDatabase::IconDatabase): Don't set up the timer here...
              (WebCore::IconDatabase::scheduleOrDeferSyncTimer): Create the timer on demand
              (WebCore::IconDatabase::iconDatabaseSyncThread): makeAllDirectories() here where it's not as expensive
              (WebCore::IconDatabase::cleanupSyncThread): Cleanup the directory as well as full path
      
              * loader/icon/IconDatabase.h: m_syncTimer becomes an OwnPtr, and we add the database directory
                as a member to set it on the main thread and act with it on the background thread
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      799fac2b
  30. 11 Sep, 2007 1 commit
    • beidson's avatar
      Reviewed by Maciej · 5df6eeda
      beidson authored
              Fix for <rdar://problem/5473046> - Crash when resetting all icons
      
              Originally I'd written the "reset all icons" to be synchronous on the main thread, but it
              was decided that it should be async since it involved I/O.  Turns out it needs to be... both!
              Synchronous removal of all in-memory records of icons, and then continue and clean up the 
              on-disk database on the background thread.
      
              Also, it turns out that resetting all the page url retain counts should *not* be part of 
              "reset all icons" because it breaks various contracts the API makes about maintaining retain counts.
      
              The problem that occured here was removing all the icons, then all the history items that were 
              removed as part of "Reset Safari..." would try to release their icon, but their icon doesn't exist
              anymore.
      
              We get around this by simply leaving the in-memory page url records and retain counts alone - they
              are still wiped from disk.
      
              * loader/icon/IconDatabase.cpp:
              (WebCore::IconDatabase::removeAllIcons): Clear in-memory records of all icons then tell the thread to
                wipe the on-disk tables
              (WebCore::IconDatabase::removeAllIconsOnThread): Only do the disk cleanup - in-memory maintenance is
                handled on the main thread
              (WebCore::IconDatabase::cleanupSyncThread): Now that it's possible for new "icons to be written to disk"
                to appear while on-disk deleting is occuring, let the cleanup procedure perform 1 final write *after*
                it does the remove all icons
              * loader/icon/IconDatabase.h: Removed unused lock and condition
      
              * loader/icon/PageURLRecord.cpp:
              (WebCore::PageURLRecord::setIconRecord): Allow setting a NULL icon record, so a PageURLRecord can be
                cleared as part of removeAllIcons()
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5df6eeda
  31. 08 Sep, 2007 1 commit
    • beidson's avatar
      WebCore: · 6e7e49ea
      beidson authored
              Reviewed by Darin
      
              <rdar://problem/5434431> - Asynchronous Icon Database
      
              The IconDatabase API was originally designed to be fully asynchronous - if an icon wasn't read in from disk
              when you asked for it, you would be notified when it was.
      
              Safari 2 did writes on a background thread, but reads blocked the main thread.
      
              The current WebCore implementation using SQLite attempted to get rid of the background thread by defering expensive 
              writes via timers, but falls short in moderate to extreme usage cases
      
              Time to make the IconDatabase live up to it's fully asynchronous destiny.
      
              This should -
              - Make the browser instantly usable while converting Safari 2 icons in the background occurs
              - Remedy any UI slowness/blocking when on slow network home directories
              - Remedy random UI slowness, pauses, and stutters do to random I/O occurring at the exact wrong time or under heavy
                disk usage from swapping or other apps on the system
              - Allow certain long-running procedures to be interruptible (Safari 2 import, reading icons in from disk when trying to quit, etc)
      
              This will have a noticeable effect on current Safari 2 and Safari 3 beta browsers, including icons not appearing in bookmarks, history,
              or the location field the first time they're asked for, as current released Safari's don't properly listen for these async notifations.  
              The second time such a menu or view is brought up, the icon should be there.
      
              Additionally this includes a SQLite schema change which will be a lot more efficient but will result in the loss of current SQLite icons.
              Converting from Safari 2 style icons will still work.
      
              WebCore, welcome to multi-threadedness
      
              * WebCore.exp:
              * WebCore.xcodeproj/project.pbxproj:
              * WebCore.vcproj/WebCore.vcproj:
      
              * loader/DocumentLoader.cpp:
              (WebCore::DocumentLoader::iconLoadDecisionAvailable): Called when an Icon becomes available that was requested by this 
                DocumentLoader (to support the webView:didReceiveIcon: delegate call in WebKit)
              * loader/DocumentLoader.h:
      
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::iconLoadDecisionAvailable): Called from the DocumentLoaders who get notified - if the FrameLoader 
                ends up not caring because the WebView has transitioned to a new page, nothing occurs.  Otherwise, the FrameLoader possibly
                starts it Icon Loader and possibly sends the webView:didReceiveIcon: delegate call
              (WebCore::FrameLoader::startIconLoader): Instead of "Yes, load the icon now" or "No, don't load it" there is a third possibility -
                "You might be asked to load your icon later."  Add supporting logic for receiving this state, and being called a second time
                when the load decision is finally available.
              * loader/FrameLoader.h:
      
              * loader/FrameLoaderClient.h: Added "registerForIconNotification" which is a way to tell WebViews "The icon you are interested in might
                become available via the generic WebIconDatabaseDidAddIconNotification instead of a targeted delegate call"
                A WebView can then receive the generic notification and pass on it's own targeted delegate call.
      
              * loader/icon/IconDataCache.cpp: Removed.
              * loader/icon/IconDataCache.h: Removed.
      
              * loader/icon/IconDatabase.cpp:
              (WebCore::urlForLogging): Cut a URL down in length for sane logging and debugging
              (WebCore::defaultClient): Return the default, empty IconDatabaseClient incase the API doesn't set one.
      
              Following block of methods are for the Main thread's usage -
              (WebCore::IconDatabase::setClient):
              (WebCore::makeAllDirectories): Small optimization that checks to see if the entire path exists already, and doesn't try to loop
                through each patch component if the full path is already present
              (WebCore::IconDatabase::open): Makes all directories to the target path and kicks off the background thread - nothing more.
              (WebCore::IconDatabase::close): Signals the thread to quit and waits for it to do so
              (WebCore::IconDatabase::removeAllIcons): Purge the icon database
              (WebCore::IconDatabase::iconForPageURL):
              (WebCore::IconDatabase::readIconForPageURLFromDisk):
              (WebCore::IconDatabase::iconURLForPageURL):
              (WebCore::IconDatabase::defaultIcon):
              (WebCore::IconDatabase::retainIconForPageURL):
              (WebCore::IconDatabase::releaseIconForPageURL):
              (WebCore::IconDatabase::setIconDataForIconURL):
              (WebCore::IconDatabase::setIconURLForPageURL):
              (WebCore::IconDatabase::loadDecisionForIconURL): Determine if an icon loader should load now.  If the decision is "maybe later", then
                mark the DocumentLoader to be notified later when the final decision is available.
              (WebCore::IconDatabase::iconDataKnownForIconURL): Determine if the actual image data has been read from disk (or set from the loader) for 
                icon URL in question
              (WebCore::IconDatabase::setEnabled):
              (WebCore::IconDatabase::isEnabled):
              (WebCore::IconDatabase::setPrivateBrowsingEnabled):
              (WebCore::IconDatabase::isPrivateBrowsingEnabled):
              (WebCore::IconDatabase::delayDatabaseCleanup): Restore this method from a year ago, as asynchronous pruning of icons can now occur on a 
                background thread.
              (WebCore::IconDatabase::allowDatabaseCleanup):
              (WebCore::IconDatabase::checkIntegrityBeforeOpening):
              (WebCore::IconDatabase::pageURLMappingCount):
              (WebCore::IconDatabase::retainedPageURLCount):
              (WebCore::IconDatabase::iconRecordCount):
              (WebCore::IconDatabase::iconRecordCountWithData):
              (WebCore::IconDatabase::IconDatabase):
              (WebCore::IconDatabase::~IconDatabase):
              (WebCore::IconDatabase::notifyPendingLoadDecisions): Tell all the registered DocumentLoaders "Hey, we've read in all URL mappings from disk,
                so check to see if you are interested in any of them"
              (WebCore::IconDatabase::notifyPendingLoadDecisionsInternal):
              (WebCore::IconDatabase::wakeSyncThread): Wake the sync thread, if it is idle
              (WebCore::IconDatabase::scheduleOrDeferSyncTimer): Even though we're on a background thread, we still defer writing out to disk during
                periods of high activity
              (WebCore::IconDatabase::syncTimerFired): Call wakeSyncThread()
      
              Following block of methods may be used by either thread -
              (WebCore::IconDatabase::isOpen):
              (WebCore::IconDatabase::databasePath):
              (WebCore::IconDatabase::defaultDatabaseFilename):
              (WebCore::IconDatabase::getOrCreateIconRecord):
              (WebCore::IconDatabase::getOrCreatePageURLRecord):
      
              Following block of methods are used by the secondary thread only -
              (WebCore::IconDatabase::importIconURLForPageURL): For the Safari 2 import procedure - write a URL mapping directly out to disk
              (WebCore::IconDatabase::importIconDataForIconURL): For the Safari 2 import procedure - write an Icon directly out to disk
              (WebCore::IconDatabase::shouldStopThreadActivity): To check and see if the thread should stop what it is doing now to do something
                more important (such as quit, or delete all icons)
              (WebCore::IconDatabase::iconDatabaseSyncThreadStart):
              (WebCore::IconDatabase::iconDatabaseSyncThread): Entry point for the background thread
              (WebCore::databaseVersionNumber):
              (WebCore::isValidDatabase):
              (WebCore::createDatabaseTables):
              (WebCore::IconDatabase::performOpenInitialization): Open and validate the SQLite database, making sure it's schema jives with what
                is expected
              (WebCore::IconDatabase::checkIntegrity):
              (WebCore::IconDatabase::performURLImport): Import all the Page URL -> Icon URL mappings from the database.  Done "1st thing" on startup,
                this is necessary to be able to give the loader decisions about whether or not it should load icons from the network
              (WebCore::IconDatabase::syncThreadMainLoop): Main loop - sleeps until woken up, then does a read cycle and a write cycle until both cycles
                do no work - then it goes back to sleep.
              (WebCore::IconDatabase::readFromDatabase): Reads icons from the database that clients are waiting on
              (WebCore::IconDatabase::writeToDatabase): Writes any changes page -> icon url mappings to disk, as well as any new image data that has 
                been received from the loader
              (WebCore::IconDatabase::pruneUnretainedIcons): Done only once, and only after the first write to the database, this procedure removes all
                icons and page URLs from disk that haven't been retained by any client.  Note that the prune can be delayed by utilizing delayDatabaseCleanup()
              (WebCore::IconDatabase::checkForDanglingPageURLs): Usually part of the prune procedure, prunes any pages who point to icons that no longer exist 
                in the database
              (WebCore::IconDatabase::removeAllIconsOnThread): Completely purge both the on-disk and in memory records of all icons
              (WebCore::IconDatabase::deleteAllPreparedStatements): Part of removeAllIcons and the thread cleanup procedure
              (WebCore::IconDatabase::cleanupSyncThread): Write out any last remaining writes to disk, close the database, and then end the thread
              (WebCore::IconDatabase::imported): Checks the DB to see if the Safari 2 import has occured
              (WebCore::IconDatabase::setImported): Sets the "Safari 2 imported" flag
              (WebCore::readySQLStatement):
              (WebCore::IconDatabase::setIconURLForPageURLInSQLDatabase): This and the following "SQLDatabase" suffixed methods are pretty self explanatory
              (WebCore::IconDatabase::setIconIDForPageURLInSQLDatabase):
              (WebCore::IconDatabase::removePageURLFromSQLDatabase):
              (WebCore::IconDatabase::getIconIDForIconURLFromSQLDatabase):
              (WebCore::IconDatabase::addIconURLToSQLDatabase):
              (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
              (WebCore::IconDatabase::removeIconFromSQLDatabase):
              (WebCore::IconDatabase::writeIconSnapshotToSQLDatabase):
              * loader/icon/IconDatabase.h:
      
              * loader/icon/IconDatabaseClient.h: Added.
              (WebCore::IconDatabaseClient::~IconDatabaseClient):
              (WebCore::IconDatabaseClient::performImport): Perform the Safari 2 import, implemented by WebKit
              (WebCore::IconDatabaseClient::dispatchDidRemoveAllIcons): Send the API notification
              (WebCore::IconDatabaseClient::dispatchDidAddIconForPageURL): Ditto
      
              * loader/icon/IconDatabaseNone.cpp: Best attempt to keep non icon-DB platforms building
              (WebCore::IconDatabase::defaultDatabaseFilename):
              (WebCore::IconDatabase::readIconForPageURLFromDisk):
              (WebCore::IconDatabase::loadDecisionForIconURL):
              (WebCore::IconDatabase::iconDataKnownForIconURL):
              (WebCore::IconDatabase::setIconURLForPageURL):
              (WebCore::IconDatabase::isEnabled):
              (WebCore::IconDatabase::delayDatabaseCleanup):
              (WebCore::IconDatabase::allowDatabaseCleanup):
              (WebCore::IconDatabase::setClient):
      
              * loader/icon/IconRecord.cpp: Added.
              (WebCore::IconRecord::IconRecord): IconRecord used to be "IconDataCache" - it is merely a container for the url, timestamp, and image for a site icon.
                It is Shared, and therefore ref counted - PageURLRecords are the owning containers.  This is a tricky way to track how many page urls are retaining 
                an IconRecord and therefore tracking when we should try to get rid of one.
              (WebCore::IconRecord::~IconRecord):
              (WebCore::IconRecord::image):
              (WebCore::IconRecord::setImageData):
              (WebCore::IconRecord::loadImageFromResource):
              (WebCore::IconRecord::imageDataStatus): Return whether the image data hasn't been read yet, exists in memory, or is absent (site with no icon)
              (WebCore::IconRecord::snapshot): Returns a snapshot of the icon's data - url, timestamp, and image data - to be written to disk
              * loader/icon/IconRecord.h: Added.
              (WebCore::IconSnapshot::IconSnapshot):
              (WebCore::IconRecord::getTimestamp):
              (WebCore::IconRecord::setTimestamp):
              (WebCore::IconRecord::iconURL):
              (WebCore::IconRecord::retainingPageURLs):
      
              * loader/icon/PageURLRecord.cpp: Added.
              (WebCore::PageURLRecord::PageURLRecord): PageURLRecord is fundamentally a pairing of a Page URL to an Icon.  It has manual ref counting for the sake
                of "retainIconForPageURL" and "releaseIconForPageURL", and can provide a quick snapshot of it's Page URL -> Icon URL mapping for writing to
                the database
              (WebCore::PageURLRecord::setIconRecord):
              (WebCore::PageURLRecord::snapshot):
              * loader/icon/PageURLRecord.h: Added.
              (WebCore::PageURLSnapshot::PageURLSnapshot):
              (WebCore::PageURLRecord::url):
              (WebCore::PageURLRecord::PageURLRecord::iconRecord):
              (WebCore::PageURLRecord::retain):
              (WebCore::PageURLRecord::release):
              (WebCore::PageURLRecord::retainCount):
      
              * platform/SharedBuffer.cpp:
              (WebCore::SharedBuffer::copy): Added a deep copy method for the purposes of handing icon data across the thread boundary into the icon database
              * platform/SharedBuffer.h:
      
              * platform/graphics/svg/SVGImageEmptyClients.h:
              (WebCore::SVGEmptyFrameLoaderClient::registerForIconNotification):
      
              * platform/win/TemporaryLinkStubs.cpp:
              (WebCore::callOnMainThread): Only other IconDatabase utilizing platform - keep their build going
      
      WebKit:
      
              Reviewed by Darin
      
              <rdar://problem/5434431> - Asynchronous Icon Database
      
              WebKit side of things
              Mainly, there are Notifications WebKit has to listen for now that tell it when to either call back into WebCore
              for some purpose or to send the webView:didReceiveIcon: delegate call
      
              Many smaller tweaks as well.
      
              * Misc/WebIconDatabase.h:
              * Misc/WebIconDatabase.mm:
              (defaultClient):
              (-[WebIconDatabase init]):
              (+[WebIconDatabase delayDatabaseCleanup]): Accessor so clients can prevent the thread from cleaning up the database
                before they've done all their necessary retaining of icons.
              (+[WebIconDatabase allowDatabaseCleanup]):
              (-[WebIconDatabase removeAllIcons]):
              (-[WebIconDatabase _isEnabled]):
              (-[WebIconDatabase _sendNotificationForURL:]):
              (-[WebIconDatabase _sendDidRemoveAllIconsNotification]):
              (-[WebIconDatabase _databaseDirectory]):
      
              (-[ThreadEnabler threadEnablingSelector:]): Quick and dirty class to enabled Cocoa multithreading
              (+[ThreadEnabler enableThreading]):
              (importToWebCoreFormat):
              * Misc/WebIconDatabaseInternal.h: Expose the internal methods of WebIconDatabase that are required by WebIconDatabaseClient
      
              * Misc/WebNSNotificationCenterExtras.h: Added. - Great utility class whose design was borrowed from Colloquy
                that allows the posting of a Cocoa notification on the main thread from *any* thread
              * Misc/WebNSNotificationCenterExtras.m: Added.
              (-[NSNotificationCenter postNotificationOnMainThreadWithName:object:]):
              (-[NSNotificationCenter postNotificationOnMainThreadWithName:object:userInfo:]):
              (-[NSNotificationCenter postNotificationOnMainThreadWithName:object:userInfo:waitUntilDone:]):
              (+[NSNotificationCenter _postNotificationName:]):
      
              * WebCoreSupport/WebFrameLoaderClient.h:
              * WebCoreSupport/WebFrameLoaderClient.mm:
              (WebFrameLoaderClient::dispatchDidReceiveIcon): Send the webView:didReceiveIcon: delegate call
              (WebFrameLoaderClient::registerForIconNotification):
      
              * WebCoreSupport/WebIconDatabaseClient.h: Added.
              * WebCoreSupport/WebIconDatabaseClient.mm: Added.
              (WebIconDatabaseClient::performImport):  Perform the Safari 2 icon import
              (WebIconDatabaseClient::dispatchDidRemoveAllIcons): Send the NSNotification
              (WebIconDatabaseClient::dispatchDidAddIconForPageURL): Ditto
      
              * WebView/WebView.mm:
              (-[WebView _receivedIconChangedNotification:]): Check and see if this notification is for this WebView's current URL by
                calling back into the IconDatabase
              (-[WebView _registerForIconNotification:]): Support for WebIconDatabaseClient
              (-[WebView _dispatchDidReceiveIconFromWebFrame:]): Dispatch this delegate call as well as unregister for the notification
              * WebView/WebViewInternal.h:
      
              * WebKit.xcodeproj/project.pbxproj:
      
      win:
      
              <rdar://problem/5434431> - Asynchronous Icon Database
      
              * WebFrame.cpp:
              (WebFrame::didPerformFirstNavigation): Empty impl for now
              (WebFrame::registerForIconNotification): Ditto
              * WebFrame.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6e7e49ea
  32. 02 Sep, 2007 1 commit
    • beidson's avatar
      WebCore: · 30ab48d5
      beidson authored
              Reviewed by John Sullivan and Mark Rowe
      
              Groundwork for support for monitoring IconDatabase in-memory statistics
      
              * WebCore.exp:
              * loader/icon/IconDatabase.cpp:
              (WebCore::IconDatabase::pageURLMappingCount): Stub for now
              (WebCore::IconDatabase::retainedPageURLCount): Ditto
              (WebCore::IconDatabase::iconRecordCount): Ditto
              (WebCore::IconDatabase::iconRecordCountWithData): Ditto
              * loader/icon/IconDatabase.h:
      
      WebKit:
      
              Reviewed by John Sullivan and Mark Rowe
      
              Groundwork for support for monitoring IconDatabase in-memory statistics
       
              * Misc/WebCoreStatistics.h:
              * Misc/WebCoreStatistics.mm:
              (+[WebCoreStatistics iconPageURLMappingCount]):
              (+[WebCoreStatistics iconRetainedPageURLCount]):
              (+[WebCoreStatistics iconRecordCount]):
              (+[WebCoreStatistics iconsWithDataCount]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      30ab48d5
  33. 14 Aug, 2007 1 commit
    • beidson's avatar
      WebCore: · 9b723725
      beidson authored
              Reviewed by Darin, John, Maciej, Oliver, and Tim
      
              <rdar://problem/5394708> - Crash on launch with corrupt icon database
      
              The main part of the fix is to not disable SQLite's default level of protection - to leave the sync options at their normal,
              mostly safe levels.  
      
              But in case lightning strikes at the exact right moment and someone ends up with a corrupt database, add some support code to
              detect that condition and recover from it.  
      
              This is mainly accomplished by exposing the "PRAGMA integrity_check;" facilities of sqlite through IconDatabase SPI as well as
              running that integrity check if a journal file is detected at launch (a strong indication that the last quit was not clean).
              There's also a method exposed to allow clients to tell the icon database "I suspect something bad happened, please check integrity"
      
              * loader/icon/IconDatabase.cpp:
              (WebCore::IconDatabase::checkIntegrityBeforeOpening): Allow clients to suggest an integrity check
              (WebCore::IconDatabase::open): Add a check to see if the journal file for the database exists.  If it does, run the integrity
                check.  Also run the check if a client has suggested it to be necessary.
                If the integrity-check fails, we sadly have to destroy the database and recreate from scratch.
                Also - quite importantly - do not adjust the default sync preferences for the SQLDatabase.  They were an optimization that 
                might have been valid at one time but no longer affects any benchmarks we care about.
              (WebCore::IconDatabase::checkIntegrity): Perform the SQLite integrity_check pragma
              * loader/icon/IconDatabase.h:
      
              * loader/icon/IconDatabaseNone.cpp:
              (WebCore::IconDatabase::checkIntegrity): Keep IconDatabaseNone users building
              (WebCore::IconDatabase::checkIntegrityBeforeOpening): Ditto
      
              * loader/icon/SQLDatabase.cpp:
              (WebCore::SQLDatabase::open): Make a copy of the path string so we don't accidentally mutate anyone else's string on ::close()
      
              * platform/FileSystem.h: Added. Begin a long-needed platform file system abstraction
              * platform/mac/FileSystemMac.mm: Added.
              (WebCore::fileExists): Check if a file exists
              (WebCore::deleteFile): Delete a file
      
              * platform/gdk/TemporaryLinkStubs.cpp:
              (WebCore::fileExists):
              (WebCore::deleteFile):
              * platform/qt/TemporaryLinkStubs.cpp:
              (WebCore::fileExists):
              (WebCore::deleteFile):
              * platform/win/TemporaryLinkStubs.cpp:
              (WebCore::fileExists):
              (WebCore::deleteFile):
      
              * WebCore.exp:
              * WebCore.xcodeproj/project.pbxproj:
      
      WebKit:
      
              Reviewed by Darin, John, Maciej, Oliver, and Tim
      
              <rdar://problem/5394708> - Crash on launch with corrupt icon database
      
              Expose some new SPI to help recover from this case should it happen again
      
              * Misc/WebIconDatabase.mm:
              (-[WebIconDatabase init]): Use the new _databaseDirectory to determine where to open the database on disk
              (+[WebIconDatabase _checkIntegrityBeforeOpening]): Tell the icon database to check integrity when it opens
              (-[WebIconDatabase _databaseDirectory]): Moved the database-directory-determining logic here as it's now used in two places
              * Misc/WebIconDatabasePrivate.h: Added _checkIntegrityBeforeOpening SPI for clients to give hints about when the
                integrity check should run
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9b723725
  34. 17 Jul, 2007 1 commit
    • antti's avatar
      Reviewed by home-bradee. · b982814f
      antti authored
              <rdar://problem/5336372>
              Icon database uses too much memory
              
              XRaying Safari startup memory consumption revealed that icon database is eating quite
              a bit of RAM if Icon.db is large (which it probably is if it has been in use for a while, 
              mine used for getting figures below was 2.6MB). 
              
              Note that the wins are less impressive with smaller Icon.db.
              
              This patch addresses three separate issues
              
              - SQLite fails to free the memory used by temporary tables. Icon database uses a temporary table
                on startup for pruning unused page urls. This wastes around 1MB. Addressed by rewriting
                pruning so it does not need a temporary table. The new method is also quite a bit faster speeding
                up Safari launch time by around 100ms
              - SQLite has it's own memory cache limited by default to 3MB. Icon database does not really need that much.
                Dropped the cache size to 300kB saving ~1MB on startup. 
                Smaller cache slows down startup by ~30ms (more than compensated by faster pruning above)
              - Don't populate m_pageURLToIconURLMap with all urls from database on startup, instead let it get populated
                when urls are accessed (user opens history menu for example). This shouldn't have any real performance impact 
                as the accesses are icon loads that need to hit the database anyway. This saves ~700kB.
                
              All in all with this Icon.db these changes reduce allocated memory by around 2.7MB on startup. Release build
              Safari RPRVT (empty start page) goes from 12.4MB to 10.4MB (TCMalloc pooling probably explaining why the win 
              looks bit smaller here).
      
              * loader/icon/IconDatabase.cpp:
              (WebCore::IconDatabase::IconDatabase):
              (WebCore::IconDatabase::open):
              (WebCore::IconDatabase::deleteAllPreparedStatements):
              (WebCore::IconDatabase::retainIconForPageURL):
              (WebCore::IconDatabase::releaseIconForPageURL):
              (WebCore::IconDatabase::establishIconIDForIconURL):
              (WebCore::IconDatabase::pruneUnretainedIconsOnStartup):
              * loader/icon/IconDatabase.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b982814f