WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
121985
[iOS] Upstream disk image cache
https://bugs.webkit.org/show_bug.cgi?id=121985
Summary
[iOS] Upstream disk image cache
Daniel Bates
Reported
2013-09-26 14:52:28 PDT
Upstream the iOS-specific disk image cache feature.
Attachments
Patch
(76.07 KB, patch)
2013-09-26 14:59 PDT
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Patch
(73.55 KB, patch)
2013-09-27 13:39 PDT
,
Daniel Bates
joepeck
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Daniel Bates
Comment 1
2013-09-26 14:59:59 PDT
Created
attachment 212755
[details]
Patch
WebKit Commit Bot
Comment 2
2013-09-26 15:01:55 PDT
Attachment 212755
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/WebCore.exp.in', u'Source/WebCore/WebCore.xcodeproj/project.pbxproj', u'Source/WebCore/loader/DiskImageCache.cpp', u'Source/WebCore/loader/DiskImageCache.h', u'Source/WebCore/loader/DiskImageCacheClient.h', u'Source/WebCore/loader/ResourceBuffer.cpp', u'Source/WebCore/loader/ResourceBuffer.h', u'Source/WebCore/loader/cache/CachedImage.cpp', u'Source/WebCore/loader/cache/CachedImage.h', u'Source/WebCore/loader/cache/CachedResource.cpp', u'Source/WebCore/loader/cache/CachedResource.h', u'Source/WebCore/loader/cache/MemoryCache.cpp', u'Source/WebCore/loader/cache/MemoryCache.h', u'Source/WebCore/loader/ios/DiskImageCacheIOS.mm', u'Source/WebCore/platform/Logging.h', u'Source/WebCore/platform/SharedBuffer.cpp', u'Source/WebCore/platform/SharedBuffer.h', u'Source/WebCore/platform/cf/SharedBufferCF.cpp', u'Source/WebKit/ChangeLog', u'Source/WebKit/WebKit.xcodeproj/project.pbxproj', u'Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.h', u'Source/WebKit/ios/WebCoreSupport/WebDiskImageCacheClientIOS.mm', u'Source/WebKit/mac/ChangeLog', u'Source/WebKit/mac/Misc/WebCache.mm', u'Source/WebKit/mac/WebView/WebDataSource.mm', u'Source/WebKit/mac/WebView/WebDataSourcePrivate.h', u'Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h', u'Source/WebKit/mac/WebView/WebPreferences.mm', u'Source/WebKit/mac/WebView/WebView.mm']" exit_code: 1 Source/WebCore/loader/DiskImageCache.cpp:116: Missing space before { [whitespace/braces] [5] Source/WebCore/loader/DiskImageCache.cpp:128: Missing space before { [whitespace/braces] [5] Source/WebCore/loader/DiskImageCache.cpp:228: Missing space before { [whitespace/braces] [5] Source/WebCore/loader/DiskImageCache.cpp:231: Missing space before { [whitespace/braces] [5] Source/WebCore/loader/DiskImageCache.cpp:266: Missing space before { [whitespace/braces] [5] Source/WebCore/loader/DiskImageCache.cpp:269: More than one command on the same line [whitespace/newline] [4] Source/WebCore/loader/DiskImageCache.cpp:269: Missing space before { [whitespace/braces] [5] Total errors found: 7 in 30 files If any of these errors are false positives, please file a bug against check-webkit-style.
Daniel Bates
Comment 3
2013-09-26 15:06:18 PDT
I am looking to clean up the WebPreference code so as to work for both iOS and Mac. For now, I added an implementation, but didn't declare the following methods in WebPreferencesPrivate.h: diskImageCacheEnabled, setDiskImageCacheEnabled, diskImageCacheMinimumImageSize, diskImageCacheMaximumCacheSize, setDiskImageCacheMaximumCacheSize, _diskImageCacheSavedCacheDirectory, _setDiskImageCacheSavedCacheDirectory. Let me know if it would be preferred to omit the implementations as well or if we should look to clean up WebPreferences before landing this patch.
Joseph Pecoraro
Comment 4
2013-09-26 15:44:08 PDT
Comment on
attachment 212755
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=212755&action=review
A few drive by comments, but this looks fine to me. Ideally this code will go away eventually; in favor of better shared cache between the lower network layer and WebCore.
> Source/WebCore/loader/DiskImageCache.cpp:29 > +#if ENABLE(DISK_IMAGE_CACHE)
This file openly uses WebThreadRun and includes WebCoreThread* files. So perhaps this should be #if PLATFORM(IOS) && ENABLE(DISK_IMAGE_CACHE)?
> Source/WebCore/loader/DiskImageCache.cpp:42 > + DEFINE_STATIC_LOCAL(DiskImageCache, staticCache, ());
Newer code has been moving away from DEFINE_STATIC_LOCAL. It seems NeverDestroyed<> or just using a static (like WebCore::memoryCache()) would be fine.
> Source/WebCore/loader/cache/CachedResource.h:255 > + virtual bool canUseDiskImageCache() const { return false; } > + virtual void useDiskImageCache() { ASSERT(canUseDiskImageCache()); }
These could be OVERRIDE.
Daniel Bates
Comment 5
2013-09-26 16:58:44 PDT
(In reply to
comment #4
)
> [...] > > Source/WebCore/loader/DiskImageCache.cpp:29 > > +#if ENABLE(DISK_IMAGE_CACHE) > > This file openly uses WebThreadRun and includes WebCoreThread* files. So perhaps this should be #if PLATFORM(IOS) && ENABLE(DISK_IMAGE_CACHE)?
I can do this. What are your thoughts about moving files Source/WebCore/loader/DiskImageCache.{cpp, h}, and Source/WebCore/loader/DiskImageCacheClient.h to directory Source/WebCore/loader/ios?
> > > Source/WebCore/loader/DiskImageCache.cpp:42 > > + DEFINE_STATIC_LOCAL(DiskImageCache, staticCache, ()); > > Newer code has been moving away from DEFINE_STATIC_LOCAL. It seems NeverDestroyed<> or just using a static (like WebCore::memoryCache()) would be fine.
Will use NeverDestroyed<>.
> > > Source/WebCore/loader/cache/CachedResource.h:255 > > + virtual bool canUseDiskImageCache() const { return false; } > > + virtual void useDiskImageCache() { ASSERT(canUseDiskImageCache()); } > > These could be OVERRIDE.
These are the base class definitions; => we can't mark them OVERRIDE.
Joseph Pecoraro
Comment 6
2013-09-26 18:13:54 PDT
(In reply to
comment #5
)
> (In reply to
comment #4
) > > [...] > > > Source/WebCore/loader/DiskImageCache.cpp:29 > > > +#if ENABLE(DISK_IMAGE_CACHE) > > > > This file openly uses WebThreadRun and includes WebCoreThread* files. So perhaps this should be #if PLATFORM(IOS) && ENABLE(DISK_IMAGE_CACHE)? > > I can do this. What are your thoughts about moving files Source/WebCore/loader/DiskImageCache.{cpp, h}, and Source/WebCore/loader/DiskImageCacheClient.h to directory Source/WebCore/loader/ios?
That sounds fine.
> > > Source/WebCore/loader/cache/CachedResource.h:255 > > > + virtual bool canUseDiskImageCache() const { return false; } > > > + virtual void useDiskImageCache() { ASSERT(canUseDiskImageCache()); } > > > > These could be OVERRIDE. > > These are the base class definitions; => we can't mark them OVERRIDE.
Ahh, good point!
Daniel Bates
Comment 7
2013-09-27 13:39:47 PDT
Created
attachment 212839
[details]
Patch
Joseph Pecoraro
Comment 8
2013-10-04 13:01:28 PDT
Comment on
attachment 212839
[details]
Patch r=me
Daniel Bates
Comment 9
2013-10-04 15:39:53 PDT
Committed
r156918
: <
http://trac.webkit.org/changeset/156918
>
Gustavo Noronha (kov)
Comment 10
2013-10-23 11:59:42 PDT
(In reply to
comment #4
)
> […] Ideally this code will go away eventually; in favor of better shared cache between the lower network layer and WebCore.
Is that really possible? To me it looks like this is being done at the proper level, since it's actually decoded data that's being file-backed, rather than the bytes that were downloaded.
Gustavo Noronha (kov)
Comment 11
2013-10-28 04:34:15 PDT
hrm, no, I misunderstood, it's caching the data it got from the network, so I think your comment makes sense, it would be great to make it integrate with the lower level.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug