Fix bindings tests after r173176.
https://bugs.webkit.org/show_bug.cgi?id=136460

Reviewed by Simon Fraser.

* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSattribute.h:
* bindings/scripts/test/JS/JSreadonly.cpp:
* bindings/scripts/test/JS/JSreadonly.h:
* bindings/scripts/test/ObjC/DOMFloat64ArrayInternal.h:
* bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h:
* bindings/scripts/test/ObjC/DOMTestCallbackInternal.h:
* bindings/scripts/test/ObjC/DOMTestCustomNamedGetterInternal.h:
* bindings/scripts/test/ObjC/DOMTestEventConstructorInternal.h:
* bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h:
* bindings/scripts/test/ObjC/DOMTestExceptionInternal.h:
* bindings/scripts/test/ObjC/DOMTestGenerateIsReachableInternal.h:
* bindings/scripts/test/ObjC/DOMTestInterfaceInternal.h:
* bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h:
* bindings/scripts/test/ObjC/DOMTestNamedConstructorInternal.h:
* bindings/scripts/test/ObjC/DOMTestNodeInternal.h:
* bindings/scripts/test/ObjC/DOMTestNondeterministicInternal.h:
* bindings/scripts/test/ObjC/DOMTestObjInternal.h:
* bindings/scripts/test/ObjC/DOMTestOverloadedConstructorsInternal.h:
* bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterfaceInternal.h:
* bindings/scripts/test/ObjC/DOMTestTypedefsInternal.h:
* bindings/scripts/test/ObjC/DOMattributeInternal.h:
* bindings/scripts/test/ObjC/DOMreadonlyInternal.h:
Added new WEBCORE_EXPORT macros.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use jsNontrivialString for strings we know are more than a single character
https://bugs.webkit.org/show_bug.cgi?id=136393

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-09-02
Reviewed by Geoffrey Garen.

* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::addUsagesToJSON):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid backing store allocation with some combinations of replaced elements, masking and visibility:hidden
https://bugs.webkit.org/show_bug.cgi?id=136400

Reviewed by Tim Horton.
Source/WebCore:

RenderLayer::isVisuallyNonEmpty() would return true for replaced elements (e.g. images)
with visibility:hidden, and for layers with a mask, and both would cause additional
backing store in some cases.

We can move the hasVisibleContent() to the top of the function, since visibility:hidden
will always hide any content of this layer. The hasMask() check can also be removed;
a mask can only mask content that is already visible; it never contributes additional
pixels.

Tests: compositing/backing/masked-child-no-backing.html
       compositing/backing/replaced-child-no-backing.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):

LayoutTests:

* compositing/backing/masked-child-no-backing-expected.txt: Added.
* compositing/backing/masked-child-no-backing.html: Added.
* compositing/backing/replaced-child-no-backing-expected.txt: Added.
* compositing/backing/replaced-child-no-backing.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix an assertion sometimes seen under RenderLayerCompositor::detachRootLayer()
https://bugs.webkit.org/show_bug.cgi?id=136464

Reviewed by Tim Horton.

Don't try to call RenderLayer::isVisuallyNonEmpty() under RenderLayerCompositor::detachRootLayer()
when layout might be stale; there's not point trying to update the backing store state
when detaching, only when attaching.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make sure WK1 prefs are initialized in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=136465

Reviewed by Tim Horton.

Call -didChangeSettings from -awakeFromNib for WK1 windows just as we do
for WK2 windows, to make sure that WebPreferences are updated (to get
layer borders to work consistently).

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController awakeFromNib]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Optimize own property GetByVals with rope string subscripts.
<https://webkit.org/b/136458>

For simple JSObjects that don't override getOwnPropertySlot to implement
custom properties, we have a fast path that grabs directly at the object
property storage.

Make this fast path even faster when the property name is an unresolved
rope string by using JSString::toExistingAtomicString(). This is faster
because it avoids allocating a new StringImpl if the string is already
a known Identifier, which is guaranteed to be the case if it's present
as an own property on the object.)

~10% speed-up on Dromaeo/dom-attr.html

Reviewed by Geoffrey Garen.

* dfg/DFGOperations.cpp:
* jit/JITOperations.cpp:
(JSC::getByVal):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::getByVal):

    When using the fastGetOwnProperty() optimization, get the String
    out of JSString by using toExistingAtomicString(). This avoids
    StringImpl allocation and lets us bypass the PropertyTable lookup
    entirely if no AtomicString is found.

* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::fastGetOwnProperty):

    Make fastGetOwnProperty() take a PropertyName instead of a String.
    This avoids churning the ref count, since we don't need to create
    a temporary wrapper around the AtomicStringImpl* found in GetByVal.

* runtime/PropertyName.h:
(JSC::PropertyName::PropertyName):

    Add constructor: PropertyName(AtomicStringImpl*)

* runtime/PropertyMapHashTable.h:
(JSC::PropertyTable::get):
(JSC::PropertyTable::findWithString): Deleted.
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::get):

    Remove code for querying a PropertyTable with an unhashed string key
    since the only client is now gone.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Exclude touch and gesture files when building without ENABLE_TOUCH_EVENTS
and ENABLE_IOS_GESTURE_EVENTS, respectively
https://bugs.webkit.org/show_bug.cgi?id=136456

Reviewed by Andy Estes.

It's sufficient to exclude the touch and gesture files when building without
ENABLE_TOUCH_EVENTS and ENABLE_IOS_GESTURE_EVENTS, respectively. Currently we
exclude these files when building without the Apple Internal SDK, which is
heavy handed.

* Configurations/WebCore.xcconfig:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use references in public EventSender functions
https://bugs.webkit.org/show_bug.cgi?id=136463

Reviewed by Dan Bates.

Passing nullptr to EventSender shouldn't be allowed.

No new tests because there is no behavior change.

* dom/EventSender.h:
(WebCore::EventSender::hasPendingEvents):
(WebCore::EventSender<T>::dispatchEventSoon):
(WebCore::EventSender<T>::cancelEvent):
(WebCore::EventSender<T>::dispatchPendingEvents):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::~HTMLStyleElement):
(WebCore::HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::~ImageLoader):
(WebCore::ImageLoader::setImageWithoutConsideringPendingLoadEvent):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pass the resource identifier in willSendRequest callback.
https://bugs.webkit.org/show_bug.cgi?id=136325

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2014-09-02
Reviewed by Dan Bernstein.

Add two new delegate methods webProcessPlugInBrowserContextController:frame:willSendRequestForResource:request:redirectResponse:
and webProcessPlugInBrowserContextController:frame:didInitiateLoadForResource:request:pageIsProvisionallyLoading:. We will remove
the old willSendRequest and didInitiateLoadForResource when clients adopt the new methods.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(willSendRequestForFrame):
(didInitiateLoadForResource):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Support using Foundation networking code
https://bugs.webkit.org/show_bug.cgi?id=136467

Reviewed by Pratik Solanki.

Source/WebCore:

We should support building iOS WebKit with the Foundation networking code
(i.e. !USE(CFNETWORK)).

Additionally, disable USE(CFNETWORK) and use the Foundation networking code
by default when building iOS WebKit without the Apple Internal SDK.

* Configurations/WebCore.xcconfig: Remove file WebCoreURLResponse.mm from the list of excluded files
so that we compile an implementation for function WebCore::synthesizeRedirectResponseIfNecessary when
building without USE(CFNETWORK).
* WebCore.exp.in: Add symbols for WebCore::synthesizeRedirectResponseIfNecessary() and WebCore::ResourceHandleClient::willCacheResponseAsync().
* WebCore.xcodeproj/project.pbxproj: Add new files CFNetworkConnectionCacheSPI.h and CFURLRequestSPI.h.
Also move group platform/spi such that it appears in alphabetical order in the platform group.
* platform/cf/URLCF.cpp: Remove unnecessary header <CoreFoundation/CFPriv.h>.
* platform/network/ResourceHandle.h: Declare iOS-specific variant of ResourceHandle::createNSURLConnection().
* platform/network/ResourceHandleClient.h: Always include header <wtf/RetainPtr.h> when building for iOS.
(WebCore::ResourceHandleClient::connectionProperties): Add PLATFORM(IOS)-guard around declaration.
* platform/network/cf/ResourceRequestCFNet.cpp: Substitute header CFNetworkConnectionCacheSPI.h for
<CFNetwork/CFNetworkConnectionCachePriv.h>.
* platform/network/mac/CredentialStorageMac.mm:
(WebCore::CredentialStorage::saveToPersistentStorage): Use Credential::nsCredential() and ProtectionSpace::nsSpace()
instead of WebCore::mac(const {Credential, ProtectionSpace}&) as the latter were removed in <http://trac.webkit.org/changeset/171801>
and <http://trac.webkit.org/changeset/171540>, respectively.
* platform/network/mac/ResourceErrorMac.mm: Add USE(CFNETWORK)-guard around <CFNetwork/CFSocketStreamPriv.h>.
* platform/network/mac/ResourceHandleMac.mm: Substitute header CFURLRequestSPI.h for <CFNetwork/CFURLRequest.h>.
(WebCore::ResourceHandle::start): Modified to use ResourceHandle::makeDelegate() instead of d->m_proxy, which
was removed in <http://trac.webkit.org/changeset/147476>.
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary): Add !USE(CFNETWORK)- and PLATFORM(IOS)- guards.
* platform/spi/cf/CFNetworkConnectionCacheSPI.h: Added.
* platform/spi/cf/CFURLRequestSPI.h: Added.

Source/WTF:

Disable USE(CFNETWORK) and use the Foundation networking code by default when building
iOS WebKit without the Apple Internal SDK.

* wtf/Platform.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Updated German translation
https://bugs.webkit.org/show_bug.cgi?id=135956

Patch by Christian Stadelmann <gnome-de@genodeftest.de> on 2014-09-02
Reviewed by Gustavo Noronha.

* de.po: updated.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Attempt to fix the Windows build after <http://trac.webkit.org/changeset/173192>
(https://bugs.webkit.org/show_bug.cgi?id=136467)

Declare ResourceHandleClient::connectionProperties() when building for iOS or when USE(CFNETWORK).

* platform/network/ResourceHandleClient.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EME][Mac] Refactor CDMPrivateMediaSourceAVFObjC to allow sessions to be created without being attached to an AVStreamDataParser.
https://bugs.webkit.org/show_bug.cgi?id=136016

Reviewed by Eric Carlson.

The CDMPrivateMediaPlayer class will delegate creation of CDMSession instances to the current MediaPlayer. This
of course requires the MediaKeys object owning the CDM to be attached to a HTMLMediaElement, and specifically to
one with a valid src attribute or source node which has sucessfully begun loading. For certain CDM operations,
it would be better if a given MediaKeys could create a session without actually being connected to a
HTMLMediaElement (yet).

To facilitate this for CDMSessionPrivateMediaSourceAVFObjC, add a new class, CDMPrivateMediaSourceAVFObjC, which
is the primary factory for CDMSessionPrivateMediaSOurceAVFObjC. Disclaim responsibility for creating these sessions
in MediaPlayerPrivateMediaSourceAVFObjC by not passing the "supportsKeySystem" method when registering itself.

Add methods to CDMSessionPrivateMediaSourceAVFObjC to allow SourceBuffers to be added and removed from the session,
to support adding the session to the HTMLMediaElement after the session has been created.

Since MediaPlayerPrivate instance and  CDMSession instances must be able to communicate with one another, add a type()
enum and virtual method to allow CDMSession instnaces to be distinguisted from (and casted to) one another.

* Modules/encryptedmedia/CDM.cpp:
(WebCore::installedCDMFactories): Register CDMPrivateMediaSourceAVFObjC.
(WebCore::CDM::createSession): Notify the MediaPlayer of the new CDMSession.
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::setMediaElement): Notify the HTMLMediaElement of any existing sessions.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/CDMSession.h:
(WebCore::CDMSession::type): Added.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setCDMSession): Pass through to the MediaPlayerPrivate.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setCDMSession): Added. Default no-op.
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h: Added.
(WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC): Simple constructor.
(WebCore::CDMPrivateMediaSourceAVFObjC::~CDMPrivateMediaSourceAVFObjC): Simple destructor.
(WebCore::CDMPrivateMediaSourceAVFObjC::create): Simple factory.
(WebCore::CDMPrivateMediaSourceAVFObjC::cdm): Simple accessor.
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem): Moved from MediaPlayerPrivateMediaSourceAVFObjC.
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType): Ditto.
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): Ditto.
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Returns new CDMSessionMediaSourceAVFObjC.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
(WebCore::CDMSessionAVFoundationObjC::type): Added.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
(WebCore::CDMSessionMediaSourceAVFObjC::type): Added.
(WebCore::toCDMSessionMediaSourceAVFObjC): Throw assertion if type() is not correct.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC): Removed m_parent ivar.
(WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): Ditto.
(WebCore::CDMSessionMediaSourceAVFObjC::update): Determing which SourceBuffer is protected.
(WebCore::CDMSessionMediaSourceAVFObjC::addSourceBuffer): Added.
(WebCore::CDMSessionMediaSourceAVFObjC::removeSourceBuffer): Added.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): Remove supportsKeyType parameter.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Remove keyType check.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): Tell the CDMSession about outstanding SourceBuffers.
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: remove ProfilerAgent and legacy profiler files in the frontend
https://bugs.webkit.org/show_bug.cgi?id=136462

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

It's not used by the frontend anymore.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:

* inspector/JSConsoleClient.cpp:
(Inspector::JSConsoleClient::JSConsoleClient): Stub out console.profile/profileEnd
methods since they didn't work for JSContexts anyway.
(Inspector::JSConsoleClient::profile):
(Inspector::JSConsoleClient::profileEnd):
* inspector/JSConsoleClient.h:

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
* inspector/agents/InspectorProfilerAgent.cpp: Removed.
* inspector/agents/InspectorProfilerAgent.h: Removed.
* inspector/agents/JSGlobalObjectProfilerAgent.cpp: Removed.
* inspector/agents/JSGlobalObjectProfilerAgent.h: Removed.
* inspector/protocol/Profiler.json: Removed.

Source/WebCore:

It's not used by the frontend anymore.

No new tests, no behavior changed.

* CMakeLists.txt:
* ForwardingHeaders/inspector/agents/InspectorProfilerAgent.h: Removed.
* WebCore.order:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorController.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::InstrumentingAgents):
(WebCore::InstrumentingAgents::reset):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorProfilerAgent): Deleted.
(WebCore::InstrumentingAgents::setInspectorProfilerAgent): Deleted.
* inspector/PageProfilerAgent.cpp: Removed.
* inspector/PageProfilerAgent.h: Removed.
* inspector/TimelineRecordFactory.cpp: Moved these builders to their only callsite.
(WebCore::buildInspectorObject):
(WebCore::buildProfileInspectorObject):
(WebCore::TimelineRecordFactory::appendProfile):
* inspector/WebProfilerAgent.cpp: Removed.
* inspector/WebProfilerAgent.h: Removed.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
* inspector/WorkerProfilerAgent.cpp: Removed.
* inspector/WorkerProfilerAgent.h: Removed.
* inspector/protocol/Timeline.json:

Source/WebInspectorUI:

The legacy profiler manager didn't do anything, and its views and models
have been superseded by new views and models based on the Timeline classes.

* .eslintrc:
* UserInterface/Base/Main.js:
(WebInspector.loaded):
(WebInspector.openURL): Remove profile URL handling code.
* UserInterface/Controllers/LegacyProfileManager.js: Removed.
* UserInterface/Main.html:
* UserInterface/Protocol/ConsoleObserver.js:
(WebInspector.ConsoleObserver.prototype.messageAdded):
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.isProfilingJavaScript): Deleted.
(InspectorFrontendAPI.startProfilingJavaScript): Deleted.
(InspectorFrontendAPI.stopProfilingJavaScript): Deleted.
* UserInterface/Protocol/LegacyProfilerObserver.js: Removed.
* UserInterface/Views/LegacyBottomUpProfileDataGridTree.js: Removed.
* UserInterface/Views/LegacyJavaScriptProfileObject.js: Removed.
* UserInterface/Views/LegacyJavaScriptProfileType.js: Removed.
* UserInterface/Views/LegacyJavaScriptProfileView.css: Removed.
* UserInterface/Views/LegacyJavaScriptProfileView.js: Removed.
* UserInterface/Views/LegacyProfileDataGridTree.js: Removed.
* UserInterface/Views/LegacyProfileObject.js: Removed.
* UserInterface/Views/LegacyProfileType.js: Removed.
* UserInterface/Views/LegacyProfileView.css: Removed.
* UserInterface/Views/LegacyProfileView.js: Removed.
* UserInterface/Views/LegacyTopDownProfileDataGridTree.js: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LegacyProfiler: remove redundant ProfileNode members and other cleanup
https://bugs.webkit.org/show_bug.cgi?id=136380

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

ProfileNode's selfTime and totalTime members are redundant and only used
for dumping profile data from debug-only code. Remove the members and compute
the same data on-demand when necessary using a postorder traversal functor.

Remove ProfileNode.head since it is only used to calculate percentages for
dumped profile data. This can be explicitly passed around when needed.

Rename Profile.head to Profile.rootNode, and other various renamings.

Rearrange some header includes so that touching LegacyProfiler-related headers
will no longer cause a full rebuild.

* inspector/JSConsoleClient.cpp: Add header include.
* inspector/agents/InspectorProfilerAgent.cpp:
(Inspector::InspectorProfilerAgent::buildProfileInspectorObject):
* inspector/protocol/Profiler.json: Remove unused Profile.idleTime member.
* jit/JIT.h: Remove header include.
* jit/JITCode.h: Remove header include.
* jit/JITOperations.cpp: Sort and add header include.
* llint/LLIntSlowPaths.cpp: Sort and add header include.
* profiler/Profile.cpp: Rename the debug dumping functions. Move the node
postorder traversal code to ProfileNode so we can traverse any subtree.
(JSC::Profile::Profile):
(JSC::Profile::debugPrint):
(JSC::Profile::debugPrintSampleStyle):
(JSC::Profile::forEach): Deleted.
(JSC::Profile::debugPrintData): Deleted.
(JSC::Profile::debugPrintDataSampleStyle): Deleted.
* profiler/Profile.h:
* profiler/ProfileGenerator.cpp:
(JSC::ProfileGenerator::ProfileGenerator):
(JSC::AddParentForConsoleStartFunctor::AddParentForConsoleStartFunctor):
(JSC::AddParentForConsoleStartFunctor::operator()):
(JSC::ProfileGenerator::addParentForConsoleStart):
(JSC::ProfileGenerator::didExecute):
(JSC::StopProfilingFunctor::operator()):
(JSC::ProfileGenerator::stopProfiling):
(JSC::ProfileGenerator::removeProfileStart):
(JSC::ProfileGenerator::removeProfileEnd):
* profiler/ProfileGenerator.h:
* profiler/ProfileNode.cpp:
(JSC::ProfileNode::ProfileNode):
(JSC::ProfileNode::willExecute):
(JSC::ProfileNode::removeChild):
(JSC::ProfileNode::stopProfiling):
(JSC::ProfileNode::endAndRecordCall):
(JSC::ProfileNode::debugPrint):
(JSC::ProfileNode::debugPrintSampleStyle):
(JSC::ProfileNode::debugPrintRecursively):
(JSC::ProfileNode::debugPrintSampleStyleRecursively):
(JSC::ProfileNode::debugPrintData): Deleted.
(JSC::ProfileNode::debugPrintDataSampleStyle): Deleted.
* profiler/ProfileNode.h: Calculate per-node self and total times using a postorder traversal.
The forEachNodePostorder functor traverses the subtree rooted at |this|.
(JSC::ProfileNode::create):
(JSC::ProfileNode::calls):
(JSC::ProfileNode::forEachNodePostorder):
(JSC::CalculateProfileSubtreeDataFunctor::returnValue):
(JSC::CalculateProfileSubtreeDataFunctor::operator()):
(JSC::ProfileNode::head): Deleted.
(JSC::ProfileNode::setHead): Deleted.
(JSC::ProfileNode::totalTime): Deleted.
(JSC::ProfileNode::setTotalTime): Deleted.
(JSC::ProfileNode::selfTime): Deleted.
(JSC::ProfileNode::setSelfTime): Deleted.
(JSC::ProfileNode::totalPercent): Deleted.
(JSC::ProfileNode::selfPercent): Deleted.
* runtime/ConsoleClient.h: Remove header include.

Source/WebCore:

Remove Profile.idleTime, rename head to rootNode, and remove ProfileNode members.

Covered by existing tests.

* inspector/ScriptProfile.idl:
* inspector/ScriptProfileNode.idl:
* inspector/TimelineRecordFactory.cpp:

Source/WebInspectorUI:

Remove unused Profile.idleTime member.

* UserInterface/Models/Profile.js:
(WebInspector.Profile.prototype.get idleTime): Deleted.
* UserInterface/Models/ScriptTimelineRecord.js:
(WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload):

LayoutTests:

Renamed Profile.head to Profile.rootNode.

* fast/profiler/resources/profiler-test-JS-resources.js:
(printHeavyProfilesDataWithoutTime):
(printProfilesDataWithoutTime):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Memory cache capacity is not set.
https://bugs.webkit.org/show_bug.cgi?id=136432

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-09-02
Reviewed by Alex Christensen.

Reuse code from AppleWin to set memory and disk cache capacity.

* WebKitSystemBits.cpp:
(WebVolumeFreeSize):
* WebKitSystemBits.h:
* WebView.cpp:
(WebView::setCacheModel):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GMainLoopSource is exposed to race conditions
https://bugs.webkit.org/show_bug.cgi?id=135800

Reviewed by Carlos Garcia Campos.

Source/WTF:

GMainLoopSource objects can be dispatching tasks on one thread
while having a new task scheduled on a different thread. This
can for instance occur in WebKitVideoSink, where the timeout
callback can be called on main thread while at the same time
it is being rescheduled on a different thread (created through
GStreamer).

The initial solution is to use GMutex to prevent parallel data
access from different threads. In the future I plan to add better
assertions, some meaningful comments and look at the possibility
of creating thread-specific GMainLoopSource objects that wouldn't
require the use of GMutex.

GSource, GCancellable and std::function<> objects are now packed
into an internal Context structure. Using the C++11 move semantics
it's simple to, at the time of dispatch, move the current context
out of the GMainLoopSource object in case the dispatch causes a
rescheduling on that same object.

All the schedule*() methods and the cancelInternal() method callers
now lock the GMutex to ensure no one else is accessing the data at
that moment. Similar goes for the dispatch methods, but those do
the dispatch and possible destruction duties with the mutex unlocked.
The dispatch can cause rescheduling on the same GMainLoopSource object,
which must not be done with a locked mutex.

* wtf/gobject/GMainLoopSource.cpp:
(WTF::GMainLoopSource::GMainLoopSource):
(WTF::GMainLoopSource::~GMainLoopSource):
(WTF::GMainLoopSource::cancel):
(WTF::GMainLoopSource::cancelInternal):
(WTF::GMainLoopSource::scheduleIdleSource):
(WTF::GMainLoopSource::schedule):
(WTF::GMainLoopSource::scheduleTimeoutSource):
(WTF::GMainLoopSource::scheduleAfterDelay):
(WTF::GMainLoopSource::voidCallback):
(WTF::GMainLoopSource::boolCallback):
(WTF::GMainLoopSource::socketCallback):
(WTF::GMainLoopSource::destroy):
(WTF::GMainLoopSource::reset): Deleted.
* wtf/gobject/GMainLoopSource.h:

Tools:

Add a unit test for GMainLoopSource that tests different
types of rescheduling tasks on already-active sources.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/WTF/gobject/GMainLoopSource.cpp: Added.
(GMainLoopSourceTest::GMainLoopSourceTest):
(GMainLoopSourceTest::~GMainLoopSourceTest):
(GMainLoopSourceTest::runLoop):
(GMainLoopSourceTest::finish):
(GMainLoopSourceTest::source):
(testGMainLoopSourceBasicRescheduling):
(testGMainLoopSourceReentrantRescheduling):
(testGMainLoopSourceDifferentThreadRescheduling):
(beforeAll):
(afterAll):
(TestWebKitAPI::GMainLoopSourceTest::GMainLoopSourceTest):
(TestWebKitAPI::GMainLoopSourceTest::~GMainLoopSourceTest):
(TestWebKitAPI::GMainLoopSourceTest::runLoop):
(TestWebKitAPI::GMainLoopSourceTest::finish):
(TestWebKitAPI::GMainLoopSourceTest::source):
(TestWebKitAPI::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't generate superfluous mov instructions for move immediate on ARM64.
https://bugs.webkit.org/show_bug.cgi?id=136435

Patch by Akos Kiss <akiss@inf.u-szeged.hu> on 2014-09-03
Reviewed by Michael Saboff.

On ARM64, the size of an immediate operand for a mov instruction is 16
bits. Thus, a move immediate offlineasm instruction may potentially be
split up to several machine level instructions. The current
implementation always emits a mov for the least significant 16 bits of
the value. However, if any of the bits 63:16 are significant then the
first emitted mov already filled bits 15:0 with zeroes (or ones, for
negative values). So, if bits 15:0 of the value are all zeroes (or ones)
then the last mov does not need to be emitted.

* offlineasm/arm64.rb:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[XSLT] Make WebKit build when XSLT is disabled
https://bugs.webkit.org/show_bug.cgi?id=136471

Reviewed by Simon Fraser.

Fixes a Clang compiler warning that file-static function WebCore::hasNoStyleInformation is unused.
This function is only called from ENABLE(XSLT)-guarded code. So, add a ENABLE(XSLT)-guard around
WebCore::hasNoStyleInformation().

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::hasNoStyleInformation):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r173200.

* WebView.cpp:
(WebView::setCacheModel): Use appropriate types for cache sizes to be
64-bit clean on CFNetwork compile.



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