Fix the !USE(IOSURFACE) build.

* WebCore.exp.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=134732

Reviewed by Darin Adler.

Source/WebCore:
No new tests because no functional changes.

* WebCore.exp.in:

Source/WebKit2:
Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This
is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering
that uses AsynchronousNetworkLoaderClient.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
(WebKit::NetworkResourceLoader::didFinishLoading):
* NetworkProcess/NetworkResourceLoader.h:
(WebKit::NetworkResourceLoader::bufferedData):
* NetworkProcess/SynchronousNetworkLoaderClient.cpp:
(WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
(WebKit::SynchronousNetworkLoaderClient::didFinishLoading):
(WebKit::SynchronousNetworkLoaderClient::didFail):
(WebKit::SynchronousNetworkLoaderClient::sendDelayedReply):
* NetworkProcess/SynchronousNetworkLoaderClient.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add SharedBuffer::wrapCFDataArray() and use it
https://bugs.webkit.org/show_bug.cgi?id=134733

Reviewed by Antti Koivisto.

No new tests. Should be covered by existing tests.

* platform/SharedBuffer.h:
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::wrapCFDataArray):
(WebCore::SharedBuffer::SharedBuffer):
* platform/network/ResourceHandle.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::handleDataArray): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray):
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveDataArray:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r167770): Cannot login in Evernote Safari extension
https://bugs.webkit.org/show_bug.cgi?id=134776

Reviewed by Enrica Casucci.

Unfortunately, NSWindowDidBecomeKeyNotification does not notify us when a popover becomes key
so we need to keep using the SPI (_windowChangedKeyState) I removed in r167770.

* WebView/WebView.mm:
(-[WebView _windowChangedKeyState]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170931 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: [MSE] http/tests/media/media-source/mediasource-remove.html is failing
https://bugs.webkit.org/show_bug.cgi?id=134768

Reviewed by Eric Carlson.

Fix multiple bugs causing mediasource-remove.html to fail:

Separate out setDuration() into setDurationInternal() so that steps which require
us to run the "duration change algorithm" don't bail out if the SoureBuffer is
inside updating().

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::setDuration):
(WebCore::MediaSource::setDurationInternal):
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):

When removing coded frames, do so starting from the first sample in the range in
decode order, so that frames dependant on removed frames are themselves removed. Add
a convenience method in SampleMap findSampleWithPresentationTime(), and rename
findSampleAfterPresentationTime() to findSampleOnOrAfterPresentationTime() to correctly
reflect what the method does, and simplify its implementation by searching the map's keys
directly.

* Modules/mediasource/SampleMap.cpp:
(WebCore::PresentationOrderSampleMap::findSampleWithPresentationTime):
(WebCore::PresentationOrderSampleMap::findSampleOnOrAfterPresentationTime):
(WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime):
(WebCore::PresentationOrderSampleMap::findSampleAfterPresentationTime): Deleted.
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::decodeTimeComparator):
(WebCore::SourceBuffer::removeCodedFrames):

Throw the correct exception (INVALID_STATE_ERR) from SourceBuffer::remove().

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::remove):

LayoutTests: [MSE] http/tests/media/media-source/mediasource-remove.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=134768

Reviewed by Eric Carlson.

Update mediasource-remove.html with the correct locations of sync-samples.

* http/tests/media/media-source/mediasource-remove.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170932 268f45cc-cd09-0410-ab3c-d52691b4dbfc