Source/WebCore: Web Inspector: Incorrect XHR responses when two async xhrs are sent synchronously
https://bugs.webkit.org/show_bug.cgi?id=91630

Patch by Pavel Chadnov <chadnov@google.com> on 2012-08-15
Reviewed by Vsevolod Vlasov.

CachedResource object for XHR response is now taken from ResourceLoader (if it's possible).

Test: http/tests/inspector/network/network-xhr-async-double.html

* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
(WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::didReceiveResourceResponse):
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::willSendRequest):
(WebCore::InspectorResourceAgent::didReceiveResponse):
* inspector/InspectorResourceAgent.h:
(WebCore):
(InspectorResourceAgent):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didReceiveResponse):
(WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
* loader/ResourceLoadNotifier.h:
(ResourceLoadNotifier):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::isSubresourceLoader):
(WebCore):
* loader/ResourceLoader.h:
(ResourceLoader):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::cachedResource):
(WebCore):
(WebCore::SubresourceLoader::isSubresourceLoader):
* loader/SubresourceLoader.h:
(SubresourceLoader):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didReceiveResponse):

LayoutTests: Web Inspector: Incorrect XHR responses when two async xhrs are sent synchronously
https://bugs.webkit.org/show_bug.cgi?id=91630

Patch by Pavel Chadnov <chadnov@google.com> on 2012-08-15
Reviewed by Vsevolod Vlasov.

New test for two async XHRs sent synchronously.

* http/tests/inspector/network-test.js:
(doXHR):
(doXHRWithPayload.xhr.onreadystatechange):
(doXHRWithPayload):
* http/tests/inspector/network/network-xhr-async-double-expected.txt: Added.
* http/tests/inspector/network/network-xhr-async-double.html: Added.
* http/tests/inspector/network/resources/echo-payload.php: Added.
* platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt:
* platform/chromium/http/tests/inspector/console-xhr-logging-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add the timestampOffset attribute to SourceBuffer.
https://bugs.webkit.org/show_bug.cgi?id=93303

Reviewed by Dimitri Glazkov.

On the 30 July 2012 version of the Media Source Extensions spec, a timestampOffset
attribute was added to the SourceBuffer object:
http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#dom-timestampoffset

Source/WebCore:

Tests: additions to http/tests/media/media-source/video-media-source-objects.html

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::setTimestampOffset): Set the timestampOffset on MediaPlayer.
(WebCore):
* Modules/mediasource/MediaSource.h:
(MediaSource):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer): Let the timestampOffset be 0 initially
(WebCore::SourceBuffer::timestampOffset): Return the last value set.
(WebCore):
(WebCore::SourceBuffer::setTimestampOffset): Forward the call onto MediaSouce.
* Modules/mediasource/SourceBuffer.h:
(SourceBuffer):
* Modules/mediasource/SourceBuffer.idl: Create the new timestampOffset attr.
* platform/graphics/MediaPlayer.cpp:
(WebCore::NullMediaPlayerPrivate::sourceSetTimestampOffset): A null media player
    should just return false (nothing to set).
(WebCore):
(WebCore::MediaPlayer::sourceSetTimestampOffset):  Forward the call.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::sourceSetTimestampOffset):

Source/WebKit/chromium:

* public/WebMediaPlayer.h:
(WebKit::WebMediaPlayer::sourceSetTimestampOffset): Add the new method.
* src/WebMediaPlayerClientImpl.cpp:
(WebKit):
(WebKit::WebMediaPlayerClientImpl::sourceSetTimestampOffset): Forward the call.
* src/WebMediaPlayerClientImpl.h:
(WebMediaPlayerClientImpl):

LayoutTests:

* http/tests/media/media-source/video-media-source-objects-expected.txt:
* http/tests/media/media-source/video-media-source-objects.html:

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