Changeset 184064 in webkit
- Timestamp:
- May 10, 2015, 8:09:11 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
NetworkProcess/soup/NetworkProcessSoup.cpp (modified) (3 diffs)
-
WebProcess/soup/WebProcessSoup.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r184061 r184064 1 2015-05-10 Philip Chimento <philip.chimento@gmail.com> 2 3 [GTK][SOUP] Web and Network processes don't know how to get memory size on OSX 4 https://bugs.webkit.org/show_bug.cgi?id=144554 5 6 Reviewed by Darin Adler. 7 8 * NetworkProcess/soup/NetworkProcessSoup.cpp: 9 (WebKit::NetworkProcess::platformSetCacheModel): Use WTF::ramSize() 10 instead of local function. Also use WTF::MB instead of dividing by 11 1024 * 1024. 12 (WebKit::getMemorySize): Deleted. 13 * WebProcess/soup/WebProcessSoup.cpp: 14 (WebKit::WebProcess::platformSetCacheModel): Ditto. 15 (WebKit::getMemorySize): Deleted. 16 1 17 2015-05-10 Yongjun Zhang <yongjun_zhang@apple.com> 2 18 -
trunk/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp
r183931 r184064 39 39 #include <WebCore/SoupNetworkSession.h> 40 40 #include <libsoup/soup.h> 41 #include <wtf/RAMSize.h> 41 42 #include <wtf/gobject/GRefPtr.h> 42 43 #include <wtf/gobject/GUniquePtr.h> … … 59 60 } 60 61 #endif 61 62 static uint64_t getMemorySize()63 {64 static uint64_t kDefaultMemorySize = 512;65 long pageSize = sysconf(_SC_PAGESIZE);66 if (pageSize == -1)67 return kDefaultMemorySize;68 69 long physPages = sysconf(_SC_PHYS_PAGES);70 if (physPages == -1)71 return kDefaultMemorySize;72 73 return ((pageSize / 1024) * physPages) / 1024;74 }75 62 76 63 void NetworkProcess::userPreferredLanguagesChanged(const Vector<String>& languages) … … 129 116 130 117 #if ENABLE(NETWORK_CACHE) 131 uint64_t diskFreeSize = WebCore::getVolumeFreeSizeForPath(m_diskCacheDirectory.utf8().data()) / 1024 / 1024;118 uint64_t diskFreeSize = WebCore::getVolumeFreeSizeForPath(m_diskCacheDirectory.utf8().data()) / WTF::MB; 132 119 #else 133 120 SoupCache* cache = SoupNetworkSession::defaultSession().cache(); 134 uint64_t diskFreeSize = getCacheDiskFreeSize(cache) / 1024 / 1024;121 uint64_t diskFreeSize = getCacheDiskFreeSize(cache) / WTF::MB; 135 122 #endif 136 123 137 uint64_t memSize = getMemorySize();124 uint64_t memSize = WTF::ramSize() / WTF::MB; 138 125 calculateCacheSizes(cacheModel, memSize, diskFreeSize, 139 126 cacheTotalCapacity, cacheMinDeadCapacity, cacheMaxDeadCapacity, deadDecodedDataDeletionInterval, -
trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
r183931 r184064 42 42 #include <WebCore/SoupNetworkSession.h> 43 43 #include <libsoup/soup.h> 44 #include <wtf/RAMSize.h> 44 45 #include <wtf/gobject/GRefPtr.h> 45 46 #include <wtf/gobject/GUniquePtr.h> … … 57 58 58 59 return WebCore::getVolumeFreeSizeForPath(cacheDir.get()); 59 }60 61 static uint64_t getMemorySize()62 {63 static uint64_t kDefaultMemorySize = 512;64 long pageSize = sysconf(_SC_PAGESIZE);65 if (pageSize == -1)66 return kDefaultMemorySize;67 68 long physPages = sysconf(_SC_PHYS_PAGES);69 if (physPages == -1)70 return kDefaultMemorySize;71 72 return ((pageSize / 1024LL) * physPages) / 1024LL;73 60 } 74 61 … … 89 76 if (!usesNetworkProcess()) { 90 77 cache = WebCore::SoupNetworkSession::defaultSession().cache(); 91 diskFreeSize = getCacheDiskFreeSize(cache) / 1024 / 1024;78 diskFreeSize = getCacheDiskFreeSize(cache) / WTF::MB; 92 79 } 93 80 94 uint64_t memSize = getMemorySize();81 uint64_t memSize = WTF::ramSize() / WTF::MB; 95 82 calculateCacheSizes(cacheModel, memSize, diskFreeSize, 96 83 cacheTotalCapacity, cacheMinDeadCapacity, cacheMaxDeadCapacity, deadDecodedDataDeletionInterval,
Note:
See TracChangeset
for help on using the changeset viewer.