Title: [107101] trunk/Source
Revision
107101
Author
o...@webkit.org
Date
2012-02-08 09:56:22 -0800 (Wed, 08 Feb 2012)

Log Message

Unreviewed, rolling out r106920, r106924, r106933, r106939,
and r107090.
http://trac.webkit.org/changeset/106920
http://trac.webkit.org/changeset/106924
http://trac.webkit.org/changeset/106933
http://trac.webkit.org/changeset/106939
http://trac.webkit.org/changeset/107090
https://bugs.webkit.org/show_bug.cgi?id=78124

Something is completely wrong this change (Requested by
Ossy_gardener on #webkit).

Patch by Sheriff Bot <webkit.review....@gmail.com> on 2012-02-08

Source/WebCore:

* platform/FileSystem.h:
(WebCore):
* platform/qt/FileSystemQt.cpp:

Source/WebKit2:

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
(WebProcessCreationParameters):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
* UIProcess/qt/WebContextQt.cpp:
(WebKit::WebContext::platformInitializeWebProcess):
* WebProcess/qt/WebProcessQt.cpp:
(WebKit):
(WebKit::WebProcess::platformSetCacheModel):
(WebKit::WebProcess::platformInitializeWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107100 => 107101)


--- trunk/Source/WebCore/ChangeLog	2012-02-08 17:35:44 UTC (rev 107100)
+++ trunk/Source/WebCore/ChangeLog	2012-02-08 17:56:22 UTC (rev 107101)
@@ -1,3 +1,21 @@
+2012-02-08  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r106920, r106924, r106933, r106939,
+        and r107090.
+        http://trac.webkit.org/changeset/106920
+        http://trac.webkit.org/changeset/106924
+        http://trac.webkit.org/changeset/106933
+        http://trac.webkit.org/changeset/106939
+        http://trac.webkit.org/changeset/107090
+        https://bugs.webkit.org/show_bug.cgi?id=78124
+
+        Something is completely wrong this change (Requested by
+        Ossy_gardener on #webkit).
+
+        * platform/FileSystem.h:
+        (WebCore):
+        * platform/qt/FileSystemQt.cpp:
+
 2012-02-08  David Hyatt  <hy...@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=78122

Modified: trunk/Source/WebCore/platform/FileSystem.h (107100 => 107101)


--- trunk/Source/WebCore/platform/FileSystem.h	2012-02-08 17:35:44 UTC (rev 107100)
+++ trunk/Source/WebCore/platform/FileSystem.h	2012-02-08 17:56:22 UTC (rev 107101)
@@ -198,8 +198,6 @@
 String filenameToString(const char*);
 String filenameForDisplay(const String&);
 CString applicationDirectoryPath();
-#endif
-#if PLATFORM(GTK) || PLATFORM(QT)
 uint64_t getVolumeFreeSizeForPath(const char*);
 #endif
 

Modified: trunk/Source/WebCore/platform/qt/FileSystemQt.cpp (107100 => 107101)


--- trunk/Source/WebCore/platform/qt/FileSystemQt.cpp	2012-02-08 17:35:44 UTC (rev 107100)
+++ trunk/Source/WebCore/platform/qt/FileSystemQt.cpp	2012-02-08 17:56:22 UTC (rev 107101)
@@ -39,9 +39,6 @@
 #include <QFile>
 #include <QFileInfo>
 #include <QTemporaryFile>
-#if !defined(Q_OS_WIN)
-#include <sys/statvfs.h>
-#endif
 #include <wtf/text/CString.h>
 
 namespace WebCore {
@@ -193,23 +190,6 @@
     return -1;
 }
 
-uint64_t getVolumeFreeSizeForPath(const char* path)
-{
-#if defined(Q_OS_WIN)
-    ULARGE_INTEGER freeBytesToCaller;
-    BOOL result = GetDiskFreeSpaceExW((LPCWSTR)path, &freeBytesToCaller, 0, 0);
-    if (!result)
-        return 0;
-    return static_cast<uint64_t>(freeBytesToCaller.QuadPart);
-#else
-    struct statvfs volumeInfo;
-    if (statvfs(path, &volumeInfo))
-        return 0;
-
-    return static_cast<uint64_t>(volumeInfo.f_bavail) * static_cast<uint64_t>(volumeInfo.f_frsize);
-#endif
-}
-
 int writeToFile(PlatformFileHandle handle, const char* data, int length)
 {
     if (handle && handle->exists() && handle->isWritable())

Modified: trunk/Source/WebKit2/ChangeLog (107100 => 107101)


--- trunk/Source/WebKit2/ChangeLog	2012-02-08 17:35:44 UTC (rev 107100)
+++ trunk/Source/WebKit2/ChangeLog	2012-02-08 17:56:22 UTC (rev 107101)
@@ -1,3 +1,31 @@
+2012-02-08  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r106920, r106924, r106933, r106939,
+        and r107090.
+        http://trac.webkit.org/changeset/106920
+        http://trac.webkit.org/changeset/106924
+        http://trac.webkit.org/changeset/106933
+        http://trac.webkit.org/changeset/106939
+        http://trac.webkit.org/changeset/107090
+        https://bugs.webkit.org/show_bug.cgi?id=78124
+
+        Something is completely wrong this change (Requested by
+        Ossy_gardener on #webkit).
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        (WebProcessCreationParameters):
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext):
+        * UIProcess/qt/WebContextQt.cpp:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * WebProcess/qt/WebProcessQt.cpp:
+        (WebKit):
+        (WebKit::WebProcess::platformSetCacheModel):
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2012-02-08  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK] Fix a crash when WebKitWebView is created without a WebContext

Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (107100 => 107101)


--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp	2012-02-08 17:35:44 UTC (rev 107100)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp	2012-02-08 17:56:22 UTC (rev 107101)
@@ -98,7 +98,6 @@
 #endif
 #if PLATFORM(QT)
     encoder->encode(cookieStorageDirectory);
-    encoder->encode(diskCacheDirectory);
 #endif
 
 #if ENABLE(NOTIFICATIONS)
@@ -196,8 +195,6 @@
 #if PLATFORM(QT)
     if (!decoder->decode(parameters.cookieStorageDirectory))
         return false;
-    if (!decoder->decode(parameters.diskCacheDirectory))
-        return false;
 #endif
 
 #if ENABLE(NOTIFICATIONS)

Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (107100 => 107101)


--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h	2012-02-08 17:35:44 UTC (rev 107100)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h	2012-02-08 17:56:22 UTC (rev 107101)
@@ -121,7 +121,6 @@
 #endif // PLATFORM(WIN)
 #if PLATFORM(QT)
     String cookieStorageDirectory;
-    String diskCacheDirectory;
 #endif
 
 #if ENABLE(NOTIFICATIONS)

Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (107100 => 107101)


--- trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-02-08 17:35:44 UTC (rev 107100)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-02-08 17:56:22 UTC (rev 107101)
@@ -122,11 +122,7 @@
     , m_visitedLinkProvider(this)
     , m_alwaysUsesComplexTextCodePath(false)
     , m_shouldUseFontSmoothing(true)
-#if PLATFORM(QT)
-    , m_cacheModel(CacheModelPrimaryWebBrowser)
-#else
     , m_cacheModel(CacheModelDocumentViewer)
-#endif
     , m_memorySamplerEnabled(false)
     , m_memorySamplerInterval(1400.0)
     , m_applicationCacheManagerProxy(WebApplicationCacheManagerProxy::create(this))

Modified: trunk/Source/WebKit2/UIProcess/qt/WebContextQt.cpp (107100 => 107101)


--- trunk/Source/WebKit2/UIProcess/qt/WebContextQt.cpp	2012-02-08 17:35:44 UTC (rev 107100)
+++ trunk/Source/WebKit2/UIProcess/qt/WebContextQt.cpp	2012-02-08 17:56:22 UTC (rev 107101)
@@ -57,18 +57,6 @@
     return s_dataLocation;
 }
 
-static String defaultDiskCacheDirectory()
-{
-    static String s_defaultDiskCacheDirectory;
-
-    if (!s_defaultDiskCacheDirectory.isEmpty())
-        return s_defaultDiskCacheDirectory;
-
-    s_defaultDiskCacheDirectory = WebCore::pathByAppendingComponent(defaultDataLocation(), "cache/");
-    WebCore::makeAllDirectories(s_defaultDiskCacheDirectory);
-    return s_defaultDiskCacheDirectory;
-}
-
 static QString s_defaultDatabaseDirectory;
 static QString s_defaultLocalStorageDirectory;
 
@@ -81,8 +69,6 @@
 {
     qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
     parameters.cookieStorageDirectory = defaultDataLocation();
-    parameters.diskCacheDirectory = defaultDiskCacheDirectory();
-
 #if ENABLE(GEOLOCATION)
     static WebGeolocationProviderQt* location = WebGeolocationProviderQt::create(toAPI(geolocationManagerProxy()));
     WKGeolocationManagerSetProvider(toAPI(geolocationManagerProxy()), WebGeolocationProviderQt::provider(location));

Modified: trunk/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp (107100 => 107101)


--- trunk/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp	2012-02-08 17:35:44 UTC (rev 107100)
+++ trunk/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp	2012-02-08 17:56:22 UTC (rev 107101)
@@ -1,6 +1,5 @@
 /*
  * Copyright (C) 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2011, 2012 Nokia Corporation and/or its subsidiary(-ies)
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -36,93 +35,24 @@
 #include <QCoreApplication>
 #include <QNetworkAccessManager>
 #include <QNetworkCookieJar>
-#include <QNetworkDiskCache>
 #include <WebCore/CookieJarQt.h>
-#include <WebCore/FileSystem.h>
-#include <WebCore/MemoryCache.h>
 #include <WebCore/PageCache.h>
 #include <WebCore/RuntimeEnabledFeatures.h>
 
 #if defined(Q_OS_MACX)
 #include <dispatch/dispatch.h>
-#include <mach/host_info.h>
-#include <mach/mach.h>
-#include <mach/mach_error.h>
-#elif defined(Q_OS_WIN)
-
-#else
-#include <unistd.h>
 #endif
 
 using namespace WebCore;
 
 namespace WebKit {
 
-static uint64_t physicalMemorySizeInBytes()
-{
-    static uint64_t physicalMemorySize = 0;
+static const int DefaultPageCacheCapacity = 20;
 
-    if (!physicalMemorySize) {
-#if defined(Q_OS_MACX)
-        host_basic_info_data_t hostInfo;
-        mach_port_t host = mach_host_self();
-        mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;
-        kern_return_t r = host_info(host, HOST_BASIC_INFO, (host_info_t)&hostInfo, &count);
-        mach_port_deallocate(mach_task_self(), host);
-
-        if (r == KERN_SUCCESS)
-            physicalMemorySize = hostInfo.max_mem;
-
-#elif defined(Q_OS_WIN)
-        MEMORYSTATUSEX statex;
-        statex.dwLength = sizeof(statex);
-        GlobalMemoryStatusEx(&statex);
-        physicalMemorySize = static_cast<uint64_t>(statex.ullTotalPhys);
-
-#else
-        long pageSize = sysconf(_SC_PAGESIZE);
-        long numberOfPages = sysconf(_SC_PHYS_PAGES);
-
-        if (pageSize > 0 && numberOfPages > 0)
-            physicalMemorySize = static_cast<uint64_t>(pageSize) * static_cast<uint64_t>(numberOfPages);
-
-#endif
-    }
-    return physicalMemorySize;
-}
-
-void WebProcess::platformSetCacheModel(CacheModel cacheModel)
+void WebProcess::platformSetCacheModel(CacheModel)
 {
-    QNetworkDiskCache* diskCache = qobject_cast<QNetworkDiskCache*>(m_networkAccessManager->cache());
-    ASSERT(diskCache);
-
-    uint64_t physicalMemorySizeInMegabytes = physicalMemorySizeInBytes() / 1024 / 1024;
-
-    // The Mac port of WebKit2 uses a fudge factor of 1000 here to account for misalignment, however,
-    // that tends to overestimate the memory quite a bit (1 byte misalignment ~ 48 MiB misestimation).
-    // We use 1024 * 1023 for now to keep the estimation error down to +/- ~1 MiB.
-    uint64_t freeVolumeSpace = WebCore::getVolumeFreeSizeForPath(diskCache->cacheDirectory().toAscii().constData()) / 1024 / 1023;
-
-    // The following variables are initialised to 0 because WebProcess::calculateCacheSizes might not
-    // set them in some rare cases.
-    unsigned cacheTotalCapacity = 0;
-    unsigned cacheMinDeadCapacity = 0;
-    unsigned cacheMaxDeadCapacity = 0;
-    double deadDecodedDataDeletionInterval = 0;
-    unsigned pageCacheCapacity = 0;
-    unsigned long urlCacheMemoryCapacity = 0;
-    unsigned long urlCacheDiskCapacity = 0;
-
-    calculateCacheSizes(cacheModel, physicalMemorySizeInMegabytes, freeVolumeSpace,
-        cacheTotalCapacity, cacheMinDeadCapacity, cacheMaxDeadCapacity, deadDecodedDataDeletionInterval,
-        pageCacheCapacity, urlCacheMemoryCapacity, urlCacheDiskCapacity);
-
-    memoryCache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
-    memoryCache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
-    pageCache()->setCapacity(pageCacheCapacity);
-
-    // FIXME: Implement hybrid in-memory- and disk-caching as e.g. the Mac port does.
-    diskCache->setMaximumCacheSize(static_cast<qint64>(urlCacheDiskCapacity));
+    // FIXME: see bug 73918
+    pageCache()->setCapacity(DefaultPageCacheCapacity);
 }
 
 void WebProcess::platformClearResourceCaches(ResourceCachesToClear)
@@ -139,13 +69,6 @@
 void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder* arguments)
 {
     m_networkAccessManager = new QtNetworkAccessManager(this);
-
-    ASSERT(!parameters.diskCacheDirectory.isEmpty() && !parameters.diskCacheDirectory.isNull());
-    QNetworkDiskCache* diskCache = new QNetworkDiskCache();
-    diskCache->setCacheDirectory(parameters.diskCacheDirectory);
-    // The m_networkAccessManager takes ownership of the diskCache object upon the following call.
-    m_networkAccessManager->setCache(diskCache);
-
     ASSERT(!parameters.cookieStorageDirectory.isEmpty() && !parameters.cookieStorageDirectory.isNull());
     WebCore::SharedCookieJarQt* jar = WebCore::SharedCookieJarQt::create(parameters.cookieStorageDirectory);
     m_networkAccessManager->setCookieJar(jar);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to