<!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>[175406] 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/175406">175406</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-10-30 21:25:34 -0700 (Thu, 30 Oct 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&lt;SharedBuffer&gt;. Would be better if it returned a SharedBuffer&amp;,
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 &quot;schedule&quot; 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&amp;.

* 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&amp; 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&lt;ResourceBuffer&gt;.

* 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&amp; 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&amp; 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&amp; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-10-31 04:25:34 UTC (rev 175406)
</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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/ChangeLog        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -1,3 +1,205 @@
</span><ins>+2014-10-30  Darin Adler  &lt;darin@apple.com&gt;
+
+        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&lt;SharedBuffer&gt;. Would be better if it returned a SharedBuffer&amp;,
+        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 &quot;schedule&quot; 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&amp;.
+
+        * 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&amp; 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&lt;ResourceBuffer&gt;.
+
+        * 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-10-30  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move border-image-source / -webkit-mask-box-image-source to the new StyleBuilder
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -340,7 +340,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">@@ -383,13 +383,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">@@ -1728,9 +1721,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">@@ -2803,7 +2793,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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -7251,7 +7251,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\PolicyCallback.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\PolicyChecker.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\ProgressTracker.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\loader\ResourceBuffer.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\loader\ResourceLoader.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\cf\ResourceLoaderCFNet.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\ResourceLoadNotifier.cpp&quot; /&gt;
</span><span class="lines">@@ -19254,7 +19253,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\PolicyChecker.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\ProgressTracker.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\ProgressTrackerClient.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\loader\ResourceBuffer.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\loader\ResourceLoader.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\ResourceLoaderOptions.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\ResourceLoadNotifier.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -927,9 +927,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\ProgressTracker.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\loader\ResourceBuffer.cpp&quot;&gt;
-      &lt;Filter&gt;loader&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\loader\ResourceLoader.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -7950,9 +7947,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\ProgressTrackerClient.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\loader\ResourceBuffer.h&quot;&gt;
-      &lt;Filter&gt;loader&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\loader\ResourceLoader.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -1868,9 +1868,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">@@ -8980,9 +8977,6 @@
</span><span class="cx">                 51405C87190B014400754F94 /* SelectionRectGatherer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionRectGatherer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 514B3F720C722047000530DF /* FileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystem.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 514B3F750C722055000530DF /* FileSystemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileSystemMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                514BC83D161CF043004D52F4 /* ResourceBuffer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceBuffer.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
-                514BC840161CF05C004D52F4 /* ResourceBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceBuffer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                514BC841161CF05C004D52F4 /* ResourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceBuffer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 514C76350CE9225E007EF3CD /* JSSQLError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLError.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 514C76360CE9225E007EF3CD /* JSSQLTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransaction.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 514C76420CE9234E007EF3CD /* AuthenticationMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17630,7 +17624,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">@@ -21298,8 +21291,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">@@ -25862,7 +25853,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">@@ -29330,8 +29320,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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -62,7 +62,6 @@
</span><span class="cx"> #import &quot;RenderObject.h&quot;
</span><span class="cx"> #import &quot;RenderStyleConstants.h&quot;
</span><span class="cx"> #import &quot;RenderText.h&quot;
</span><del>-#import &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #import &quot;SharedBuffer.h&quot;
</span><span class="cx"> #import &quot;VisiblePosition.h&quot;
</span><span class="cx"> #import &quot;VisibleUnits.h&quot;
</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)-&gt;cachedImage();
</del><ins>+    WebCore::CachedImage* cachedImage = core(self)-&gt;cachedImage();
</ins><span class="cx">     if (!cachedImage)
</span><span class="cx">         return nil;
</span><del>-    WebCore::Image *image = cachedImage-&gt;image();
</del><ins>+    WebCore::Image* image = cachedImage-&gt;image();
</ins><span class="cx">     if (!image)
</span><span class="cx">         return nil;
</span><del>-    WebCore::SharedBuffer *data = nil;
-    if (rawImageData) {
-        ResourceBuffer *resourceBuffer = cachedImage-&gt;resourceBuffer();
-        if (resourceBuffer)
-            data = resourceBuffer-&gt;sharedBuffer();
-    } else {
-        data = image-&gt;data();
-    }
</del><ins>+    WebCore::SharedBuffer* data = rawImageData ? cachedImage-&gt;resourceBuffer() : image-&gt;data();
</ins><span class="cx">     if (!data)
</span><span class="cx">         return nil;
</span><del>-
</del><span class="cx">     return data-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ios/EditorIOS.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/editing/ios/EditorIOS.mm        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -49,7 +49,6 @@
</span><span class="cx"> #include &quot;Pasteboard.h&quot;
</span><span class="cx"> #include &quot;RenderBlock.h&quot;
</span><span class="cx"> #include &quot;RenderImage.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><span class="cx"> #include &quot;SoftLinking.h&quot;
</span><span class="cx"> #include &quot;StyleProperties.h&quot;
</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-&gt;response().mimeType());
</span><del>-    pasteboardImage.resourceData = cachedImage-&gt;resourceBuffer()-&gt;sharedBuffer();
</del><ins>+    pasteboardImage.resourceData = cachedImage-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/EditorMac.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -52,7 +52,6 @@
</span><span class="cx"> #import &quot;Range.h&quot;
</span><span class="cx"> #import &quot;RenderBlock.h&quot;
</span><span class="cx"> #import &quot;RenderImage.h&quot;
</span><del>-#import &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #import &quot;RuntimeApplicationChecks.h&quot;
</span><span class="cx"> #import &quot;Sound.h&quot;
</span><span class="cx"> #import &quot;StyleProperties.h&quot;
</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()-&gt;userVisibleString(pasteboardImage.url.url);
</span><del>-    pasteboardImage.resourceData = cachedImage-&gt;resourceBuffer()-&gt;sharedBuffer();
</del><ins>+    pasteboardImage.resourceData = cachedImage-&gt;resourceBuffer();
</ins><span class="cx">     pasteboardImage.resourceMIMEType = cachedImage-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageDocument.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/html/ImageDocument.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;RawDataDocumentParser.h&quot;
</span><span class="cx"> #include &quot;RenderElement.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;Settings.h&quot;
</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-&gt;cachedImage()-&gt;addDataBuffer(loader()-&gt;mainResourceData().get());
</del><ins>+    if (RefPtr&lt;SharedBuffer&gt; buffer = loader()-&gt;mainResourceData())
+        m_imageElement-&gt;cachedImage()-&gt;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()-&gt;isStopped() &amp;&amp; m_imageElement) {
</span><span class="cx">         CachedImage&amp; cachedImage = *m_imageElement-&gt;cachedImage();
</span><del>-        RefPtr&lt;ResourceBuffer&gt; data = loader()-&gt;mainResourceData();
</del><ins>+        RefPtr&lt;SharedBuffer&gt; data = loader()-&gt;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()-&gt;isLoadingMultipartContent())
</del><ins>+        if (data &amp;&amp; loader()-&gt;isLoadingMultipartContent())
</ins><span class="cx">             data = data-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -62,7 +62,6 @@
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;ScriptController.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</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&lt;SharedBuffer&gt; buffer = hasZeroSize ? SharedBuffer::create() : cachedResource-&gt;resourceBuffer()-&gt;sharedBuffer();
-
</del><ins>+        RefPtr&lt;SharedBuffer&gt; buffer = hasZeroSize ? SharedBuffer::create() : cachedResource-&gt;resourceBuffer();
</ins><span class="cx">         if (!buffer)
</span><span class="cx">             return false;
</span><del>-
</del><span class="cx">         *result = base64Encode(buffer-&gt;data(), buffer-&gt;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&lt;CachedScript&gt;(*cachedResource).script();
</span><span class="cx">             return true;
</span><span class="cx">         case CachedResource::RawResource: {
</span><del>-            ResourceBuffer* buffer = cachedResource-&gt;resourceBuffer();
</del><ins>+            auto* buffer = cachedResource-&gt;resourceBuffer();
</ins><span class="cx">             if (!buffer)
</span><span class="cx">                 return false;
</span><span class="cx">             RefPtr&lt;TextResourceDecoder&gt; decoder = createXHRTextDecoder(cachedResource-&gt;response().mimeType(), cachedResource-&gt;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-&gt;resourceBuffer();
</del><ins>+            auto* buffer = cachedResource-&gt;resourceBuffer();
</ins><span class="cx">             return decodeBuffer(buffer ? buffer-&gt;data() : nullptr, buffer ? buffer-&gt;size() : 0, cachedResource-&gt;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&lt;ResourceBuffer&gt; buffer = frame-&gt;loader().documentLoader()-&gt;mainResourceData();
</del><ins>+    RefPtr&lt;SharedBuffer&gt; buffer = frame-&gt;loader().documentLoader()-&gt;mainResourceData();
</ins><span class="cx">     if (!buffer)
</span><span class="cx">         return false;
</span><del>-    String textEncodingName = frame-&gt;document()-&gt;inputEncoding();
-
-    return InspectorPageAgent::dataContent(buffer-&gt;data(), buffer-&gt;size(), textEncodingName, withBase64Encode, result);
</del><ins>+    return InspectorPageAgent::dataContent(buffer-&gt;data(), buffer-&gt;size(), frame-&gt;document()-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -54,7 +54,6 @@
</span><span class="cx"> #include &quot;NetworkResourcesData.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;ProgressTracker.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;ResourceError.h&quot;
</span><span class="cx"> #include &quot;ResourceLoader.h&quot;
</span><span class="cx"> #include &quot;ResourceRequest.h&quot;
</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-&gt;resourceType(requestId) == InspectorPageAgent::DocumentResource) {
</span><del>-        RefPtr&lt;ResourceBuffer&gt; buffer = loader-&gt;frameLoader()-&gt;documentLoader()-&gt;mainResourceData();
-        m_resourcesData-&gt;addResourceSharedBuffer(requestId, buffer ? buffer-&gt;sharedBuffer() : nullptr, loader-&gt;frame()-&gt;document()-&gt;inputEncoding());
</del><ins>+        m_resourcesData-&gt;addResourceSharedBuffer(requestId,
+            loader-&gt;frameLoader()-&gt;documentLoader()-&gt;mainResourceData(),
+            loader-&gt;frame()-&gt;document()-&gt;inputEncoding());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_resourcesData-&gt;maybeDecodeDataToContent(requestId);
</span><span class="lines">@@ -435,8 +435,9 @@
</span><span class="cx">     if (m_resourcesData-&gt;resourceType(requestId) == InspectorPageAgent::DocumentResource) {
</span><span class="cx">         Frame* frame = loader ? loader-&gt;frame() : nullptr;
</span><span class="cx">         if (frame &amp;&amp; frame-&gt;loader().documentLoader() &amp;&amp; frame-&gt;document()) {
</span><del>-            RefPtr&lt;ResourceBuffer&gt; buffer = frame-&gt;loader().documentLoader()-&gt;mainResourceData();
-            m_resourcesData-&gt;addResourceSharedBuffer(requestId, buffer ? buffer-&gt;sharedBuffer() : nullptr, frame-&gt;document()-&gt;inputEncoding());
</del><ins>+            m_resourcesData-&gt;addResourceSharedBuffer(requestId,
+                frame-&gt;loader().documentLoader()-&gt;mainResourceData(),
+                frame-&gt;document()-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PolicyChecker.h&quot;
</span><span class="cx"> #include &quot;ProgressTracker.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;ResourceHandle.h&quot;
</span><span class="cx"> #include &quot;SchemeRegistry.h&quot;
</span><span class="cx"> #include &quot;SecurityPolicy.h&quot;
</span><span class="lines">@@ -171,20 +170,20 @@
</span><span class="cx">     clearMainResource();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;ResourceBuffer&gt; DocumentLoader::mainResourceData() const
</del><ins>+PassRefPtr&lt;SharedBuffer&gt; DocumentLoader::mainResourceData() const
</ins><span class="cx"> {
</span><span class="cx">     if (m_substituteData.isValid())
</span><del>-        return ResourceBuffer::create(m_substituteData.content()-&gt;data(), m_substituteData.content()-&gt;size());
</del><ins>+        return m_substituteData.content()-&gt;copy();
</ins><span class="cx">     if (m_mainResource)
</span><span class="cx">         return m_mainResource-&gt;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 &amp;&amp; m_frame-&gt;loader().documentLoader() == this)
</span><span class="cx">         return m_frame-&gt;document();
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const ResourceRequest&amp; 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&lt;ResourceBuffer&gt; mainResourceBuffer = mainResourceData();
-    m_archive = ArchiveFactory::create(m_response.url(), mainResourceBuffer ? mainResourceBuffer-&gt;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&lt;Archive&gt; 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&amp; 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-&gt;archiveResourceForURL(url);
</span><del>-
-    return resource &amp;&amp; !resource-&gt;shouldIgnoreWhenUnarchiving() ? resource : 0;
</del><ins>+    if (!resource || resource-&gt;shouldIgnoreWhenUnarchiving())
+        return nullptr;
+    return resource;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;ArchiveResource&gt; DocumentLoader::mainResource() const
</span><span class="cx"> {
</span><del>-    const ResourceResponse&amp; r = response();
-    
-    RefPtr&lt;ResourceBuffer&gt; mainResourceBuffer = mainResourceData();
-    RefPtr&lt;SharedBuffer&gt; data = mainResourceBuffer ? mainResourceBuffer-&gt;sharedBuffer() : 0;
</del><ins>+    RefPtr&lt;SharedBuffer&gt; 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()-&gt;tree().uniqueName());
</del><ins>+    auto&amp; response = this-&gt;response();
+    return ArchiveResource::create(data, response.url(), response.mimeType(), response.textEncodingName(), frame()-&gt;tree().uniqueName());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;ArchiveResource&gt; DocumentLoader::subresource(const URL&amp; 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-&gt;cachedResource(url);
</span><span class="cx">     if (!resource || !resource-&gt;isLoaded())
</span><span class="cx">         return archiveResourceForURL(url);
</span><span class="cx"> 
</span><span class="cx">     if (resource-&gt;type() == CachedResource::MainResource)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    ResourceBuffer* data = resource-&gt;resourceBuffer();
</del><ins>+    auto* data = resource-&gt;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-&gt;sharedBuffer(), url, resource-&gt;response());
</del><ins>+    return ArchiveResource::create(data, url, resource-&gt;response());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Vector&lt;RefPtr&lt;ArchiveResource&gt;&gt; DocumentLoader::subresources() const
</span><span class="lines">@@ -1511,7 +1509,7 @@
</span><span class="cx"> 
</span><span class="cx">     frameLoader()-&gt;setupForReplace();
</span><span class="cx">     m_committed = false;
</span><del>-    RefPtr&lt;ResourceBuffer&gt; resourceData = mainResourceData();
</del><ins>+    RefPtr&lt;SharedBuffer&gt; resourceData = mainResourceData();
</ins><span class="cx">     commitLoad(resourceData-&gt;data(), resourceData-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/DocumentLoader.h        2014-10-31 04:25:34 UTC (rev 175406)
</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&lt;ResourceBuffer&gt; mainResourceData() const;
</del><ins>+        WEBCORE_EXPORT PassRefPtr&lt;SharedBuffer&gt; mainResourceData() const;
</ins><span class="cx">         
</span><span class="cx">         DocumentWriter&amp; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/MediaResourceLoader.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/MediaResourceLoader.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -27,12 +27,12 @@
</span><span class="cx"> #include &quot;MediaResourceLoader.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><ins>+
</ins><span class="cx"> #include &quot;CachedRawResource.h&quot;
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> #include &quot;CachedResourceRequest.h&quot;
</span><span class="cx"> #include &quot;CrossOriginAccessControl.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</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&lt;MediaResourceLoader&gt; protect(this);
</span><span class="cx">     m_client-&gt;dataReceived(data, dataLength);
</span><del>-
-    if (SharedBuffer* buffer = resource-&gt;resourceBuffer() ? resource-&gt;resourceBuffer()-&gt;sharedBuffer() : nullptr)
-        m_client-&gt;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-&gt;loadFailedOrCanceled())
</span><span class="cx">         m_client-&gt;loadFailed(resource-&gt;resourceError());
</span><span class="cx">     else
</span><del>-        m_client-&gt;loadFinished(resource-&gt;resourceBuffer() ? resource-&gt;resourceBuffer()-&gt;sharedBuffer() : nullptr);
</del><ins>+        m_client-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceBuffer.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/ResourceBuffer.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</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 &quot;config.h&quot;
-#include &quot;ResourceBuffer.h&quot;
-
-#include &quot;SharedBuffer.h&quot;
-
-namespace WebCore {
-
-ResourceBuffer::ResourceBuffer()
-    : m_sharedBuffer(SharedBuffer::create())
-{
-}
-
-ResourceBuffer::ResourceBuffer(const char* data, unsigned size)
-    : m_sharedBuffer(SharedBuffer::create(data, size))
-{
-}
-
-ResourceBuffer::ResourceBuffer(PassRefPtr&lt;SharedBuffer&gt; sharedBuffer)
-    : m_sharedBuffer(sharedBuffer)
-{
-    ASSERT(m_sharedBuffer);
-}
-    
-ResourceBuffer::~ResourceBuffer()
-{
-}
-
-PassRefPtr&lt;ResourceBuffer&gt; ResourceBuffer::adoptSharedBuffer(PassRefPtr&lt;SharedBuffer&gt; shared)
-{
-    return shared ? adoptRef(new ResourceBuffer(shared)) : nullptr;
-}
-
-const char* ResourceBuffer::data() const
-{
-    return m_sharedBuffer-&gt;data();
-}
-
-unsigned ResourceBuffer::size() const
-{
-    return m_sharedBuffer-&gt;size();
-}
-
-bool ResourceBuffer::isEmpty() const
-{
-    return m_sharedBuffer-&gt;isEmpty();
-}
-
-void ResourceBuffer::append(const char* data, unsigned size)
-{
-    m_sharedBuffer-&gt;append(data, size);
-}
-
-void ResourceBuffer::append(SharedBuffer* buffer)
-{
-    m_sharedBuffer-&gt;append(buffer);
-}
-
-#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
-void ResourceBuffer::append(CFDataRef data)
-{
-    ASSERT(m_sharedBuffer);
-    m_sharedBuffer-&gt;append(data);
-}
-#endif
-
-void ResourceBuffer::clear()
-{
-    m_sharedBuffer-&gt;clear();
-}
-
-unsigned ResourceBuffer::getSomeData(const char*&amp; data, unsigned position) const
-{
-    return m_sharedBuffer-&gt;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&lt;ResourceBuffer&gt; ResourceBuffer::copy() const
-{
-    return ResourceBuffer::adoptSharedBuffer(m_sharedBuffer-&gt;copy());
-}
-
-#if USE(CF)
-RetainPtr&lt;CFDataRef&gt; ResourceBuffer::createCFData()
-{
-    return m_sharedBuffer-&gt;createCFData();
-}
-#endif
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceBufferh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/ResourceBuffer.h (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceBuffer.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/ResourceBuffer.h        2014-10-31 04:25:34 UTC (rev 175406)
</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 &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/RetainPtr.h&gt;
-
-#if USE(FOUNDATION)
-OBJC_CLASS NSData;
-#endif
-
-namespace WebCore {
-
-class SharedBuffer;
-
-class ResourceBuffer : public RefCounted&lt;ResourceBuffer&gt; {
-public:
-
-    static PassRefPtr&lt;ResourceBuffer&gt; create() { return adoptRef(new ResourceBuffer); }
-    static PassRefPtr&lt;ResourceBuffer&gt; create(const char* data, unsigned size) { return adoptRef(new ResourceBuffer(data, size)); }
-    static PassRefPtr&lt;ResourceBuffer&gt; adoptSharedBuffer(PassRefPtr&lt;SharedBuffer&gt;);
-
-    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*&amp; data, unsigned position = 0) const;
-    
-    WEBCORE_EXPORT SharedBuffer* sharedBuffer() const;
-#if USE(FOUNDATION)
-    void tryReplaceSharedBufferContents(SharedBuffer*);
-#endif
-    PassRefPtr&lt;ResourceBuffer&gt; copy() const;
-
-#if USE(FOUNDATION)
-    WEBCORE_EXPORT RetainPtr&lt;NSData&gt; createNSData();
-#endif
-#if USE(CF)
-    RetainPtr&lt;CFDataRef&gt; createCFData();
-#endif
-
-protected:
-    WEBCORE_EXPORT ResourceBuffer();
-
-private:
-    WEBCORE_EXPORT ResourceBuffer(const char*, unsigned);
-    ResourceBuffer(PassRefPtr&lt;SharedBuffer&gt;);
-
-    RefPtr&lt;SharedBuffer&gt; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PlatformStrategies.h&quot;
</span><span class="cx"> #include &quot;ProgressTracker.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;ResourceError.h&quot;
</span><span class="cx"> #include &quot;ResourceHandle.h&quot;
</span><span class="cx"> #include &quot;ResourceLoadScheduler.h&quot;
</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-&gt;append(buffer);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.h (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/ResourceLoader.h        2014-10-31 04:25:34 UTC (rev 175406)
</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&amp; 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&lt;ResourceBuffer&gt; m_resourceData;
</del><ins>+    RefPtr&lt;SharedBuffer&gt; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubresourceLoader.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PageActivityAssertionToken.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCountedLeakCounter.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="lines">@@ -233,11 +232,10 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;ResourceBuffer&gt; buffer = resourceData();
</del><ins>+    auto* buffer = resourceData();
</ins><span class="cx">     if (m_loadingMultipartContent &amp;&amp; buffer &amp;&amp; buffer-&gt;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&lt;ResourceBuffer&gt; copiedData = ResourceBuffer::create(buffer-&gt;data(), buffer-&gt;size());
-        m_resource-&gt;finishLoading(copiedData.get());
</del><ins>+        m_resource-&gt;finishLoading(&amp;buffer-&gt;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 &quot;finished&quot; 
</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-&gt;resourceData())
-            m_resource-&gt;addDataBuffer(resourceData);
</del><ins>+        if (auto* resourceData = this-&gt;resourceData())
+            m_resource-&gt;addDataBuffer(*resourceData);
</ins><span class="cx">         else
</span><span class="cx">             m_resource-&gt;addData(buffer ? buffer-&gt;data() : data, buffer ? buffer-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/TextTrackLoader.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/TextTrackLoader.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx"> #include &quot;CrossOriginAccessControl.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><ins>+#include &quot;SharedBuffer.h&quot;
</ins><span class="cx"> #include &quot;VTTCue.h&quot;
</span><span class="cx"> #include &quot;WebVTTParser.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">     if (m_state == Failed || !resource-&gt;resourceBuffer())
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    ResourceBuffer* buffer = resource-&gt;resourceBuffer();
</del><ins>+    auto* buffer = resource-&gt;resourceBuffer();
</ins><span class="cx">     if (m_parseOffset == buffer-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><span class="cx"> #include &quot;ManifestParser.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;ResourceHandle.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="lines">@@ -254,11 +253,8 @@
</span><span class="cx">                 resource-&gt;addType(ApplicationCacheResource::Master);
</span><span class="cx">                 ASSERT(!resource-&gt;storageID());
</span><span class="cx">             }
</span><del>-        } else {
-            RefPtr&lt;ResourceBuffer&gt; buffer = loader-&gt;mainResourceData();
-            m_newestCache-&gt;addResource(ApplicationCacheResource::create(url, loader-&gt;response(), ApplicationCacheResource::Master, buffer ? buffer-&gt;sharedBuffer() : 0));
-        }
-
</del><ins>+        } else
+            m_newestCache-&gt;addResource(ApplicationCacheResource::create(url, loader-&gt;response(), ApplicationCacheResource::Master, loader-&gt;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-&gt;addType(ApplicationCacheResource::Master);
</span><span class="cx">                 ASSERT(!resource-&gt;storageID());
</span><span class="cx">             }
</span><del>-        } else {
-            RefPtr&lt;ResourceBuffer&gt; buffer = loader-&gt;mainResourceData();
-            m_cacheBeingUpdated-&gt;addResource(ApplicationCacheResource::create(url, loader-&gt;response(), ApplicationCacheResource::Master, buffer ? buffer-&gt;sharedBuffer() : 0));
-        }
</del><ins>+        } else
+            m_cacheBeingUpdated-&gt;addResource(ApplicationCacheResource::create(url, loader-&gt;response(), ApplicationCacheResource::Master, loader-&gt;mainResourceData()));
</ins><span class="cx">         // The &quot;cached&quot; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;Range.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;markup.h&quot;
</span><span class="cx"> #include &lt;wtf/ListHashSet.h&gt;
</span><span class="lines">@@ -550,9 +549,7 @@
</span><span class="cx"> #endif
</span><span class="cx">                 CachedResource* cachedResource = memoryCache()-&gt;resourceForRequest(request, frame-&gt;page()-&gt;sessionID());
</span><span class="cx">                 if (cachedResource) {
</span><del>-                    ResourceBuffer* data = cachedResource-&gt;resourceBuffer();
-
-                    if (RefPtr&lt;ArchiveResource&gt; resource = ArchiveResource::create(data ? data-&gt;sharedBuffer() : 0, subresourceURL, cachedResource-&gt;response())) {
</del><ins>+                    if (RefPtr&lt;ArchiveResource&gt; resource = ArchiveResource::create(cachedResource-&gt;resourceBuffer(), subresourceURL, cachedResource-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> #include &quot;HTTPHeaderNames.h&quot;
</span><span class="cx"> #include &quot;HTTPParsers.h&quot;
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><ins>+#include &quot;SharedBuffer.h&quot;
</ins><span class="cx"> #include &quot;StyleSheetContents.h&quot;
</span><span class="cx"> #include &quot;TextResourceDecoder.h&quot;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="lines">@@ -90,13 +90,13 @@
</span><span class="cx">     return m_decoder-&gt;decodeAndFlush(m_data-&gt;data(), m_data-&gt;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-&gt;size() : 0);
</del><ins>+    setEncodedSize(data ? data-&gt;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-&gt;decodeAndFlush(m_data-&gt;data(), m_data-&gt;size());
</del><ins>+    if (data)
+        m_decodedSheetText = m_decoder-&gt;decodeAndFlush(data-&gt;data(), data-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> 
</span><span class="cx">         virtual void setEncoding(const String&amp;) 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedFont.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include &quot;FontCustomPlatformData.h&quot;
</span><span class="cx"> #include &quot;FontPlatformData.h&quot;
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><span class="cx"> #include &quot;TextResourceDecoder.h&quot;
</span><span class="cx"> #include &quot;TypedElementDescendantIterator.h&quot;
</span><span class="lines">@@ -76,7 +75,7 @@
</span><span class="cx">         static_cast&lt;CachedFontClient*&gt;(c)-&gt;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-&gt;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 &amp;&amp; !errorOccurred() &amp;&amp; !isLoading() &amp;&amp; m_data) {
</span><del>-        SharedBuffer* buffer = m_data.get()-&gt;sharedBuffer();
-        ASSERT(buffer);
-
</del><ins>+        RefPtr&lt;SharedBuffer&gt; buffer = m_data;
</ins><span class="cx">         bool fontIsWOFF = false;
</span><del>-#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1090) &amp;&amp; (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED &lt; 80000)
-        RefPtr&lt;SharedBuffer&gt; sfntBuffer;
</del><span class="cx"> 
</span><del>-        fontIsWOFF = isWOFF(buffer);
-        if (fontIsWOFF) {
-            Vector&lt;char&gt; sfnt;
-            if (convertWOFFToSfnt(buffer, sfnt)) {
-                sfntBuffer = SharedBuffer::adoptVector(sfnt);
-                buffer = sfntBuffer.get();
-            } else
</del><ins>+#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1090) &amp;&amp; (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED &lt; 80000)
+        if (isWOFF(buffer.get())) {
+            Vector&lt;char&gt; 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 &amp;&amp; !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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedFont.h        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     virtual void load(CachedResourceLoader*, const ResourceLoaderOptions&amp;) 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;RenderElement.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;SVGImage.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</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 &amp;&amp; !m_image &amp;&amp; !errorOccurred()) {
</span><span class="cx">         createImage();
</span><del>-        m_image-&gt;setData(m_data-&gt;sharedBuffer(), true);
</del><ins>+        m_image-&gt;setData(m_data, true);
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    ASSERT(c-&gt;resourceClientType() == CachedImageClient::expectedType());
</del><ins>+    ASSERT(client-&gt;resourceClientType() == CachedImageClient::expectedType());
</ins><span class="cx">     if (m_image &amp;&amp; !m_image-&gt;isNull())
</span><del>-        static_cast&lt;CachedImageClient*&gt;(c)-&gt;imageChanged(this);
</del><ins>+        static_cast&lt;CachedImageClient*&gt;(client)-&gt;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-&gt;resourceClientType() == CachedImageClient::expectedType());
</del><ins>+    ASSERT(client);
+    ASSERT(client-&gt;resourceClientType() == CachedImageClient::expectedType());
</ins><span class="cx"> 
</span><del>-    m_pendingContainerSizeRequests.remove(static_cast&lt;CachedImageClient*&gt;(c));
</del><ins>+    m_pendingContainerSizeRequests.remove(static_cast&lt;CachedImageClient*&gt;(client));
</ins><span class="cx"> 
</span><span class="cx">     if (m_svgImageCache)
</span><del>-        m_svgImageCache-&gt;removeClientFromCache(static_cast&lt;CachedImageClient*&gt;(c));
</del><ins>+        m_svgImageCache-&gt;removeClientFromCache(static_cast&lt;CachedImageClient*&gt;(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&amp; data)
</ins><span class="cx"> {
</span><del>-    m_data = data;
-    if (!data)
-        return;
</del><ins>+    m_data = &amp;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-&gt;setData(m_data-&gt;sharedBuffer(), false);
</del><ins>+    bool sizeAvailable = m_image-&gt;setData(&amp;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-&gt;data() ? m_image-&gt;data()-&gt;size() : 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CachedImage::addDataBuffer(ResourceBuffer* data)
</del><ins>+void CachedImage::addDataBuffer(SharedBuffer&amp; 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 &amp;&amp; data)
</span><span class="cx">         createImage();
</span><span class="cx"> 
</span><span class="cx">     if (m_image)
</span><del>-        m_image-&gt;setData(m_data-&gt;sharedBuffer(), true);
</del><ins>+        m_image-&gt;setData(data, true);
</ins><span class="cx"> 
</span><span class="cx">     if (!m_image || m_image-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedImage.h        2014-10-31 04:25:34 UTC (rev 175406)
</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&amp;) 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&amp;) override;
</span><span class="cx"> 
</span><del>-    void addIncrementalDataBuffer(ResourceBuffer*);
</del><ins>+    void addIncrementalDataBuffer(SharedBuffer&amp;);
</ins><span class="cx"> 
</span><span class="cx">     typedef std::pair&lt;LayoutSize, float&gt; SizeAndZoom;
</span><span class="cx">     typedef HashMap&lt;const CachedImageClient*, SizeAndZoom&gt; ContainerSizeRequests;
</span><span class="lines">@@ -130,8 +130,8 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Image&gt; m_image;
</span><span class="cx">     std::unique_ptr&lt;SVGImageCache&gt; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedRawResource.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include &quot;CachedResourceClientWalker.h&quot;
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> #include &quot;HTTPHeaderNames.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><ins>+#include &quot;SharedBuffer.h&quot;
</ins><span class="cx"> #include &quot;SubresourceLoader.h&quot;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringView.h&gt;
</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&amp; incrementalDataLength)
</del><ins>+const char* CachedRawResource::calculateIncrementalDataChunk(SharedBuffer* data, unsigned&amp; incrementalDataLength)
</ins><span class="cx"> {
</span><span class="cx">     incrementalDataLength = 0;
</span><span class="cx">     if (!data)
</span><span class="lines">@@ -58,34 +58,36 @@
</span><span class="cx">     return data-&gt;data() + previousDataLength;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CachedRawResource::addDataBuffer(ResourceBuffer* data)
</del><ins>+void CachedRawResource::addDataBuffer(SharedBuffer&amp; data)
</ins><span class="cx"> {
</span><span class="cx">     CachedResourceHandle&lt;CachedRawResource&gt; protect(this);
</span><del>-    ASSERT(m_options.dataBufferingPolicy() == BufferData);
-    m_data = data;
</del><ins>+    ASSERT(dataBufferingPolicy() == BufferData);
+    m_data = &amp;data;
</ins><span class="cx"> 
</span><span class="cx">     unsigned incrementalDataLength;
</span><del>-    const char* incrementalData = calculateIncrementalDataChunk(data, incrementalDataLength);
-    if (data)
-        setEncodedSize(data-&gt;size());
</del><ins>+    const char* incrementalData = calculateIncrementalDataChunk(&amp;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-&gt;setDataBufferingPolicy(DoNotBufferData);
</span><span class="cx">         clear();
</span><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&lt;CachedRawResource&gt; protect(this);
</span><del>-    DataBufferingPolicy dataBufferingPolicy = m_options.dataBufferingPolicy();
</del><ins>+    DataBufferingPolicy dataBufferingPolicy = this-&gt;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 +101,7 @@
</span><span class="cx">     m_allowEncodedDataReplacement = !m_loader-&gt;isQuickLookResource();
</span><span class="cx"> 
</span><span class="cx">     CachedResource::finishLoading(data);
</span><del>-    if (dataBufferingPolicy == BufferData &amp;&amp; m_options.dataBufferingPolicy() == DoNotBufferData) {
</del><ins>+    if (dataBufferingPolicy == BufferData &amp;&amp; this-&gt;dataBufferingPolicy() == DoNotBufferData) {
</ins><span class="cx">         if (m_loader)
</span><span class="cx">             m_loader-&gt;setDataBufferingPolicy(DoNotBufferData);
</span><span class="cx">         clear();
</span><span class="lines">@@ -222,7 +224,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool CachedRawResource::canReuse(const ResourceRequest&amp; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedRawResource.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.h        2014-10-31 04:25:34 UTC (rev 175406)
</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&amp;) 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&amp;) const override;
</span><span class="cx"> 
</span><del>-    const char* calculateIncrementalDataChunk(ResourceBuffer*, unsigned&amp; incrementalDataLength);
</del><ins>+    const char* calculateIncrementalDataChunk(SharedBuffer*, unsigned&amp; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;PlatformStrategies.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;ResourceHandle.h&quot;
</span><span class="cx"> #include &quot;ResourceLoadScheduler.h&quot;
</span><span class="cx"> #include &quot;SchemeRegistry.h&quot;
</span><span class="lines">@@ -108,10 +107,10 @@
</span><span class="cx"> 
</span><span class="cx"> CachedResource::CachedResource(const ResourceRequest&amp; request, Type type, SessionID sessionID)
</span><span class="cx">     : m_resourceRequest(request)
</span><ins>+    , m_decodedDataDeletionTimer(this, &amp;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, &amp;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&lt;CachedResourceClient&gt; w(m_clients);
-    while (CachedResourceClient* c = w.next())
-        c-&gt;notifyFinished(this);
</del><ins>+    CachedResourceClientWalker&lt;CachedResourceClient&gt; walker(m_clients);
+    while (CachedResourceClient* client = walker.next())
+        client-&gt;notifyFinished(this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CachedResource::addDataBuffer(ResourceBuffer*)
</del><ins>+void CachedResource::addDataBuffer(SharedBuffer&amp;)
</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() &amp;&amp; !stillNeedsLoad())
</span><del>-        c-&gt;notifyFinished(this);
</del><ins>+        client-&gt;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&lt;Callback&gt;(*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&amp; resource, CachedResourceClient&amp; client)
</ins><span class="cx">     : m_resource(resource)
</span><span class="cx">     , m_client(client)
</span><del>-    , m_callbackTimer(this, &amp;CachedResourceCallback::timerFired)
</del><ins>+    , m_timer(this, &amp;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&lt;CachedResourceCallback&gt;&amp;)
</del><ins>+void CachedResource::Callback::timerFired(Timer&lt;Callback&gt;&amp;)
</ins><span class="cx"> {
</span><del>-    m_resource-&gt;didAddClient(m_client);
</del><ins>+    m_resource.didAddClient(&amp;m_client);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(FOUNDATION)
</span><del>-void CachedResource::tryReplaceEncodedData(PassRefPtr&lt;SharedBuffer&gt; newBuffer)
</del><ins>+
+void CachedResource::tryReplaceEncodedData(SharedBuffer&amp; 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-&gt;size() != newBuffer-&gt;size() || memcmp(m_data-&gt;data(), newBuffer-&gt;data(), m_data-&gt;size()))
</del><ins>+    if (m_data-&gt;size() != newBuffer.size() || memcmp(m_data-&gt;data(), newBuffer.data(), m_data-&gt;size()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_data-&gt;tryReplaceSharedBufferContents(newBuffer.get());
</del><ins>+    m_data-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h        2014-10-31 04:25:34 UTC (rev 175406)
</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&amp;) { }
</span><span class="cx">     virtual String encoding() const { return String(); }
</span><del>-    virtual void addDataBuffer(ResourceBuffer*);
</del><ins>+    virtual void addDataBuffer(SharedBuffer&amp;);
</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&amp; 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&amp;, const ResourceResponse&amp;);
</span><span class="cx">     virtual void responseReceived(const ResourceResponse&amp;);
</span><span class="lines">@@ -245,55 +244,35 @@
</span><span class="cx">     virtual bool canReuse(const ResourceRequest&amp;) const { return true; }
</span><span class="cx"> 
</span><span class="cx"> #if USE(FOUNDATION)
</span><del>-    WEBCORE_EXPORT void tryReplaceEncodedData(PassRefPtr&lt;SharedBuffer&gt;);
</del><ins>+    WEBCORE_EXPORT void tryReplaceEncodedData(SharedBuffer&amp;);
</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&amp; /* actualSize */) { return 0; }
</del><ins>+    virtual char* getOrCreateReadBuffer(size_t /* requestedSize */, size_t&amp; /* 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&lt;CachedResourceClient*&gt; m_clients;
</span><del>-
-    class CachedResourceCallback {
-    public:
-        CachedResourceCallback(CachedResource*, CachedResourceClient*);
-
-        static std::unique_ptr&lt;CachedResourceCallback&gt; schedule(CachedResource* resource, CachedResourceClient* client) { return std::make_unique&lt;CachedResourceCallback&gt;(resource, client); }
-        void cancel();
-    private:
-        void timerFired(Timer&lt;CachedResourceCallback&gt;&amp;);
-
-        CachedResource* m_resource;
-        CachedResourceClient* m_client;
-        Timer&lt;CachedResourceCallback&gt; m_callbackTimer;
-    };
-    HashMap&lt;CachedResourceClient*, std::unique_ptr&lt;CachedResourceCallback&gt;&gt; m_clientsAwaitingCallback;
-
</del><span class="cx">     ResourceRequest m_resourceRequest;
</span><del>-    SessionID m_sessionID;
-    String m_accept;
</del><span class="cx">     RefPtr&lt;SubresourceLoader&gt; 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&lt;ResourceBuffer&gt; m_data;
</del><ins>+    RefPtr&lt;SharedBuffer&gt; 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&amp;) 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&lt;CachedResourceClient*, std::unique_ptr&lt;Callback&gt;&gt; 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&amp;, CachedResourceClient&amp;);
+
+    void cancel();
+
+private:
+    void timerFired(Timer&lt;Callback&gt;&amp;);
+
+    CachedResource&amp; m_resource;
+    CachedResourceClient&amp; m_client;
+    Timer&lt;Callback&gt; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceClient.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedResourceClient.h        2014-10-31 04:25:34 UTC (rev 175406)
</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 &lt;wtf/FastMalloc.h&gt;
</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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -23,10 +23,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;CachedSVGDocument.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;CachedResourceClient.h&quot;
-#include &quot;CachedResourceHandle.h&quot;
-#include &quot;ResourceBuffer.h&quot;
-#include &lt;wtf/text/StringBuilder.h&gt;
</del><ins>+#include &quot;SharedBuffer.h&quot;
</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-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGDocument.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedSVGDocument.h        2014-10-31 04:25:34 UTC (rev 175406)
</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&lt;SVGDocument&gt; m_document;
-    RefPtr&lt;TextResourceDecoder&gt; 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&amp;) 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&lt;SVGDocument&gt; m_document;
+    RefPtr&lt;TextResourceDecoder&gt; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedScript.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedScript.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx"> #include &quot;HTTPParsers.h&quot;
</span><span class="cx"> #include &quot;MIMETypeRegistry.h&quot;
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;RuntimeApplicationChecks.h&quot;
</span><ins>+#include &quot;SharedBuffer.h&quot;
</ins><span class="cx"> #include &quot;TextResourceDecoder.h&quot;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</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-&gt;size() : 0);
</del><ins>+    setEncodedSize(data ? data-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedScript.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedScript.h        2014-10-31 04:25:34 UTC (rev 175406)
</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&amp;, const String&amp; charset, SessionID);
-        virtual ~CachedScript();
</del><ins>+class CachedScript final : public CachedResource {
+public:
+    CachedScript(const ResourceRequest&amp;, const String&amp; charset, SessionID);
+    virtual ~CachedScript();
</ins><span class="cx"> 
</span><del>-        const String&amp; script();
</del><ins>+    const String&amp; 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&amp;) override;
-        virtual String encoding() const override;
-        virtual void finishLoading(ResourceBuffer*) override;
</del><ins>+    virtual void setEncoding(const String&amp;) 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&lt;TextResourceDecoder&gt; m_decoder;
-    };
</del><ins>+    String m_script;
+    RefPtr&lt;TextResourceDecoder&gt; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedTextTrack.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedTextTrack.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include &quot;CachedResourceClient.h&quot;
</span><span class="cx"> #include &quot;CachedResourceClientWalker.h&quot;
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><span class="cx"> #include &quot;TextResourceDecoder.h&quot;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</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-&gt;size() : 0);
</del><ins>+    setEncodedSize(data ? data-&gt;size() : 0);
</ins><span class="cx"> 
</span><span class="cx">     CachedResourceClientWalker&lt;CachedResourceClient&gt; walker(m_clients);
</span><del>-    while (CachedResourceClient *client = walker.next())
</del><ins>+    while (CachedResourceClient* client = walker.next())
</ins><span class="cx">         client-&gt;deprecatedDidReceiveCachedResource(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CachedTextTrack::finishLoading(ResourceBuffer* data)
</del><ins>+void CachedTextTrack::addDataBuffer(SharedBuffer&amp; data)
</ins><span class="cx"> {
</span><del>-    addDataBuffer(data);
</del><ins>+    updateData(&amp;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedTextTrack.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedTextTrack.h        2014-10-31 04:25:34 UTC (rev 175406)
</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&amp;, 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&amp;) 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CachedResourceClientWalker.h&quot;
</span><span class="cx"> #include &quot;CachedStyleSheetClient.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><ins>+#include &quot;SharedBuffer.h&quot;
</ins><span class="cx"> #include &quot;TextResourceDecoder.h&quot;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -46,6 +46,10 @@
</span><span class="cx">     setAccept(&quot;text/xml, application/xml, application/xhtml+xml, text/xsl, application/rss+xml, application/atom+xml&quot;);
</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-&gt;resourceClientType() == CachedStyleSheetClient::expectedType());
</span><span class="lines">@@ -63,12 +67,12 @@
</span><span class="cx">     return m_decoder-&gt;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-&gt;size() : 0);
-    if (m_data.get())
-        m_sheet = m_decoder-&gt;decodeAndFlush(m_data-&gt;data(), encodedSize());
</del><ins>+    setEncodedSize(data ? data-&gt;size() : 0);
+    if (data)
+        m_sheet = m_decoder-&gt;decodeAndFlush(data-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -29,35 +29,30 @@
</span><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CachedResource.h&quot;
</span><del>-#include &lt;wtf/Vector.h&gt;
</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&amp;, SessionID);
</del><ins>+class CachedXSLStyleSheet final : public CachedResource {
+public:
+    CachedXSLStyleSheet(const ResourceRequest&amp;, SessionID);
+    virtual ~CachedXSLStyleSheet();
</ins><span class="cx"> 
</span><del>-        const String&amp; sheet() const { return m_sheet; }
</del><ins>+    const String&amp; 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&amp;) override;
+    virtual String encoding() const override;
+    virtual void finishLoading(SharedBuffer*) override;
</ins><span class="cx"> 
</span><del>-        String m_sheet;
-        RefPtr&lt;TextResourceDecoder&gt; m_decoder;
</del><ins>+    String m_sheet;
+    RefPtr&lt;TextResourceDecoder&gt; 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&amp;) 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</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-&gt;resourceData())
-                m_resource-&gt;addDataBuffer(resourceData);
</del><ins>+            if (auto* resourceData = this-&gt;resourceData())
+                m_resource-&gt;addDataBuffer(*resourceData);
</ins><span class="cx">             else {
</span><span class="cx">                 CFDataRef cfData = reinterpret_cast&lt;CFDataRef&gt;(CFArrayGetValueAtIndex(dataArray, i));
</span><span class="cx">                 const char* data = reinterpret_cast&lt;const char *&gt;(CFDataGetBytePtr(cfData));
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercocoaDiskCacheMonitorCocoah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.h (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.h        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> protected:
</span><span class="cx">     WEBCORE_EXPORT DiskCacheMonitor(const ResourceRequest&amp;, SessionID, CFCachedURLResponseRef);
</span><span class="cx"> 
</span><del>-    virtual void resourceBecameFileBacked(PassRefPtr&lt;SharedBuffer&gt;);
</del><ins>+    virtual void resourceBecameFileBacked(SharedBuffer&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const ResourceRequest&amp; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm        2014-10-31 04:25:34 UTC (rev 175406)
</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-&gt;resourceBecameFileBacked(fileBackedBuffer);
</del><ins>+        monitor-&gt;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&lt;SharedBuffer&gt; fileBackedBuffer)
</del><ins>+void DiskCacheMonitor::resourceBecameFileBacked(SharedBuffer&amp; fileBackedBuffer)
</ins><span class="cx"> {
</span><span class="cx">     CachedResource* resource = memoryCache()-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconLoader.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/icon/IconLoader.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include &quot;IconController.h&quot;
</span><span class="cx"> #include &quot;IconDatabase.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;ResourceRequest.h&quot;
</span><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</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&lt;ResourceBuffer&gt; data = resource-&gt;resourceBuffer();
</del><ins>+    auto* data = resource-&gt;resourceBuffer();
</ins><span class="cx">     int status = resource-&gt;response().httpStatusCode();
</span><span class="cx">     if (status &amp;&amp; (status &lt; 200 || status &gt; 299))
</span><del>-        data = 0;
</del><ins>+        data = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     static const char pdfMagicNumber[] = &quot;%PDF&quot;;
</span><span class="cx">     static unsigned pdfMagicNumberLength = sizeof(pdfMagicNumber) - 1;
</span><span class="cx">     if (data &amp;&amp; data-&gt;size() &gt;= pdfMagicNumberLength &amp;&amp; !memcmp(data-&gt;data(), pdfMagicNumber, pdfMagicNumberLength)) {
</span><span class="cx">         LOG(IconDatabase, &quot;IconLoader::finishLoading() - Ignoring icon at %s because it appears to be a PDF&quot;, resource-&gt;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, &quot;IconLoader::finishLoading() - Committing iconURL %s to database&quot;, resource-&gt;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-&gt;sharedBuffer() : 0, resource-&gt;url().string());
</del><ins>+    iconDatabase().setIconDataForIconURL(data, resource-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/mac/ResourceBuffer.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/mac/ResourceBuffer.mm        2014-10-31 04:25:34 UTC (rev 175406)
</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 &quot;config.h&quot;
-#include &quot;ResourceBuffer.h&quot;
-
-#include &quot;SharedBuffer.h&quot;
-
-namespace WebCore {
-
-RetainPtr&lt;NSData&gt; ResourceBuffer::createNSData()
-{
-    return m_sharedBuffer-&gt;createNSData();
-}
-
-void ResourceBuffer::tryReplaceSharedBufferContents(SharedBuffer* newContents)
-{
-    if (!m_sharedBuffer)
-        m_sharedBuffer = newContents;
-    else
-        m_sharedBuffer-&gt;tryReplaceContentsWithPlatformBuffer(newContents);
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreloadermacResourceLoaderMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -31,10 +31,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;FrameLoaderClient.h&quot;
</span><ins>+#include &quot;SharedBuffer.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</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-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SharedBuffer.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/platform/SharedBuffer.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</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 &lt; 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">@@ -226,24 +227,26 @@
</span><span class="cx">     clearDataBuffer();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;SharedBuffer&gt; SharedBuffer::copy() const
</del><ins>+PassRef&lt;SharedBuffer&gt; SharedBuffer::copy() const
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;SharedBuffer&gt; clone(adoptRef(new SharedBuffer));
</del><ins>+    PassRef&lt;SharedBuffer&gt; clone { adoptRef(*new SharedBuffer) };
</ins><span class="cx">     if (hasPlatformData()) {
</span><del>-        clone-&gt;append(data(), size());
</del><ins>+        clone.get().append(data(), size());
</ins><span class="cx">         return clone;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    clone-&gt;m_size = m_size;
-    clone-&gt;m_buffer-&gt;data.reserveCapacity(m_size);
-    clone-&gt;m_buffer-&gt;data.append(m_buffer-&gt;data.data(), m_buffer-&gt;data.size());
</del><ins>+    clone.get().m_size = m_size;
+    clone.get().m_buffer-&gt;data.reserveCapacity(m_size);
+    clone.get().m_buffer-&gt;data.append(m_buffer-&gt;data.data(), m_buffer-&gt;data.size());
+
</ins><span class="cx"> #if !USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><del>-    for (unsigned i = 0; i &lt; m_segments.size(); ++i)
-        clone-&gt;m_buffer-&gt;data.append(m_segments[i], segmentSize);
</del><ins>+    for (char* segment : m_segments)
+        clone.get().m_buffer-&gt;data.append(segment, segmentSize);
</ins><span class="cx"> #else
</span><del>-    for (unsigned i = 0; i &lt; m_dataArray.size(); ++i)
-        clone-&gt;append(m_dataArray[i].get());
</del><ins>+    for (auto&amp; data : m_dataArray)
+        clone.get().append(data.get());
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx">     return clone;
</span><span class="cx"> }
</span><span class="cx"> 
</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 &lt; 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&lt;char&gt;&amp; SharedBuffer::buffer() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSharedBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/SharedBuffer.h (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SharedBuffer.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/platform/SharedBuffer.h        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">     void append(CFDataRef);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    PassRefPtr&lt;SharedBuffer&gt; copy() const;
</del><ins>+    PassRef&lt;SharedBuffer&gt; copy() const;
</ins><span class="cx">     
</span><span class="cx">     // Return the number of consecutive bytes after &quot;position&quot;. &quot;data&quot;
</span><span class="cx">     // points to the first byte.
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">     //      }
</span><span class="cx">     WEBCORE_EXPORT unsigned getSomeData(const char*&amp; data, unsigned position = 0) const;
</span><span class="cx"> 
</span><del>-    void tryReplaceContentsWithPlatformBuffer(SharedBuffer*);
</del><ins>+    void tryReplaceContentsWithPlatformBuffer(SharedBuffer&amp;);
</ins><span class="cx">     WEBCORE_EXPORT bool hasPlatformData() const;
</span><span class="cx"> 
</span><span class="cx">     struct DataBuffer : public ThreadSafeRefCounted&lt;DataBuffer&gt; {
</span><span class="lines">@@ -158,6 +158,7 @@
</span><span class="cx"> #else
</span><span class="cx">     mutable Vector&lt;char*&gt; 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&lt;CFDataRef&gt; m_cfData;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfSharedBufferCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</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&amp; newContents)
</ins><span class="cx"> {
</span><del>-    if (!newContents-&gt;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-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/platform/graphics/PlatformMediaResourceLoader.h        2014-10-31 04:25:34 UTC (rev 175406)
</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 &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</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&amp;) { }
</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&amp;) { }
</span><span class="cx">     virtual void loadFailed(const ResourceError&amp;) { }
</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&amp; /*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&lt;PlatformMediaResourceLoaderClient&gt; client)
</del><ins>+    explicit PlatformMediaResourceLoader(std::unique_ptr&lt;PlatformMediaResourceLoaderClient&gt; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include &quot;CachedResourceRequest.h&quot;
</span><span class="cx"> #include &quot;MediaPlayerPrivateAVFoundationCF.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><del>-#include &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;ResourceLoaderOptions.h&quot;
</span><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><span class="cx"> #include &quot;SoftLinking.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcWebCoreAVFResourceLoadermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #import &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> #import &quot;CachedResourceRequest.h&quot;
</span><span class="cx"> #import &quot;MediaPlayerPrivateAVFoundationObjC.h&quot;
</span><del>-#import &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #import &quot;ResourceLoaderOptions.h&quot;
</span><span class="cx"> #import &quot;SharedBuffer.h&quot;
</span><span class="cx"> #import &quot;SoftLinking.h&quot;
</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-&gt;resourceBuffer() ? resource-&gt;resourceBuffer()-&gt;sharedBuffer() : 0;
</del><ins>+    SharedBuffer* data = resource-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</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&amp;) override;
</span><span class="cx">         virtual void loadFailed(const ResourceError&amp;) 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-&gt;priv-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx"> #import &quot;PasteboardStrategy.h&quot;
</span><span class="cx"> #import &quot;PlatformStrategies.h&quot;
</span><span class="cx"> #import &quot;RenderImage.h&quot;
</span><del>-#import &quot;ResourceBuffer.h&quot;
</del><span class="cx"> #import &quot;Text.h&quot;
</span><span class="cx"> #import &quot;WebCoreNSStringExtras.h&quot;
</span><span class="cx"> #import &quot;WebNSAttributedStringExtras.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsoupSharedBufferSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/soup/SharedBufferSoup.cpp (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/soup/SharedBufferSoup.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebCore/platform/soup/SharedBufferSoup.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-10-30  Darin Adler  &lt;darin@apple.com&gt;
+
+        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-10-30  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EME] Add Setting for accessing storage location for MediaKeys data
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebDataSourcemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebDataSource.mm (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebDataSource.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit/mac/WebView/WebDataSource.mm        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx"> #import &lt;WebCore/URL.h&gt;
</span><span class="cx"> #import &lt;WebCore/LegacyWebArchive.h&gt;
</span><span class="cx"> #import &lt;WebCore/MIMETypeRegistry.h&gt;
</span><del>-#import &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #import &lt;WebCore/ResourceRequest.h&gt;
</span><span class="cx"> #import &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebCoreObjCExtras.h&gt;
</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&lt;ResourceBuffer&gt; mainResourceData = toPrivate(_private)-&gt;loader-&gt;mainResourceData();
</del><ins>+    RefPtr&lt;SharedBuffer&gt; mainResourceData = toPrivate(_private)-&gt;loader-&gt;mainResourceData();
</ins><span class="cx">     if (!mainResourceData)
</span><span class="cx">         return nil;
</span><span class="cx">     return mainResourceData-&gt;createNSData().autorelease();
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -108,7 +108,6 @@
</span><span class="cx"> #import &lt;WebCore/Range.h&gt;
</span><span class="cx"> #import &lt;WebCore/RenderView.h&gt;
</span><span class="cx"> #import &lt;WebCore/RenderWidget.h&gt;
</span><del>-#import &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #import &lt;WebCore/RuntimeApplicationChecks.h&gt;
</span><span class="cx"> #import &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> #import &lt;WebCore/SimpleFontData.h&gt;
</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&lt;CachedResource*&gt;(tiffResource)-&gt;resourceBuffer()) {
</del><ins>+        if (auto* buffer = tiffResource-&gt;resourceBuffer()) {
</ins><span class="cx">             NSURLResponse *response = tiffResource-&gt;response().nsURLResponse();
</span><span class="cx">             draggingImageURL = [response URL];
</span><span class="cx">             wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:buffer-&gt;createNSData().get()] autorelease];
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit/win/ChangeLog        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-10-30  Darin Adler  &lt;darin@apple.com&gt;
+
+        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-10-20  peavo@outlook.com  &lt;peavo@outlook.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WinCairo] Crash in ATI display driver in accelerated compositing mode.
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebDataSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebDataSource.cpp (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebDataSource.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit/win/WebDataSource.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> #include &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/URL.h&gt;
</span><del>-#include &lt;WebCore/ResourceBuffer.h&gt;
</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&lt;ResourceBuffer&gt; buffer = m_loader-&gt;mainResourceData();
-    return MemoryStream::createInstance(buffer ? buffer-&gt;sharedBuffer() : 0).copyRefTo(stream);
</del><ins>+    return MemoryStream::createInstance(m_loader-&gt;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-&gt;resourceBuffer();
-    *resource = WebResource::createInstance(buffer ? buffer-&gt;sharedBuffer() : 0, cachedResource-&gt;response());
</del><ins>+    *resource = WebResource::createInstance(cachedResource-&gt;resourceBuffer(), cachedResource-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/CMakeLists.txt        2014-10-31 04:25:34 UTC (rev 175406)
</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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/ChangeLog        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -1,3 +1,63 @@
</span><ins>+2014-10-30  Darin Adler  &lt;darin@apple.com&gt;
+
+        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&amp; 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&amp; 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&amp; instead of a Page*.
+        (WebKit::WebPage::focusNextAssistedNode): Updated for above changes.
+        (WebKit::WebPage::getAssistedNodeInformation): Updated for above changes.
+
</ins><span class="cx"> 2014-10-30  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EME] Add Setting for accessing storage location for MediaKeys data
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> #include &lt;WebCore/BlobDataFileReference.h&gt;
</span><span class="cx"> #include &lt;WebCore/CertificateInfo.h&gt;
</span><span class="cx"> #include &lt;WebCore/NotImplemented.h&gt;
</span><del>-#include &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #include &lt;WebCore/ResourceHandle.h&gt;
</span><span class="cx"> #include &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> #include &lt;WebCore/SynchronousLoaderClient.h&gt;
</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) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2014-10-31 04:25:34 UTC (rev 175406)
</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) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090)
</span><span class="cx">     static void tryGetShareableHandleFromCFURLCachedResponse(ShareableResource::Handle&amp;, CFCachedURLResponseRef);
</span><del>-    static void tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle&amp;, WebCore::SharedBuffer*);
</del><ins>+    static void tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle&amp;, WebCore::SharedBuffer&amp;);
</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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h        2014-10-31 04:25:34 UTC (rev 175406)
</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&lt;WebCore::SharedBuffer&gt;) override;
</del><ins>+    virtual void resourceBecameFileBacked(WebCore::SharedBuffer&amp;) 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm        2014-10-31 04:25:34 UTC (rev 175406)
</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&lt;SharedBuffer&gt; fileBackedBuffer)
</del><ins>+void NetworkDiskCacheMonitor::resourceBecameFileBacked(SharedBuffer&amp; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm        2014-10-31 04:25:34 UTC (rev 175406)
</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&amp; handle, SharedBuffer* buffer)
</del><ins>+void NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle&amp; handle, SharedBuffer&amp; 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-&gt;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 &gt;= 1090
</del><span class="cx"> 
</span><ins>+#endif // IOS || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 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-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/DataReference.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/Platform/IPC/DataReference.h        2014-10-31 04:25:34 UTC (rev 175406)
</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-&gt;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&lt;uint8_t&gt; vector() const = delete;
</span><span class="cx"> 
</span><del>-    void encode(ArgumentEncoder&amp;) const override;
-    virtual ~SharedBufferDataReference() { m_buffer = 0; }
</del><ins>+    virtual void encode(ArgumentEncoder&amp;) const override;
</ins><span class="cx"> 
</span><del>-private:
</del><span class="cx">     RefPtr&lt;WebCore::SharedBuffer&gt; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebResourceBuffer.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/Shared/WebResourceBuffer.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</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 &quot;config.h&quot;
-#include &quot;WebResourceBuffer.h&quot;
-
-#if ENABLE(SHAREABLE_RESOURCE)
-
-#include &quot;Logging.h&quot;
-#include &quot;ShareableResource.h&quot;
-
-namespace WebKit {
-
-WebResourceBuffer::WebResourceBuffer(PassRefPtr&lt;ShareableResource&gt; resource)
-    : m_resource(resource)
-{
-    ASSERT(m_resource);
-}
-
-WebResourceBuffer::~WebResourceBuffer()
-{
-}
-
-const char* WebResourceBuffer::data() const
-{
-    return reinterpret_cast&lt;const char*&gt;(m_resource-&gt;data());
-}
-
-unsigned WebResourceBuffer::size() const
-{
-    return m_resource-&gt;size();
-}
-
-bool WebResourceBuffer::isEmpty() const
-{
-    return !m_resource || !m_resource-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebResourceBuffer.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/Shared/WebResourceBuffer.h        2014-10-31 04:25:34 UTC (rev 175406)
</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 &lt;WebCore/ResourceBuffer.h&gt;
-
-namespace WebKit {
-
-class ShareableResource;
-
-class WebResourceBuffer : public WebCore::ResourceBuffer {
-public:
-    static PassRefPtr&lt;WebResourceBuffer&gt; create(PassRefPtr&lt;ShareableResource&gt; 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&lt;ShareableResource&gt;);
-
-    RefPtr&lt;ShareableResource&gt; 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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -822,8 +822,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">@@ -2858,8 +2856,6 @@
</span><span class="cx">                 512127C21908239A00DAF35C /* WebPasteboardOverrides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardOverrides.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5121745E164C20E30037A5C1 /* ShareableResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShareableResource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5121745F164C20E30037A5C1 /* ShareableResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareableResource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                51217462164C21370037A5C1 /* WebResourceBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceBuffer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                51217463164C21370037A5C1 /* WebResourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceBuffer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 5123CF19133D260A0056F800 /* WKIconDatabaseCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WKIconDatabaseCG.cpp; path = cg/WKIconDatabaseCG.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5123CF1A133D260A0056F800 /* WKIconDatabaseCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKIconDatabaseCG.h; path = cg/WKIconDatabaseCG.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51290990183ACEAF005522A6 /* WebIDBServerConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBServerConnection.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4539,8 +4535,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">@@ -7618,7 +7612,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">@@ -9304,7 +9297,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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -30,12 +30,10 @@
</span><span class="cx"> #include &quot;NetworkConnectionToWebProcessMessages.h&quot;
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebProcess.h&quot;
</span><del>-#include &quot;WebResourceBuffer.h&quot;
</del><span class="cx"> #include &quot;WebResourceLoadScheduler.h&quot;
</span><span class="cx"> #include &quot;WebResourceLoaderMessages.h&quot;
</span><span class="cx"> #include &lt;WebCore/CachedResource.h&gt;
</span><span class="cx"> #include &lt;WebCore/MemoryCache.h&gt;
</span><del>-#include &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #include &lt;WebCore/SessionID.h&gt;
</span><span class="cx"> #include &lt;WebCore/SharedBuffer.h&gt;
</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-&gt;tryReplaceEncodedData(buffer.release());
</del><ins>+    resource-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> #include &lt;WebCore/FrameLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/NetscapePlugInStreamLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/ReferrerPolicy.h&gt;
</span><del>-#include &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #include &lt;WebCore/ResourceLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/SessionID.h&gt;
</span><span class="cx"> #include &lt;WebCore/Settings.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include &lt;WebCore/ApplicationCacheHost.h&gt;
</span><span class="cx"> #include &lt;WebCore/CertificateInfo.h&gt;
</span><span class="cx"> #include &lt;WebCore/DocumentLoader.h&gt;
</span><del>-#include &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #include &lt;WebCore/ResourceError.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceLoader.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.h (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.h        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.h        2014-10-31 04:25:34 UTC (rev 175406)
</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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx"> #include &lt;WebCore/PluginData.h&gt;
</span><span class="cx"> #include &lt;WebCore/PluginDocument.h&gt;
</span><span class="cx"> #include &lt;WebCore/ProgressTracker.h&gt;
</span><del>-#include &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #include &lt;WebCore/ResourceError.h&gt;
</span><span class="cx"> #include &lt;WebCore/ScriptController.h&gt;
</span><span class="cx"> #include &lt;WebCore/Settings.h&gt;
</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&lt;ResourceBuffer&gt; mainResourceData = loader-&gt;mainResourceData();
</del><ins>+            RefPtr&lt;SharedBuffer&gt; mainResourceData = loader-&gt;mainResourceData();
</ins><span class="cx">             IPC::DataReference dataReference(reinterpret_cast&lt;const uint8_t*&gt;(mainResourceData ? mainResourceData-&gt;data() : 0), mainResourceData ? mainResourceData-&gt;size() : 0);
</span><span class="cx">             webPage-&gt;send(Messages::WebPageProxy::DidFinishLoadingDataForCustomContentProvider(loader-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -65,7 +65,6 @@
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><span class="cx"> #include &lt;WebCore/PluginDocument.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderTreeAsText.h&gt;
</span><del>-#include &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #include &lt;WebCore/ResourceLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/ScriptController.h&gt;
</span><span class="cx"> #include &lt;WebCore/SecurityOrigin.h&gt;
</span><span class="lines">@@ -305,7 +304,7 @@
</span><span class="cx">     DocumentLoader* documentLoader = m_coreFrame-&gt;loader().activeDocumentLoader();
</span><span class="cx">     if (!documentLoader)
</span><span class="cx">         return String();
</span><del>-    RefPtr&lt;ResourceBuffer&gt; mainResourceData = documentLoader-&gt;mainResourceData();
</del><ins>+    RefPtr&lt;SharedBuffer&gt; mainResourceData = documentLoader-&gt;mainResourceData();
</ins><span class="cx">     if (!mainResourceData)
</span><span class="cx">         return String();
</span><span class="cx">     return decoder-&gt;encoding().decode(mainResourceData-&gt;data(), mainResourceData-&gt;size());
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -137,7 +137,6 @@
</span><span class="cx"> #include &lt;WebCore/RenderLayer.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderTreeAsText.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderView.h&gt;
</span><del>-#include &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #include &lt;WebCore/ResourceRequest.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceResponse.h&gt;
</span><span class="cx"> #include &lt;WebCore/RuntimeEnabledFeatures.h&gt;
</span><span class="lines">@@ -2433,17 +2432,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&lt;SerializedScriptValue&gt; serializedResultValue;
</span><del>-    IPC::DataReference dataReference;
-
</del><span class="cx">     JSLockHolder lock(JSDOMWindow::commonVM());
</span><span class="cx">     if (JSValue resultValue = m_mainFrame-&gt;coreFrame()-&gt;script().executeScript(script, true).jsValue()) {
</span><del>-        if ((serializedResultValue = SerializedScriptValue::create(m_mainFrame-&gt;jsContext(), toRef(m_mainFrame-&gt;coreFrame()-&gt;script().globalObject(mainThreadNormalWorld())-&gt;globalExec(), resultValue), 0)))
-            dataReference = serializedResultValue-&gt;data();
</del><ins>+        serializedResultValue = SerializedScriptValue::create(m_mainFrame-&gt;jsContext(),
+            toRef(m_mainFrame-&gt;coreFrame()-&gt;script().globalObject(mainThreadNormalWorld())-&gt;globalExec(), resultValue), nullptr);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    IPC::DataReference dataReference;
+    if (serializedResultValue)
+        dataReference = serializedResultValue-&gt;data();
</ins><span class="cx">     send(Messages::WebPageProxy::ScriptValueCallback(dataReference, callbackID));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2456,15 +2454,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&lt;SharedBuffer&gt; 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&lt;const uint8_t*&gt;(buffer-&gt;data()), buffer-&gt;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">@@ -2487,20 +2484,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&lt;LegacyWebArchive&gt; archive;
</del><span class="cx">     RetainPtr&lt;CFDataRef&gt; data;
</span><ins>+    if (Frame* frame = frameWithSelection(m_page.get()))
+        data = LegacyWebArchive::createFromSelection(frame)-&gt;rawDataRepresentation();
+#endif
</ins><span class="cx"> 
</span><del>-    Frame* frame = frameWithSelection(m_page.get());
-    if (frame) {
-        archive = LegacyWebArchive::createFromSelection(frame);
-        data = archive-&gt;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">@@ -2523,24 +2517,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&lt;ResourceBuffer&gt; buffer;
-    RefPtr&lt;SharedBuffer&gt; pdfResource;
</del><ins>+    RefPtr&lt;SharedBuffer&gt; buffer;
</ins><span class="cx">     if (WebFrame* frame = WebProcess::shared().webFrame(frameID)) {
</span><del>-        if (PluginView* pluginView = pluginViewForFrame(frame-&gt;coreFrame())) {
-            if ((pdfResource = pluginView-&gt;liveResourceData()))
-                dataReference = IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;(pdfResource-&gt;data()), pdfResource-&gt;size());
</del><ins>+        if (PluginView* pluginView = pluginViewForFrame(frame-&gt;coreFrame()))
+            buffer = pluginView-&gt;liveResourceData();
+        if (!buffer) {
+            if (DocumentLoader* loader = frame-&gt;coreFrame()-&gt;loader().documentLoader())
+                buffer = loader-&gt;mainResourceData();
</ins><span class="cx">         }
</span><del>-
-        if (dataReference.isEmpty()) {
-            if (DocumentLoader* loader = frame-&gt;coreFrame()-&gt;loader().documentLoader()) {
-                if ((buffer = loader-&gt;mainResourceData()))
-                    dataReference = IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;(buffer-&gt;data()), buffer-&gt;size());
-            }
-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // FIXME: Use SharedBufferDataReference.
+    IPC::DataReference dataReference;
+    if (buffer)
+        dataReference = IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;(buffer-&gt;data()), buffer-&gt;size());
</ins><span class="cx">     send(Messages::WebPageProxy::DataCallback(dataReference, callbackID));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2559,38 +2549,38 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::getResourceDataFromFrame(uint64_t frameID, const String&amp; resourceURLString, uint64_t callbackID)
</span><span class="cx"> {
</span><del>-    IPC::DataReference dataReference;
-    URL resourceURL(URL(), resourceURLString);
-
</del><span class="cx">     RefPtr&lt;SharedBuffer&gt; 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-&gt;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&lt;const uint8_t*&gt;(buffer-&gt;data()), buffer-&gt;size());
</del><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // FIXME: Use SharedBufferDataReference.
+    IPC::DataReference dataReference;
+    if (buffer)
+        dataReference = IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;(buffer-&gt;data()), buffer-&gt;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&lt;CFDataRef&gt; data;
</span><del>-    if (WebFrame* frame = WebProcess::shared().webFrame(frameID)) {
-        if ((data = frame-&gt;webArchiveData(0, 0)))
-            dataReference = IPC::DataReference(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()));
-    }
</del><ins>+    if (WebFrame* frame = WebProcess::shared().webFrame(frameID))
+        data = frame-&gt;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 (175405 => 175406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-10-31 02:37:40 UTC (rev 175405)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-10-31 04:25:34 UTC (rev 175406)
</span><span class="lines">@@ -81,7 +81,6 @@
</span><span class="cx"> #import &lt;WebCore/RenderImage.h&gt;
</span><span class="cx"> #import &lt;WebCore/RenderThemeIOS.h&gt;
</span><span class="cx"> #import &lt;WebCore/RenderView.h&gt;
</span><del>-#import &lt;WebCore/ResourceBuffer.h&gt;
</del><span class="cx"> #import &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> #import &lt;WebCore/TextIterator.h&gt;
</span><span class="cx"> #import &lt;WebCore/VisibleUnits.h&gt;
</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-&gt;parentElement())
-        if (currentElement-&gt;isLink())
-            return currentElement;
-    return 0;
</del><ins>+    for (auto&amp; currentElement : elementLineage(element)) {
+        if (currentElement.isLink())
+            return &amp;currentElement;
+    }
+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::getPositionInformation(const IntPoint&amp; point, InteractionInformationAtPosition&amp; info)
</span><span class="lines">@@ -1949,73 +1949,77 @@
</span><span class="cx">     if (!is&lt;HTMLElement&gt;(m_interactionNode.get()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    HTMLElement* element = downcast&lt;HTMLElement&gt;(m_interactionNode.get());
-    if (!element-&gt;renderer())
</del><ins>+    HTMLElement&amp; element = downcast&lt;HTMLElement&gt;(*m_interactionNode);
+    if (!element.renderer())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (static_cast&lt;SheetAction&gt;(action) == SheetAction::Copy) {
</span><del>-        if (is&lt;RenderImage&gt;(*element-&gt;renderer())) {
-            Element* linkElement = containingLinkElement(element);
-        
</del><ins>+        if (is&lt;RenderImage&gt;(*element.renderer())) {
+            Element* linkElement = containingLinkElement(&amp;element);
</ins><span class="cx">             if (!linkElement)
</span><del>-                m_interactionNode-&gt;document().frame()-&gt;editor().writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), *element, downcast&lt;RenderImage&gt;(*element-&gt;renderer()).cachedImage()-&gt;url(), String());
</del><ins>+                m_interactionNode-&gt;document().frame()-&gt;editor().writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), element, downcast&lt;RenderImage&gt;(*element.renderer()).cachedImage()-&gt;url(), String());
</ins><span class="cx">             else
</span><del>-                m_interactionNode-&gt;document().frame()-&gt;editor().copyURL(linkElement-&gt;document().completeURL(stripLeadingAndTrailingHTMLSpaces(linkElement-&gt;getAttribute(HTMLNames::hrefAttr))), linkElement-&gt;textContent());
-        } else if (element-&gt;isLink()) {
-            m_interactionNode-&gt;document().frame()-&gt;editor().copyURL(element-&gt;document().completeURL(stripLeadingAndTrailingHTMLSpaces(element-&gt;getAttribute(HTMLNames::hrefAttr))), element-&gt;textContent());
</del><ins>+                m_interactionNode-&gt;document().frame()-&gt;editor().copyURL(linkElement-&gt;document().completeURL(stripLeadingAndTrailingHTMLSpaces(linkElement-&gt;fastGetAttribute(HTMLNames::hrefAttr))), linkElement-&gt;textContent());
+        } else if (element.isLink()) {
+            m_interactionNode-&gt;document().frame()-&gt;editor().copyURL(element.document().completeURL(stripLeadingAndTrailingHTMLSpaces(element.fastGetAttribute(HTMLNames::hrefAttr))), element.textContent());
</ins><span class="cx">         }
</span><span class="cx">     } else if (static_cast&lt;SheetAction&gt;(action) == SheetAction::SaveImage) {
</span><del>-        if (!is&lt;RenderImage&gt;(*element-&gt;renderer()))
</del><ins>+        if (!is&lt;RenderImage&gt;(*element.renderer()))
</ins><span class="cx">             return;
</span><del>-        if (CachedImage* cachedImage = downcast&lt;RenderImage&gt;(*element-&gt;renderer()).cachedImage()) {
-            SharedMemory::Handle handle;
-            RefPtr&lt;SharedBuffer&gt; buffer = cachedImage-&gt;resourceBuffer()-&gt;sharedBuffer();
-            if (buffer) {
-                uint64_t bufferSize = buffer-&gt;size();
-                RefPtr&lt;SharedMemory&gt; sharedMemoryBuffer = SharedMemory::create(bufferSize);
-                memcpy(sharedMemoryBuffer-&gt;data(), buffer-&gt;data(), bufferSize);
-                sharedMemoryBuffer-&gt;createHandle(handle, SharedMemory::ReadOnly);
-                send(Messages::WebPageProxy::SaveImageToLibrary(handle, bufferSize));
-            }
-        }
</del><ins>+        CachedImage* cachedImage = downcast&lt;RenderImage&gt;(*element.renderer()).cachedImage();
+        if (!cachedImage)
+            return;
+        buffer = cachedImage-&gt;resourceBuffer();
+        if (!buffer)
+            return;
+        uint64_t bufferSize = buffer-&gt;size();
+        RefPtr&lt;SharedMemory&gt; sharedMemoryBuffer = SharedMemory::create(bufferSize);
+        memcpy(sharedMemoryBuffer-&gt;data(), buffer-&gt;data(), bufferSize);
+        SharedMemory::Handle handle;
+        sharedMemoryBuffer-&gt;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&amp; node)
</ins><span class="cx"> {
</span><del>-    if (is&lt;HTMLSelectElement&gt;(*node))
</del><ins>+    if (is&lt;HTMLSelectElement&gt;(node))
</ins><span class="cx">         return true;
</span><del>-    if (is&lt;HTMLTextAreaElement&gt;(*node))
-        return !downcast&lt;HTMLTextAreaElement&gt;(*node).isReadOnlyNode();
-    if (is&lt;HTMLInputElement&gt;(*node)) {
-        HTMLInputElement&amp; element = downcast&lt;HTMLInputElement&gt;(*node);
-        return !element.isReadOnlyNode() &amp;&amp; (element.isTextField() || element.isDateField() || element.isDateTimeLocalField() || element.isMonthField() || element.isTimeField());
</del><ins>+    if (is&lt;HTMLTextAreaElement&gt;(node))
+        return !downcast&lt;HTMLTextAreaElement&gt;(node).isReadOnlyNode();
+    if (is&lt;HTMLInputElement&gt;(node)) {
+        HTMLInputElement&amp; inputElement = downcast&lt;HTMLInputElement&gt;(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() &amp;&amp; (inputElement.isTextField() || inputElement.isDateField() || inputElement.isDateTimeLocalField() || inputElement.isMonthField() || inputElement.isTimeField());
</ins><span class="cx">     }
</span><del>-
-    return node-&gt;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&amp; page, bool isForward)
</ins><span class="cx"> {
</span><ins>+    if (!is&lt;Element&gt;(startNode))
+        return nullptr;
+
</ins><span class="cx">     RefPtr&lt;KeyboardEvent&gt; key = KeyboardEvent::create();
</span><span class="cx"> 
</span><span class="cx">     Element* nextElement = downcast&lt;Element&gt;(startNode);
</span><span class="cx">     do {
</span><del>-        nextElement = isForward ? page-&gt;focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&amp;nextElement-&gt;document()), nextElement, key.get())
-            : page-&gt;focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&amp;nextElement-&gt;document()), nextElement, key.get());
-    } while (nextElement &amp;&amp; !isAssistableNode(nextElement));
</del><ins>+        nextElement = isForward
+            ? page.focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&amp;nextElement-&gt;document()), nextElement, key.get())
+            : page.focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&amp;nextElement-&gt;document()), nextElement, key.get());
+    } while (nextElement &amp;&amp; !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&amp; 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-&gt;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&lt;HTMLSelectElement&gt;(*m_assistedNode)) {
</span><span class="cx">         HTMLSelectElement&amp; element = downcast&lt;HTMLSelectElement&gt;(*m_assistedNode);
</span></span></pre>
</div>
</div>

</body>
</html>