Move PrettyPatch related code to prettypatch.py
https://bugs.webkit.org/show_bug.cgi?id=124937

Patch by Dániel Bátyai <Batyai.Daniel@stud.u-szeged.hu> on 2013-12-07
Reviewed by Ryosuke Niwa.

This code seems to have a better place here than in Port, since PrettyPatch already knows
pretty_patch_path, and this also unifies the usage of PrettyPatch

* Scripts/webkitpy/common/prettypatch.py:
(PrettyPatch.__init__):
(PrettyPatch.pretty_diff):
(PrettyPatch):
(PrettyPatch.pretty_patch_available):
(PrettyPatch.check_pretty_patch):
(PrettyPatch.pretty_patch_text):
* Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:
(TestResultWriter.create_text_diff_and_write_result):
* Scripts/webkitpy/layout_tests/models/test_run_results.py:
(summarize_results):
* Scripts/webkitpy/port/base.py:
(Port.__init__):
(Port.wdiff_available):
(Port.check_image_diff):
(Port.wdiff_text):
* Scripts/webkitpy/port/base_unittest.py:
(PortTest.test_pretty_patch_os_error):
(PortTest.test_pretty_patch_script_error):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win][64-bit] Hitting breakpoint assembler instruction in callToJavaScript.
https://bugs.webkit.org/show_bug.cgi?id=125382

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-12-07
Reviewed by Michael Saboff.

The WinCairo results from run-javascriptcore-tests are the same as the WinCairo 32-bits results, when removing these breakpoints.

* jit/JITStubsMSVC64.asm: Remove breakpoint instructions.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Build fix for gtk port after r160260.

* loader/cache/CachedImage.h: Add missing a header.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160273 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Run each gtest subtest separately instead of in one go
https://bugs.webkit.org/show_bug.cgi?id=125386

Reviewed by Martin Robinson.

This is what other ports are doing (except they build each test as a separate binary)
and will help with the timeouts we sometimes hit because it applies to the full test
run.

* Scripts/run-gtk-tests:
(TestRunner._get_tests_from_google_test_suite): get a list of available sub-tests.
(TestRunner._run_google_test): run a single subtest from a gtest binary.
(TestRunner._run_google_test_suite): call the binary once per subtest.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Convert MiniBrowser to use WKProcessGroup and WKBrowsingContextGroup
https://bugs.webkit.org/show_bug.cgi?id=125400

Reviewed by Dan Bernstein.

* MiniBrowser/mac/AppDelegate.h:
* MiniBrowser/mac/AppDelegate.m:
* MiniBrowser/mac/WK2BrowserWindowController.h:
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController initWithProcessGroup:browsingContextGroup:]):
(-[WK2BrowserWindowController dealloc]):
(createNewPage):
(-[WK2BrowserWindowController awakeFromNib]):
(-[WK2BrowserWindowController browsingContextController:didNavigateWithNavigationData:]):
(-[WK2BrowserWindowController browsingContextController:didPerformClientRedirectFromURL:toURL:]):
(-[WK2BrowserWindowController browsingContextController:didPerformServerRedirectFromURL:toURL:]):
(-[WK2BrowserWindowController browsingContextController:didUpdateHistoryTitle:forURL:]):
Replace global WKContextRef and WKPageGroupRef with WKProcessGroup and WKBrowsingContextGroup. Also
replace context based WKContextHistoryClient with WKBrowsingContextController based WKBrowsingContextHistoryDelegate


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Convert a few more parts of MiniBrowser over to the Objective-C API
https://bugs.webkit.org/show_bug.cgi?id=125401

Reviewed by Dan Bernstein.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController fetch:]):
(-[WK2BrowserWindowController reload:]):
(-[WK2BrowserWindowController goBack:]):
(-[WK2BrowserWindowController goForward:]):
(-[WK2BrowserWindowController validateUserInterfaceItem:]):
(-[WK2BrowserWindowController currentZoomFactor]):
(-[WK2BrowserWindowController setCurrentZoomFactor:]):
(-[WK2BrowserWindowController zoomIn:]):
(-[WK2BrowserWindowController zoomOut:]):
(-[WK2BrowserWindowController canResetZoom]):
(-[WK2BrowserWindowController resetZoom:]):
(-[WK2BrowserWindowController toggleZoomMode:]):
(-[WK2BrowserWindowController updateTextFieldFromURL:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Make WKWebProcessPlugInBrowserContextController work with WKObject wrapping
https://bugs.webkit.org/show_bug.cgi?id=125403

Reviewed by Dan Bernstein.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/mac/ObjCObjectGraphCoders.mm:
(WebKit::InjectedBundleObjCObjectGraphDecoderImpl::decode):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
(didCreatePage):
(willDestroyPage):
(setUpBundleClient):
(-[WKWebProcessPlugInController _initWithPrincipalClassInstance:bundle:]):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController dealloc]):
(-[WKWebProcessPlugInBrowserContextController mainFrameDocument]):
(-[WKWebProcessPlugInBrowserContextController selectedRange]):
(-[WKWebProcessPlugInBrowserContextController API::]):
(-[WKWebProcessPlugInBrowserContextController _bundlePageRef]):
(-[WKWebProcessPlugInBrowserContextController handle]):
(+[WKWebProcessPlugInBrowserContextController lookUpBrowsingContextFromHandle:]):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h:
(WebKit::wrapper):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::load):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] WebData has a generic wrapper
https://bugs.webkit.org/show_bug.cgi?id=125402

Reviewed by Sam Weinig.

Added WKNSData, an NSData subclass that confroms to WKObject and wraps a WebData.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject): Allocate a WKNSData if the API::Object is data.
* Shared/Cocoa/WKNSData.h: Added.
(WebKit::wrapper): Added. Returns a WebData’s wrapper as an NSData.
* Shared/Cocoa/WKNSData.mm: Added.
(-[WKNSData dealloc]): Calls the WebData destructor.
(-[WKNSData length]): Added.
(-[WKNSData bytes]): Added.
(-[WKNSData copyWithZone:]): Retains self.
(-[WKNSData _apiObject]): Returns the wrapped WebData.
* WebKit2.xcodeproj/project.pbxproj: Added references to new files.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove statusWithDirection static function from RenderBlockLineLayout
https://bugs.webkit.org/show_bug.cgi?id=125372

Reviewed by Andreas Kling.

I run into a FIXME about using BidiStatus constructor rather than statusWithDirection,
once it's implemented. BidiStatus has got the appropriate constructor now, so I removed
statusWithDirection and updated the code to use the constructor of BidiStatus.

No new tests, no behavior change.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::constructBidiRunsForSegment):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Make WKWebProcessPlugInController work with WKObject wrapping
https://bugs.webkit.org/show_bug.cgi?id=125404

Reviewed by Dan Bernstein.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/mac/ObjCObjectGraphCoders.mm:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
(-[WKWebProcessPlugInController dealloc]):
(didCreatePage):
(willDestroyPage):
(-[WKWebProcessPlugInController _setPrincipalClassInstance:]):
(-[WKWebProcessPlugInController API::]):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h:
(WebKit::wrapper):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInPrivate.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::load):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160280 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE][Mac] Crash when removing MediaSource from HTMLMediaElement.
https://bugs.webkit.org/show_bug.cgi?id=125269

Reviewed by Sam Weinig.

Fixes the media/media-source/media-source-fastseek.html test when run with MallocScribble enabled.

It's possible for a SourceBufferPrivateAVFObjC to outlive its MediaSourcePrivateAVFObjC, so
make sure to clear the pointer from the former to the latter when the latter is destroyed.
That means we now have to check to see if the pointer to the latter is still valid at every
call site.

As a drive-by fix, rename m_parent to m_mediaSource to more accurately reflect what the pointer
points to.

* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC): Clear the SourceBuffer's backpointer.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
(WebCore::SourceBufferPrivateAVFObjC::clearMediaSource):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): Rename m_parent -> m_mediaSource.
(WebCore::SourceBufferPrivateAVFObjC::append): Check m_mediaSource before calling.
(WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::readyState): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::setReadyState): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::setActive): Ditto.
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate): Clear the SourceBuffer's backpointer.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::MockSourceBufferPrivate): Rename m_parent -> m_mediaSource.
(WebCore::MockSourceBufferPrivate::removedFromMediaSource): Check m_mediaSource before calling.
(WebCore::MockSourceBufferPrivate::readyState): Ditto.
(WebCore::MockSourceBufferPrivate::setReadyState): Ditto.
(WebCore::MockSourceBufferPrivate::setActive): Ditto.
* platform/mock/mediasource/MockSourceBufferPrivate.h:
(WebCore::MockSourceBufferPrivate::clearMediaSource):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Bring end-of-stream algorithm section up to current spec.
https://bugs.webkit.org/show_bug.cgi?id=125270

Reviewed by Darin Adler.

Source/WebCore:

Test: media/media-source/media-source-end-of-stream.html

Separate the "endOfStream()" method from the "end of stream algorithm".

* Modules/mediasource/MediaSource.cpp:
(WebCore::SourceBufferIsUpdating): Added predicate function.
(WebCore::MediaSource::endOfStream): Call streamEndedWithError().
(WebCore::MediaSource::streamEndedWithError): Added.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferTimerFired): Call streamEndedWithError().
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
* Modules/mediasource/SourceBuffer.h:
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::mediaLoadingFailedFatally): Renamed from mediaEngineError.
(HTMLMediaElement::mediaLoadingFailed): Call renamed method.
* html/HTMLMediaElement.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::markEndOfStream): Set load state to Loaded.
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::setNetworkState): Simple setter.
* platform/mock/mediasource/MockMediaPlayerMediaSource.h:
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Set the intitial duration to NaN.
(WebCore::MockMediaSourcePrivate::markEndOfStream): Set load state to Loaded.

LayoutTests:

* media/media-source/media-source-end-of-stream-expected.txt: Added.
* media/media-source/media-source-end-of-stream.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening. Adding expectations for the current test failures.
Adding a GTK-specific baseline for a recently introduced a11y test.

* platform/gtk/TestExpectations:
* platform/gtk/accessibility/press-targets-center-point-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160283 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

Removing the baseline added in r160283. It's not really required, the failure is originating
in an unnecessary and wrong patch that's applied on the Freetype source tree that's used in the
GTK's Jhbuild setup. That patch will be removed in the near future, but until then the failure
of accessibility/press-targers-center-point.html should be handled through an expectation.

* platform/gtk/TestExpectations:
* platform/gtk/accessibility/press-targets-center-point-expected.txt: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gtk] install-dependencies doesn't install libgtk-3-dev
https://bugs.webkit.org/show_bug.cgi?id=125320

Patch by Brendan Long <b.long@cablelabs.com> on 2013-12-08
Reviewed by Gustavo Noronha Silva.

* gtk/install-dependencies: Add libgtk-3-dev, libsoup2.4 and subversion

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[webkitpy] Add a WestonDriver unit test
https://bugs.webkit.org/show_bug.cgi?id=125408

Reviewed by Gustavo Noronha Silva.

Add a webkitpy unit test for the Weston driver.

* Scripts/webkitpy/port/westondriver_unittest.py: Added.
(WestonDriverTest):
(WestonDriverTest.make_driver): Sets up a new WestonDriver instance for testing purposes.
(WestonDriverTest.test_start): Check that the Weston compositor is launched properly and that
the server environment contains proper WAYLAND and GDK_BACKEND entries.
(WestonDriverTest.test_stop): Check that the Weston compositor is terminated properly and that
the driver cleans up the temporary directory.
(WestonDriverTest.test_stop.FakeWestonProcess): A helper class that logs the expected termination.
(WestonDriverTest.test_stop.FakeWestonProcess.terminate):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[gdb] Update printers for WTF::CString, JSC::JSString
https://bugs.webkit.org/show_bug.cgi?id=124600

Reviewed by Gustavo Noronha Silva.

Update the two printers after they fell behind the changes in implementation.

* gdb/webkit.py:
(WTFCStringPrinter.to_string):
(JSCJSStringPrinter.to_string):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Do not generate new dispatch_event methods marked as deprecated
https://bugs.webkit.org/show_bug.cgi?id=125416

Reviewed by Gustavo Noronha Silva.

* bindings/scripts/CodeGeneratorGObject.pm:
(SkipFunction): Skip dispatch_event methods for objects
implementing EventTarget interface unless they are already
deprecated.
(GenerateFunction): Pass also the parentNode to SkipFunction().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Do not skip attributes with only custom setter
https://bugs.webkit.org/show_bug.cgi?id=125417

Reviewed by Gustavo Noronha Silva.

For attributes with a custom setter, we now generate the code as a
read-only attribute with a getter method, unless it also has a
custom getter in which case the attribute is skipped.

* bindings/gobject/GNUmakefile.am: Generate WebKitDOMMediaController
that is now required by an attribute having a custom setter.
* bindings/gobject/WebKitDOMCustom.cpp: Remove methods that are now generated.
* bindings/gobject/WebKitDOMCustom.h: Ditto.
* bindings/gobject/WebKitDOMCustom.symbols: Ditto.
* bindings/gobject/webkitdom.symbols: Add new symbols.
* bindings/scripts/CodeGeneratorGObject.pm:
(SkipAttribute): Do not skip attributes having a custom setter.
(GetWriteableProperties): Do not include attributes having a
custom setter.
(GenerateProperty): Do not return early for attributes having
custom setter.
(GenerateFunctions): Do not generate setter for attributes having
a custom setter.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Guard include of SecItemShim.h with ENABLE(SEC_ITEM_SHIM)
https://bugs.webkit.org/show_bug.cgi?id=125415

Patch by Brian Holt <brian.holt@samsung.com> on 2013-12-08
Reviewed by Gustavo Noronha Silva.

* NetworkProcess/NetworkProcess.cpp:
* UIProcess/Network/NetworkProcessProxy.cpp:

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