<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[175549] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/175549">175549</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-11-04 08:47:53 -0800 (Tue, 04 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Eliminate ResourceBuffer and use SharedBuffer directly instead
https://bugs.webkit.org/show_bug.cgi?id=138174
Reviewed by Antti Koivisto.
Source/WebCore:
Refactoring, with test coverage across many existing tests.
* CMakeLists.txt: Deleted ResourceBuffer.cpp.
* WebCore.exp.in: Removed ResourceBuffer-related symbols, and updated symbol
for one function that used to take a PassRefPtr but now takes a reference instead.
* WebCore.vcxproj/WebCore.vcxproj: Deleted ResourceBuffer.cpp/.h.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Deleted ResourceBuffer.mm/.cpp/.h.
* bindings/objc/DOMUIKitExtensions.mm:
(-[DOMHTMLImageElement dataRepresentation:]): Use SharedBuffer directly.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::writeImageToPasteboard): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::writeImageToPasteboard): Ditto.
* html/ImageDocument.cpp:
(WebCore::ImageDocument::updateDuringParsing): Use SharedBuffer directly, and
also pass a reference only if non-null rather than passing a pointer.
(WebCore::ImageDocument::finishedParsing): Ditto. Added a missing null check.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceContent): Use SharedBuffer directly.
(WebCore::InspectorPageAgent::mainResourceContent): Ditto.
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::didFinishLoading): Ditto.
(WebCore::InspectorResourceAgent::didFailLoading): Ditto.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::mainResourceData): Use SharedBuffer directly,
and use the copy function rather than a hand-written alternative.
(WebCore::DocumentLoader::maybeCreateArchive): Ditto.
(WebCore::DocumentLoader::mainResource): Ditto.
(WebCore::DocumentLoader::subresource): Ditto.
(WebCore::DocumentLoader::maybeFinishLoadingMultipartContent): Ditto.
* loader/DocumentLoader.h: Changed mainResourceData to return a
PassRefPtr<SharedBuffer>. Would be better if it returned a SharedBuffer&,
but it currently returns a newly created buffer when there is substitute
data and can also return null, even though many callers assume it will not!
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::dataReceived): Removed call to unused client
function bufferReceived.
(WebCore::MediaResourceLoader::notifyFinished): Removed unused buffer
argument to client function loadFinished.
* loader/ResourceBuffer.cpp: Removed.
* loader/ResourceBuffer.h: Removed.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::addDataOrBuffer): Use SharedBuffer directly.
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::resourceData): Use SharedBuffer.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse): Use SharedBuffer.
(WebCore::SubresourceLoader::didReceiveDataOrBuffer): Ditto.
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::processNewCueData): Use SharedBuffer.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::finishedLoadingMainResource): Ditto.
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create): Ditto.
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::finishLoading): Use SharedBuffer.
* loader/cache/CachedCSSStyleSheet.h: Ditto.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::finishLoading): Ditto.
(WebCore::CachedFont::ensureCustomFontData): Ditto.
* loader/cache/CachedFont.h: Ditto.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didAddClient): Use SharedBuffer.
(WebCore::CachedImage::didRemoveClient): Ditto.
(WebCore::CachedImage::addIncrementalDataBuffer): Ditto. Changed to take
a reference rather than a pointer.
(WebCore::CachedImage::addDataBuffer): Ditto. Also added call through
to base class and changed to take a reference rather than a pointer.
(WebCore::CachedImage::addData): Ditto. Also added call through to base class.
(WebCore::CachedImage::finishLoading): Ditto.
* loader/cache/CachedImage.h: Ditto. Also changed the type of some bit fields
to be unsigned instead of unsigend char.
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::calculateIncrementalDataChunk): Use SharedBuffer.
(WebCore::CachedRawResource::addDataBuffer): Ditto. Changed to take
a reference rather than a pointer.
(WebCore::CachedRawResource::addData): Ditto.
(WebCore::CachedRawResource::finishLoading): Ditto.
(WebCore::CachedRawResource::canReuse): Ditto.
* loader/cache/CachedRawResource.h: Ditto.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource): Reordered data members due to change
in header.
(WebCore::CachedResource::addDataBuffer): Changed argument type.
(WebCore::CachedResource::finishLoading): Ditto.
(WebCore::CachedResource::didAddClient): Refactored to eliminate one extra hash
table lookup by using the return value from the remove function.
(WebCore::CachedResource::addClientToSet): Use std::make_unique directly instead
of using a function named "schedule" to allocate the callback object.
(WebCore::CachedResource::Callback::Callback): Changed function and data member
name.
(WebCore::CachedResource::Callback::cancel): Ditto.
(WebCore::CachedResource::Callback::timerFired): Ditto.
(WebCore::CachedResource::tryReplaceEncodedData): Changed to take a SharedBuffer&.
* loader/cache/CachedResource.h: Changed types to use SharedBuffer. Also made most
data members and one function member private instead of protected. Also renamed the
CachedResource::CachedResourceCallback function CachedResource::Callback and moved
its definition out of the CachedResource class definition.
* loader/cache/CachedResourceClient.h: Removed unneeded include.
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::finishLoading): Use SharedBuffer.
* loader/cache/CachedSVGDocument.h: Ditto. Made data members private.
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::finishLoading): Use SharedBuffer.
* loader/cache/CachedScript.h: Ditto. Also fixed indenting and removed unneeded
forward declaration.
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::updateData): Added, so that finishLoading does not
call addDataBuffer.
(WebCore::CachedTextTrack::addDataBuffer): Take SharedBuffer, call updateData.
(WebCore::CachedTextTrack::finishLoading): Ditto.
* loader/cache/CachedTextTrack.h: Take out unneeded explicit override of the
destructor. Updated for above changes.
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::finishLoading): Updated to use SharedBuffer.
* loader/cache/CachedXSLStyleSheet.h: Took out unneeded includes, made everything
private rather than protected. Added an explicit virtual constructor so we can
compile without knowing how to ref/deref TextResourceDecoder.
* loader/cf/SubresourceLoaderCF.cpp:
(WebCore::SubresourceLoader::didReceiveDataArray): Updated to use SharedBuffer
and to call addDataBuffer only if there is a new data buffer.
* loader/cocoa/DiskCacheMonitorCocoa.h: Use SharedBuffer& instead of PassRefPtr.
* loader/cocoa/DiskCacheMonitorCocoa.mm:
(WebCore::DiskCacheMonitor::DiskCacheMonitor): Ditto.
(WebCore::DiskCacheMonitor::resourceBecameFileBacked): Ditto.
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::notifyFinished): Use SharedBuffer* instead of
RefPtr<ResourceBuffer>.
* loader/mac/ResourceBuffer.mm: Removed.
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::didReceiveDataArray): Use SharedBuffer.
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::clear): Use a modern for loop.
(WebCore::SharedBuffer::copy): Return a PassRef instead of a PassRefPtr, since
this never returns null. Use modern for loops.
(WebCore::SharedBuffer::copyBufferAndClear): Use a modern for loop.
* platform/SharedBuffer.h: Changed copy to return PassRef instead of PassRefPtr.
Changed tryReplaceContentsWithPlatformBuffer to take a reference rather than
a pointer.
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Take a reference
instead of a pointer.
* platform/graphics/PlatformMediaResourceLoader.h: Removed unused function
bufferReceived and unneeded buffer argument from loadFinished. Also marked the
constructor explicit.
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
Removed include of ResourceBuffer.h.
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource): Use
SharedBuffer directly.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::loadFinished): Updated for change to
PlatformMediaResourceLoaderClient.
* platform/mac/PasteboardMac.mm: Removed include of ResourceBuffer.h.
* platform/soup/SharedBufferSoup.cpp: Removed unused, unneeded
tryReplaceContentsWithPlatformBuffer function.
Source/WebKit/mac:
* WebView/WebDataSource.mm:
(-[WebDataSource data]): Use SharedBuffer directly.
* WebView/WebHTMLView.mm:
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto.
Source/WebKit/win:
* WebDataSource.cpp:
(WebDataSource::data): Use SharedBuffer directly.
(WebDataSource::subresourceForURL): Ditto.
Source/WebKit2:
* CMakeLists.txt: Removed WebResourceBuffer.cpp.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::sendBuffer): Use a reference instead of pointer.
* NetworkProcess/NetworkResourceLoader.h: Ditto.
* NetworkProcess/mac/NetworkDiskCacheMonitor.h: Ditto.
* NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
(WebKit::NetworkDiskCacheMonitor::resourceBecameFileBacked): Ditto.
* NetworkProcess/mac/NetworkResourceLoaderMac.mm:
(WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): Ditto.
* Shared/WebResourceBuffer.cpp: Removed.
* Shared/WebResourceBuffer.h: Removed.
* WebKit2.xcodeproj/project.pbxproj: Removed WebResourceBuffer.cpp/h.
* WebProcess/Network/NetworkProcessConnection.cpp: Removed unneeded includes.
(WebKit::NetworkProcessConnection::didCacheResource): Use a reference instead
of a pointer.
* WebProcess/Network/WebResourceLoadScheduler.cpp: Removed unneeded include.
* WebProcess/Network/WebResourceLoader.cpp: Ditto.
* WebProcess/Network/WebResourceLoader.h: Ditto.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Ditto.
(WebKit::WebFrameLoaderClient::finishedLoading): Use SharedBuffer directly.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::source): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScriptInMainFrame): Refactored to make the relationship
between the buffer and the DataReference clearer and to avoid having a long-lived
DataReference pointing to an underlying buffer with unclear lifetime.
(WebKit::WebPage::getContentsAsString): Ditto.
(WebKit::WebPage::getSelectionAsWebArchiveData): Ditto.
(WebKit::WebPage::getMainResourceDataOfFrame): Ditto. Also use SharedBuffer directly.
(WebKit::WebPage::getResourceDataFromFrame): Ditto.
(WebKit::WebPage::getWebArchiveOfFrame): Ditto.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::containingLinkElement): Use elementLineage.
(WebKit::WebPage::performActionOnElement): Use references and SharedBuffer.
ALso did a bit of other cleanup in here.
(WebKit::isAssistableElement): Take Element& instead of Node*, since that's what
the caller has.
(WebKit::nextAssistableElement): Changed name to match what the function does.
Added an obviously-missing check on the startNode argument. Updated for change
to isAssistableElement above. Take a Page& instead of a Page*.
(WebKit::hasAssistableElement): Changed name to match what the function does.
Updated for change to nextAssistableElement above. Took out incorrect comparison
of a C++ pointer to the Objective-C object pointer nil. Take a Page& instead of a Page*.
(WebKit::WebPage::focusNextAssistedNode): Updated for above changes.
(WebKit::WebPage::getAssistedNodeInformation): Updated for above changes.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm">trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingiosEditorIOSmm">trunk/Source/WebCore/editing/ios/EditorIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingmacEditorMacmm">trunk/Source/WebCore/editing/mac/EditorMac.mm</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDocumentcpp">trunk/Source/WebCore/html/ImageDocument.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorResourceAgentcpp">trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoaderh">trunk/Source/WebCore/loader/DocumentLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderMediaResourceLoadercpp">trunk/Source/WebCore/loader/MediaResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadercpp">trunk/Source/WebCore/loader/ResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoaderh">trunk/Source/WebCore/loader/ResourceLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderSubresourceLoadercpp">trunk/Source/WebCore/loader/SubresourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderTextTrackLoadercpp">trunk/Source/WebCore/loader/TextTrackLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderappcacheApplicationCacheGroupcpp">trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderarchivecfLegacyWebArchivecpp">trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedCSSStyleSheetcpp">trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedCSSStyleSheeth">trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedFontcpp">trunk/Source/WebCore/loader/cache/CachedFont.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedFonth">trunk/Source/WebCore/loader/cache/CachedFont.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedImagecpp">trunk/Source/WebCore/loader/cache/CachedImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedImageh">trunk/Source/WebCore/loader/cache/CachedImage.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedRawResourcecpp">trunk/Source/WebCore/loader/cache/CachedRawResource.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedRawResourceh">trunk/Source/WebCore/loader/cache/CachedRawResource.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourcecpp">trunk/Source/WebCore/loader/cache/CachedResource.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceh">trunk/Source/WebCore/loader/cache/CachedResource.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceClienth">trunk/Source/WebCore/loader/cache/CachedResourceClient.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedSVGDocumentcpp">trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedSVGDocumenth">trunk/Source/WebCore/loader/cache/CachedSVGDocument.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedScriptcpp">trunk/Source/WebCore/loader/cache/CachedScript.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedScripth">trunk/Source/WebCore/loader/cache/CachedScript.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedTextTrackcpp">trunk/Source/WebCore/loader/cache/CachedTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedTextTrackh">trunk/Source/WebCore/loader/cache/CachedTextTrack.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedXSLStyleSheetcpp">trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedXSLStyleSheeth">trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h</a></li>
<li><a href="#trunkSourceWebCoreloadercfSubresourceLoaderCFcpp">trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercocoaDiskCacheMonitorCocoah">trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.h</a></li>
<li><a href="#trunkSourceWebCoreloadercocoaDiskCacheMonitorCocoamm">trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreloadericonIconLoadercpp">trunk/Source/WebCore/loader/icon/IconLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadermacResourceLoaderMacmm">trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformSharedBuffercpp">trunk/Source/WebCore/platform/SharedBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformSharedBufferh">trunk/Source/WebCore/platform/SharedBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcfSharedBufferCFcpp">trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPlatformMediaResourceLoaderh">trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfWebCoreAVCFResourceLoadercpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcWebCoreAVFResourceLoadermm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerWebKitWebSourceGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPasteboardMacmm">trunk/Source/WebCore/platform/mac/PasteboardMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformsoupSharedBufferSoupcpp">trunk/Source/WebCore/platform/soup/SharedBufferSoup.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebDataSourcemm">trunk/Source/WebKit/mac/WebView/WebDataSource.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLViewmm">trunk/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebDataSourcecpp">trunk/Source/WebKit/win/WebDataSource.cpp</a></li>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkResourceLoaderh">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessmacNetworkDiskCacheMonitorh">trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessmacNetworkDiskCacheMonitormm">trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessmacNetworkResourceLoaderMacmm">trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCDataReferenceh">trunk/Source/WebKit2/Platform/IPC/DataReference.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectioncpp">trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkWebResourceLoadSchedulercpp">trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkWebResourceLoadercpp">trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkWebResourceLoaderh">trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebFramecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreloaderResourceBuffercpp">trunk/Source/WebCore/loader/ResourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceBufferh">trunk/Source/WebCore/loader/ResourceBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreloadermacResourceBuffermm">trunk/Source/WebCore/loader/mac/ResourceBuffer.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedWebResourceBuffercpp">trunk/Source/WebKit2/Shared/WebResourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebResourceBufferh">trunk/Source/WebKit2/Shared/WebResourceBuffer.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1816,7 +1816,6 @@
</span><span class="cx"> loader/PolicyCallback.cpp
</span><span class="cx"> loader/PolicyChecker.cpp
</span><span class="cx"> loader/ProgressTracker.cpp
</span><del>- loader/ResourceBuffer.cpp
</del><span class="cx"> loader/ResourceLoadNotifier.cpp
</span><span class="cx"> loader/ResourceLoadScheduler.cpp
</span><span class="cx"> loader/ResourceLoader.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/ChangeLog        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1,3 +1,205 @@
</span><ins>+2014-11-04 Darin Adler <darin@apple.com>
+
+ Eliminate ResourceBuffer and use SharedBuffer directly instead
+ https://bugs.webkit.org/show_bug.cgi?id=138174
+
+ Reviewed by Antti Koivisto.
+
+ Refactoring, with test coverage across many existing tests.
+
+ * CMakeLists.txt: Deleted ResourceBuffer.cpp.
+
+ * WebCore.exp.in: Removed ResourceBuffer-related symbols, and updated symbol
+ for one function that used to take a PassRefPtr but now takes a reference instead.
+
+ * WebCore.vcxproj/WebCore.vcxproj: Deleted ResourceBuffer.cpp/.h.
+ * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Deleted ResourceBuffer.mm/.cpp/.h.
+
+ * bindings/objc/DOMUIKitExtensions.mm:
+ (-[DOMHTMLImageElement dataRepresentation:]): Use SharedBuffer directly.
+ * editing/ios/EditorIOS.mm:
+ (WebCore::Editor::writeImageToPasteboard): Ditto.
+ * editing/mac/EditorMac.mm:
+ (WebCore::Editor::writeImageToPasteboard): Ditto.
+
+ * html/ImageDocument.cpp:
+ (WebCore::ImageDocument::updateDuringParsing): Use SharedBuffer directly, and
+ also pass a reference only if non-null rather than passing a pointer.
+ (WebCore::ImageDocument::finishedParsing): Ditto. Added a missing null check.
+
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::cachedResourceContent): Use SharedBuffer directly.
+ (WebCore::InspectorPageAgent::mainResourceContent): Ditto.
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::InspectorResourceAgent::didFinishLoading): Ditto.
+ (WebCore::InspectorResourceAgent::didFailLoading): Ditto.
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::mainResourceData): Use SharedBuffer directly,
+ and use the copy function rather than a hand-written alternative.
+ (WebCore::DocumentLoader::maybeCreateArchive): Ditto.
+ (WebCore::DocumentLoader::mainResource): Ditto.
+ (WebCore::DocumentLoader::subresource): Ditto.
+ (WebCore::DocumentLoader::maybeFinishLoadingMultipartContent): Ditto.
+
+ * loader/DocumentLoader.h: Changed mainResourceData to return a
+ PassRefPtr<SharedBuffer>. Would be better if it returned a SharedBuffer&,
+ but it currently returns a newly created buffer when there is substitute
+ data and can also return null, even though many callers assume it will not!
+
+ * loader/MediaResourceLoader.cpp:
+ (WebCore::MediaResourceLoader::dataReceived): Removed call to unused client
+ function bufferReceived.
+ (WebCore::MediaResourceLoader::notifyFinished): Removed unused buffer
+ argument to client function loadFinished.
+
+ * loader/ResourceBuffer.cpp: Removed.
+ * loader/ResourceBuffer.h: Removed.
+
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::addDataOrBuffer): Use SharedBuffer directly.
+
+ * loader/ResourceLoader.h:
+ (WebCore::ResourceLoader::resourceData): Use SharedBuffer.
+
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::didReceiveResponse): Use SharedBuffer.
+ (WebCore::SubresourceLoader::didReceiveDataOrBuffer): Ditto.
+
+ * loader/TextTrackLoader.cpp:
+ (WebCore::TextTrackLoader::processNewCueData): Use SharedBuffer.
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::finishedLoadingMainResource): Ditto.
+ * loader/archive/cf/LegacyWebArchive.cpp:
+ (WebCore::LegacyWebArchive::create): Ditto.
+
+ * loader/cache/CachedCSSStyleSheet.cpp:
+ (WebCore::CachedCSSStyleSheet::finishLoading): Use SharedBuffer.
+ * loader/cache/CachedCSSStyleSheet.h: Ditto.
+ * loader/cache/CachedFont.cpp:
+ (WebCore::CachedFont::finishLoading): Ditto.
+ (WebCore::CachedFont::ensureCustomFontData): Ditto.
+ * loader/cache/CachedFont.h: Ditto.
+
+ * loader/cache/CachedImage.cpp:
+ (WebCore::CachedImage::didAddClient): Use SharedBuffer.
+ (WebCore::CachedImage::didRemoveClient): Ditto.
+ (WebCore::CachedImage::addIncrementalDataBuffer): Ditto. Changed to take
+ a reference rather than a pointer.
+ (WebCore::CachedImage::addDataBuffer): Ditto. Also added call through
+ to base class and changed to take a reference rather than a pointer.
+ (WebCore::CachedImage::addData): Ditto. Also added call through to base class.
+ (WebCore::CachedImage::finishLoading): Ditto.
+ * loader/cache/CachedImage.h: Ditto. Also changed the type of some bit fields
+ to be unsigned instead of unsigend char.
+
+ * loader/cache/CachedRawResource.cpp:
+ (WebCore::CachedRawResource::calculateIncrementalDataChunk): Use SharedBuffer.
+ (WebCore::CachedRawResource::addDataBuffer): Ditto. Changed to take
+ a reference rather than a pointer.
+ (WebCore::CachedRawResource::addData): Ditto.
+ (WebCore::CachedRawResource::finishLoading): Ditto.
+ (WebCore::CachedRawResource::canReuse): Ditto.
+ * loader/cache/CachedRawResource.h: Ditto.
+
+ * loader/cache/CachedResource.cpp:
+ (WebCore::CachedResource::CachedResource): Reordered data members due to change
+ in header.
+ (WebCore::CachedResource::addDataBuffer): Changed argument type.
+ (WebCore::CachedResource::finishLoading): Ditto.
+ (WebCore::CachedResource::didAddClient): Refactored to eliminate one extra hash
+ table lookup by using the return value from the remove function.
+ (WebCore::CachedResource::addClientToSet): Use std::make_unique directly instead
+ of using a function named "schedule" to allocate the callback object.
+ (WebCore::CachedResource::Callback::Callback): Changed function and data member
+ name.
+ (WebCore::CachedResource::Callback::cancel): Ditto.
+ (WebCore::CachedResource::Callback::timerFired): Ditto.
+ (WebCore::CachedResource::tryReplaceEncodedData): Changed to take a SharedBuffer&.
+
+ * loader/cache/CachedResource.h: Changed types to use SharedBuffer. Also made most
+ data members and one function member private instead of protected. Also renamed the
+ CachedResource::CachedResourceCallback function CachedResource::Callback and moved
+ its definition out of the CachedResource class definition.
+
+ * loader/cache/CachedResourceClient.h: Removed unneeded include.
+
+ * loader/cache/CachedSVGDocument.cpp:
+ (WebCore::CachedSVGDocument::finishLoading): Use SharedBuffer.
+
+ * loader/cache/CachedSVGDocument.h: Ditto. Made data members private.
+
+ * loader/cache/CachedScript.cpp:
+ (WebCore::CachedScript::finishLoading): Use SharedBuffer.
+ * loader/cache/CachedScript.h: Ditto. Also fixed indenting and removed unneeded
+ forward declaration.
+
+ * loader/cache/CachedTextTrack.cpp:
+ (WebCore::CachedTextTrack::updateData): Added, so that finishLoading does not
+ call addDataBuffer.
+ (WebCore::CachedTextTrack::addDataBuffer): Take SharedBuffer, call updateData.
+ (WebCore::CachedTextTrack::finishLoading): Ditto.
+ * loader/cache/CachedTextTrack.h: Take out unneeded explicit override of the
+ destructor. Updated for above changes.
+
+ * loader/cache/CachedXSLStyleSheet.cpp:
+ (WebCore::CachedXSLStyleSheet::finishLoading): Updated to use SharedBuffer.
+ * loader/cache/CachedXSLStyleSheet.h: Took out unneeded includes, made everything
+ private rather than protected. Added an explicit virtual constructor so we can
+ compile without knowing how to ref/deref TextResourceDecoder.
+
+ * loader/cf/SubresourceLoaderCF.cpp:
+ (WebCore::SubresourceLoader::didReceiveDataArray): Updated to use SharedBuffer
+ and to call addDataBuffer only if there is a new data buffer.
+
+ * loader/cocoa/DiskCacheMonitorCocoa.h: Use SharedBuffer& instead of PassRefPtr.
+ * loader/cocoa/DiskCacheMonitorCocoa.mm:
+ (WebCore::DiskCacheMonitor::DiskCacheMonitor): Ditto.
+ (WebCore::DiskCacheMonitor::resourceBecameFileBacked): Ditto.
+
+ * loader/icon/IconLoader.cpp:
+ (WebCore::IconLoader::notifyFinished): Use SharedBuffer* instead of
+ RefPtr<ResourceBuffer>.
+
+ * loader/mac/ResourceBuffer.mm: Removed.
+
+ * loader/mac/ResourceLoaderMac.mm:
+ (WebCore::ResourceLoader::didReceiveDataArray): Use SharedBuffer.
+
+ * platform/SharedBuffer.cpp:
+ (WebCore::SharedBuffer::clear): Use a modern for loop.
+ (WebCore::SharedBuffer::copy): Return a PassRef instead of a PassRefPtr, since
+ this never returns null. Use modern for loops.
+ (WebCore::SharedBuffer::copyBufferAndClear): Use a modern for loop.
+
+ * platform/SharedBuffer.h: Changed copy to return PassRef instead of PassRefPtr.
+ Changed tryReplaceContentsWithPlatformBuffer to take a reference rather than
+ a pointer.
+
+ * platform/cf/SharedBufferCF.cpp:
+ (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Take a reference
+ instead of a pointer.
+
+ * platform/graphics/PlatformMediaResourceLoader.h: Removed unused function
+ bufferReceived and unneeded buffer argument from loadFinished. Also marked the
+ constructor explicit.
+
+ * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
+ Removed include of ResourceBuffer.h.
+ * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
+ (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource): Use
+ SharedBuffer directly.
+
+ * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+ (CachedResourceStreamingClient::loadFinished): Updated for change to
+ PlatformMediaResourceLoaderClient.
+
+ * platform/mac/PasteboardMac.mm: Removed include of ResourceBuffer.h.
+
+ * platform/soup/SharedBufferSoup.cpp: Removed unused, unneeded
+ tryReplaceContentsWithPlatformBuffer function.
+
</ins><span class="cx"> 2014-11-04 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Use SPECIALIZE_TYPE_TRAITS_*() macro for StyleRuleGroup subclasses
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -341,7 +341,7 @@
</span><span class="cx"> __ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE
</span><span class="cx"> __ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE
</span><span class="cx"> __ZN7WebCore14CachedResource16unregisterHandleEPNS_24CachedResourceHandleBaseE
</span><del>-__ZN7WebCore14CachedResource21tryReplaceEncodedDataEN3WTF10PassRefPtrINS_12SharedBufferEEE
</del><ins>+__ZN7WebCore14CachedResource21tryReplaceEncodedDataERNS_12SharedBufferE
</ins><span class="cx"> __ZN7WebCore14CachedResource9addClientEPNS_20CachedResourceClientE
</span><span class="cx"> __ZN7WebCore14ClientRectListC1ERKN3WTF6VectorINS_9FloatQuadELm0ENS1_15CrashOnOverflowEEE
</span><span class="cx"> __ZN7WebCore14ClientRectListC1Ev
</span><span class="lines">@@ -384,13 +384,6 @@
</span><span class="cx"> __ZN7WebCore14LoaderStrategy21resourceLoadSchedulerEv
</span><span class="cx"> __ZN7WebCore14LoaderStrategy25loadResourceSynchronouslyEPNS_17NetworkingContextEmRKNS_15ResourceRequestENS_17StoredCredentialsENS_22ClientCredentialPolicyERNS_13ResourceErrorERNS_16ResourceResponseERN3WTF6VectorIcLm0ENSC_15CrashOnOverflowEEE
</span><span class="cx"> __ZN7WebCore14PluginDocument12pluginWidgetEv
</span><del>-__ZN7WebCore14ResourceBuffer12createNSDataEv
-__ZN7WebCore14ResourceBuffer6appendEPKcj
-__ZN7WebCore14ResourceBufferC1EPKcj
-__ZN7WebCore14ResourceBufferC1Ev
-__ZN7WebCore14ResourceBufferC2Ev
-__ZN7WebCore14ResourceBufferD1Ev
-__ZN7WebCore14ResourceBufferD2Ev
</del><span class="cx"> __ZN7WebCore14ResourceHandle12firstRequestEv
</span><span class="cx"> __ZN7WebCore14ResourceHandle16setDefersLoadingEb
</span><span class="cx"> __ZN7WebCore14ResourceHandle20forceContentSniffingEv
</span><span class="lines">@@ -1732,9 +1725,6 @@
</span><span class="cx"> __ZNK7WebCore14FrameSelection36rootEditableElementOrDocumentElementEv
</span><span class="cx"> __ZNK7WebCore14InsertionPoint8isActiveEv
</span><span class="cx"> __ZNK7WebCore14RenderListItem10markerTextEv
</span><del>-__ZNK7WebCore14ResourceBuffer4dataEv
-__ZNK7WebCore14ResourceBuffer4sizeEv
-__ZNK7WebCore14ResourceBuffer7isEmptyEv
</del><span class="cx"> __ZNK7WebCore14ResourceHandle10connectionEv
</span><span class="cx"> __ZNK7WebCore14ResourceLoader11frameLoaderEv
</span><span class="cx"> __ZNK7WebCore14ResourceLoader32isAllowedToAskUserForCredentialsEv
</span><span class="lines">@@ -2807,7 +2797,6 @@
</span><span class="cx"> __ZNK7WebCore14FrameSelection32rangeByExtendingCurrentSelectionEi
</span><span class="cx"> __ZNK7WebCore14FrameSelection35characterInRelationToCaretSelectionEi
</span><span class="cx"> __ZNK7WebCore14FrameSelection36elementRangeContainingCaretSelectionEv
</span><del>-__ZNK7WebCore14ResourceBuffer12sharedBufferEv
</del><span class="cx"> __ZNK7WebCore14SecurityOrigin8toStringEv
</span><span class="cx"> __ZNK7WebCore15GraphicsLayerCA21contentsLayerForMediaEv
</span><span class="cx"> __ZNK7WebCore15VisiblePosition4leftEb
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -7252,7 +7252,6 @@
</span><span class="cx"> <ClCompile Include="..\loader\PolicyCallback.cpp" />
</span><span class="cx"> <ClCompile Include="..\loader\PolicyChecker.cpp" />
</span><span class="cx"> <ClCompile Include="..\loader\ProgressTracker.cpp" />
</span><del>- <ClCompile Include="..\loader\ResourceBuffer.cpp" />
</del><span class="cx"> <ClCompile Include="..\loader\ResourceLoader.cpp" />
</span><span class="cx"> <ClCompile Include="..\loader\cf\ResourceLoaderCFNet.cpp" />
</span><span class="cx"> <ClCompile Include="..\loader\ResourceLoadNotifier.cpp" />
</span><span class="lines">@@ -19256,7 +19255,6 @@
</span><span class="cx"> <ClInclude Include="..\loader\PolicyChecker.h" />
</span><span class="cx"> <ClInclude Include="..\loader\ProgressTracker.h" />
</span><span class="cx"> <ClInclude Include="..\loader\ProgressTrackerClient.h" />
</span><del>- <ClInclude Include="..\loader\ResourceBuffer.h" />
</del><span class="cx"> <ClInclude Include="..\loader\ResourceLoader.h" />
</span><span class="cx"> <ClInclude Include="..\loader\ResourceLoaderOptions.h" />
</span><span class="cx"> <ClInclude Include="..\loader\ResourceLoadNotifier.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -930,9 +930,6 @@
</span><span class="cx"> <ClCompile Include="..\loader\ProgressTracker.cpp">
</span><span class="cx"> <Filter>loader</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\loader\ResourceBuffer.cpp">
- <Filter>loader</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\loader\ResourceLoader.cpp">
</span><span class="cx"> <Filter>loader</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -7953,9 +7950,6 @@
</span><span class="cx"> <ClInclude Include="..\loader\ProgressTrackerClient.h">
</span><span class="cx"> <Filter>loader</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\loader\ResourceBuffer.h">
- <Filter>loader</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\loader\ResourceLoader.h">
</span><span class="cx"> <Filter>loader</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1870,9 +1870,6 @@
</span><span class="cx">                 51405C89190B014400754F94 /* SelectionRectGatherer.h in Headers */ = {isa = PBXBuildFile; fileRef = 51405C87190B014400754F94 /* SelectionRectGatherer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 514B3F730C722047000530DF /* FileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 514B3F720C722047000530DF /* FileSystem.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 514B3F760C722055000530DF /* FileSystemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514B3F750C722055000530DF /* FileSystemMac.mm */; };
</span><del>-                514BC83F161CF04A004D52F4 /* ResourceBuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514BC83D161CF043004D52F4 /* ResourceBuffer.mm */; };
-                514BC842161CF05C004D52F4 /* ResourceBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514BC840161CF05C004D52F4 /* ResourceBuffer.cpp */; };
-                514BC843161CF05C004D52F4 /* ResourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 514BC841161CF05C004D52F4 /* ResourceBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 514C76370CE9225E007EF3CD /* JSSQLError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76350CE9225E007EF3CD /* JSSQLError.cpp */; };
</span><span class="cx">                 514C76380CE9225E007EF3CD /* JSSQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76360CE9225E007EF3CD /* JSSQLTransaction.cpp */; };
</span><span class="cx">                 514C764C0CE9234E007EF3CD /* AuthenticationMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76420CE9234E007EF3CD /* AuthenticationMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -8984,9 +8981,6 @@
</span><span class="cx">                 51405C87190B014400754F94 /* SelectionRectGatherer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionRectGatherer.h; sourceTree = "<group>"; };
</span><span class="cx">                 514B3F720C722047000530DF /* FileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystem.h; sourceTree = "<group>"; };
</span><span class="cx">                 514B3F750C722055000530DF /* FileSystemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileSystemMac.mm; sourceTree = "<group>"; };
</span><del>-                514BC83D161CF043004D52F4 /* ResourceBuffer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceBuffer.mm; sourceTree = "<group>"; };
-                514BC840161CF05C004D52F4 /* ResourceBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceBuffer.cpp; sourceTree = "<group>"; };
-                514BC841161CF05C004D52F4 /* ResourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceBuffer.h; sourceTree = "<group>"; };
</del><span class="cx">                 514C76350CE9225E007EF3CD /* JSSQLError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLError.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 514C76360CE9225E007EF3CD /* JSSQLTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransaction.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 514C76420CE9234E007EF3CD /* AuthenticationMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationMac.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -17636,7 +17630,6 @@
</span><span class="cx">                                 1C2649790D7E248A00BD10F2 /* DocumentLoaderMac.cpp */,
</span><span class="cx">                                 656D371A0ADBA5DE00A4554D /* LoaderNSURLExtras.h */,
</span><span class="cx">                                 656D371B0ADBA5DE00A4554D /* LoaderNSURLExtras.mm */,
</span><del>-                                514BC83D161CF043004D52F4 /* ResourceBuffer.mm */,
</del><span class="cx">                                 51AA3F6E0BD5AA9E00892971 /* ResourceLoaderMac.mm */,
</span><span class="cx">                         );
</span><span class="cx">                         path = mac;
</span><span class="lines">@@ -21304,8 +21297,6 @@
</span><span class="cx">                                 1A2A68210B5BEDE70002A480 /* ProgressTracker.cpp */,
</span><span class="cx">                                 1A2A68220B5BEDE70002A480 /* ProgressTracker.h */,
</span><span class="cx">                                 1ACADD781880D91C00D8B71D /* ProgressTrackerClient.h */,
</span><del>-                                514BC840161CF05C004D52F4 /* ResourceBuffer.cpp */,
-                                514BC841161CF05C004D52F4 /* ResourceBuffer.h */,
</del><span class="cx">                                 93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */,
</span><span class="cx">                                 656D37270ADBA5DE00A4554D /* ResourceLoader.h */,
</span><span class="cx">                                 D0A3A7301405A39800FB8ED3 /* ResourceLoaderOptions.h */,
</span><span class="lines">@@ -25868,7 +25859,6 @@
</span><span class="cx">                                 99CC0B5C18BE984A006CEBCC /* ReplaySessionSegment.h in Headers */,
</span><span class="cx">                                 4998AEC613F9D0EA0090B1AA /* RequestAnimationFrameCallback.h in Headers */,
</span><span class="cx">                                 F55B3DD01251F12D003EF269 /* ResetInputType.h in Headers */,
</span><del>-                                514BC843161CF05C004D52F4 /* ResourceBuffer.h in Headers */,
</del><span class="cx">                                 7EE6846A12D26E3800E79415 /* ResourceError.h in Headers */,
</span><span class="cx">                                 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
</span><span class="cx">                                 514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
</span><span class="lines">@@ -29338,8 +29328,6 @@
</span><span class="cx">                                 99CC0B5918BE984A006CEBCC /* ReplaySession.cpp in Sources */,
</span><span class="cx">                                 99CC0B5B18BE984A006CEBCC /* ReplaySessionSegment.cpp in Sources */,
</span><span class="cx">                                 F55B3DCF1251F12D003EF269 /* ResetInputType.cpp in Sources */,
</span><del>-                                514BC842161CF05C004D52F4 /* ResourceBuffer.cpp in Sources */,
-                                514BC83F161CF04A004D52F4 /* ResourceBuffer.mm in Sources */,
</del><span class="cx">                                 934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */,
</span><span class="cx">                                 7EE6846B12D26E3800E79415 /* ResourceErrorCF.cpp in Sources */,
</span><span class="cx">                                 514C76500CE9234E007EF3CD /* ResourceErrorMac.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -62,7 +62,6 @@
</span><span class="cx"> #import "RenderObject.h"
</span><span class="cx"> #import "RenderStyleConstants.h"
</span><span class="cx"> #import "RenderText.h"
</span><del>-#import "ResourceBuffer.h"
</del><span class="cx"> #import "SharedBuffer.h"
</span><span class="cx"> #import "VisiblePosition.h"
</span><span class="cx"> #import "VisibleUnits.h"
</span><span class="lines">@@ -464,23 +463,15 @@
</span><span class="cx">
</span><span class="cx"> - (NSData *)dataRepresentation:(BOOL)rawImageData
</span><span class="cx"> {
</span><del>- WebCore::CachedImage *cachedImage = core(self)->cachedImage();
</del><ins>+ WebCore::CachedImage* cachedImage = core(self)->cachedImage();
</ins><span class="cx"> if (!cachedImage)
</span><span class="cx"> return nil;
</span><del>- WebCore::Image *image = cachedImage->image();
</del><ins>+ WebCore::Image* image = cachedImage->image();
</ins><span class="cx"> if (!image)
</span><span class="cx"> return nil;
</span><del>- WebCore::SharedBuffer *data = nil;
- if (rawImageData) {
- ResourceBuffer *resourceBuffer = cachedImage->resourceBuffer();
- if (resourceBuffer)
- data = resourceBuffer->sharedBuffer();
- } else {
- data = image->data();
- }
</del><ins>+ WebCore::SharedBuffer* data = rawImageData ? cachedImage->resourceBuffer() : image->data();
</ins><span class="cx"> if (!data)
</span><span class="cx"> return nil;
</span><del>-
</del><span class="cx"> return data->createNSData().autorelease();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingiosEditorIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ios/EditorIOS.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ios/EditorIOS.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/editing/ios/EditorIOS.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -49,7 +49,6 @@
</span><span class="cx"> #include "Pasteboard.h"
</span><span class="cx"> #include "RenderBlock.h"
</span><span class="cx"> #include "RenderImage.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include "SoftLinking.h"
</span><span class="cx"> #include "StyleProperties.h"
</span><span class="lines">@@ -385,7 +384,7 @@
</span><span class="cx"> pasteboardImage.url.url = imageElement.document().completeURL(stripLeadingAndTrailingHTMLSpaces(imageElement.imageSourceURL()));
</span><span class="cx"> pasteboardImage.url.title = title;
</span><span class="cx"> pasteboardImage.resourceMIMEType = pasteboard.resourceMIMEType(cachedImage->response().mimeType());
</span><del>- pasteboardImage.resourceData = cachedImage->resourceBuffer()->sharedBuffer();
</del><ins>+ pasteboardImage.resourceData = cachedImage->resourceBuffer();
</ins><span class="cx">
</span><span class="cx"> pasteboard.write(pasteboardImage);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmacEditorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/EditorMac.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -52,7 +52,6 @@
</span><span class="cx"> #import "Range.h"
</span><span class="cx"> #import "RenderBlock.h"
</span><span class="cx"> #import "RenderImage.h"
</span><del>-#import "ResourceBuffer.h"
</del><span class="cx"> #import "RuntimeApplicationChecks.h"
</span><span class="cx"> #import "Sound.h"
</span><span class="cx"> #import "StyleProperties.h"
</span><span class="lines">@@ -447,7 +446,7 @@
</span><span class="cx"> pasteboardImage.url.url = url;
</span><span class="cx"> pasteboardImage.url.title = title;
</span><span class="cx"> pasteboardImage.url.userVisibleForm = client()->userVisibleString(pasteboardImage.url.url);
</span><del>- pasteboardImage.resourceData = cachedImage->resourceBuffer()->sharedBuffer();
</del><ins>+ pasteboardImage.resourceData = cachedImage->resourceBuffer();
</ins><span class="cx"> pasteboardImage.resourceMIMEType = cachedImage->response().mimeType();
</span><span class="cx">
</span><span class="cx"> pasteboard.write(pasteboardImage);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageDocument.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageDocument.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/html/ImageDocument.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "RawDataDocumentParser.h"
</span><span class="cx"> #include "RenderElement.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "Settings.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -134,7 +133,8 @@
</span><span class="cx"> if (!m_imageElement)
</span><span class="cx"> createDocumentStructure();
</span><span class="cx">
</span><del>- m_imageElement->cachedImage()->addDataBuffer(loader()->mainResourceData().get());
</del><ins>+ if (RefPtr<SharedBuffer> buffer = loader()->mainResourceData())
+ m_imageElement->cachedImage()->addDataBuffer(*buffer);
</ins><span class="cx">
</span><span class="cx"> imageUpdated();
</span><span class="cx"> }
</span><span class="lines">@@ -143,11 +143,11 @@
</span><span class="cx"> {
</span><span class="cx"> if (!parser()->isStopped() && m_imageElement) {
</span><span class="cx"> CachedImage& cachedImage = *m_imageElement->cachedImage();
</span><del>- RefPtr<ResourceBuffer> data = loader()->mainResourceData();
</del><ins>+ RefPtr<SharedBuffer> data = loader()->mainResourceData();
</ins><span class="cx">
</span><span class="cx"> // If this is a multipart image, make a copy of the current part, since the resource data
</span><span class="cx"> // will be overwritten by the next part.
</span><del>- if (loader()->isLoadingMultipartContent())
</del><ins>+ if (data && loader()->isLoadingMultipartContent())
</ins><span class="cx"> data = data->copy();
</span><span class="cx">
</span><span class="cx"> cachedImage.finishLoading(data.get());
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -62,7 +62,6 @@
</span><span class="cx"> #include "MainFrame.h"
</span><span class="cx"> #include "MemoryCache.h"
</span><span class="cx"> #include "Page.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "ScriptController.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="lines">@@ -143,11 +142,9 @@
</span><span class="cx">
</span><span class="cx"> *base64Encoded = !hasTextContent(cachedResource);
</span><span class="cx"> if (*base64Encoded) {
</span><del>- RefPtr<SharedBuffer> buffer = hasZeroSize ? SharedBuffer::create() : cachedResource->resourceBuffer()->sharedBuffer();
-
</del><ins>+ RefPtr<SharedBuffer> buffer = hasZeroSize ? SharedBuffer::create() : cachedResource->resourceBuffer();
</ins><span class="cx"> if (!buffer)
</span><span class="cx"> return false;
</span><del>-
</del><span class="cx"> *result = base64Encode(buffer->data(), buffer->size());
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -166,7 +163,7 @@
</span><span class="cx"> *result = downcast<CachedScript>(*cachedResource).script();
</span><span class="cx"> return true;
</span><span class="cx"> case CachedResource::RawResource: {
</span><del>- ResourceBuffer* buffer = cachedResource->resourceBuffer();
</del><ins>+ auto* buffer = cachedResource->resourceBuffer();
</ins><span class="cx"> if (!buffer)
</span><span class="cx"> return false;
</span><span class="cx"> RefPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedResource->response().mimeType(), cachedResource->response().textEncodingName());
</span><span class="lines">@@ -177,7 +174,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> default:
</span><del>- ResourceBuffer* buffer = cachedResource->resourceBuffer();
</del><ins>+ auto* buffer = cachedResource->resourceBuffer();
</ins><span class="cx"> return decodeBuffer(buffer ? buffer->data() : nullptr, buffer ? buffer->size() : 0, cachedResource->encoding(), result);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -186,12 +183,10 @@
</span><span class="cx">
</span><span class="cx"> bool InspectorPageAgent::mainResourceContent(Frame* frame, bool withBase64Encode, String* result)
</span><span class="cx"> {
</span><del>- RefPtr<ResourceBuffer> buffer = frame->loader().documentLoader()->mainResourceData();
</del><ins>+ RefPtr<SharedBuffer> buffer = frame->loader().documentLoader()->mainResourceData();
</ins><span class="cx"> if (!buffer)
</span><span class="cx"> return false;
</span><del>- String textEncodingName = frame->document()->inputEncoding();
-
- return InspectorPageAgent::dataContent(buffer->data(), buffer->size(), textEncodingName, withBase64Encode, result);
</del><ins>+ return InspectorPageAgent::dataContent(buffer->data(), buffer->size(), frame->document()->inputEncoding(), withBase64Encode, result);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // static
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorResourceAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -54,7 +54,6 @@
</span><span class="cx"> #include "NetworkResourcesData.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "ProgressTracker.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "ResourceError.h"
</span><span class="cx"> #include "ResourceLoader.h"
</span><span class="cx"> #include "ResourceRequest.h"
</span><span class="lines">@@ -405,8 +404,9 @@
</span><span class="cx">
</span><span class="cx"> String requestId = IdentifiersFactory::requestId(identifier);
</span><span class="cx"> if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::DocumentResource) {
</span><del>- RefPtr<ResourceBuffer> buffer = loader->frameLoader()->documentLoader()->mainResourceData();
- m_resourcesData->addResourceSharedBuffer(requestId, buffer ? buffer->sharedBuffer() : nullptr, loader->frame()->document()->inputEncoding());
</del><ins>+ m_resourcesData->addResourceSharedBuffer(requestId,
+ loader->frameLoader()->documentLoader()->mainResourceData(),
+ loader->frame()->document()->inputEncoding());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_resourcesData->maybeDecodeDataToContent(requestId);
</span><span class="lines">@@ -435,8 +435,9 @@
</span><span class="cx"> if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::DocumentResource) {
</span><span class="cx"> Frame* frame = loader ? loader->frame() : nullptr;
</span><span class="cx"> if (frame && frame->loader().documentLoader() && frame->document()) {
</span><del>- RefPtr<ResourceBuffer> buffer = frame->loader().documentLoader()->mainResourceData();
- m_resourcesData->addResourceSharedBuffer(requestId, buffer ? buffer->sharedBuffer() : nullptr, frame->document()->inputEncoding());
</del><ins>+ m_resourcesData->addResourceSharedBuffer(requestId,
+ frame->loader().documentLoader()->mainResourceData(),
+ frame->document()->inputEncoding());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PolicyChecker.h"
</span><span class="cx"> #include "ProgressTracker.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "ResourceHandle.h"
</span><span class="cx"> #include "SchemeRegistry.h"
</span><span class="cx"> #include "SecurityPolicy.h"
</span><span class="lines">@@ -171,20 +170,20 @@
</span><span class="cx"> clearMainResource();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<ResourceBuffer> DocumentLoader::mainResourceData() const
</del><ins>+PassRefPtr<SharedBuffer> DocumentLoader::mainResourceData() const
</ins><span class="cx"> {
</span><span class="cx"> if (m_substituteData.isValid())
</span><del>- return ResourceBuffer::create(m_substituteData.content()->data(), m_substituteData.content()->size());
</del><ins>+ return m_substituteData.content()->copy();
</ins><span class="cx"> if (m_mainResource)
</span><span class="cx"> return m_mainResource->resourceBuffer();
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Document* DocumentLoader::document() const
</span><span class="cx"> {
</span><span class="cx"> if (m_frame && m_frame->loader().documentLoader() == this)
</span><span class="cx"> return m_frame->document();
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const ResourceRequest& DocumentLoader::originalRequest() const
</span><span class="lines">@@ -994,8 +993,7 @@
</span><span class="cx"> #else
</span><span class="cx">
</span><span class="cx"> // Give the archive machinery a crack at this document. If the MIME type is not an archive type, it will return 0.
</span><del>- RefPtr<ResourceBuffer> mainResourceBuffer = mainResourceData();
- m_archive = ArchiveFactory::create(m_response.url(), mainResourceBuffer ? mainResourceBuffer->sharedBuffer() : 0, m_response.mimeType());
</del><ins>+ m_archive = ArchiveFactory::create(m_response.url(), mainResourceData().get(), m_response.mimeType());
</ins><span class="cx"> if (!m_archive)
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="lines">@@ -1011,6 +1009,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><ins>+
</ins><span class="cx"> void DocumentLoader::setArchive(PassRefPtr<Archive> archive)
</span><span class="cx"> {
</span><span class="cx"> m_archive = archive;
</span><span class="lines">@@ -1058,47 +1057,46 @@
</span><span class="cx"> {
</span><span class="cx"> return m_parsedArchiveData.get();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif // ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><span class="cx">
</span><span class="cx"> ArchiveResource* DocumentLoader::archiveResourceForURL(const URL& url) const
</span><span class="cx"> {
</span><span class="cx"> if (!m_archiveResourceCollection)
</span><del>- return 0;
-
</del><ins>+ return nullptr;
</ins><span class="cx"> ArchiveResource* resource = m_archiveResourceCollection->archiveResourceForURL(url);
</span><del>-
- return resource && !resource->shouldIgnoreWhenUnarchiving() ? resource : 0;
</del><ins>+ if (!resource || resource->shouldIgnoreWhenUnarchiving())
+ return nullptr;
+ return resource;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<ArchiveResource> DocumentLoader::mainResource() const
</span><span class="cx"> {
</span><del>- const ResourceResponse& r = response();
-
- RefPtr<ResourceBuffer> mainResourceBuffer = mainResourceData();
- RefPtr<SharedBuffer> data = mainResourceBuffer ? mainResourceBuffer->sharedBuffer() : 0;
</del><ins>+ RefPtr<SharedBuffer> data = mainResourceData();
</ins><span class="cx"> if (!data)
</span><span class="cx"> data = SharedBuffer::create();
</span><span class="cx">
</span><del>- return ArchiveResource::create(data, r.url(), r.mimeType(), r.textEncodingName(), frame()->tree().uniqueName());
</del><ins>+ auto& response = this->response();
+ return ArchiveResource::create(data, response.url(), response.mimeType(), response.textEncodingName(), frame()->tree().uniqueName());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<ArchiveResource> DocumentLoader::subresource(const URL& url) const
</span><span class="cx"> {
</span><span class="cx"> if (!isCommitted())
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> CachedResource* resource = m_cachedResourceLoader->cachedResource(url);
</span><span class="cx"> if (!resource || !resource->isLoaded())
</span><span class="cx"> return archiveResourceForURL(url);
</span><span class="cx">
</span><span class="cx"> if (resource->type() == CachedResource::MainResource)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><del>- ResourceBuffer* data = resource->resourceBuffer();
</del><ins>+ auto* data = resource->resourceBuffer();
</ins><span class="cx"> if (!data)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><del>- return ArchiveResource::create(data->sharedBuffer(), url, resource->response());
</del><ins>+ return ArchiveResource::create(data, url, resource->response());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Vector<RefPtr<ArchiveResource>> DocumentLoader::subresources() const
</span><span class="lines">@@ -1511,7 +1509,7 @@
</span><span class="cx">
</span><span class="cx"> frameLoader()->setupForReplace();
</span><span class="cx"> m_committed = false;
</span><del>- RefPtr<ResourceBuffer> resourceData = mainResourceData();
</del><ins>+ RefPtr<SharedBuffer> resourceData = mainResourceData();
</ins><span class="cx"> commitLoad(resourceData->data(), resourceData->size());
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/DocumentLoader.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -68,7 +68,6 @@
</span><span class="cx"> class Frame;
</span><span class="cx"> class FrameLoader;
</span><span class="cx"> class Page;
</span><del>- class ResourceBuffer;
</del><span class="cx"> class ResourceLoader;
</span><span class="cx"> class SharedBuffer;
</span><span class="cx"> class SubstituteResource;
</span><span class="lines">@@ -93,7 +92,7 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT FrameLoader* frameLoader() const;
</span><span class="cx"> WEBCORE_EXPORT ResourceLoader* mainResourceLoader() const;
</span><del>- WEBCORE_EXPORT PassRefPtr<ResourceBuffer> mainResourceData() const;
</del><ins>+ WEBCORE_EXPORT PassRefPtr<SharedBuffer> mainResourceData() const;
</ins><span class="cx">
</span><span class="cx"> DocumentWriter& writer() const { return m_writer; }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderMediaResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/MediaResourceLoader.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/MediaResourceLoader.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/MediaResourceLoader.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -27,12 +27,12 @@
</span><span class="cx"> #include "MediaResourceLoader.h"
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><ins>+
</ins><span class="cx"> #include "CachedRawResource.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="cx"> #include "CachedResourceRequest.h"
</span><span class="cx"> #include "CrossOriginAccessControl.h"
</span><span class="cx"> #include "Document.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx">
</span><span class="lines">@@ -112,13 +112,10 @@
</span><span class="cx">
</span><span class="cx"> void MediaResourceLoader::dataReceived(CachedResource* resource, const char* data, int dataLength)
</span><span class="cx"> {
</span><del>- ASSERT(resource == m_resource);
</del><ins>+ ASSERT_UNUSED(resource, resource == m_resource);
</ins><span class="cx">
</span><span class="cx"> RefPtr<MediaResourceLoader> protect(this);
</span><span class="cx"> m_client->dataReceived(data, dataLength);
</span><del>-
- if (SharedBuffer* buffer = resource->resourceBuffer() ? resource->resourceBuffer()->sharedBuffer() : nullptr)
- m_client->bufferReceived(buffer);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaResourceLoader::notifyFinished(CachedResource* resource)
</span><span class="lines">@@ -129,7 +126,7 @@
</span><span class="cx"> if (resource->loadFailedOrCanceled())
</span><span class="cx"> m_client->loadFailed(resource->resourceError());
</span><span class="cx"> else
</span><del>- m_client->loadFinished(resource->resourceBuffer() ? resource->resourceBuffer()->sharedBuffer() : nullptr);
</del><ins>+ m_client->loadFinished();
</ins><span class="cx"> stop();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceBuffercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/ResourceBuffer.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceBuffer.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/ResourceBuffer.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1,122 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ResourceBuffer.h"
-
-#include "SharedBuffer.h"
-
-namespace WebCore {
-
-ResourceBuffer::ResourceBuffer()
- : m_sharedBuffer(SharedBuffer::create())
-{
-}
-
-ResourceBuffer::ResourceBuffer(const char* data, unsigned size)
- : m_sharedBuffer(SharedBuffer::create(data, size))
-{
-}
-
-ResourceBuffer::ResourceBuffer(PassRefPtr<SharedBuffer> sharedBuffer)
- : m_sharedBuffer(sharedBuffer)
-{
- ASSERT(m_sharedBuffer);
-}
-
-ResourceBuffer::~ResourceBuffer()
-{
-}
-
-PassRefPtr<ResourceBuffer> ResourceBuffer::adoptSharedBuffer(PassRefPtr<SharedBuffer> shared)
-{
- return shared ? adoptRef(new ResourceBuffer(shared)) : nullptr;
-}
-
-const char* ResourceBuffer::data() const
-{
- return m_sharedBuffer->data();
-}
-
-unsigned ResourceBuffer::size() const
-{
- return m_sharedBuffer->size();
-}
-
-bool ResourceBuffer::isEmpty() const
-{
- return m_sharedBuffer->isEmpty();
-}
-
-void ResourceBuffer::append(const char* data, unsigned size)
-{
- m_sharedBuffer->append(data, size);
-}
-
-void ResourceBuffer::append(SharedBuffer* buffer)
-{
- m_sharedBuffer->append(buffer);
-}
-
-#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
-void ResourceBuffer::append(CFDataRef data)
-{
- ASSERT(m_sharedBuffer);
- m_sharedBuffer->append(data);
-}
-#endif
-
-void ResourceBuffer::clear()
-{
- m_sharedBuffer->clear();
-}
-
-unsigned ResourceBuffer::getSomeData(const char*& data, unsigned position) const
-{
- return m_sharedBuffer->getSomeData(data, position);
-}
-
-SharedBuffer* ResourceBuffer::sharedBuffer() const
-{
- // Currently all ResourceBuffers are backed by SharedBuffers.
- // In the future we might have to create the SharedBuffer on demand here.
- // We should also phase out as much use of this accessor as possible and have clients
- // either use the ResourceBuffer directly or use getSomeData() when sensical.
- return m_sharedBuffer.get();
-}
-
-PassRefPtr<ResourceBuffer> ResourceBuffer::copy() const
-{
- return ResourceBuffer::adoptSharedBuffer(m_sharedBuffer->copy());
-}
-
-#if USE(CF)
-RetainPtr<CFDataRef> ResourceBuffer::createCFData()
-{
- return m_sharedBuffer->createCFData();
-}
-#endif
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceBufferh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/ResourceBuffer.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceBuffer.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/ResourceBuffer.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1,89 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ResourceBuffer_h
-#define ResourceBuffer_h
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/RetainPtr.h>
-
-#if USE(FOUNDATION)
-OBJC_CLASS NSData;
-#endif
-
-namespace WebCore {
-
-class SharedBuffer;
-
-class ResourceBuffer : public RefCounted<ResourceBuffer> {
-public:
-
- static PassRefPtr<ResourceBuffer> create() { return adoptRef(new ResourceBuffer); }
- static PassRefPtr<ResourceBuffer> create(const char* data, unsigned size) { return adoptRef(new ResourceBuffer(data, size)); }
- static PassRefPtr<ResourceBuffer> adoptSharedBuffer(PassRefPtr<SharedBuffer>);
-
- WEBCORE_EXPORT virtual ~ResourceBuffer();
-
- WEBCORE_EXPORT virtual const char* data() const;
- WEBCORE_EXPORT virtual unsigned size() const;
- WEBCORE_EXPORT virtual bool isEmpty() const;
-
- WEBCORE_EXPORT void append(const char*, unsigned);
- void append(SharedBuffer*);
-#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
- void append(CFDataRef);
-#endif
- void clear();
-
- unsigned getSomeData(const char*& data, unsigned position = 0) const;
-
- WEBCORE_EXPORT SharedBuffer* sharedBuffer() const;
-#if USE(FOUNDATION)
- void tryReplaceSharedBufferContents(SharedBuffer*);
-#endif
- PassRefPtr<ResourceBuffer> copy() const;
-
-#if USE(FOUNDATION)
- WEBCORE_EXPORT RetainPtr<NSData> createNSData();
-#endif
-#if USE(CF)
- RetainPtr<CFDataRef> createCFData();
-#endif
-
-protected:
- WEBCORE_EXPORT ResourceBuffer();
-
-private:
- WEBCORE_EXPORT ResourceBuffer(const char*, unsigned);
- ResourceBuffer(PassRefPtr<SharedBuffer>);
-
- RefPtr<SharedBuffer> m_sharedBuffer;
-};
-
-} // namespace WebCore
-
-#endif // ResourceBuffer_h
</del></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PlatformStrategies.h"
</span><span class="cx"> #include "ProgressTracker.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "ResourceError.h"
</span><span class="cx"> #include "ResourceHandle.h"
</span><span class="cx"> #include "ResourceLoadScheduler.h"
</span><span class="lines">@@ -222,12 +221,12 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (dataPayloadType == DataPayloadWholeResource) {
</span><del>- m_resourceData = buffer ? ResourceBuffer::adoptSharedBuffer(buffer) : ResourceBuffer::create(data, length);
</del><ins>+ m_resourceData = buffer ? buffer : SharedBuffer::create(data, length);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_resourceData)
</span><del>- m_resourceData = buffer ? ResourceBuffer::adoptSharedBuffer(buffer) : ResourceBuffer::create(data, length);
</del><ins>+ m_resourceData = buffer ? buffer : SharedBuffer::create(data, length);
</ins><span class="cx"> else {
</span><span class="cx"> if (buffer)
</span><span class="cx"> m_resourceData->append(buffer);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/ResourceLoader.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> class Frame;
</span><span class="cx"> class FrameLoader;
</span><span class="cx"> class URL;
</span><del>-class ResourceBuffer;
</del><span class="cx">
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> class QuickLookHandle;
</span><span class="lines">@@ -88,7 +87,7 @@
</span><span class="cx"> virtual void releaseResources();
</span><span class="cx"> const ResourceResponse& response() const;
</span><span class="cx">
</span><del>- ResourceBuffer* resourceData() const { return m_resourceData.get(); }
</del><ins>+ SharedBuffer* resourceData() const { return m_resourceData.get(); }
</ins><span class="cx"> void clearResourceData();
</span><span class="cx">
</span><span class="cx"> virtual bool isSubresourceLoader();
</span><span class="lines">@@ -204,7 +203,7 @@
</span><span class="cx">
</span><span class="cx"> ResourceRequest m_request;
</span><span class="cx"> ResourceRequest m_originalRequest; // Before redirects.
</span><del>- RefPtr<ResourceBuffer> m_resourceData;
</del><ins>+ RefPtr<SharedBuffer> m_resourceData;
</ins><span class="cx">
</span><span class="cx"> unsigned long m_identifier;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubresourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubresourceLoader.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include "MemoryCache.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PageActivityAssertionToken.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include <wtf/Ref.h>
</span><span class="cx"> #include <wtf/RefCountedLeakCounter.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="lines">@@ -233,11 +232,10 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<ResourceBuffer> buffer = resourceData();
</del><ins>+ auto* buffer = resourceData();
</ins><span class="cx"> if (m_loadingMultipartContent && buffer && buffer->size()) {
</span><span class="cx"> // The resource data will change as the next part is loaded, so we need to make a copy.
</span><del>- RefPtr<ResourceBuffer> copiedData = ResourceBuffer::create(buffer->data(), buffer->size());
- m_resource->finishLoading(copiedData.get());
</del><ins>+ m_resource->finishLoading(buffer->copy().get());
</ins><span class="cx"> clearResourceData();
</span><span class="cx"> // Since a subresource loader does not load multipart sections progressively, data was delivered to the loader all at once.
</span><span class="cx"> // After the first multipart section is complete, signal to delegates that this load is "finished"
</span><span class="lines">@@ -273,8 +271,8 @@
</span><span class="cx"> ResourceLoader::didReceiveDataOrBuffer(data, length, buffer, encodedDataLength, dataPayloadType);
</span><span class="cx">
</span><span class="cx"> if (!m_loadingMultipartContent) {
</span><del>- if (ResourceBuffer* resourceData = this->resourceData())
- m_resource->addDataBuffer(resourceData);
</del><ins>+ if (auto* resourceData = this->resourceData())
+ m_resource->addDataBuffer(*resourceData);
</ins><span class="cx"> else
</span><span class="cx"> m_resource->addData(buffer ? buffer->data() : data, buffer ? buffer->size() : length);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderTextTrackLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/TextTrackLoader.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/TextTrackLoader.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/TextTrackLoader.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx"> #include "CrossOriginAccessControl.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "Logging.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "SecurityOrigin.h"
</span><ins>+#include "SharedBuffer.h"
</ins><span class="cx"> #include "VTTCue.h"
</span><span class="cx"> #include "WebVTTParser.h"
</span><span class="cx">
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> if (m_state == Failed || !resource->resourceBuffer())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- ResourceBuffer* buffer = resource->resourceBuffer();
</del><ins>+ auto* buffer = resource->resourceBuffer();
</ins><span class="cx"> if (m_parseOffset == buffer->size())
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderappcacheApplicationCacheGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> #include "InspectorInstrumentation.h"
</span><span class="cx"> #include "ManifestParser.h"
</span><span class="cx"> #include "Page.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "ResourceHandle.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="lines">@@ -254,11 +253,8 @@
</span><span class="cx"> resource->addType(ApplicationCacheResource::Master);
</span><span class="cx"> ASSERT(!resource->storageID());
</span><span class="cx"> }
</span><del>- } else {
- RefPtr<ResourceBuffer> buffer = loader->mainResourceData();
- m_newestCache->addResource(ApplicationCacheResource::create(url, loader->response(), ApplicationCacheResource::Master, buffer ? buffer->sharedBuffer() : 0));
- }
-
</del><ins>+ } else
+ m_newestCache->addResource(ApplicationCacheResource::create(url, loader->response(), ApplicationCacheResource::Master, loader->mainResourceData()));
</ins><span class="cx"> break;
</span><span class="cx"> case Failure:
</span><span class="cx"> // Cache update has been a failure, so there is no reason to keep the document associated with the incomplete cache
</span><span class="lines">@@ -276,10 +272,8 @@
</span><span class="cx"> resource->addType(ApplicationCacheResource::Master);
</span><span class="cx"> ASSERT(!resource->storageID());
</span><span class="cx"> }
</span><del>- } else {
- RefPtr<ResourceBuffer> buffer = loader->mainResourceData();
- m_cacheBeingUpdated->addResource(ApplicationCacheResource::create(url, loader->response(), ApplicationCacheResource::Master, buffer ? buffer->sharedBuffer() : 0));
- }
</del><ins>+ } else
+ m_cacheBeingUpdated->addResource(ApplicationCacheResource::create(url, loader->response(), ApplicationCacheResource::Master, loader->mainResourceData()));
</ins><span class="cx"> // The "cached" event will be posted to all associated documents once update is complete.
</span><span class="cx"> break;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderarchivecfLegacyWebArchivecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> #include "MemoryCache.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "Range.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "markup.h"
</span><span class="cx"> #include <wtf/ListHashSet.h>
</span><span class="lines">@@ -550,9 +549,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> CachedResource* cachedResource = memoryCache()->resourceForRequest(request, frame->page()->sessionID());
</span><span class="cx"> if (cachedResource) {
</span><del>- ResourceBuffer* data = cachedResource->resourceBuffer();
-
- if (RefPtr<ArchiveResource> resource = ArchiveResource::create(data ? data->sharedBuffer() : 0, subresourceURL, cachedResource->response())) {
</del><ins>+ if (RefPtr<ArchiveResource> resource = ArchiveResource::create(cachedResource->resourceBuffer(), subresourceURL, cachedResource->response())) {
</ins><span class="cx"> subresources.append(WTF::move(resource));
</span><span class="cx"> continue;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> #include "HTTPHeaderNames.h"
</span><span class="cx"> #include "HTTPParsers.h"
</span><span class="cx"> #include "MemoryCache.h"
</span><del>-#include "ResourceBuffer.h"
</del><ins>+#include "SharedBuffer.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include <wtf/CurrentTime.h>
</span><span class="lines">@@ -90,13 +90,13 @@
</span><span class="cx"> return m_decoder->decodeAndFlush(m_data->data(), m_data->size());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedCSSStyleSheet::finishLoading(ResourceBuffer* data)
</del><ins>+void CachedCSSStyleSheet::finishLoading(SharedBuffer* data)
</ins><span class="cx"> {
</span><span class="cx"> m_data = data;
</span><del>- setEncodedSize(m_data.get() ? m_data->size() : 0);
</del><ins>+ setEncodedSize(data ? data->size() : 0);
</ins><span class="cx"> // Decode the data to find out the encoding and keep the sheet text around during checkNotify()
</span><del>- if (m_data)
- m_decodedSheetText = m_decoder->decodeAndFlush(m_data->data(), m_data->size());
</del><ins>+ if (data)
+ m_decodedSheetText = m_decoder->decodeAndFlush(data->data(), data->size());
</ins><span class="cx"> setLoading(false);
</span><span class="cx"> checkNotify();
</span><span class="cx"> // Clear the decoded text as it is unlikely to be needed immediately again and is cheap to regenerate.
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedCSSStyleSheeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">
</span><span class="cx"> virtual void setEncoding(const String&) override;
</span><span class="cx"> virtual String encoding() const override;
</span><del>- virtual void finishLoading(ResourceBuffer*) override;
</del><ins>+ virtual void finishLoading(SharedBuffer*) override;
</ins><span class="cx"> virtual void destroyDecodedData() override;
</span><span class="cx">
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedFontcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedFont.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedFont.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include "FontCustomPlatformData.h"
</span><span class="cx"> #include "FontPlatformData.h"
</span><span class="cx"> #include "MemoryCache.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include "TypedElementDescendantIterator.h"
</span><span class="lines">@@ -76,7 +75,7 @@
</span><span class="cx"> static_cast<CachedFontClient*>(c)->fontLoaded(this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedFont::finishLoading(ResourceBuffer* data)
</del><ins>+void CachedFont::finishLoading(SharedBuffer* data)
</ins><span class="cx"> {
</span><span class="cx"> m_data = data;
</span><span class="cx"> setEncodedSize(m_data.get() ? m_data->size() : 0);
</span><span class="lines">@@ -95,30 +94,27 @@
</span><span class="cx"> bool CachedFont::ensureCustomFontData()
</span><span class="cx"> {
</span><span class="cx"> if (!m_fontData && !errorOccurred() && !isLoading() && m_data) {
</span><del>- SharedBuffer* buffer = m_data.get()->sharedBuffer();
- ASSERT(buffer);
-
</del><ins>+ RefPtr<SharedBuffer> buffer = m_data;
</ins><span class="cx"> bool fontIsWOFF = false;
</span><del>-#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED <= 1090) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED < 80000)
- RefPtr<SharedBuffer> sfntBuffer;
</del><span class="cx">
</span><del>- fontIsWOFF = isWOFF(buffer);
- if (fontIsWOFF) {
- Vector<char> sfnt;
- if (convertWOFFToSfnt(buffer, sfnt)) {
- sfntBuffer = SharedBuffer::adoptVector(sfnt);
- buffer = sfntBuffer.get();
- } else
</del><ins>+#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED <= 1090) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED < 80000)
+ if (isWOFF(buffer.get())) {
+ Vector<char> convertedFont;
+ if (!convertWOFFToSfnt(buffer.get(), convertedFont))
</ins><span class="cx"> buffer = nullptr;
</span><ins>+ else {
+ buffer = SharedBuffer::adoptVector(convertedFont);
+ fontIsWOFF = true;
+ }
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> m_fontData = buffer ? createFontCustomPlatformData(*buffer) : nullptr;
</span><del>- if (m_fontData)
- m_hasCreatedFontDataWrappingResource = !fontIsWOFF;
- else
</del><ins>+ m_hasCreatedFontDataWrappingResource = m_fontData && !fontIsWOFF;
+ if (!m_fontData)
</ins><span class="cx"> setStatus(DecodeError);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> return m_fontData.get();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedFonth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedFont.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedFont.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> virtual void load(CachedResourceLoader*, const ResourceLoaderOptions&) override;
</span><span class="cx">
</span><span class="cx"> virtual void didAddClient(CachedResourceClient*) override;
</span><del>- virtual void finishLoading(ResourceBuffer*) override;
</del><ins>+ virtual void finishLoading(SharedBuffer*) override;
</ins><span class="cx">
</span><span class="cx"> virtual void allClientsRemoved() override;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include "MemoryCache.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "RenderElement.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "SVGImage.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="lines">@@ -116,31 +115,31 @@
</span><span class="cx"> setLoading(false);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedImage::didAddClient(CachedResourceClient* c)
</del><ins>+void CachedImage::didAddClient(CachedResourceClient* client)
</ins><span class="cx"> {
</span><span class="cx"> if (m_data && !m_image && !errorOccurred()) {
</span><span class="cx"> createImage();
</span><del>- m_image->setData(m_data->sharedBuffer(), true);
</del><ins>+ m_image->setData(m_data, true);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- ASSERT(c->resourceClientType() == CachedImageClient::expectedType());
</del><ins>+ ASSERT(client->resourceClientType() == CachedImageClient::expectedType());
</ins><span class="cx"> if (m_image && !m_image->isNull())
</span><del>- static_cast<CachedImageClient*>(c)->imageChanged(this);
</del><ins>+ static_cast<CachedImageClient*>(client)->imageChanged(this);
</ins><span class="cx">
</span><del>- CachedResource::didAddClient(c);
</del><ins>+ CachedResource::didAddClient(client);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedImage::didRemoveClient(CachedResourceClient* c)
</del><ins>+void CachedImage::didRemoveClient(CachedResourceClient* client)
</ins><span class="cx"> {
</span><del>- ASSERT(c);
- ASSERT(c->resourceClientType() == CachedImageClient::expectedType());
</del><ins>+ ASSERT(client);
+ ASSERT(client->resourceClientType() == CachedImageClient::expectedType());
</ins><span class="cx">
</span><del>- m_pendingContainerSizeRequests.remove(static_cast<CachedImageClient*>(c));
</del><ins>+ m_pendingContainerSizeRequests.remove(static_cast<CachedImageClient*>(client));
</ins><span class="cx">
</span><span class="cx"> if (m_svgImageCache)
</span><del>- m_svgImageCache->removeClientFromCache(static_cast<CachedImageClient*>(c));
</del><ins>+ m_svgImageCache->removeClientFromCache(static_cast<CachedImageClient*>(client));
</ins><span class="cx">
</span><del>- CachedResource::didRemoveClient(c);
</del><ins>+ CachedResource::didRemoveClient(client);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CachedImage::switchClientsToRevalidatedResource()
</span><span class="lines">@@ -365,18 +364,16 @@
</span><span class="cx"> m_image.clear();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedImage::addIncrementalDataBuffer(ResourceBuffer* data)
</del><ins>+void CachedImage::addIncrementalDataBuffer(SharedBuffer& data)
</ins><span class="cx"> {
</span><del>- m_data = data;
- if (!data)
- return;
</del><ins>+ m_data = &data;
</ins><span class="cx">
</span><span class="cx"> createImage();
</span><span class="cx">
</span><span class="cx"> // Have the image update its data from its internal buffer.
</span><span class="cx"> // It will not do anything now, but will delay decoding until
</span><span class="cx"> // queried for info (like size or specific image frames).
</span><del>- bool sizeAvailable = m_image->setData(m_data->sharedBuffer(), false);
</del><ins>+ bool sizeAvailable = m_image->setData(&data, false);
</ins><span class="cx"> if (!sizeAvailable)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -398,26 +395,28 @@
</span><span class="cx"> setEncodedSize(m_image->data() ? m_image->data()->size() : 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedImage::addDataBuffer(ResourceBuffer* data)
</del><ins>+void CachedImage::addDataBuffer(SharedBuffer& data)
</ins><span class="cx"> {
</span><del>- ASSERT(m_options.dataBufferingPolicy() == BufferData);
</del><ins>+ ASSERT(dataBufferingPolicy() == BufferData);
</ins><span class="cx"> addIncrementalDataBuffer(data);
</span><ins>+ CachedResource::addDataBuffer(data);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CachedImage::addData(const char* data, unsigned length)
</span><span class="cx"> {
</span><del>- ASSERT(m_options.dataBufferingPolicy() == DoNotBufferData);
- addIncrementalDataBuffer(ResourceBuffer::create(data, length).get());
</del><ins>+ ASSERT(dataBufferingPolicy() == DoNotBufferData);
+ addIncrementalDataBuffer(*SharedBuffer::create(data, length));
+ CachedResource::addData(data, length);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedImage::finishLoading(ResourceBuffer* data)
</del><ins>+void CachedImage::finishLoading(SharedBuffer* data)
</ins><span class="cx"> {
</span><span class="cx"> m_data = data;
</span><span class="cx"> if (!m_image && data)
</span><span class="cx"> createImage();
</span><span class="cx">
</span><span class="cx"> if (m_image)
</span><del>- m_image->setData(m_data->sharedBuffer(), true);
</del><ins>+ m_image->setData(data, true);
</ins><span class="cx">
</span><span class="cx"> if (!m_image || m_image->isNull()) {
</span><span class="cx"> // Image decoding failed; the image data is malformed.
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedImage.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedImage.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -71,8 +71,8 @@
</span><span class="cx"> bool imageHasRelativeWidth() const;
</span><span class="cx"> bool imageHasRelativeHeight() const;
</span><span class="cx">
</span><del>- virtual void addDataBuffer(ResourceBuffer*) override;
- virtual void finishLoading(ResourceBuffer*) override;
</del><ins>+ virtual void addDataBuffer(SharedBuffer&) override;
+ virtual void finishLoading(SharedBuffer*) override;
</ins><span class="cx">
</span><span class="cx"> enum SizeType {
</span><span class="cx"> UsedSize,
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx"> void createImage();
</span><span class="cx"> void clearImage();
</span><span class="cx"> // If not null, changeRect is the changed part of the image.
</span><del>- void notifyObservers(const IntRect* changeRect = 0);
</del><ins>+ void notifyObservers(const IntRect* changeRect = nullptr);
</ins><span class="cx"> void checkShouldPaintBrokenImage();
</span><span class="cx">
</span><span class="cx"> virtual void switchClientsToRevalidatedResource() override;
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx"> virtual void animationAdvanced(const Image*) override;
</span><span class="cx"> virtual void changedInRect(const Image*, const IntRect&) override;
</span><span class="cx">
</span><del>- void addIncrementalDataBuffer(ResourceBuffer*);
</del><ins>+ void addIncrementalDataBuffer(SharedBuffer&);
</ins><span class="cx">
</span><span class="cx"> typedef std::pair<LayoutSize, float> SizeAndZoom;
</span><span class="cx"> typedef HashMap<const CachedImageClient*, SizeAndZoom> ContainerSizeRequests;
</span><span class="lines">@@ -130,8 +130,8 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<Image> m_image;
</span><span class="cx"> std::unique_ptr<SVGImageCache> m_svgImageCache;
</span><del>- unsigned char m_isManuallyCached : 1;
- unsigned char m_shouldPaintBrokenImage : 1;
</del><ins>+ unsigned m_isManuallyCached : 1;
+ unsigned m_shouldPaintBrokenImage : 1;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedRawResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedRawResource.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include "CachedResourceClientWalker.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="cx"> #include "HTTPHeaderNames.h"
</span><del>-#include "ResourceBuffer.h"
</del><ins>+#include "SharedBuffer.h"
</ins><span class="cx"> #include "SubresourceLoader.h"
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/text/StringView.h>
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> ASSERT(isMainOrRawResource());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const char* CachedRawResource::calculateIncrementalDataChunk(ResourceBuffer* data, unsigned& incrementalDataLength)
</del><ins>+const char* CachedRawResource::calculateIncrementalDataChunk(SharedBuffer* data, unsigned& incrementalDataLength)
</ins><span class="cx"> {
</span><span class="cx"> incrementalDataLength = 0;
</span><span class="cx"> if (!data)
</span><span class="lines">@@ -58,34 +58,37 @@
</span><span class="cx"> return data->data() + previousDataLength;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedRawResource::addDataBuffer(ResourceBuffer* data)
</del><ins>+void CachedRawResource::addDataBuffer(SharedBuffer& data)
</ins><span class="cx"> {
</span><span class="cx"> CachedResourceHandle<CachedRawResource> protect(this);
</span><del>- ASSERT(m_options.dataBufferingPolicy() == BufferData);
- m_data = data;
</del><ins>+ ASSERT(dataBufferingPolicy() == BufferData);
+ m_data = &data;
</ins><span class="cx">
</span><span class="cx"> unsigned incrementalDataLength;
</span><del>- const char* incrementalData = calculateIncrementalDataChunk(data, incrementalDataLength);
- if (data)
- setEncodedSize(data->size());
</del><ins>+ const char* incrementalData = calculateIncrementalDataChunk(&data, incrementalDataLength);
+ setEncodedSize(data.size());
</ins><span class="cx"> notifyClientsDataWasReceived(incrementalData, incrementalDataLength);
</span><del>- if (m_options.dataBufferingPolicy() == DoNotBufferData) {
</del><ins>+ if (dataBufferingPolicy() == DoNotBufferData) {
</ins><span class="cx"> if (m_loader)
</span><span class="cx"> m_loader->setDataBufferingPolicy(DoNotBufferData);
</span><span class="cx"> clear();
</span><ins>+ return;
</ins><span class="cx"> }
</span><ins>+
+ CachedResource::addDataBuffer(data);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CachedRawResource::addData(const char* data, unsigned length)
</span><span class="cx"> {
</span><del>- ASSERT(m_options.dataBufferingPolicy() == DoNotBufferData);
</del><ins>+ ASSERT(dataBufferingPolicy() == DoNotBufferData);
</ins><span class="cx"> notifyClientsDataWasReceived(data, length);
</span><ins>+ CachedResource::addData(data, length);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedRawResource::finishLoading(ResourceBuffer* data)
</del><ins>+void CachedRawResource::finishLoading(SharedBuffer* data)
</ins><span class="cx"> {
</span><span class="cx"> CachedResourceHandle<CachedRawResource> protect(this);
</span><del>- DataBufferingPolicy dataBufferingPolicy = m_options.dataBufferingPolicy();
</del><ins>+ DataBufferingPolicy dataBufferingPolicy = this->dataBufferingPolicy();
</ins><span class="cx"> if (dataBufferingPolicy == BufferData) {
</span><span class="cx"> m_data = data;
</span><span class="cx">
</span><span class="lines">@@ -99,7 +102,7 @@
</span><span class="cx"> m_allowEncodedDataReplacement = !m_loader->isQuickLookResource();
</span><span class="cx">
</span><span class="cx"> CachedResource::finishLoading(data);
</span><del>- if (dataBufferingPolicy == BufferData && m_options.dataBufferingPolicy() == DoNotBufferData) {
</del><ins>+ if (dataBufferingPolicy == BufferData && this->dataBufferingPolicy() == DoNotBufferData) {
</ins><span class="cx"> if (m_loader)
</span><span class="cx"> m_loader->setDataBufferingPolicy(DoNotBufferData);
</span><span class="cx"> clear();
</span><span class="lines">@@ -222,7 +225,7 @@
</span><span class="cx">
</span><span class="cx"> bool CachedRawResource::canReuse(const ResourceRequest& newRequest) const
</span><span class="cx"> {
</span><del>- if (m_options.dataBufferingPolicy() == DoNotBufferData)
</del><ins>+ if (dataBufferingPolicy() == DoNotBufferData)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (m_resourceRequest.httpMethod() != newRequest.httpMethod())
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedRawResourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedRawResource.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -48,9 +48,9 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual void didAddClient(CachedResourceClient*) override;
</span><del>- virtual void addDataBuffer(ResourceBuffer*) override;
</del><ins>+ virtual void addDataBuffer(SharedBuffer&) override;
</ins><span class="cx"> virtual void addData(const char* data, unsigned length) override;
</span><del>- virtual void finishLoading(ResourceBuffer*) override;
</del><ins>+ virtual void finishLoading(SharedBuffer*) override;
</ins><span class="cx">
</span><span class="cx"> virtual bool shouldIgnoreHTTPStatusCodeErrors() const override { return true; }
</span><span class="cx"> virtual void allClientsRemoved() override;
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">
</span><span class="cx"> virtual bool canReuse(const ResourceRequest&) const override;
</span><span class="cx">
</span><del>- const char* calculateIncrementalDataChunk(ResourceBuffer*, unsigned& incrementalDataLength);
</del><ins>+ const char* calculateIncrementalDataChunk(SharedBuffer*, unsigned& incrementalDataLength);
</ins><span class="cx"> void notifyClientsDataWasReceived(const char* data, unsigned length);
</span><span class="cx">
</span><span class="cx"> #if USE(SOUP)
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MemoryCache.h"
</span><span class="cx"> #include "PlatformStrategies.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "ResourceHandle.h"
</span><span class="cx"> #include "ResourceLoadScheduler.h"
</span><span class="cx"> #include "SchemeRegistry.h"
</span><span class="lines">@@ -108,10 +107,10 @@
</span><span class="cx">
</span><span class="cx"> CachedResource::CachedResource(const ResourceRequest& request, Type type, SessionID sessionID)
</span><span class="cx"> : m_resourceRequest(request)
</span><ins>+ , m_decodedDataDeletionTimer(this, &CachedResource::decodedDataDeletionTimerFired, deadDecodedDataDeletionIntervalForResourceType(type))
</ins><span class="cx"> , m_sessionID(sessionID)
</span><span class="cx"> , m_loadPriority(defaultPriorityForResourceType(type))
</span><span class="cx"> , m_responseTimestamp(currentTime())
</span><del>- , m_decodedDataDeletionTimer(this, &CachedResource::decodedDataDeletionTimerFired, deadDecodedDataDeletionIntervalForResourceType(type))
</del><span class="cx"> , m_lastDecodedAccessTime(0)
</span><span class="cx"> , m_loadFinishTime(0)
</span><span class="cx"> , m_encodedSize(0)
</span><span class="lines">@@ -286,22 +285,22 @@
</span><span class="cx"> if (isLoading() || stillNeedsLoad())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- CachedResourceClientWalker<CachedResourceClient> w(m_clients);
- while (CachedResourceClient* c = w.next())
- c->notifyFinished(this);
</del><ins>+ CachedResourceClientWalker<CachedResourceClient> walker(m_clients);
+ while (CachedResourceClient* client = walker.next())
+ client->notifyFinished(this);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedResource::addDataBuffer(ResourceBuffer*)
</del><ins>+void CachedResource::addDataBuffer(SharedBuffer&)
</ins><span class="cx"> {
</span><del>- ASSERT(m_options.dataBufferingPolicy() == BufferData);
</del><ins>+ ASSERT(dataBufferingPolicy() == BufferData);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CachedResource::addData(const char*, unsigned)
</span><span class="cx"> {
</span><del>- ASSERT(m_options.dataBufferingPolicy() == DoNotBufferData);
</del><ins>+ ASSERT(dataBufferingPolicy() == DoNotBufferData);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedResource::finishLoading(ResourceBuffer*)
</del><ins>+void CachedResource::finishLoading(SharedBuffer*)
</ins><span class="cx"> {
</span><span class="cx"> setLoading(false);
</span><span class="cx"> checkNotify();
</span><span class="lines">@@ -391,17 +390,15 @@
</span><span class="cx"> didAddClient(client);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedResource::didAddClient(CachedResourceClient* c)
</del><ins>+void CachedResource::didAddClient(CachedResourceClient* client)
</ins><span class="cx"> {
</span><span class="cx"> if (m_decodedDataDeletionTimer.isActive())
</span><span class="cx"> m_decodedDataDeletionTimer.stop();
</span><span class="cx">
</span><del>- if (m_clientsAwaitingCallback.contains(c)) {
- m_clients.add(c);
- m_clientsAwaitingCallback.remove(c);
- }
</del><ins>+ if (m_clientsAwaitingCallback.remove(client))
+ m_clients.add(client);
</ins><span class="cx"> if (!isLoading() && !stillNeedsLoad())
</span><del>- c->notifyFinished(this);
</del><ins>+ client->notifyFinished(this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CachedResource::addClientToSet(CachedResourceClient* client)
</span><span class="lines">@@ -423,7 +420,7 @@
</span><span class="cx"> // Therefore, rather than immediately sending callbacks on a cache hit like other CachedResources,
</span><span class="cx"> // we schedule the callbacks and ensure we never finish synchronously.
</span><span class="cx"> ASSERT(!m_clientsAwaitingCallback.contains(client));
</span><del>- m_clientsAwaitingCallback.add(client, CachedResourceCallback::schedule(this, client));
</del><ins>+ m_clientsAwaitingCallback.add(client, std::make_unique<Callback>(*this, *client));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -731,27 +728,28 @@
</span><span class="cx"> m_loadPriority = loadPriority;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CachedResource::CachedResourceCallback::CachedResourceCallback(CachedResource* resource, CachedResourceClient* client)
</del><ins>+inline CachedResource::Callback::Callback(CachedResource& resource, CachedResourceClient& client)
</ins><span class="cx"> : m_resource(resource)
</span><span class="cx"> , m_client(client)
</span><del>- , m_callbackTimer(this, &CachedResourceCallback::timerFired)
</del><ins>+ , m_timer(this, &Callback::timerFired)
</ins><span class="cx"> {
</span><del>- m_callbackTimer.startOneShot(0);
</del><ins>+ m_timer.startOneShot(0);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedResource::CachedResourceCallback::cancel()
</del><ins>+inline void CachedResource::Callback::cancel()
</ins><span class="cx"> {
</span><del>- if (m_callbackTimer.isActive())
- m_callbackTimer.stop();
</del><ins>+ if (m_timer.isActive())
+ m_timer.stop();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedResource::CachedResourceCallback::timerFired(Timer<CachedResourceCallback>&)
</del><ins>+void CachedResource::Callback::timerFired(Timer<Callback>&)
</ins><span class="cx"> {
</span><del>- m_resource->didAddClient(m_client);
</del><ins>+ m_resource.didAddClient(&m_client);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE(FOUNDATION)
</span><del>-void CachedResource::tryReplaceEncodedData(PassRefPtr<SharedBuffer> newBuffer)
</del><ins>+
+void CachedResource::tryReplaceEncodedData(SharedBuffer& newBuffer)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_data)
</span><span class="cx"> return;
</span><span class="lines">@@ -762,11 +760,12 @@
</span><span class="cx"> // We have to do the memcmp because we can't tell if the replacement file backed data is for the
</span><span class="cx"> // same resource or if we made a second request with the same URL which gave us a different
</span><span class="cx"> // resource. We have seen this happen for cached POST resources.
</span><del>- if (m_data->size() != newBuffer->size() || memcmp(m_data->data(), newBuffer->data(), m_data->size()))
</del><ins>+ if (m_data->size() != newBuffer.size() || memcmp(m_data->data(), newBuffer.data(), m_data->size()))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- m_data->tryReplaceSharedBufferContents(newBuffer.get());
</del><ins>+ m_data->tryReplaceContentsWithPlatformBuffer(newBuffer);
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> class CachedResourceHandleBase;
</span><span class="cx"> class CachedResourceLoader;
</span><span class="cx"> class InspectorResource;
</span><del>-class ResourceBuffer;
</del><span class="cx"> class SecurityOrigin;
</span><span class="cx"> class SharedBuffer;
</span><span class="cx"> class SubresourceLoader;
</span><span class="lines">@@ -96,9 +95,9 @@
</span><span class="cx">
</span><span class="cx"> virtual void setEncoding(const String&) { }
</span><span class="cx"> virtual String encoding() const { return String(); }
</span><del>- virtual void addDataBuffer(ResourceBuffer*);
</del><ins>+ virtual void addDataBuffer(SharedBuffer&);
</ins><span class="cx"> virtual void addData(const char* data, unsigned length);
</span><del>- virtual void finishLoading(ResourceBuffer*);
</del><ins>+ virtual void finishLoading(SharedBuffer*);
</ins><span class="cx"> virtual void error(CachedResource::Status);
</span><span class="cx">
</span><span class="cx"> void setResourceError(const ResourceError& error) { m_error = error; }
</span><span class="lines">@@ -187,7 +186,7 @@
</span><span class="cx">
</span><span class="cx"> void clearLoader();
</span><span class="cx">
</span><del>- ResourceBuffer* resourceBuffer() const { return m_data.get(); }
</del><ins>+ SharedBuffer* resourceBuffer() const { return m_data.get(); }
</ins><span class="cx">
</span><span class="cx"> virtual void willSendRequest(ResourceRequest&, const ResourceResponse&);
</span><span class="cx"> virtual void responseReceived(const ResourceResponse&);
</span><span class="lines">@@ -245,55 +244,35 @@
</span><span class="cx"> virtual bool canReuse(const ResourceRequest&) const { return true; }
</span><span class="cx">
</span><span class="cx"> #if USE(FOUNDATION)
</span><del>- WEBCORE_EXPORT void tryReplaceEncodedData(PassRefPtr<SharedBuffer>);
</del><ins>+ WEBCORE_EXPORT void tryReplaceEncodedData(SharedBuffer&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if USE(SOUP)
</span><del>- virtual char* getOrCreateReadBuffer(size_t /* requestedSize */, size_t& /* actualSize */) { return 0; }
</del><ins>+ virtual char* getOrCreateReadBuffer(size_t /* requestedSize */, size_t& /* actualSize */) { return nullptr; }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- virtual void checkNotify();
-
</del><span class="cx"> void setEncodedSize(unsigned);
</span><span class="cx"> void setDecodedSize(unsigned);
</span><span class="cx"> void didAccessDecodedData(double timeStamp);
</span><span class="cx">
</span><ins>+ // FIXME: Make the rest of these data members private and use functions in derived classes instead.
</ins><span class="cx"> HashCountedSet<CachedResourceClient*> m_clients;
</span><del>-
- class CachedResourceCallback {
- public:
- CachedResourceCallback(CachedResource*, CachedResourceClient*);
-
- static std::unique_ptr<CachedResourceCallback> schedule(CachedResource* resource, CachedResourceClient* client) { return std::make_unique<CachedResourceCallback>(resource, client); }
- void cancel();
- private:
- void timerFired(Timer<CachedResourceCallback>&);
-
- CachedResource* m_resource;
- CachedResourceClient* m_client;
- Timer<CachedResourceCallback> m_callbackTimer;
- };
- HashMap<CachedResourceClient*, std::unique_ptr<CachedResourceCallback>> m_clientsAwaitingCallback;
-
</del><span class="cx"> ResourceRequest m_resourceRequest;
</span><del>- SessionID m_sessionID;
- String m_accept;
</del><span class="cx"> RefPtr<SubresourceLoader> m_loader;
</span><span class="cx"> ResourceLoaderOptions m_options;
</span><del>- ResourceLoadPriority m_loadPriority;
-
</del><span class="cx"> ResourceResponse m_response;
</span><del>- double m_responseTimestamp;
-
- RefPtr<ResourceBuffer> m_data;
</del><ins>+ RefPtr<SharedBuffer> m_data;
</ins><span class="cx"> DeferrableOneShotTimer m_decodedDataDeletionTimer;
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+ class Callback;
+
</ins><span class="cx"> bool addClientToSet(CachedResourceClient*);
</span><span class="cx">
</span><span class="cx"> void decodedDataDeletionTimerFired();
</span><span class="cx">
</span><ins>+ virtual void checkNotify();
</ins><span class="cx"> virtual bool mayTryReplaceEncodedData() const { return false; }
</span><span class="cx">
</span><span class="cx"> double freshnessLifetime(const ResourceResponse&) const;
</span><span class="lines">@@ -301,6 +280,12 @@
</span><span class="cx"> void addAdditionalRequestHeaders(CachedResourceLoader*);
</span><span class="cx"> void failBeforeStarting();
</span><span class="cx">
</span><ins>+ HashMap<CachedResourceClient*, std::unique_ptr<Callback>> m_clientsAwaitingCallback;
+ SessionID m_sessionID;
+ String m_accept;
+ ResourceLoadPriority m_loadPriority;
+ double m_responseTimestamp;
+
</ins><span class="cx"> String m_fragmentIdentifierForRequest;
</span><span class="cx">
</span><span class="cx"> ResourceError m_error;
</span><span class="lines">@@ -338,7 +323,7 @@
</span><span class="cx"> CachedResource* m_nextInLiveResourcesList;
</span><span class="cx"> CachedResource* m_prevInLiveResourcesList;
</span><span class="cx">
</span><del>- CachedResourceLoader* m_owningCachedResourceLoader; // only non-0 for resources that are not in the cache
</del><ins>+ CachedResourceLoader* m_owningCachedResourceLoader; // only non-null for resources that are not in the cache
</ins><span class="cx">
</span><span class="cx"> // If this field is non-null we are using the resource as a proxy for checking whether an existing resource is still up to date
</span><span class="cx"> // using HTTP If-Modified-Since/If-None-Match headers. If the response is 304 all clients of this resource are moved
</span><span class="lines">@@ -355,6 +340,20 @@
</span><span class="cx"> RedirectChainCacheStatus m_redirectChainCacheStatus;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+class CachedResource::Callback {
+public:
+ Callback(CachedResource&, CachedResourceClient&);
+
+ void cancel();
+
+private:
+ void timerFired(Timer<Callback>&);
+
+ CachedResource& m_resource;
+ CachedResourceClient& m_client;
+ Timer<Callback> m_timer;
+};
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #define SPECIALIZE_TYPE_TRAITS_CACHED_RESOURCE(ToClassName, CachedResourceType) \
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceClient.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceClient.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedResourceClient.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -25,9 +25,8 @@
</span><span class="cx"> #ifndef CachedResourceClient_h
</span><span class="cx"> #define CachedResourceClient_h
</span><span class="cx">
</span><del>-#include <wtf/FastMalloc.h>
</del><ins>+namespace WebCore {
</ins><span class="cx">
</span><del>-namespace WebCore {
</del><span class="cx"> class CachedResource;
</span><span class="cx">
</span><span class="cx"> class CachedResourceClient {
</span><span class="lines">@@ -44,13 +43,14 @@
</span><span class="cx"> virtual ~CachedResourceClient() { }
</span><span class="cx"> virtual void notifyFinished(CachedResource*) { }
</span><span class="cx"> virtual void deprecatedDidReceiveCachedResource(CachedResource*) { }
</span><del>-
</del><ins>+
</ins><span class="cx"> static CachedResourceClientType expectedType() { return BaseResourceType; }
</span><span class="cx"> virtual CachedResourceClientType resourceClientType() const { return expectedType(); }
</span><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> CachedResourceClient() { }
</span><span class="cx"> };
</span><ins>+
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedSVGDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -23,10 +23,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "CachedSVGDocument.h"
</span><span class="cx">
</span><del>-#include "CachedResourceClient.h"
-#include "CachedResourceHandle.h"
-#include "ResourceBuffer.h"
-#include <wtf/text/StringBuilder.h>
</del><ins>+#include "SharedBuffer.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -51,7 +48,7 @@
</span><span class="cx"> return m_decoder->encoding().name();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedSVGDocument::finishLoading(ResourceBuffer* data)
</del><ins>+void CachedSVGDocument::finishLoading(SharedBuffer* data)
</ins><span class="cx"> {
</span><span class="cx"> if (data) {
</span><span class="cx"> // We don't need to create a new frame because the new document belongs to the parent UseElement.
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedSVGDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedSVGDocument.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGDocument.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedSVGDocument.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -37,15 +37,14 @@
</span><span class="cx">
</span><span class="cx"> SVGDocument* document() const { return m_document.get(); }
</span><span class="cx">
</span><del>-protected:
- RefPtr<SVGDocument> m_document;
- RefPtr<TextResourceDecoder> m_decoder;
-
</del><span class="cx"> private:
</span><span class="cx"> virtual bool mayTryReplaceEncodedData() const override { return true; }
</span><span class="cx"> virtual void setEncoding(const String&) override;
</span><span class="cx"> virtual String encoding() const override;
</span><del>- virtual void finishLoading(ResourceBuffer*) override;
</del><ins>+ virtual void finishLoading(SharedBuffer*) override;
+
+ RefPtr<SVGDocument> m_document;
+ RefPtr<TextResourceDecoder> m_decoder;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedScriptcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedScript.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedScript.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedScript.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx"> #include "HTTPParsers.h"
</span><span class="cx"> #include "MIMETypeRegistry.h"
</span><span class="cx"> #include "MemoryCache.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "RuntimeApplicationChecks.h"
</span><ins>+#include "SharedBuffer.h"
</ins><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="lines">@@ -76,14 +76,13 @@
</span><span class="cx"> setDecodedSize(m_script.sizeInBytes());
</span><span class="cx"> }
</span><span class="cx"> m_decodedDataDeletionTimer.restart();
</span><del>-
</del><span class="cx"> return m_script;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedScript::finishLoading(ResourceBuffer* data)
</del><ins>+void CachedScript::finishLoading(SharedBuffer* data)
</ins><span class="cx"> {
</span><span class="cx"> m_data = data;
</span><del>- setEncodedSize(m_data.get() ? m_data->size() : 0);
</del><ins>+ setEncodedSize(data ? data->size() : 0);
</ins><span class="cx"> CachedResource::finishLoading(data);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedScripth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedScript.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedScript.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedScript.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -30,36 +30,35 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class CachedResourceLoader;
- class TextResourceDecoder;
</del><ins>+class TextResourceDecoder;
</ins><span class="cx">
</span><del>- class CachedScript final : public CachedResource {
- public:
- CachedScript(const ResourceRequest&, const String& charset, SessionID);
- virtual ~CachedScript();
</del><ins>+class CachedScript final : public CachedResource {
+public:
+ CachedScript(const ResourceRequest&, const String& charset, SessionID);
+ virtual ~CachedScript();
</ins><span class="cx">
</span><del>- const String& script();
</del><ins>+ const String& script();
</ins><span class="cx">
</span><del>- String mimeType() const;
</del><ins>+ String mimeType() const;
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(NOSNIFF)
</span><del>- bool mimeTypeAllowedByNosniff() const;
</del><ins>+ bool mimeTypeAllowedByNosniff() const;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- private:
- virtual bool mayTryReplaceEncodedData() const override { return true; }
</del><ins>+private:
+ virtual bool mayTryReplaceEncodedData() const override { return true; }
</ins><span class="cx">
</span><del>- virtual bool shouldIgnoreHTTPStatusCodeErrors() const override;
</del><ins>+ virtual bool shouldIgnoreHTTPStatusCodeErrors() const override;
</ins><span class="cx">
</span><del>- virtual void setEncoding(const String&) override;
- virtual String encoding() const override;
- virtual void finishLoading(ResourceBuffer*) override;
</del><ins>+ virtual void setEncoding(const String&) override;
+ virtual String encoding() const override;
+ virtual void finishLoading(SharedBuffer*) override;
</ins><span class="cx">
</span><del>- virtual void destroyDecodedData() override;
</del><ins>+ virtual void destroyDecodedData() override;
</ins><span class="cx">
</span><del>- String m_script;
- RefPtr<TextResourceDecoder> m_decoder;
- };
</del><ins>+ String m_script;
+ RefPtr<TextResourceDecoder> m_decoder;
+};
</ins><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedTextTrack.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedTextTrack.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedTextTrack.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include "CachedResourceClient.h"
</span><span class="cx"> #include "CachedResourceClientWalker.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="lines">@@ -44,24 +43,26 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CachedTextTrack::~CachedTextTrack()
</del><ins>+void CachedTextTrack::updateData(SharedBuffer* data)
</ins><span class="cx"> {
</span><del>-}
-
-void CachedTextTrack::addDataBuffer(ResourceBuffer* data)
-{
- ASSERT(m_options.dataBufferingPolicy() == BufferData);
</del><ins>+ ASSERT(dataBufferingPolicy() == BufferData);
</ins><span class="cx"> m_data = data;
</span><del>- setEncodedSize(m_data.get() ? m_data->size() : 0);
</del><ins>+ setEncodedSize(data ? data->size() : 0);
</ins><span class="cx">
</span><span class="cx"> CachedResourceClientWalker<CachedResourceClient> walker(m_clients);
</span><del>- while (CachedResourceClient *client = walker.next())
</del><ins>+ while (CachedResourceClient* client = walker.next())
</ins><span class="cx"> client->deprecatedDidReceiveCachedResource(this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedTextTrack::finishLoading(ResourceBuffer* data)
</del><ins>+void CachedTextTrack::addDataBuffer(SharedBuffer& data)
</ins><span class="cx"> {
</span><del>- addDataBuffer(data);
</del><ins>+ updateData(&data);
+ CachedResource::addDataBuffer(data);
+}
+
+void CachedTextTrack::finishLoading(SharedBuffer* data)
+{
+ updateData(data);
</ins><span class="cx"> CachedResource::finishLoading(data);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedTextTrack.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedTextTrack.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedTextTrack.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -36,12 +36,13 @@
</span><span class="cx"> class CachedTextTrack final : public CachedResource {
</span><span class="cx"> public:
</span><span class="cx"> CachedTextTrack(const ResourceRequest&, SessionID);
</span><del>- virtual ~CachedTextTrack();
</del><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual bool mayTryReplaceEncodedData() const override { return true; }
</span><del>- virtual void addDataBuffer(ResourceBuffer*) override;
- virtual void finishLoading(ResourceBuffer*) override;
</del><ins>+ virtual void addDataBuffer(SharedBuffer&) override;
+ virtual void finishLoading(SharedBuffer*) override;
+
+ void updateData(SharedBuffer*);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedXSLStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">
</span><span class="cx"> #include "CachedResourceClientWalker.h"
</span><span class="cx"> #include "CachedStyleSheetClient.h"
</span><del>-#include "ResourceBuffer.h"
</del><ins>+#include "SharedBuffer.h"
</ins><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="lines">@@ -46,6 +46,10 @@
</span><span class="cx"> setAccept("text/xml, application/xml, application/xhtml+xml, text/xsl, application/rss+xml, application/atom+xml");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+CachedXSLStyleSheet::~CachedXSLStyleSheet()
+{
+}
+
</ins><span class="cx"> void CachedXSLStyleSheet::didAddClient(CachedResourceClient* c)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(c->resourceClientType() == CachedStyleSheetClient::expectedType());
</span><span class="lines">@@ -63,12 +67,12 @@
</span><span class="cx"> return m_decoder->encoding().name();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedXSLStyleSheet::finishLoading(ResourceBuffer* data)
</del><ins>+void CachedXSLStyleSheet::finishLoading(SharedBuffer* data)
</ins><span class="cx"> {
</span><span class="cx"> m_data = data;
</span><del>- setEncodedSize(m_data.get() ? m_data->size() : 0);
- if (m_data.get())
- m_sheet = m_decoder->decodeAndFlush(m_data->data(), encodedSize());
</del><ins>+ setEncodedSize(data ? data->size() : 0);
+ if (data)
+ m_sheet = m_decoder->decodeAndFlush(data->data(), encodedSize());
</ins><span class="cx"> setLoading(false);
</span><span class="cx"> checkNotify();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedXSLStyleSheeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -29,35 +29,30 @@
</span><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx">
</span><span class="cx"> #include "CachedResource.h"
</span><del>-#include <wtf/Vector.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class CachedResourceLoader;
- class TextResourceDecoder;
</del><ins>+class TextResourceDecoder;
</ins><span class="cx">
</span><del>- class CachedXSLStyleSheet final : public CachedResource {
- public:
- CachedXSLStyleSheet(const ResourceRequest&, SessionID);
</del><ins>+class CachedXSLStyleSheet final : public CachedResource {
+public:
+ CachedXSLStyleSheet(const ResourceRequest&, SessionID);
+ virtual ~CachedXSLStyleSheet();
</ins><span class="cx">
</span><del>- const String& sheet() const { return m_sheet; }
</del><ins>+ const String& sheet() const { return m_sheet; }
</ins><span class="cx">
</span><del>- protected:
- virtual void checkNotify() override;
</del><ins>+private:
+ virtual void checkNotify() override;
+ virtual bool mayTryReplaceEncodedData() const override { return true; }
+ virtual void didAddClient(CachedResourceClient*) override;
+ virtual void setEncoding(const String&) override;
+ virtual String encoding() const override;
+ virtual void finishLoading(SharedBuffer*) override;
</ins><span class="cx">
</span><del>- String m_sheet;
- RefPtr<TextResourceDecoder> m_decoder;
</del><ins>+ String m_sheet;
+ RefPtr<TextResourceDecoder> m_decoder;
+};
</ins><span class="cx">
</span><del>- private:
- virtual bool mayTryReplaceEncodedData() const override { return true; }
-
- virtual void didAddClient(CachedResourceClient*) override;
-
- virtual void setEncoding(const String&) override;
- virtual String encoding() const override;
- virtual void finishLoading(ResourceBuffer*) override;
- };
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CACHED_RESOURCE(CachedXSLStyleSheet, CachedResource::XSLStyleSheet)
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercfSubresourceLoaderCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -51,8 +51,8 @@
</span><span class="cx"> // being cancelled. Bail out if we no longer have a cached resource.
</span><span class="cx"> if (!m_resource)
</span><span class="cx"> return;
</span><del>- if (ResourceBuffer* resourceData = this->resourceData())
- m_resource->addDataBuffer(resourceData);
</del><ins>+ if (auto* resourceData = this->resourceData())
+ m_resource->addDataBuffer(*resourceData);
</ins><span class="cx"> else {
</span><span class="cx"> CFDataRef cfData = reinterpret_cast<CFDataRef>(CFArrayGetValueAtIndex(dataArray, i));
</span><span class="cx"> const char* data = reinterpret_cast<const char *>(CFDataGetBytePtr(cfData));
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercocoaDiskCacheMonitorCocoah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> protected:
</span><span class="cx"> WEBCORE_EXPORT DiskCacheMonitor(const ResourceRequest&, SessionID, CFCachedURLResponseRef);
</span><span class="cx">
</span><del>- virtual void resourceBecameFileBacked(PassRefPtr<SharedBuffer>);
</del><ins>+ virtual void resourceBecameFileBacked(SharedBuffer&);
</ins><span class="cx">
</span><span class="cx"> const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
</span><span class="cx"> SessionID sessionID() const { return m_sessionID; }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercocoaDiskCacheMonitorCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> if (!fileBackedBuffer)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- monitor->resourceBecameFileBacked(fileBackedBuffer);
</del><ins>+ monitor->resourceBecameFileBacked(*fileBackedBuffer);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> #if USE(WEB_THREAD)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> _CFCachedURLResponseSetBecameFileBackedCallBackBlock(cachedResponse, blockToRun, dispatch_get_main_queue());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DiskCacheMonitor::resourceBecameFileBacked(PassRefPtr<SharedBuffer> fileBackedBuffer)
</del><ins>+void DiskCacheMonitor::resourceBecameFileBacked(SharedBuffer& fileBackedBuffer)
</ins><span class="cx"> {
</span><span class="cx"> CachedResource* resource = memoryCache()->resourceForRequest(m_resourceRequest, m_sessionID);
</span><span class="cx"> if (!resource)
</span></span></pre></div>
<a id="trunkSourceWebCoreloadericonIconLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/icon/IconLoader.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconLoader.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/icon/IconLoader.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include "IconController.h"
</span><span class="cx"> #include "IconDatabase.h"
</span><span class="cx"> #include "Logging.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "ResourceRequest.h"
</span><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="lines">@@ -85,16 +84,16 @@
</span><span class="cx">
</span><span class="cx"> // If we got a status code indicating an invalid response, then lets
</span><span class="cx"> // ignore the data and not try to decode the error page as an icon.
</span><del>- RefPtr<ResourceBuffer> data = resource->resourceBuffer();
</del><ins>+ auto* data = resource->resourceBuffer();
</ins><span class="cx"> int status = resource->response().httpStatusCode();
</span><span class="cx"> if (status && (status < 200 || status > 299))
</span><del>- data = 0;
</del><ins>+ data = nullptr;
</ins><span class="cx">
</span><span class="cx"> static const char pdfMagicNumber[] = "%PDF";
</span><span class="cx"> static unsigned pdfMagicNumberLength = sizeof(pdfMagicNumber) - 1;
</span><span class="cx"> if (data && data->size() >= pdfMagicNumberLength && !memcmp(data->data(), pdfMagicNumber, pdfMagicNumberLength)) {
</span><span class="cx"> LOG(IconDatabase, "IconLoader::finishLoading() - Ignoring icon at %s because it appears to be a PDF", resource->url().string().ascii().data());
</span><del>- data = 0;
</del><ins>+ data = nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LOG(IconDatabase, "IconLoader::finishLoading() - Committing iconURL %s to database", resource->url().string().ascii().data());
</span><span class="lines">@@ -102,7 +101,7 @@
</span><span class="cx"> // Setting the icon data only after committing to the database ensures that the data is
</span><span class="cx"> // kept in memory (so it does not have to be read from the database asynchronously), since
</span><span class="cx"> // there is a page URL referencing it.
</span><del>- iconDatabase().setIconDataForIconURL(data ? data->sharedBuffer() : 0, resource->url().string());
</del><ins>+ iconDatabase().setIconDataForIconURL(data, resource->url().string());
</ins><span class="cx"> m_frame.loader().client().dispatchDidReceiveIcon();
</span><span class="cx"> stopLoading();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadermacResourceBuffermm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/mac/ResourceBuffer.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/mac/ResourceBuffer.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/mac/ResourceBuffer.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ResourceBuffer.h"
-
-#include "SharedBuffer.h"
-
-namespace WebCore {
-
-RetainPtr<NSData> ResourceBuffer::createNSData()
-{
- return m_sharedBuffer->createNSData();
-}
-
-void ResourceBuffer::tryReplaceSharedBufferContents(SharedBuffer* newContents)
-{
- if (!m_sharedBuffer)
- m_sharedBuffer = newContents;
- else
- m_sharedBuffer->tryReplaceContentsWithPlatformBuffer(newContents);
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreloadermacResourceLoaderMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -31,10 +31,10 @@
</span><span class="cx">
</span><span class="cx"> #include "FrameLoader.h"
</span><span class="cx"> #include "FrameLoaderClient.h"
</span><ins>+#include "SharedBuffer.h"
</ins><span class="cx">
</span><span class="cx"> #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><span class="cx"> #include "InspectorInstrumentation.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if USE(CFNETWORK)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">
</span><span class="cx"> if (m_options.dataBufferingPolicy() == BufferData) {
</span><span class="cx"> if (!m_resourceData)
</span><del>- m_resourceData = ResourceBuffer::create();
</del><ins>+ m_resourceData = SharedBuffer::create();
</ins><span class="cx"> m_resourceData->append(data);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSharedBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/SharedBuffer.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SharedBuffer.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/platform/SharedBuffer.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> #if !USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><ins>+
</ins><span class="cx"> static const unsigned segmentSize = 0x1000;
</span><span class="cx"> static const unsigned segmentPositionMask = 0x0FFF;
</span><span class="cx">
</span><span class="lines">@@ -56,6 +57,7 @@
</span><span class="cx"> {
</span><span class="cx"> fastFree(p);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> SharedBuffer::SharedBuffer()
</span><span class="lines">@@ -214,9 +216,8 @@
</span><span class="cx"> clearPlatformData();
</span><span class="cx">
</span><span class="cx"> #if !USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><del>- for (unsigned i = 0; i < m_segments.size(); ++i)
- freeSegment(m_segments[i]);
-
</del><ins>+ for (char* segment : m_segments)
+ freeSegment(segment);
</ins><span class="cx"> m_segments.clear();
</span><span class="cx"> #else
</span><span class="cx"> m_dataArray.clear();
</span><span class="lines">@@ -228,23 +229,25 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<SharedBuffer> SharedBuffer::copy() const
</span><span class="cx"> {
</span><del>- RefPtr<SharedBuffer> clone(adoptRef(new SharedBuffer));
</del><ins>+ RefPtr<SharedBuffer> clone { adoptRef(*new SharedBuffer) };
</ins><span class="cx"> if (hasPlatformData()) {
</span><span class="cx"> clone->append(data(), size());
</span><del>- return clone;
</del><ins>+ return clone.release();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> clone->m_size = m_size;
</span><span class="cx"> clone->m_buffer->data.reserveCapacity(m_size);
</span><span class="cx"> clone->m_buffer->data.append(m_buffer->data.data(), m_buffer->data.size());
</span><ins>+
</ins><span class="cx"> #if !USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><del>- for (unsigned i = 0; i < m_segments.size(); ++i)
- clone->m_buffer->data.append(m_segments[i], segmentSize);
</del><ins>+ for (char* segment : m_segments)
+ clone->m_buffer->data.append(segment, segmentSize);
</ins><span class="cx"> #else
</span><del>- for (unsigned i = 0; i < m_dataArray.size(); ++i)
- clone->append(m_dataArray[i].get());
</del><ins>+ for (auto& data : m_dataArray)
+ clone->append(data.get());
</ins><span class="cx"> #endif
</span><del>- return clone;
</del><ins>+
+ return clone.release();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SharedBuffer::duplicateDataBufferIfNecessary() const
</span><span class="lines">@@ -275,17 +278,19 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if !USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><ins>+
</ins><span class="cx"> void SharedBuffer::copyBufferAndClear(char* destination, unsigned bytesToCopy) const
</span><span class="cx"> {
</span><del>- for (unsigned i = 0; i < m_segments.size(); ++i) {
</del><ins>+ for (char* segment : m_segments) {
</ins><span class="cx"> unsigned effectiveBytesToCopy = std::min(bytesToCopy, segmentSize);
</span><del>- memcpy(destination, m_segments[i], effectiveBytesToCopy);
</del><ins>+ memcpy(destination, segment, effectiveBytesToCopy);
</ins><span class="cx"> destination += effectiveBytesToCopy;
</span><span class="cx"> bytesToCopy -= effectiveBytesToCopy;
</span><del>- freeSegment(m_segments[i]);
</del><ins>+ freeSegment(segment);
</ins><span class="cx"> }
</span><span class="cx"> m_segments.clear();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> const Vector<char>& SharedBuffer::buffer() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSharedBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/SharedBuffer.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SharedBuffer.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/platform/SharedBuffer.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx"> // }
</span><span class="cx"> WEBCORE_EXPORT unsigned getSomeData(const char*& data, unsigned position = 0) const;
</span><span class="cx">
</span><del>- void tryReplaceContentsWithPlatformBuffer(SharedBuffer*);
</del><ins>+ void tryReplaceContentsWithPlatformBuffer(SharedBuffer&);
</ins><span class="cx"> WEBCORE_EXPORT bool hasPlatformData() const;
</span><span class="cx">
</span><span class="cx"> struct DataBuffer : public ThreadSafeRefCounted<DataBuffer> {
</span><span class="lines">@@ -158,6 +158,7 @@
</span><span class="cx"> #else
</span><span class="cx"> mutable Vector<char*> m_segments;
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if USE(CF)
</span><span class="cx"> explicit SharedBuffer(CFDataRef);
</span><span class="cx"> RetainPtr<CFDataRef> m_cfData;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfSharedBufferCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -92,13 +92,13 @@
</span><span class="cx"> m_cfData = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SharedBuffer::tryReplaceContentsWithPlatformBuffer(SharedBuffer* newContents)
</del><ins>+void SharedBuffer::tryReplaceContentsWithPlatformBuffer(SharedBuffer& newContents)
</ins><span class="cx"> {
</span><del>- if (!newContents->m_cfData)
</del><ins>+ if (!newContents.m_cfData)
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> clear();
</span><del>- m_cfData = newContents->m_cfData;
</del><ins>+ m_cfData = newContents.m_cfData;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SharedBuffer::maybeAppendPlatformData(SharedBuffer* newContents)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPlatformMediaResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define PlatformMediaResourceLoader_h
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><ins>+
</ins><span class="cx"> #include <wtf/Noncopyable.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx">
</span><span class="lines">@@ -35,7 +36,6 @@
</span><span class="cx"> class ResourceError;
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ResourceResponse;
</span><del>-class SharedBuffer;
</del><span class="cx">
</span><span class="cx"> class PlatformMediaResourceLoaderClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -43,10 +43,9 @@
</span><span class="cx">
</span><span class="cx"> virtual void responseReceived(const ResourceResponse&) { }
</span><span class="cx"> virtual void dataReceived(const char*, int) { }
</span><del>- virtual void bufferReceived(SharedBuffer*) { }
</del><span class="cx"> virtual void accessControlCheckFailed(const ResourceError&) { }
</span><span class="cx"> virtual void loadFailed(const ResourceError&) { }
</span><del>- virtual void loadFinished(SharedBuffer*) { }
</del><ins>+ virtual void loadFinished() { }
</ins><span class="cx"> #if USE(SOUP)
</span><span class="cx"> virtual char* getOrCreateReadBuffer(size_t /*requestedSize*/, size_t& /*actualSize*/) { return nullptr; };
</span><span class="cx"> #endif
</span><span class="lines">@@ -68,7 +67,7 @@
</span><span class="cx"> virtual bool didPassAccessControlCheck() const { return false; }
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- PlatformMediaResourceLoader(std::unique_ptr<PlatformMediaResourceLoaderClient> client)
</del><ins>+ explicit PlatformMediaResourceLoader(std::unique_ptr<PlatformMediaResourceLoaderClient> client)
</ins><span class="cx"> : m_client(WTF::move(client))
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfWebCoreAVCFResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include "CachedResourceRequest.h"
</span><span class="cx"> #include "MediaPlayerPrivateAVFoundationCF.h"
</span><span class="cx"> #include "NotImplemented.h"
</span><del>-#include "ResourceBuffer.h"
</del><span class="cx"> #include "ResourceLoaderOptions.h"
</span><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include "SoftLinking.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcWebCoreAVFResourceLoadermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #import "CachedResourceLoader.h"
</span><span class="cx"> #import "CachedResourceRequest.h"
</span><span class="cx"> #import "MediaPlayerPrivateAVFoundationObjC.h"
</span><del>-#import "ResourceBuffer.h"
</del><span class="cx"> #import "ResourceLoaderOptions.h"
</span><span class="cx"> #import "SharedBuffer.h"
</span><span class="cx"> #import "SoftLinking.h"
</span><span class="lines">@@ -152,7 +151,7 @@
</span><span class="cx"> if (!dataRequest)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- SharedBuffer* data = resource->resourceBuffer() ? resource->resourceBuffer()->sharedBuffer() : 0;
</del><ins>+ SharedBuffer* data = resource->resourceBuffer();
</ins><span class="cx"> if (!data)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerWebKitWebSourceGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> virtual void dataReceived(const char*, int) override;
</span><span class="cx"> virtual void accessControlCheckFailed(const ResourceError&) override;
</span><span class="cx"> virtual void loadFailed(const ResourceError&) override;
</span><del>- virtual void loadFinished(SharedBuffer*) override;
</del><ins>+ virtual void loadFinished() override;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class ResourceHandleStreamingClient : public ResourceHandleClient, public StreamingClient {
</span><span class="lines">@@ -1031,7 +1031,7 @@
</span><span class="cx"> gst_app_src_end_of_stream(src->priv->appsrc);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CachedResourceStreamingClient::loadFinished(SharedBuffer*)
</del><ins>+void CachedResourceStreamingClient::loadFinished()
</ins><span class="cx"> {
</span><span class="cx"> handleNotifyFinished();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPasteboardMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx"> #import "PasteboardStrategy.h"
</span><span class="cx"> #import "PlatformStrategies.h"
</span><span class="cx"> #import "RenderImage.h"
</span><del>-#import "ResourceBuffer.h"
</del><span class="cx"> #import "Text.h"
</span><span class="cx"> #import "WebCoreNSStringExtras.h"
</span><span class="cx"> #import "WebNSAttributedStringExtras.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsoupSharedBufferSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/soup/SharedBufferSoup.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/soup/SharedBufferSoup.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebCore/platform/soup/SharedBufferSoup.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -44,11 +44,6 @@
</span><span class="cx"> m_soupBuffer.reset();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SharedBuffer::tryReplaceContentsWithPlatformBuffer(SharedBuffer*)
-{
- ASSERT_NOT_REACHED();
-}
-
</del><span class="cx"> void SharedBuffer::maybeTransferPlatformData()
</span><span class="cx"> {
</span><span class="cx"> if (!m_soupBuffer)
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-11-04 Darin Adler <darin@apple.com>
+
+ Eliminate ResourceBuffer and use SharedBuffer directly instead
+ https://bugs.webkit.org/show_bug.cgi?id=138174
+
+ Reviewed by Antti Koivisto.
+
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource data]): Use SharedBuffer directly.
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto.
+
</ins><span class="cx"> 2014-11-03 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r175406, r175413, and r175423.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebDataSourcemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebDataSource.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebDataSource.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit/mac/WebView/WebDataSource.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx"> #import <WebCore/URL.h>
</span><span class="cx"> #import <WebCore/LegacyWebArchive.h>
</span><span class="cx"> #import <WebCore/MIMETypeRegistry.h>
</span><del>-#import <WebCore/ResourceBuffer.h>
</del><span class="cx"> #import <WebCore/ResourceRequest.h>
</span><span class="cx"> #import <WebCore/SharedBuffer.h>
</span><span class="cx"> #import <WebCore/WebCoreObjCExtras.h>
</span><span class="lines">@@ -459,7 +458,7 @@
</span><span class="cx">
</span><span class="cx"> - (NSData *)data
</span><span class="cx"> {
</span><del>- RefPtr<ResourceBuffer> mainResourceData = toPrivate(_private)->loader->mainResourceData();
</del><ins>+ RefPtr<SharedBuffer> mainResourceData = toPrivate(_private)->loader->mainResourceData();
</ins><span class="cx"> if (!mainResourceData)
</span><span class="cx"> return nil;
</span><span class="cx"> return mainResourceData->createNSData().autorelease();
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -108,7 +108,6 @@
</span><span class="cx"> #import <WebCore/Range.h>
</span><span class="cx"> #import <WebCore/RenderView.h>
</span><span class="cx"> #import <WebCore/RenderWidget.h>
</span><del>-#import <WebCore/ResourceBuffer.h>
</del><span class="cx"> #import <WebCore/RuntimeApplicationChecks.h>
</span><span class="cx"> #import <WebCore/SharedBuffer.h>
</span><span class="cx"> #import <WebCore/SimpleFontData.h>
</span><span class="lines">@@ -3955,7 +3954,7 @@
</span><span class="cx"> NSURL *draggingImageURL = nil;
</span><span class="cx">
</span><span class="cx"> if (WebCore::CachedImage* tiffResource = [self promisedDragTIFFDataSource]) {
</span><del>- if (ResourceBuffer *buffer = static_cast<CachedResource*>(tiffResource)->resourceBuffer()) {
</del><ins>+ if (auto* buffer = tiffResource->resourceBuffer()) {
</ins><span class="cx"> NSURLResponse *response = tiffResource->response().nsURLResponse();
</span><span class="cx"> draggingImageURL = [response URL];
</span><span class="cx"> wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:buffer->createNSData().get()] autorelease];
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit/win/ChangeLog        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-11-04 Darin Adler <darin@apple.com>
+
+ Eliminate ResourceBuffer and use SharedBuffer directly instead
+ https://bugs.webkit.org/show_bug.cgi?id=138174
+
+ Reviewed by Antti Koivisto.
+
+ * WebDataSource.cpp:
+ (WebDataSource::data): Use SharedBuffer directly.
+ (WebDataSource::subresourceForURL): Ditto.
+
</ins><span class="cx"> 2014-11-03 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r175406, r175413, and r175423.
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebDataSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebDataSource.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebDataSource.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit/win/WebDataSource.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> #include <WebCore/Frame.h>
</span><span class="cx"> #include <WebCore/FrameLoader.h>
</span><span class="cx"> #include <WebCore/URL.h>
</span><del>-#include <WebCore/ResourceBuffer.h>
</del><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="lines">@@ -181,8 +180,7 @@
</span><span class="cx"> if (!m_loader)
</span><span class="cx"> return E_FAIL;
</span><span class="cx">
</span><del>- RefPtr<ResourceBuffer> buffer = m_loader->mainResourceData();
- return MemoryStream::createInstance(buffer ? buffer->sharedBuffer() : 0).copyRefTo(stream);
</del><ins>+ return MemoryStream::createInstance(m_loader->mainResourceData()).copyRefTo(stream);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> HRESULT WebDataSource::representation(/* [retval][out] */ IWebDocumentRepresentation** rep)
</span><span class="lines">@@ -303,8 +301,7 @@
</span><span class="cx"> if (!cachedResource)
</span><span class="cx"> return E_FAIL;
</span><span class="cx">
</span><del>- ResourceBuffer* buffer = cachedResource->resourceBuffer();
- *resource = WebResource::createInstance(buffer ? buffer->sharedBuffer() : 0, cachedResource->response());
</del><ins>+ *resource = WebResource::createInstance(cachedResource->resourceBuffer(), cachedResource->response());
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/CMakeLists.txt        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -235,7 +235,6 @@
</span><span class="cx"> Shared/WebProcessCreationParameters.cpp
</span><span class="cx"> Shared/WebRenderLayer.cpp
</span><span class="cx"> Shared/WebRenderObject.cpp
</span><del>- Shared/WebResourceBuffer.cpp
</del><span class="cx"> Shared/WebTouchEvent.cpp
</span><span class="cx"> Shared/WebWheelEvent.cpp
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/ChangeLog        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1,3 +1,63 @@
</span><ins>+2014-11-04 Darin Adler <darin@apple.com>
+
+ Eliminate ResourceBuffer and use SharedBuffer directly instead
+ https://bugs.webkit.org/show_bug.cgi?id=138174
+
+ Reviewed by Antti Koivisto.
+
+ * CMakeLists.txt: Removed WebResourceBuffer.cpp.
+
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::sendBuffer): Use a reference instead of pointer.
+ * NetworkProcess/NetworkResourceLoader.h: Ditto.
+ * NetworkProcess/mac/NetworkDiskCacheMonitor.h: Ditto.
+ * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
+ (WebKit::NetworkDiskCacheMonitor::resourceBecameFileBacked): Ditto.
+ * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
+ (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): Ditto.
+
+ * Shared/WebResourceBuffer.cpp: Removed.
+ * Shared/WebResourceBuffer.h: Removed.
+
+ * WebKit2.xcodeproj/project.pbxproj: Removed WebResourceBuffer.cpp/h.
+
+ * WebProcess/Network/NetworkProcessConnection.cpp: Removed unneeded includes.
+ (WebKit::NetworkProcessConnection::didCacheResource): Use a reference instead
+ of a pointer.
+
+ * WebProcess/Network/WebResourceLoadScheduler.cpp: Removed unneeded include.
+ * WebProcess/Network/WebResourceLoader.cpp: Ditto.
+ * WebProcess/Network/WebResourceLoader.h: Ditto.
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Ditto.
+ (WebKit::WebFrameLoaderClient::finishedLoading): Use SharedBuffer directly.
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::source): Ditto.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::runJavaScriptInMainFrame): Refactored to make the relationship
+ between the buffer and the DataReference clearer and to avoid having a long-lived
+ DataReference pointing to an underlying buffer with unclear lifetime.
+ (WebKit::WebPage::getContentsAsString): Ditto.
+ (WebKit::WebPage::getSelectionAsWebArchiveData): Ditto.
+ (WebKit::WebPage::getMainResourceDataOfFrame): Ditto. Also use SharedBuffer directly.
+ (WebKit::WebPage::getResourceDataFromFrame): Ditto.
+ (WebKit::WebPage::getWebArchiveOfFrame): Ditto.
+
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::containingLinkElement): Use elementLineage.
+ (WebKit::WebPage::performActionOnElement): Use references and SharedBuffer.
+ ALso did a bit of other cleanup in here.
+ (WebKit::isAssistableElement): Take Element& instead of Node*, since that's what
+ the caller has.
+ (WebKit::nextAssistableElement): Changed name to match what the function does.
+ Added an obviously-missing check on the startNode argument. Updated for change
+ to isAssistableElement above. Take a Page& instead of a Page*.
+ (WebKit::hasAssistableElement): Changed name to match what the function does.
+ Updated for change to nextAssistableElement above. Took out incorrect comparison
+ of a C++ pointer to the Objective-C object pointer nil. Take a Page& instead of a Page*.
+ (WebKit::WebPage::focusNextAssistedNode): Updated for above changes.
+ (WebKit::WebPage::getAssistedNodeInformation): Updated for above changes.
+
</ins><span class="cx"> 2014-11-04 Tim Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Dictionary lookup panel pops up at random when clicking on selected text
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> #include <WebCore/BlobDataFileReference.h>
</span><span class="cx"> #include <WebCore/CertificateInfo.h>
</span><span class="cx"> #include <WebCore/NotImplemented.h>
</span><del>-#include <WebCore/ResourceBuffer.h>
</del><span class="cx"> #include <WebCore/ResourceHandle.h>
</span><span class="cx"> #include <WebCore/SharedBuffer.h>
</span><span class="cx"> #include <WebCore/SynchronousLoaderClient.h>
</span><span class="lines">@@ -409,18 +408,20 @@
</span><span class="cx">
</span><span class="cx"> void NetworkResourceLoader::sendBuffer(WebCore::SharedBuffer* buffer, int encodedDataLength)
</span><span class="cx"> {
</span><ins>+ ASSERT(buffer);
</ins><span class="cx"> ASSERT(!isSynchronous());
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
</span><span class="cx"> ShareableResource::Handle shareableResourceHandle;
</span><del>- NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(shareableResourceHandle, buffer);
</del><ins>+ NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(shareableResourceHandle, *buffer);
</ins><span class="cx"> if (!shareableResourceHandle.isNull()) {
</span><del>- // Since we're delivering this resource by ourselves all at once and don't need anymore data or callbacks from the network layer, abort the loader.
</del><ins>+ // Since we're delivering this resource by ourselves all at once and don't need any more data or callbacks from the network layer, abort the loader.
</ins><span class="cx"> abort();
</span><span class="cx"> send(Messages::WebResourceLoader::DidReceiveResource(shareableResourceHandle, currentTime()));
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> IPC::SharedBufferDataReference dataReference(buffer);
</span><span class="cx"> sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveData(dataReference, encodedDataLength));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class BlobDataFileReference;
</span><del>-class ResourceBuffer;
</del><span class="cx"> class ResourceHandle;
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> }
</span><span class="lines">@@ -92,7 +91,7 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
</span><span class="cx"> static void tryGetShareableHandleFromCFURLCachedResponse(ShareableResource::Handle&, CFCachedURLResponseRef);
</span><del>- static void tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle&, WebCore::SharedBuffer*);
</del><ins>+ static void tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle&, WebCore::SharedBuffer&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacNetworkDiskCacheMonitorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> NetworkDiskCacheMonitor(CFCachedURLResponseRef, NetworkResourceLoader*);
</span><span class="cx">
</span><span class="cx"> // WebCore::DiskCacheMonitor
</span><del>- virtual void resourceBecameFileBacked(PassRefPtr<WebCore::SharedBuffer>) override;
</del><ins>+ virtual void resourceBecameFileBacked(WebCore::SharedBuffer&) override;
</ins><span class="cx">
</span><span class="cx"> // IPC::MessageSender
</span><span class="cx"> virtual IPC::Connection* messageSenderConnection() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacNetworkDiskCacheMonitormm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -59,10 +59,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkDiskCacheMonitor::resourceBecameFileBacked(PassRefPtr<SharedBuffer> fileBackedBuffer)
</del><ins>+void NetworkDiskCacheMonitor::resourceBecameFileBacked(SharedBuffer& fileBackedBuffer)
</ins><span class="cx"> {
</span><span class="cx"> ShareableResource::Handle handle;
</span><del>- NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(handle, fileBackedBuffer.get());
</del><ins>+ NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(handle, fileBackedBuffer);
</ins><span class="cx"> if (handle.isNull())
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacNetworkResourceLoaderMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> tryGetShareableHandleFromCFData(handle, data);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle& handle, SharedBuffer* buffer)
</del><ins>+void NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle& handle, SharedBuffer& buffer)
</ins><span class="cx"> {
</span><span class="cx"> static CFURLCacheRef cache = CFURLCacheCopySharedURLCache();
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> if (!cache)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- CFDataRef data = buffer->existingCFData();
</del><ins>+ CFDataRef data = buffer.existingCFData();
</ins><span class="cx"> if (!data)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -102,14 +102,16 @@
</span><span class="cx">
</span><span class="cx"> tryGetShareableHandleFromCFData(handle, data);
</span><span class="cx"> }
</span><del>-#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</del><span class="cx">
</span><ins>+#endif // IOS || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+
</ins><span class="cx"> size_t NetworkResourceLoader::fileBackedResourceMinimumSize()
</span><span class="cx"> {
</span><span class="cx"> return SharedMemory::systemPageSize();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE(CFNETWORK)
</span><ins>+
</ins><span class="cx"> void NetworkResourceLoader::willCacheResponseAsync(ResourceHandle* handle, CFCachedURLResponseRef cfResponse)
</span><span class="cx"> {
</span><span class="cx"> ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="lines">@@ -133,6 +135,7 @@
</span><span class="cx">
</span><span class="cx"> m_handle->continueWillCacheResponse(nsResponse);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif // !USE(CFNETWORK)
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCDataReferenceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/DataReference.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/DataReference.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/Platform/IPC/DataReference.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -83,21 +83,27 @@
</span><span class="cx"> size_t m_size;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-class SharedBufferDataReference: public DataReference {
</del><ins>+class SharedBufferDataReference : public DataReference {
</ins><span class="cx"> public:
</span><ins>+ // FIXME: This class doesn't handle null, so the argument should be a reference or PassRef.
</ins><span class="cx"> SharedBufferDataReference(WebCore::SharedBuffer* buffer)
</span><ins>+ : m_buffer(buffer)
</ins><span class="cx"> {
</span><del>- m_buffer = buffer;
</del><span class="cx"> }
</span><span class="cx">
</span><del>- size_t size() const { return m_buffer->size(); }
</del><ins>+private:
+ // FIXME: It is a bad idea to violate the Liskov Substitution Principle as we do here.
+ // Since we are using DataReference as a polymoprhic base class in this fashion,
+ // then we need it to be a base class that does not have functions such as isEmpty,
+ // size, data, and vector, all of which will do the wrong thing if they are called.
+ // Deleting these functions here does not prevent them from being called.
+ bool isEmpty() const = delete;
+ size_t size() const = delete;
</ins><span class="cx"> const uint8_t* data() const = delete;
</span><span class="cx"> Vector<uint8_t> vector() const = delete;
</span><span class="cx">
</span><del>- void encode(ArgumentEncoder&) const override;
- virtual ~SharedBufferDataReference() { m_buffer = 0; }
</del><ins>+ virtual void encode(ArgumentEncoder&) const override;
</ins><span class="cx">
</span><del>-private:
</del><span class="cx"> RefPtr<WebCore::SharedBuffer> m_buffer;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebResourceBuffercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/WebResourceBuffer.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebResourceBuffer.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/Shared/WebResourceBuffer.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebResourceBuffer.h"
-
-#if ENABLE(SHAREABLE_RESOURCE)
-
-#include "Logging.h"
-#include "ShareableResource.h"
-
-namespace WebKit {
-
-WebResourceBuffer::WebResourceBuffer(PassRefPtr<ShareableResource> resource)
- : m_resource(resource)
-{
- ASSERT(m_resource);
-}
-
-WebResourceBuffer::~WebResourceBuffer()
-{
-}
-
-const char* WebResourceBuffer::data() const
-{
- return reinterpret_cast<const char*>(m_resource->data());
-}
-
-unsigned WebResourceBuffer::size() const
-{
- return m_resource->size();
-}
-
-bool WebResourceBuffer::isEmpty() const
-{
- return !m_resource || !m_resource->size();
-}
-
-} // namespace WebKit
-
-#endif // ENABLE(SHAREABLE_RESOURCE)
</del></span></pre></div>
<a id="trunkSourceWebKit2SharedWebResourceBufferh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/WebResourceBuffer.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebResourceBuffer.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/Shared/WebResourceBuffer.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -1,57 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebResourceBuffer_h
-#define WebResourceBuffer_h
-
-#if ENABLE(SHAREABLE_RESOURCE)
-
-#include <WebCore/ResourceBuffer.h>
-
-namespace WebKit {
-
-class ShareableResource;
-
-class WebResourceBuffer : public WebCore::ResourceBuffer {
-public:
- static PassRefPtr<WebResourceBuffer> create(PassRefPtr<ShareableResource> resource) { return adoptRef(new WebResourceBuffer(resource)); }
-
- virtual ~WebResourceBuffer() override;
-
- virtual const char* data() const override;
- virtual unsigned size() const override;
- virtual bool isEmpty() const override;
-
-private:
- WebResourceBuffer(PassRefPtr<ShareableResource>);
-
- RefPtr<ShareableResource> m_resource;
-};
-
-} // namespace WebKit
-
-#endif // ENABLE(SHAREABLE_RESOURCE)
-
-#endif // WebResourceBuffer_h
</del></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -821,8 +821,6 @@
</span><span class="cx">                 512127C41908239A00DAF35C /* WebPasteboardOverrides.h in Headers */ = {isa = PBXBuildFile; fileRef = 512127C21908239A00DAF35C /* WebPasteboardOverrides.h */; };
</span><span class="cx">                 51217460164C20E30037A5C1 /* ShareableResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5121745E164C20E30037A5C1 /* ShareableResource.cpp */; };
</span><span class="cx">                 51217461164C20E30037A5C1 /* ShareableResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 5121745F164C20E30037A5C1 /* ShareableResource.h */; };
</span><del>-                51217464164C21370037A5C1 /* WebResourceBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51217462164C21370037A5C1 /* WebResourceBuffer.cpp */; };
-                51217465164C21370037A5C1 /* WebResourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 51217463164C21370037A5C1 /* WebResourceBuffer.h */; };
</del><span class="cx">                 5123CF1B133D260A0056F800 /* WKIconDatabaseCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5123CF19133D260A0056F800 /* WKIconDatabaseCG.cpp */; };
</span><span class="cx">                 5123CF1C133D260A0056F800 /* WKIconDatabaseCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 5123CF1A133D260A0056F800 /* WKIconDatabaseCG.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51290992183ACEAF005522A6 /* WebIDBServerConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51290990183ACEAF005522A6 /* WebIDBServerConnection.cpp */; };
</span><span class="lines">@@ -2852,8 +2850,6 @@
</span><span class="cx">                 512127C21908239A00DAF35C /* WebPasteboardOverrides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardOverrides.h; sourceTree = "<group>"; };
</span><span class="cx">                 5121745E164C20E30037A5C1 /* ShareableResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShareableResource.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5121745F164C20E30037A5C1 /* ShareableResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareableResource.h; sourceTree = "<group>"; };
</span><del>-                51217462164C21370037A5C1 /* WebResourceBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceBuffer.cpp; sourceTree = "<group>"; };
-                51217463164C21370037A5C1 /* WebResourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceBuffer.h; sourceTree = "<group>"; };
</del><span class="cx">                 5123CF19133D260A0056F800 /* WKIconDatabaseCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WKIconDatabaseCG.cpp; path = cg/WKIconDatabaseCG.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5123CF1A133D260A0056F800 /* WKIconDatabaseCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKIconDatabaseCG.h; path = cg/WKIconDatabaseCG.h; sourceTree = "<group>"; };
</span><span class="cx">                 51290990183ACEAF005522A6 /* WebIDBServerConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBServerConnection.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -4525,8 +4521,6 @@
</span><span class="cx">                                 37948402150C350600E52CE9 /* WebRenderLayer.h */,
</span><span class="cx">                                 3760881C150413E900FC82C7 /* WebRenderObject.cpp */,
</span><span class="cx">                                 3760881D150413E900FC82C7 /* WebRenderObject.h */,
</span><del>-                                51217462164C21370037A5C1 /* WebResourceBuffer.cpp */,
-                                51217463164C21370037A5C1 /* WebResourceBuffer.h */,
</del><span class="cx">                                 F634445512A885C8000612D8 /* WebSecurityOrigin.h */,
</span><span class="cx">                                 A72D5D7F1236CBA800A88B15 /* WebSerializedScriptValue.h */,
</span><span class="cx">                                 C0337DD7127A51B6008FF4F4 /* WebTouchEvent.cpp */,
</span><span class="lines">@@ -7602,7 +7596,6 @@
</span><span class="cx">                                 51E351F6180F5C7500E53BE9 /* WebIDBFactoryBackend.h in Headers */,
</span><span class="cx">                                 2D29ECD0192F2C2E00984B78 /* RemoteLayerTreeDisplayRefreshMonitor.h in Headers */,
</span><span class="cx">                                 3760881F150413E900FC82C7 /* WebRenderObject.h in Headers */,
</span><del>-                                51217465164C21370037A5C1 /* WebResourceBuffer.h in Headers */,
</del><span class="cx">                                 33367630130C9998006C9DE2 /* WebResourceCacheManager.h in Headers */,
</span><span class="cx">                                 1AAF089B19267EE500B6390C /* WKUserScript.h in Headers */,
</span><span class="cx">                                 33367656130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h in Headers */,
</span><span class="lines">@@ -9284,7 +9277,6 @@
</span><span class="cx">                                 37948403150C350600E52CE9 /* WebRenderLayer.cpp in Sources */,
</span><span class="cx">                                 2D28F3E61885CCC1004B9EAE /* WebEditorClientIOS.mm in Sources */,
</span><span class="cx">                                 3760881E150413E900FC82C7 /* WebRenderObject.cpp in Sources */,
</span><del>-                                51217464164C21370037A5C1 /* WebResourceBuffer.cpp in Sources */,
</del><span class="cx">                                 3336762F130C9998006C9DE2 /* WebResourceCacheManager.cpp in Sources */,
</span><span class="cx">                                 E115C714190F89E400ECC516 /* DatabaseProcessIOS.mm in Sources */,
</span><span class="cx">                                 33F9D5B91312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -30,12 +30,10 @@
</span><span class="cx"> #include "NetworkConnectionToWebProcessMessages.h"
</span><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include "WebProcess.h"
</span><del>-#include "WebResourceBuffer.h"
</del><span class="cx"> #include "WebResourceLoadScheduler.h"
</span><span class="cx"> #include "WebResourceLoaderMessages.h"
</span><span class="cx"> #include <WebCore/CachedResource.h>
</span><span class="cx"> #include <WebCore/MemoryCache.h>
</span><del>-#include <WebCore/ResourceBuffer.h>
</del><span class="cx"> #include <WebCore/SessionID.h>
</span><span class="cx"> #include <WebCore/SharedBuffer.h>
</span><span class="cx">
</span><span class="lines">@@ -95,7 +93,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- resource->tryReplaceEncodedData(buffer.release());
</del><ins>+ resource->tryReplaceEncodedData(*buffer);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebResourceLoadSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> #include <WebCore/FrameLoader.h>
</span><span class="cx"> #include <WebCore/NetscapePlugInStreamLoader.h>
</span><span class="cx"> #include <WebCore/ReferrerPolicy.h>
</span><del>-#include <WebCore/ResourceBuffer.h>
</del><span class="cx"> #include <WebCore/ResourceLoader.h>
</span><span class="cx"> #include <WebCore/SessionID.h>
</span><span class="cx"> #include <WebCore/Settings.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include <WebCore/ApplicationCacheHost.h>
</span><span class="cx"> #include <WebCore/CertificateInfo.h>
</span><span class="cx"> #include <WebCore/DocumentLoader.h>
</span><del>-#include <WebCore/ResourceBuffer.h>
</del><span class="cx"> #include <WebCore/ResourceError.h>
</span><span class="cx"> #include <WebCore/ResourceLoader.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.h (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.h        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.h        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class CertificateInfo;
</span><span class="cx"> class ProtectionSpace;
</span><del>-class ResourceBuffer;
</del><span class="cx"> class ResourceError;
</span><span class="cx"> class ResourceLoader;
</span><span class="cx"> class ResourceRequest;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx"> #include <WebCore/PluginData.h>
</span><span class="cx"> #include <WebCore/PluginDocument.h>
</span><span class="cx"> #include <WebCore/ProgressTracker.h>
</span><del>-#include <WebCore/ResourceBuffer.h>
</del><span class="cx"> #include <WebCore/ResourceError.h>
</span><span class="cx"> #include <WebCore/ScriptController.h>
</span><span class="cx"> #include <WebCore/Settings.h>
</span><span class="lines">@@ -919,7 +918,7 @@
</span><span class="cx"> if (!webPage)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- RefPtr<ResourceBuffer> mainResourceData = loader->mainResourceData();
</del><ins>+ RefPtr<SharedBuffer> mainResourceData = loader->mainResourceData();
</ins><span class="cx"> IPC::DataReference dataReference(reinterpret_cast<const uint8_t*>(mainResourceData ? mainResourceData->data() : 0), mainResourceData ? mainResourceData->size() : 0);
</span><span class="cx"> webPage->send(Messages::WebPageProxy::DidFinishLoadingDataForCustomContentProvider(loader->response().suggestedFilename(), dataReference));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -65,7 +65,6 @@
</span><span class="cx"> #include <WebCore/Page.h>
</span><span class="cx"> #include <WebCore/PluginDocument.h>
</span><span class="cx"> #include <WebCore/RenderTreeAsText.h>
</span><del>-#include <WebCore/ResourceBuffer.h>
</del><span class="cx"> #include <WebCore/ResourceLoader.h>
</span><span class="cx"> #include <WebCore/ScriptController.h>
</span><span class="cx"> #include <WebCore/SecurityOrigin.h>
</span><span class="lines">@@ -305,7 +304,7 @@
</span><span class="cx"> DocumentLoader* documentLoader = m_coreFrame->loader().activeDocumentLoader();
</span><span class="cx"> if (!documentLoader)
</span><span class="cx"> return String();
</span><del>- RefPtr<ResourceBuffer> mainResourceData = documentLoader->mainResourceData();
</del><ins>+ RefPtr<SharedBuffer> mainResourceData = documentLoader->mainResourceData();
</ins><span class="cx"> if (!mainResourceData)
</span><span class="cx"> return String();
</span><span class="cx"> return decoder->encoding().decode(mainResourceData->data(), mainResourceData->size());
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -137,7 +137,6 @@
</span><span class="cx"> #include <WebCore/RenderLayer.h>
</span><span class="cx"> #include <WebCore/RenderTreeAsText.h>
</span><span class="cx"> #include <WebCore/RenderView.h>
</span><del>-#include <WebCore/ResourceBuffer.h>
</del><span class="cx"> #include <WebCore/ResourceRequest.h>
</span><span class="cx"> #include <WebCore/ResourceResponse.h>
</span><span class="cx"> #include <WebCore/RuntimeEnabledFeatures.h>
</span><span class="lines">@@ -2435,17 +2434,16 @@
</span><span class="cx"> // NOTE: We need to be careful when running scripts that the objects we depend on don't
</span><span class="cx"> // disappear during script execution.
</span><span class="cx">
</span><del>- // Retain the SerializedScriptValue at this level so it (and the internal data) lives
- // long enough for the DataReference to be encoded by the sent message.
</del><span class="cx"> RefPtr<SerializedScriptValue> serializedResultValue;
</span><del>- IPC::DataReference dataReference;
-
</del><span class="cx"> JSLockHolder lock(JSDOMWindow::commonVM());
</span><span class="cx"> if (JSValue resultValue = m_mainFrame->coreFrame()->script().executeScript(script, true).jsValue()) {
</span><del>- if ((serializedResultValue = SerializedScriptValue::create(m_mainFrame->jsContext(), toRef(m_mainFrame->coreFrame()->script().globalObject(mainThreadNormalWorld())->globalExec(), resultValue), 0)))
- dataReference = serializedResultValue->data();
</del><ins>+ serializedResultValue = SerializedScriptValue::create(m_mainFrame->jsContext(),
+ toRef(m_mainFrame->coreFrame()->script().globalObject(mainThreadNormalWorld())->globalExec(), resultValue), nullptr);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ IPC::DataReference dataReference;
+ if (serializedResultValue)
+ dataReference = serializedResultValue->data();
</ins><span class="cx"> send(Messages::WebPageProxy::ScriptValueCallback(dataReference, callbackID));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2458,15 +2456,14 @@
</span><span class="cx"> #if ENABLE(MHTML)
</span><span class="cx"> void WebPage::getContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding)
</span><span class="cx"> {
</span><del>- IPC::DataReference dataReference;
-
</del><span class="cx"> RefPtr<SharedBuffer> buffer = useBinaryEncoding
</span><span class="cx"> ? MHTMLArchive::generateMHTMLDataUsingBinaryEncoding(m_page.get())
</span><span class="cx"> : MHTMLArchive::generateMHTMLData(m_page.get());
</span><span class="cx">
</span><ins>+ // FIXME: Use SharedBufferDataReference.
+ IPC::DataReference dataReference;
</ins><span class="cx"> if (buffer)
</span><span class="cx"> dataReference = IPC::DataReference(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size());
</span><del>-
</del><span class="cx"> send(Messages::WebPageProxy::DataCallback(dataReference, callbackID));
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -2489,20 +2486,17 @@
</span><span class="cx">
</span><span class="cx"> void WebPage::getSelectionAsWebArchiveData(uint64_t callbackID)
</span><span class="cx"> {
</span><del>- IPC::DataReference dataReference;
-
</del><span class="cx"> #if PLATFORM(COCOA)
</span><del>- RefPtr<LegacyWebArchive> archive;
</del><span class="cx"> RetainPtr<CFDataRef> data;
</span><ins>+ if (Frame* frame = frameWithSelection(m_page.get()))
+ data = LegacyWebArchive::createFromSelection(frame)->rawDataRepresentation();
+#endif
</ins><span class="cx">
</span><del>- Frame* frame = frameWithSelection(m_page.get());
- if (frame) {
- archive = LegacyWebArchive::createFromSelection(frame);
- data = archive->rawDataRepresentation();
</del><ins>+ IPC::DataReference dataReference;
+#if PLATFORM(COCOA)
+ if (data)
</ins><span class="cx"> dataReference = IPC::DataReference(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()));
</span><del>- }
</del><span class="cx"> #endif
</span><del>-
</del><span class="cx"> send(Messages::WebPageProxy::DataCallback(dataReference, callbackID));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2525,24 +2519,20 @@
</span><span class="cx">
</span><span class="cx"> void WebPage::getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID)
</span><span class="cx"> {
</span><del>- IPC::DataReference dataReference;
-
- RefPtr<ResourceBuffer> buffer;
- RefPtr<SharedBuffer> pdfResource;
</del><ins>+ RefPtr<SharedBuffer> buffer;
</ins><span class="cx"> if (WebFrame* frame = WebProcess::shared().webFrame(frameID)) {
</span><del>- if (PluginView* pluginView = pluginViewForFrame(frame->coreFrame())) {
- if ((pdfResource = pluginView->liveResourceData()))
- dataReference = IPC::DataReference(reinterpret_cast<const uint8_t*>(pdfResource->data()), pdfResource->size());
</del><ins>+ if (PluginView* pluginView = pluginViewForFrame(frame->coreFrame()))
+ buffer = pluginView->liveResourceData();
+ if (!buffer) {
+ if (DocumentLoader* loader = frame->coreFrame()->loader().documentLoader())
+ buffer = loader->mainResourceData();
</ins><span class="cx"> }
</span><del>-
- if (dataReference.isEmpty()) {
- if (DocumentLoader* loader = frame->coreFrame()->loader().documentLoader()) {
- if ((buffer = loader->mainResourceData()))
- dataReference = IPC::DataReference(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size());
- }
- }
</del><span class="cx"> }
</span><span class="cx">
</span><ins>+ // FIXME: Use SharedBufferDataReference.
+ IPC::DataReference dataReference;
+ if (buffer)
+ dataReference = IPC::DataReference(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size());
</ins><span class="cx"> send(Messages::WebPageProxy::DataCallback(dataReference, callbackID));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2561,38 +2551,38 @@
</span><span class="cx">
</span><span class="cx"> void WebPage::getResourceDataFromFrame(uint64_t frameID, const String& resourceURLString, uint64_t callbackID)
</span><span class="cx"> {
</span><del>- IPC::DataReference dataReference;
- URL resourceURL(URL(), resourceURLString);
-
</del><span class="cx"> RefPtr<SharedBuffer> buffer;
</span><span class="cx"> if (WebFrame* frame = WebProcess::shared().webFrame(frameID)) {
</span><ins>+ URL resourceURL(URL(), resourceURLString);
</ins><span class="cx"> buffer = resourceDataForFrame(frame->coreFrame(), resourceURL);
</span><span class="cx"> if (!buffer) {
</span><span class="cx"> // Try to get the resource data from the cache.
</span><span class="cx"> buffer = cachedResponseDataForURL(resourceURL);
</span><span class="cx"> }
</span><del>-
- if (buffer)
- dataReference = IPC::DataReference(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size());
</del><span class="cx"> }
</span><span class="cx">
</span><ins>+ // FIXME: Use SharedBufferDataReference.
+ IPC::DataReference dataReference;
+ if (buffer)
+ dataReference = IPC::DataReference(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size());
</ins><span class="cx"> send(Messages::WebPageProxy::DataCallback(dataReference, callbackID));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPage::getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID)
</span><span class="cx"> {
</span><del>- IPC::DataReference dataReference;
-
</del><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> RetainPtr<CFDataRef> data;
</span><del>- if (WebFrame* frame = WebProcess::shared().webFrame(frameID)) {
- if ((data = frame->webArchiveData(0, 0)))
- dataReference = IPC::DataReference(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()));
- }
</del><ins>+ if (WebFrame* frame = WebProcess::shared().webFrame(frameID))
+ data = frame->webArchiveData(nullptr, nullptr);
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(frameID);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ IPC::DataReference dataReference;
+#if PLATFORM(COCOA)
+ if (data)
+ dataReference = IPC::DataReference(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()));
+#endif
</ins><span class="cx"> send(Messages::WebPageProxy::DataCallback(dataReference, callbackID));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (175548 => 175549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-11-04 16:17:50 UTC (rev 175548)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-11-04 16:47:53 UTC (rev 175549)
</span><span class="lines">@@ -81,7 +81,6 @@
</span><span class="cx"> #import <WebCore/RenderImage.h>
</span><span class="cx"> #import <WebCore/RenderThemeIOS.h>
</span><span class="cx"> #import <WebCore/RenderView.h>
</span><del>-#import <WebCore/ResourceBuffer.h>
</del><span class="cx"> #import <WebCore/SharedBuffer.h>
</span><span class="cx"> #import <WebCore/TextIterator.h>
</span><span class="cx"> #import <WebCore/VisibleUnits.h>
</span><span class="lines">@@ -1842,10 +1841,11 @@
</span><span class="cx">
</span><span class="cx"> static Element* containingLinkElement(Element* element)
</span><span class="cx"> {
</span><del>- for (Element* currentElement = element; currentElement; currentElement = currentElement->parentElement())
- if (currentElement->isLink())
- return currentElement;
- return 0;
</del><ins>+ for (auto& currentElement : elementLineage(element)) {
+ if (currentElement.isLink())
+ return &currentElement;
+ }
+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPage::getPositionInformation(const IntPoint& point, InteractionInformationAtPosition& info)
</span><span class="lines">@@ -1949,73 +1949,77 @@
</span><span class="cx"> if (!is<HTMLElement>(m_interactionNode.get()))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- HTMLElement* element = downcast<HTMLElement>(m_interactionNode.get());
- if (!element->renderer())
</del><ins>+ HTMLElement& element = downcast<HTMLElement>(*m_interactionNode);
+ if (!element.renderer())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (static_cast<SheetAction>(action) == SheetAction::Copy) {
</span><del>- if (is<RenderImage>(*element->renderer())) {
- Element* linkElement = containingLinkElement(element);
-
</del><ins>+ if (is<RenderImage>(*element.renderer())) {
+ Element* linkElement = containingLinkElement(&element);
</ins><span class="cx"> if (!linkElement)
</span><del>- m_interactionNode->document().frame()->editor().writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), *element, downcast<RenderImage>(*element->renderer()).cachedImage()->url(), String());
</del><ins>+ m_interactionNode->document().frame()->editor().writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), element, downcast<RenderImage>(*element.renderer()).cachedImage()->url(), String());
</ins><span class="cx"> else
</span><del>- m_interactionNode->document().frame()->editor().copyURL(linkElement->document().completeURL(stripLeadingAndTrailingHTMLSpaces(linkElement->getAttribute(HTMLNames::hrefAttr))), linkElement->textContent());
- } else if (element->isLink()) {
- m_interactionNode->document().frame()->editor().copyURL(element->document().completeURL(stripLeadingAndTrailingHTMLSpaces(element->getAttribute(HTMLNames::hrefAttr))), element->textContent());
</del><ins>+ m_interactionNode->document().frame()->editor().copyURL(linkElement->document().completeURL(stripLeadingAndTrailingHTMLSpaces(linkElement->fastGetAttribute(HTMLNames::hrefAttr))), linkElement->textContent());
+ } else if (element.isLink()) {
+ m_interactionNode->document().frame()->editor().copyURL(element.document().completeURL(stripLeadingAndTrailingHTMLSpaces(element.fastGetAttribute(HTMLNames::hrefAttr))), element.textContent());
</ins><span class="cx"> }
</span><span class="cx"> } else if (static_cast<SheetAction>(action) == SheetAction::SaveImage) {
</span><del>- if (!is<RenderImage>(*element->renderer()))
</del><ins>+ if (!is<RenderImage>(*element.renderer()))
</ins><span class="cx"> return;
</span><del>- if (CachedImage* cachedImage = downcast<RenderImage>(*element->renderer()).cachedImage()) {
- SharedMemory::Handle handle;
- RefPtr<SharedBuffer> buffer = cachedImage->resourceBuffer()->sharedBuffer();
- if (buffer) {
- uint64_t bufferSize = buffer->size();
- RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::create(bufferSize);
- memcpy(sharedMemoryBuffer->data(), buffer->data(), bufferSize);
- sharedMemoryBuffer->createHandle(handle, SharedMemory::ReadOnly);
- send(Messages::WebPageProxy::SaveImageToLibrary(handle, bufferSize));
- }
- }
</del><ins>+ CachedImage* cachedImage = downcast<RenderImage>(*element.renderer()).cachedImage();
+ if (!cachedImage)
+ return;
+ buffer = cachedImage->resourceBuffer();
+ if (!buffer)
+ return;
+ uint64_t bufferSize = buffer->size();
+ RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::create(bufferSize);
+ memcpy(sharedMemoryBuffer->data(), buffer->data(), bufferSize);
+ SharedMemory::Handle handle;
+ sharedMemoryBuffer->createHandle(handle, SharedMemory::ReadOnly);
+ send(Messages::WebPageProxy::SaveImageToLibrary(handle, bufferSize));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline bool isAssistableNode(Node* node)
</del><ins>+static inline bool isAssistableElement(Element& node)
</ins><span class="cx"> {
</span><del>- if (is<HTMLSelectElement>(*node))
</del><ins>+ if (is<HTMLSelectElement>(node))
</ins><span class="cx"> return true;
</span><del>- if (is<HTMLTextAreaElement>(*node))
- return !downcast<HTMLTextAreaElement>(*node).isReadOnlyNode();
- if (is<HTMLInputElement>(*node)) {
- HTMLInputElement& element = downcast<HTMLInputElement>(*node);
- return !element.isReadOnlyNode() && (element.isTextField() || element.isDateField() || element.isDateTimeLocalField() || element.isMonthField() || element.isTimeField());
</del><ins>+ if (is<HTMLTextAreaElement>(node))
+ return !downcast<HTMLTextAreaElement>(node).isReadOnlyNode();
+ if (is<HTMLInputElement>(node)) {
+ HTMLInputElement& inputElement = downcast<HTMLInputElement>(node);
+ // FIXME: This laundry list of types is not a good way to factor this. Need a suitable function on HTMLInputElement itself.
+ return !inputElement.isReadOnlyNode() && (inputElement.isTextField() || inputElement.isDateField() || inputElement.isDateTimeLocalField() || inputElement.isMonthField() || inputElement.isTimeField());
</ins><span class="cx"> }
</span><del>-
- return node->isContentEditable();
</del><ins>+ return node.isContentEditable();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static inline Element* nextFocusableElement(Node* startNode, Page* page, bool isForward)
</del><ins>+static inline Element* nextAssistableElement(Node* startNode, Page& page, bool isForward)
</ins><span class="cx"> {
</span><ins>+ if (!is<Element>(startNode))
+ return nullptr;
+
</ins><span class="cx"> RefPtr<KeyboardEvent> key = KeyboardEvent::create();
</span><span class="cx">
</span><span class="cx"> Element* nextElement = downcast<Element>(startNode);
</span><span class="cx"> do {
</span><del>- nextElement = isForward ? page->focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&nextElement->document()), nextElement, key.get())
- : page->focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&nextElement->document()), nextElement, key.get());
- } while (nextElement && !isAssistableNode(nextElement));
</del><ins>+ nextElement = isForward
+ ? page.focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&nextElement->document()), nextElement, key.get())
+ : page.focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&nextElement->document()), nextElement, key.get());
+ } while (nextElement && !isAssistableElement(*nextElement));
</ins><span class="cx">
</span><span class="cx"> return nextElement;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline bool hasFocusableElement(Node* startNode, Page* page, bool isForward)
</del><ins>+static inline bool hasAssistableElement(Node* startNode, Page& page, bool isForward)
</ins><span class="cx"> {
</span><del>- return nextFocusableElement(startNode, page, isForward) != nil;
</del><ins>+ return nextAssistableElement(startNode, page, isForward);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPage::focusNextAssistedNode(bool isForward)
</span><span class="cx"> {
</span><del>- Element* nextElement = nextFocusableElement(m_assistedNode.get(), m_page.get(), isForward);
</del><ins>+ Element* nextElement = nextAssistableElement(m_assistedNode.get(), *m_page, isForward);
</ins><span class="cx"> m_userIsInteracting = true;
</span><span class="cx"> if (nextElement)
</span><span class="cx"> nextElement->focus();
</span><span class="lines">@@ -2056,8 +2060,8 @@
</span><span class="cx"> information.minimumScaleFactor = minimumPageScaleFactor();
</span><span class="cx"> information.maximumScaleFactor = maximumPageScaleFactor();
</span><span class="cx"> information.allowsUserScaling = m_viewportConfiguration.allowsUserScaling();
</span><del>- information.hasNextNode = hasFocusableElement(m_assistedNode.get(), m_page.get(), true);
- information.hasPreviousNode = hasFocusableElement(m_assistedNode.get(), m_page.get(), false);
</del><ins>+ information.hasNextNode = hasAssistableElement(m_assistedNode.get(), *m_page, true);
+ information.hasPreviousNode = hasAssistableElement(m_assistedNode.get(), *m_page, false);
</ins><span class="cx">
</span><span class="cx"> if (is<HTMLSelectElement>(*m_assistedNode)) {
</span><span class="cx"> HTMLSelectElement& element = downcast<HTMLSelectElement>(*m_assistedNode);
</span></span></pre>
</div>
</div>
</body>
</html>