[iOS] Protect against possbile deadlock by delaying video layer creation
https://bugs.webkit.org/show_bug.cgi?id=127505

Reviewed by Eric Carlson.

Work around a possible deadlock on iOS when creating a media element
backed by AVFoundation by delaying creation of the AVPlayerLayer.
The deadlock can occur when the web thread is doing CALayer layout
while taking the web thread lock, while CoreMedia is doing property
access on an async thread while taking the CM lock, and each is waiting
for the other's lock to be released.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/15875326> REGRESSION (r162257): Assertion failure (should not be reached) in CSSPreloadScanner::tokenize()
https://bugs.webkit.org/show_bug.cgi?id=127540

Reviewed by Anders Carlsson.

No new tests, because I could not reproduce the bug reliably and I don’t know how to trigger
it.

* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::scan): Check for the DoneParsingImportRules before tokenizing
a character, not after. This restores the logic from before r162257.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix attemp on the EFL and GTK build after r162678

* CMakeLists.txt: Removed WebPolicyClient.cpp
* GNUmakefile.list.am: Removed WebPolicyClient.cpp and WebPolicyClient.h

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix crash when opening the inspector
https://bugs.webkit.org/show_bug.cgi?id=127542
<rdar://problem/15899544>

Reviewed by Joseph Pecoraro.

Create default clients so we won't crash if they're never set.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: IDB: Support IDBObjectStore.clear()
https://bugs.webkit.org/show_bug.cgi?id=127541

Reviewed by Anders Carlsson.

The backing store should never be performing callbacks directly:
* Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp:
(WebCore::IDBServerConnectionLevelDB::clearObjectStore):

Instead, the transaction operations should do that themselves:
* Modules/indexeddb/IDBTransactionBackendOperations.cpp:
(WebCore::ClearObjectStoreOperation::perform):
* Modules/indexeddb/IDBTransactionBackendOperations.h:
(WebCore::ClearObjectStoreOperation::transaction):

Source/WebKit2: IDB: Support IDBObjectStore.clear()
https://bugs.webkit.org/show_bug.cgi?id=127541

Reviewed by Anders Carlsson.

Make the WebProcess call out to the DatabaseProcess with a clear request, and handle the
response from the DatabaseProcess:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::clearObjectStore):
(WebKit::WebIDBServerConnection::didClearObjectStore):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:

Pass the clear request to the appropriate UniqueIDBDatabase:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::clearObjectStore):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:

Pass the clear request to the backing store:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::didClearObjectStore):
(WebKit::UniqueIDBDatabase::clearObjectStore):
(WebKit::UniqueIDBDatabase::clearObjectStoreInBackingStore):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

Actually drop the records in the database:
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move RegularExpression into JavaScriptCore for inspector
https://bugs.webkit.org/show_bug.cgi?id=127526

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Move RegularExpression into JavaScriptCore/yarr so it can
be used later on by JavaScriptCore/inspector. Convert to
the JSC::Yarr namespace.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* yarr/RegularExpression.cpp: Renamed from Source/WebCore/platform/text/RegularExpression.cpp.
(JSC::Yarr::RegularExpression::Private::create):
(JSC::Yarr::RegularExpression::Private::Private):
(JSC::Yarr::RegularExpression::Private::compile):
(JSC::Yarr::RegularExpression::RegularExpression):
(JSC::Yarr::RegularExpression::~RegularExpression):
(JSC::Yarr::RegularExpression::operator=):
(JSC::Yarr::RegularExpression::match):
(JSC::Yarr::RegularExpression::searchRev):
(JSC::Yarr::RegularExpression::matchedLength):
(JSC::Yarr::replace):
(JSC::Yarr::RegularExpression::isValid):
* yarr/RegularExpression.h: Renamed from Source/WebCore/platform/text/RegularExpression.h.

Source/WebCore:

Update as appropriate for the moved file and namespace
change for class RegularExpression.

* CMakeLists.txt:
* ForwardingHeaders/yarr/RegularExpression.h: Added.
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMImplementation.h:
* html/BaseCheckableInputType.cpp:
* html/BaseTextInputType.cpp:
(WebCore::BaseTextInputType::patternMismatch):
* html/EmailInputType.cpp:
(WebCore::isValidEmailAddress):
* html/InputType.cpp:
* inspector/ContentSearchUtils.cpp:
(WebCore::ContentSearchUtils::getRegularExpressionMatchesByLines):
(WebCore::ContentSearchUtils::createSearchRegex):
(WebCore::ContentSearchUtils::countRegularExpressionMatches):
(WebCore::ContentSearchUtils::searchInTextByLines):
* inspector/ContentSearchUtils.h:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::matches):
(WebCore::InspectorDebuggerAgent::breakpointActionLog):
(WebCore::InspectorDebuggerAgent::breakpointActionSound):
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::searchInResources):
* inspector/InspectorPageAgent.h:
* inspector/InspectorRuntimeAgent.cpp:
* inspector/InspectorRuntimeAgent.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::selectorsFromSource):
* inspector/WorkerDebuggerAgent.cpp:
* page/Frame.cpp:
(WebCore::createRegExpForLabels):
(WebCore::Frame::searchForLabelsAboveCell):
(WebCore::Frame::searchForLabelsBeforeElement):
(WebCore::matchLabelsAgainstString):
* page/Frame.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getUnmangledInfoLog):

Source/WebKit/mac:

* WebView/WebHTMLRepresentation.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move ContentSearchUtils, ScriptBreakpoint, and ScriptDebugListener into JavaScriptCore for inspector
https://bugs.webkit.org/show_bug.cgi?id=127537

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/ContentSearchUtilities.cpp: Renamed from Source/WebCore/inspector/ContentSearchUtils.cpp.
(Inspector::ContentSearchUtilities::createSearchRegexSource):
(Inspector::ContentSearchUtilities::sizetExtractor):
(Inspector::ContentSearchUtilities::textPositionFromOffset):
(Inspector::ContentSearchUtilities::getRegularExpressionMatchesByLines):
(Inspector::ContentSearchUtilities::lineEndings):
(Inspector::ContentSearchUtilities::buildObjectForSearchMatch):
(Inspector::ContentSearchUtilities::createSearchRegex):
(Inspector::ContentSearchUtilities::countRegularExpressionMatches):
(Inspector::ContentSearchUtilities::searchInTextByLines):
(Inspector::ContentSearchUtilities::scriptCommentPattern):
(Inspector::ContentSearchUtilities::stylesheetCommentPattern):
(Inspector::ContentSearchUtilities::findMagicComment):
(Inspector::ContentSearchUtilities::findScriptSourceURL):
(Inspector::ContentSearchUtilities::findScriptSourceMapURL):
(Inspector::ContentSearchUtilities::findStylesheetSourceMapURL):
* inspector/ContentSearchUtilities.h: Renamed from Source/WebCore/inspector/ContentSearchUtils.h.
* inspector/ScriptBreakpoint.h: Renamed from Source/WebCore/inspector/ScriptBreakpoint.h.
(Inspector::ScriptBreakpointAction::ScriptBreakpointAction):
(Inspector::ScriptBreakpoint::ScriptBreakpoint):
* inspector/ScriptDebugListener.h: Renamed from Source/WebCore/inspector/ScriptDebugListener.h.
(Inspector::ScriptDebugListener::Script::Script):
(Inspector::ScriptDebugListener::~ScriptDebugListener):
* runtime/RegExp.cpp:
(JSC::RegExp::match):

Source/WebCore:

  - Rename ContentSearchUtils => ContentSearchUtilities and move to JavaScriptCore.
  - Move ScriptBreakpoint and ScriptDebugListener to JavaScriptCore.
  - Move them all to namespace Inspector.
  - Update build files and users to the new names.

No change in functionality, just moving code.

* CMakeLists.txt:
* ForwardingHeaders/inspector/ContentSearchUtilities.h: Added.
* ForwardingHeaders/inspector/ScriptBreakpoint.h: Added.
* ForwardingHeaders/inspector/ScriptDebugListener.h: Added.
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/PageScriptDebugServer.cpp:
* bindings/js/PageScriptDebugServer.h:
* bindings/js/ScriptDebugServer.cpp:
* bindings/js/ScriptDebugServer.h:
* bindings/js/WorkerScriptDebugServer.cpp:
* bindings/js/WorkerScriptDebugServer.h:
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::searchInContent):
(WebCore::InspectorDebuggerAgent::sourceMapURLForScript):
(WebCore::InspectorDebuggerAgent::didParseSource):
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::sourceMapURLForResource):
(WebCore::InspectorPageAgent::searchInResource):
(WebCore::InspectorPageAgent::searchInResources):
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildSourceRangeObject):
(WebCore::InspectorStyleSheet::lineEndings):
(WebCore::InspectorStyleSheetForInlineStyle::lineEndings):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Upstream changes to json-shared.php from the perf dashboard
https://bugs.webkit.org/show_bug.cgi?id=127544

Reviewed by Joseph Pecoraro.

json-shared.php originated from the perf dashboard.
Upstream changes made to the version in the perf. dashboard so that two apps could share the same code.

* public/include/json-shared.php:
(exit_with_error):
(echo_success):
(exit_with_success):
(set_exit_detail):
(merge_additional_details):


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