REGRESSION (r160085): check-webkit-style: utf8' codec can't decode byte 0x89 in position 0: invalid start byte.
https://bugs.webkit.org/show_bug.cgi?id=126702

Patch by László Langó <llango.u-szeged@partner.samsung.com> on 2014-01-14
Reviewed by Alexey Proskuryakov.

Resolve regression and remove a FIXME comment that is already fixed.

* Scripts/webkitpy/common/system/filesystem.py:
(FileSystem.open_text_file_for_reading):
* Scripts/webkitpy/common/system/filesystem_unittest.py:
(RealFileSystemTest.test_read_and_write_file):
* Scripts/webkitpy/style/filereader.py:
(TextFileReader._read_lines):
* Scripts/webkitpy/style/filereader_unittest.py:
(TextFileReaderTest.test_count_delete_only_file):
(TextFileReaderTest):
(TextFileReaderTest.test_process_malformed_file):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in WebCore::MediaSourcePrivateAVFObjC::hasAudio const + 13
https://bugs.webkit.org/show_bug.cgi?id=126768

Reviewed by Eric Carlson.

Null-check m_mediaSourcePrivate before calling.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::hasVideo):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::hasAudio):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add ENABLE(WEB_REPLAY) feature flag to the build system
https://bugs.webkit.org/show_bug.cgi?id=126949

Patch by Brian J. Burg <burg@cs.washington.edu> on 2014-01-14
Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h: for now, disable the flag by default.

Tools:

* Scripts/webkitperl/FeatureList.pm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Skip FontConfig initialization in WebKitTestRunner if requested
https://bugs.webkit.org/show_bug.cgi?id=120110

Reviewed by Martin Robinson.

Skip the FontConfig settings initialization in WebKitTestRunner if the
WEBKIT_SKIP_WEBKITTESTRUNNER_FONTCONFIG_INITIALIZATION environment variable is set.
This is useful when profiling the WebKitTestRunner execution, where at the startup
this step takes considerable amount of time and disturbs the profiling output.

* WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
(WTR::initializeFontConfigSetting):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
iOS WebKit2 build fixes, part 2

* WebKit2.xcodeproj/project.pbxproj:
Add some missing files.

* WebCore.exp.in:
Export some more symbols.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
iOS WebKit2 build fixes, part 3

* WebKit2.xcodeproj/project.pbxproj:
Remove some files from the 'All' target that should never have been a part of it.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enable the experimental selector code generator by default
https://bugs.webkit.org/show_bug.cgi?id=126953

Reviewed by Gavin Barraclough.

* wtf/Platform.h:
Enable CSS_SELECTOR_JIT on OS X x86_64 by default.
The feature is not ready to ship but it is stable enough to enable
for the bots and nightly.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: For Remote Inspection link WebProcess's to their parent UIProcess
https://bugs.webkit.org/show_bug.cgi?id=126995

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-01-14
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::listingForDebuggable):
For each WebView, list the parent process. Listing the parent per WebView
is already supported back when we supported processes that could host WebViews
for multiple applications.

* inspector/remote/RemoteInspectorConstants.h:
Add a separate key for the bundle identifier, separate from application identifier.

* inspector/remote/RemoteInspectorDebuggable.cpp:
(Inspector::RemoteInspectorDebuggable::info):
* inspector/remote/RemoteInspectorDebuggable.h:
(Inspector::RemoteInspectorDebuggableInfo::RemoteInspectorDebuggableInfo):
(Inspector::RemoteInspectorDebuggableInfo::hasParentProcess):
If a RemoteInspectorDebuggable has a non-zero parent process identifier
it is a proxy for the parent process.

Source/WebCore:

* inspector/InspectorClient.h:
(WebCore::InspectorClient::parentProcessIdentifier):
Client method intended for WebKit2 so a WebProcess can link to its UIProcess.

* page/PageDebuggable.h:
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::parentProcessIdentifier):
Provide parent process identifier if there is one.

Source/WebKit2:

* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::parentProcessIdentifier):
WebProcesses are proxies for a parent UIProcess.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore icon database appears to leak sudden termination assertions
<https://webkit.org/b/126971> / <rdar://problem/15808797>

Introduce an RAII wrapper around disableSuddenTermination / enableSuddenTermination
and adopt it in IconDatabase to address the incorrect management of sudden termination.

IconDatabase now owns up to two SuddenTerminationDisabler objects. One ensures that
sudden termination is disabled while we're waiting on the sync timer to fire. The second
ensures that sudden termination is disabled while we're waiting on the sync thread to
process any pending work.

Reviewed by Alexey Proskuryakov.

* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::IconDatabase):
(WebCore::IconDatabase::wakeSyncThread): Disable sudden termination until the sync thread
has finished this unit of work.
(WebCore::IconDatabase::scheduleOrDeferSyncTimer): Disable sudden termination until the
sync timer has fired.
(WebCore::IconDatabase::syncTimerFired): Clear the member variable to reenable sudden termination.
(WebCore::IconDatabase::syncThreadMainLoop): Taken ownership of the SuddenTerminationDisabler
instance when we start processing a unit of work. Discard the object when our work is complete.
* loader/icon/IconDatabase.h:
* platform/SuddenTermination.h:
(WebCore::SuddenTerminationDisabler::SuddenTerminationDisabler): Disable sudden termination when created.
(WebCore::SuddenTerminationDisabler::~SuddenTerminationDisabler): Enable it when destroyed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: [WebGL] Invalid range checking in WebGLRenderingContext::validateTexFuncLevel
https://bugs.webkit.org/show_bug.cgi?id=126925

Reviewed by Dean Jackson.

Added fast/canvas/webgl/webgl-compressed-texture-size-limit.html.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateTexFuncLevel): Avoid off-by-one error

LayoutTests: [WebGL] Invalid range checking in WebGLRenderContext::validateTexFunctionLevel
https://bugs.webkit.org/show_bug.cgi?id=126925

Reviewed by Dean Jackson.

* fast/canvas/webgl/resources/webgl-test-utils.js:
(WebGLTestUtils): Add missing 'waitForComposite' implementatino.
* fast/canvas/webgl/webgl-compressed-texture-size-limit-expected.txt: Added.
* fast/canvas/webgl/webgl-compressed-texture-size-limit.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Directly allocate NSMutableDictionary in QLPreviewConverterDictionary() and QLContentDictionary()
https://bugs.webkit.org/show_bug.cgi?id=126999
<rdar://problem/15810305>

Reviewed by Joseph Pecoraro.

Fixes an issue where we may crash when subsequently accessing WebCore::QLPreviewConverterDictionary()
or WebCore::QLContentDictionary(). Currently neither of these functions retain'ed the NSMutable dictionary
returned by [NSMutableDictionary dictionary]. Instead, we should allocate and initialize NSMutableDictionary
directly to ensure that the dictionary is retained.

* platform/network/ios/QuickLook.mm:
(QLPreviewConverterDictionary):
(QLContentDictionary):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit2 leaks sudden termination assertions when a page with unload handlers is closed.
<https://webkit.org/b/126974> / <rdar://problem/15812954>

When a page with an unload handler is loaded, the web process tells the UI process that it
should disable sudden termination. However, when the page is closed the connection between
the web and UI process is torn down before the web content has a chance to tell the UI
process to reenable sudden termination.

Reviewed by Anders Carlsson.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::~WebProcessProxy): Balance any outstanding disableSuddenTermination calls.
(WebKit::WebProcessProxy::enableSuddenTermination): Decrement the count.
(WebKit::WebProcessProxy::disableSuddenTermination): Increment the count.
* UIProcess/WebProcessProxy.h:


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