1. 25 Apr, 2012 1 commit
    • mhahnenberg@apple.com's avatar
      WebCore shouldn't call collectAllGarbage directly · 34edae48
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=84897
      
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore:
      
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Exported symbol
      for reportAbanondedObjectGraph so WebCore can use it.
      * heap/Heap.h: Ditto.
      
      Source/WebCore:
      
      No new tests.
      
      Currently, GCController calls Heap::collectAllGarbage directly, which leads
      to an overload of collections as the timer in GCController and the timer in
      GCActivityCallback compete for collection time and fire independently. As a
      result, we end up doing almost 600 full collections during an in-browser run
      of SunSpider, or 20 full collections on a single load of TechCrunch.
      
      We can do better by preventing WebCore from calling collectAllGarbage directly
      and instead going through Heap::reportAbandonedObjectGraph, since that is what
      WebCore is trying to do--notify the Heap that a lot of garbage may have just
      been generated when we left a page.
      
      * WebCore.exp.in:
      * bindings/js/GCController.cpp: Removed all timer stuff.
      (WebCore::GCController::GCController):
      (WebCore::GCController::garbageCollectSoon): Changed to call Heap::reportAbandonedObjectGraph.
      (WebCore::GCController::garbageCollectNow): Changed to still directly call collectAllGarbage.
      We will deprecate this function soon hopefully.
      * bindings/js/GCController.h: Removed timer stuff.
      (GCController):
      * bindings/js/ScriptProfiler.cpp:
      (WebCore::ScriptProfiler::collectGarbage): Changed to call garbageCollectSoon.
      
      Source/WebKit2:
      
      * WebProcess/WebProcess.cpp:
      (WebKit::WebProcess::didClose): Changed to call garbageCollectSoon. This is the
      function that causes us to do so much collection on page navigation.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      34edae48
  2. 24 Apr, 2012 5 commits
    • adamk@chromium.org's avatar
      Remove unused undefined() method from ScriptValue · 6207f786
      adamk@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=84751
      
      Reviewed by Kentaro Hara.
      
      * bindings/js/ScriptValue.h:
      (ScriptValue):
      * bindings/v8/ScriptValue.h:
      (ScriptValue):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6207f786
    • rniwa@webkit.org's avatar
      Revert r115009; It doesn't make necessary changes to NodeRareData and Node. · 4186958b
      rniwa@webkit.org authored
      Source/WebCore:
      
      * CMakeLists.txt:
      * DerivedSources.cpp:
      * DerivedSources.make:
      * DerivedSources.pri:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/JSHTMLCollectionCustom.cpp:
      (WebCore::getNamedItems):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateImplementation):
      * bindings/v8/custom/V8HTMLCollectionCustom.cpp:
      (WebCore::getNamedItems):
      * html/CollectionType.h:
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::shouldIncludeChildren):
      (WebCore::HTMLCollection::isAcceptableElement):
      * html/HTMLFormCollection.cpp:
      (WebCore::HTMLFormCollection::HTMLFormCollection):
      * html/RadioNodeList.cpp: Removed.
      * html/RadioNodeList.h: Removed.
      * html/RadioNodeList.idl: Removed.
      
      LayoutTests:
      
      * fast/forms/form-collection-radio-node-list-expected.txt: Removed.
      * fast/forms/form-collection-radio-node-list.html: Removed.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4186958b
    • adamk@chromium.org's avatar
      Fix includes in StrongInlines.h and ScriptValue.h · f56527de
      adamk@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=84659
      
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore:
      
      * heap/StrongInlines.h: Include JSGlobalData.h, since JSGlobalData's
      definiition is required here.
      
      Source/WebCore:
      
      This change was prompted by an attempt to use ScriptValue.h from a
      WebCore header file and running into trouble with the (as it turns out
      unnecessary) include of JSDOMBinding.h.
      
      * bindings/js/ScriptValue.cpp: Add include of JSDOMBinding.h, now that
      it's not included by the header.
      * bindings/js/ScriptValue.h: Remove unnecessary include of JSDOMBinding.h.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f56527de
    • antti@apple.com's avatar
      Move MediaList CSSOM wrapper ownership to parent rule or stylesheet · 743b54c9
      antti@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=84716
      
      Reviewed by Anders Carlsson.
      
      MediaList CSSOM wrapper should be owned by a rule or a stylesheet, not by the underlying 
      MediaQuerySet.
              
      Remove the ref forwarding from MediaList in favor of regular refcounting. Use the usual
      pattern where the parent wrapper refs the child wrapper and zeroes the backpointer
      on destruction. 
      
      * bindings/js/JSDOMBinding.h:
      (WebCore::root):
      * css/CSSImportRule.cpp:
      (WebCore::CSSImportRule::~CSSImportRule):
      (WebCore::CSSImportRule::media):
      * css/CSSImportRule.h:
      (StyleRuleImport):
      (CSSImportRule):
      * css/CSSMediaRule.cpp:
      (WebCore::CSSMediaRule::~CSSMediaRule):
      (WebCore::CSSMediaRule::media):
      * css/CSSMediaRule.h:
      (CSSMediaRule):
      * css/CSSStyleSheet.cpp:
      (WebCore::CSSStyleSheet::~CSSStyleSheet):
      (WebCore::CSSStyleSheet::media):
      * css/CSSStyleSheet.h:
      (CSSStyleSheet):
      * css/MediaList.cpp:
      (WebCore::MediaQuerySet::mediaText):
      (WebCore::MediaList::MediaList):
      (WebCore):
      (WebCore::MediaList::notifyChanged):
      * css/MediaList.h:
      (MediaQuerySet):
      (WebCore::MediaList::create):
      (WebCore::MediaList::parentRule):
      (WebCore::MediaList::clearParentStyleSheet):
      (WebCore::MediaList::clearParentRule):
      (WebCore::MediaList::queries):
      (MediaList):
      * css/StyleRule.h:
      (WebCore::StyleRuleMedia::mediaQueries):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      743b54c9
    • commit-queue@webkit.org's avatar
      RadioNodeList support in HTMLFormElement::elements · 74adb741
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=81854
      
      Source/WebCore:
      
      Implement RadioNodeList support spec'ed at
      http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#radionodelist
      
      Patch by Rakesh KN <rakesh.kn@motorola.com> on 2012-04-24
      Reviewed by Ryosuke Niwa.
      
      Test: fast/forms/form-collection-radio-node-list.html
      
      * CMakeLists.txt:
      Added entries for new files.
      * DerivedSources.cpp: Ditto.
      * DerivedSources.make: Ditto.
      * DerivedSources.pri: Ditto.
      * GNUmakefile.list.am: Ditto.
      * Target.pri: Ditto.
      * WebCore.gypi: Ditto.
      * WebCore.vcproj/WebCore.vcproj: Ditto.
      * WebCore.xcodeproj/project.pbxproj: Ditto.
      * bindings/js/JSHTMLCollectionCustom.cpp:
      (WebCore::getNamedItems):
      Modified to create RadioNodeList object when FormControlCollection has more than
      one element of same name/id.
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateImplementation):
      Added code to include Node.h and JSNode.h in JSRadioNodeElement.cpp.
      * bindings/v8/custom/V8HTMLCollectionCustom.cpp:
      (WebCore::getNamedItems):
      Modified to create RadioNodeList object when FormControlCollection has more than
      one element of same name/id.
      * html/CollectionType.h:
      Added new FormControls type.
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::shouldIncludeChildren):
      (WebCore::HTMLCollection::isAcceptableElement):
      Handle FormControls collection type.
      * html/HTMLFormCollection.cpp:
      (WebCore::HTMLFormCollection::HTMLFormCollection):
      Contruct collection of FormControls type.
      * html/RadioNodeList.cpp: Added.
      (WebCore):
      (WebCore::RadioNodeList::RadioNodeList):
      (WebCore::RadioNodeList::~RadioNodeList):
      (WebCore::toRadioButtonInputElement):
      (WebCore::RadioNodeList::value):
      (WebCore::RadioNodeList::setValue):
      (WebCore::RadioNodeList::nodeMatches):
      * html/RadioNodeList.h: Added.
      (WebCore):
      (RadioNodeList):
      (WebCore::RadioNodeList::create):
      RadioNodeList implementation.
      * html/RadioNodeList.idl: Added.
      Idl for generating RadioNodeList JS/V8 bindings.
      
      LayoutTests:
      
      Patch by Rakesh KN <rakesh.kn@motorola.com> on 2012-04-24
      Reviewed by Ryosuke Niwa.
      
      * fast/forms/form-collection-radio-node-list-expected.txt: Added.
      * fast/forms/form-collection-radio-node-list.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      74adb741
  3. 23 Apr, 2012 1 commit
    • kbr@google.com's avatar
      Change ImageData to reference Uint8ClampedArray rather than CanvasPixelArray · 1262e442
      kbr@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=73011
      
      Reviewed by Oliver Hunt.
      
      Source/WebCore:
      
      Changed ImageData to contain Uint8ClampedArray instead of ByteArray
      per current HTML5 spec.
      
      In order to avoid introducing large data copies, it was necessary to
      switch a few other places in WebKit to use Uint8ClampedArray at the
      same time, most notably the FilterEffect implementation, portions of
      ImageBuffer, and a couple of places in the image encoders.
      
      Note that the change in method name from "get" to "item" occurred
      because JSC's autogenerated indexed getters reference a method
      called "item". If desired, a convenience method could be
      introduced to avoid the renamings in the FilterEffect classes.
      
      With these changes, ByteArray and some custom code in JavaScriptCore
      actually become unreferenced, and can be deleted. This deletion will
      be done separately in Bug 83655, to keep the size of this patch
      manageable.
      
      Test: fast/canvas/imagedata-contains-uint8clampedarray.html
      
      * bindings/js/JSImageDataCustom.cpp:
      (WebCore::toJS):
      * bindings/js/SerializedScriptValue.cpp:
      (WebCore::CloneSerializer::dumpIfTerminal):
      (WebCore::CloneDeserializer::readTerminal):
      * bindings/v8/SerializedScriptValue.cpp:
      * bindings/v8/custom/V8ImageDataCustom.cpp:
      (WebCore::toV8):
      * bridge/qt/qt_pixmapruntime.cpp:
      (JSC::Bindings::QtPixmapToImageDataMethod::invoke):
      * html/ImageData.cpp:
      (WebCore::ImageData::create):
      (WebCore::ImageData::ImageData):
      * html/ImageData.h:
      (ImageData):
      (WebCore::ImageData::data):
      * html/ImageData.idl:
      * html/canvas/CanvasRenderingContext2D.cpp:
      (WebCore::createEmptyImageData):
      (WebCore::CanvasRenderingContext2D::getImageData):
      (WebCore::CanvasRenderingContext2D::putImageData):
      * platform/graphics/GraphicsContext3D.cpp:
      (WebCore::GraphicsContext3D::extractImageData):
      * platform/graphics/ImageBuffer.cpp:
      (WebCore::ImageBuffer::genericConvertToLuminanceMask):
      * platform/graphics/ImageBuffer.h:
      * platform/graphics/ShadowBlur.cpp:
      (WebCore::ShadowBlur::blurShadowBuffer):
      * platform/graphics/cairo/ImageBufferCairo.cpp:
      (WebCore::getImageData):
      (WebCore::ImageBuffer::getUnmultipliedImageData):
      (WebCore::ImageBuffer::getPremultipliedImageData):
      (WebCore::ImageBuffer::putByteArray):
      * platform/graphics/cg/ImageBufferCG.cpp:
      (WebCore::ImageBuffer::getUnmultipliedImageData):
      (WebCore::ImageBuffer::getPremultipliedImageData):
      (WebCore::ImageBuffer::putByteArray):
      (WebCore::ImageBuffer::toDataURL):
      (WebCore::ImageDataToDataURL):
      * platform/graphics/cg/ImageBufferDataCG.cpp:
      (WebCore::ImageBufferData::getData):
      (WebCore::ImageBufferData::putData):
      * platform/graphics/cg/ImageBufferDataCG.h:
      (ImageBufferData):
      * platform/graphics/filters/FEBlend.cpp:
      (WebCore::FEBlend::platformApplySoftware):
      * platform/graphics/filters/FEColorMatrix.cpp:
      (WebCore::effectType):
      (WebCore::FEColorMatrix::platformApplySoftware):
      * platform/graphics/filters/FEComponentTransfer.cpp:
      (WebCore::FEComponentTransfer::platformApplySoftware):
      * platform/graphics/filters/FEComposite.cpp:
      (WebCore::FEComposite::platformArithmeticSoftware):
      (WebCore::FEComposite::platformApplySoftware):
      * platform/graphics/filters/FEComposite.h:
      * platform/graphics/filters/FEConvolveMatrix.cpp:
      (WebCore::setDestinationPixels):
      (WebCore::FEConvolveMatrix::fastSetInteriorPixels):
      (WebCore::FEConvolveMatrix::fastSetOuterPixels):
      (WebCore::FEConvolveMatrix::platformApplySoftware):
      * platform/graphics/filters/FEConvolveMatrix.h:
      (PaintingData):
      * platform/graphics/filters/FECustomFilter.cpp:
      (WebCore::FECustomFilter::platformApplySoftware):
      (WebCore::FECustomFilter::bindProgramAndBuffers):
      * platform/graphics/filters/FECustomFilter.h:
      (JSC):
      (FECustomFilter):
      * platform/graphics/filters/FEDisplacementMap.cpp:
      (WebCore::FEDisplacementMap::platformApplySoftware):
      * platform/graphics/filters/FEDropShadow.cpp:
      (WebCore::FEDropShadow::platformApplySoftware):
      * platform/graphics/filters/FEGaussianBlur.cpp:
      (WebCore::boxBlur):
      (WebCore::FEGaussianBlur::platformApplyGeneric):
      (WebCore::FEGaussianBlur::platformApply):
      (WebCore::FEGaussianBlur::platformApplySoftware):
      * platform/graphics/filters/FEGaussianBlur.h:
      (PlatformApplyParameters):
      (FEGaussianBlur):
      * platform/graphics/filters/FELighting.cpp:
      (WebCore::FELighting::LightingData::topLeft):
      (WebCore::FELighting::LightingData::topRow):
      (WebCore::FELighting::LightingData::topRight):
      (WebCore::FELighting::LightingData::leftColumn):
      (WebCore::FELighting::LightingData::interior):
      (WebCore::FELighting::LightingData::rightColumn):
      (WebCore::FELighting::LightingData::bottomLeft):
      (WebCore::FELighting::LightingData::bottomRow):
      (WebCore::FELighting::LightingData::bottomRight):
      (WebCore::FELighting::inlineSetPixel):
      (WebCore::FELighting::drawLighting):
      (WebCore::FELighting::platformApplySoftware):
      * platform/graphics/filters/FELighting.h:
      (LightingData):
      (FELighting):
      * platform/graphics/filters/FEMorphology.cpp:
      (WebCore::FEMorphology::platformApplyGeneric):
      (WebCore::FEMorphology::platformApplySoftware):
      * platform/graphics/filters/FEMorphology.h:
      (PaintingData):
      * platform/graphics/filters/FETurbulence.cpp:
      (WebCore::FETurbulence::fillRegion):
      (WebCore::FETurbulence::platformApplySoftware):
      * platform/graphics/filters/FETurbulence.h:
      (FillRegionParameters):
      (FETurbulence):
      * platform/graphics/filters/FilterEffect.cpp:
      (WebCore::FilterEffect::forceValidPreMultipliedPixels):
      (WebCore::FilterEffect::asUnmultipliedImage):
      (WebCore::FilterEffect::asPremultipliedImage):
      (WebCore::FilterEffect::copyImageBytes):
      (WebCore::FilterEffect::copyUnmultipliedImage):
      (WebCore::FilterEffect::copyPremultipliedImage):
      (WebCore::FilterEffect::createUnmultipliedImageResult):
      (WebCore::FilterEffect::createPremultipliedImageResult):
      * platform/graphics/filters/FilterEffect.h:
      (FilterEffect):
      * platform/graphics/filters/arm/FEGaussianBlurNEON.h:
      (WebCore::FEGaussianBlur::platformApplyNeon):
      * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
      (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
      * platform/graphics/qt/ImageBufferQt.cpp:
      (WebCore::getImageData):
      (WebCore::ImageBuffer::getUnmultipliedImageData):
      (WebCore::ImageBuffer::getPremultipliedImageData):
      (WebCore::ImageBuffer::putByteArray):
      * platform/graphics/skia/ImageBufferSkia.cpp:
      (WebCore::getImageData):
      (WebCore::ImageBuffer::getUnmultipliedImageData):
      (WebCore::ImageBuffer::getPremultipliedImageData):
      (WebCore::ImageBuffer::putByteArray):
      * platform/graphics/texmap/TextureMapperGL.cpp:
      * platform/graphics/wince/ImageBufferWinCE.cpp:
      (WebCore::getImageData):
      (WebCore::ImageBuffer::getUnmultipliedImageData):
      (WebCore::ImageBuffer::getPremultipliedImageData):
      (WebCore::ImageBuffer::putByteArray):
      * platform/graphics/wx/ImageBufferWx.cpp:
      (WebCore::ImageBuffer::getUnmultipliedImageData):
      (WebCore::ImageBuffer::getPremultipliedImageData):
      (WebCore::ImageBuffer::putByteArray):
      * platform/image-encoders/skia/JPEGImageEncoder.cpp:
      (WebCore::JPEGImageEncoder::encode):
      * platform/image-encoders/skia/PNGImageEncoder.cpp:
      (WebCore::PNGImageEncoder::encode):
      * platform/image-encoders/skia/WEBPImageEncoder.cpp:
      (WebCore::WEBPImageEncoder::encode):
      
      Source/WebKit/chromium:
      
      * src/GraphicsContext3DChromium.cpp:
      (WebCore::GraphicsContext3DPrivate::paintRenderingResultsToImageData):
      * src/WebViewImpl.cpp:
      (WebKit::WebViewImpl::doPixelReadbackToCanvas):
      
      Source/WTF:
      
      * wtf/ArrayBuffer.h:
      (ArrayBuffer):
      (WTF::ArrayBuffer::create):
      (WTF::ArrayBuffer::createUninitialized):
      (WTF):
      (WTF::ArrayBufferContents::tryAllocate):
      * wtf/TypedArrayBase.h:
      (WTF::TypedArrayBase::createUninitialized):
      (TypedArrayBase):
      * wtf/Uint8ClampedArray.h:
      (Uint8ClampedArray):
      (WTF::Uint8ClampedArray::createUninitialized):
      (WTF):
      (WTF::Uint8ClampedArray::zeroFill):
      
      LayoutTests:
      
      * fast/canvas/imagedata-contains-uint8clampedarray-expected.txt: Added.
      * fast/canvas/imagedata-contains-uint8clampedarray.html: Added.
      * fast/dom/Window/script-tests/postmessage-clone.js:
      * fast/dom/Window/window-postmessage-clone-expected.txt:
      * platform/chromium/fast/dom/Window/window-postmessage-clone-expected.txt:
      * platform/gtk/fast/dom/Window/window-postmessage-clone-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1262e442
  4. 21 Apr, 2012 1 commit
    • jonlee@apple.com's avatar
      Add Notification constructor · 90f6ed33
      jonlee@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=80477
      <rdar://problem/10912431>
      
      Reviewed by Jian Li.
      
      Source/WebCore:
      
      Tests will be added once there is support for web notifications on the Mac ports.
      
      * WebCore.exp.in: Export finalize() function.
      
      Modify Dictionary to support creation of event listeners.
      * bindings/js/Dictionary.h:
      (WebCore::Dictionary::isObject): Return true if the JSDictionary is valid.
      (WebCore::Dictionary::isUndefinedOrNull): Return true if the JSDictionary is not valid.
      (WebCore::Dictionary::get): Add convenience function to take const char* for
      property name, to prevent having to do implicit conversion to WTF::String.
      (WebCore::Dictionary::getEventListener): Add function to create event listener
      from the dictionary.
      (WebCore::Dictionary::asJSObject): Helper to convert WebCore objects to JS wrapper.
      * bindings/js/Dictionary.cpp:
      (WebCore::Notification): Implement asJSObject() for Notification.
      * bindings/js/JSDictionary.h:
      (WebCore::JSDictionary::execState): Expose the exec state so that the Dictionary
      can obtain its world for creating the event listener.
      
      * bindings/v8/Dictionary.h:
      (WebCore::Dictionary::getEventListener): Stub implementation.
      
      Add new constructor to idl definitions.
      * notifications/DOMWindowNotifications.idl: Add Notification constructor, if
      ENABLE(NOTIFICATIONS) is on.
      * notifications/Notification.idl: If ENABLE(NOTIFICATIONS) is turned on, define
      the constructor. Otherwise, use OmitConstructor.
      * notifications/NotificationCenter.idl: Wrap creation functions in
      ENABLE(LEGACY_NOTIFICATIONS).
      * notifications/NotificationCenter.h: Ditto.
      (NotificationCenter):
      
      * notifications/Notification.h:
      (Notification): Wrap legacy constructors in ENABLE(LEGACY_NOTIFICATIONS).
      (WebCore::Notification::create): New creation function based on discussions in WG.
      * notifications/Notification.cpp:
      (WebCore::getAndAddEventListener): Helper function to get the listener from the
      dictionary, and attach to the notification.
      (WebCore::Notification::create): Create the notification, then apply whatever
      properties can be found in the dictionary to the notification. In order to
      attach the event listeners, the notification has to have been created, which is
      why this all happens in the factory method and not in the constructor.
      (WebCore::Notification::setBody): Added so that it can be set if we find it in the
      dictionary.
      
      The new constructor queues a task to show when it is created. To support this, we
      use a one-shot timer that calls show() in the next iteration of the run loop.
      (WebCore::Notification::Notification): Start the timer.
      (WebCore::Notification::showTaskTimerFired): Call show().
      
      Notifications, not being attached to the DOM, could be GC'ed by the JS engine
      before its life cycle has completed. We add calls to setPendingActivity() when the
      notification has been shown, and when it is closed, we unsetPendingActivity().
      To guarantee that we only call this once, we add a new state to the Notification
      state machine, called NotificationState::Closed.
      (WebCore::Notification::show): Call setPendingActivity() for all ports. Remove conditional on Mac.
      (WebCore::Notification::close): Include Closed state to machine; do nothing.
      (WebCore::Notification::dispatchCloseEvent): Call finalize().
      (WebCore::Notification::finalize): If the state is not Closed, we unsetPendingActivity()
      to make it available for GC.
      (WebCore::Notification::finishLoading): Remove the unsetPendingActivity(). That call
      was to balance the setPendingActivity() called for loading the icon. Instead of wrapping
      around the icon load, we wrap around the show() -> finalize() loop.
      
      In Notification, rename some of the stages and functions to more clearly communicate
      that they mostly deal with the icon of the notification, instead of general loading.
      (WebCore::Notification::show): Refactored to use LoadingIcon and CancelledIcon.
      (WebCore::Notification::close): Refactored to use LoadingIcon and CancelledIcon.
      (WebCore::Notification::~Notification): Refactor to use LoadingIcon.
      (WebCore::Notification::startLoadingIcon): Renamed from startLoading().
      (WebCore::Notification::stopLoadingIcon): Renamed from stopLoading().
      (WebCore::Notification::finishLoadingIcon): Renamed from finishLoading().
      (WebCore::Notification::didFinishLoading):
      (WebCore::Notification::didFail):
      (WebCore::Notification::didFailRedirectCheck):
      (WebCore::Notification::didReceiveResponse):
      (WebCore::Notification::finishLoading):
      
      Add Dictionary.cpp.
      * GNUmakefile.list.am:
      * Target.pri:
      * UseJSC.cmake:
      * WebCore.gypi:
      
      Fix bug in V8 bindings generation code. If the constructor doesn't raise an exception,
      don't use an exception code.
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateParametersCheck):
      * bindings/scripts/test/V8/V8TestObj.cpp: Reset results.
      (WebCore::TestObjV8Internal::optionsObjectCallback):
      
      Source/WebKit/mac:
      
      * WebCoreSupport/WebNotificationClient.mm:
      (WebNotificationClient::clearNotifications): When clearing notifications, finalize
      them so that they can be cleaned up by the GC.
      
      Source/WebKit2:
      
      * WebProcess/Notifications/WebNotificationManager.cpp:
      (WebKit::WebNotificationManager::show): If the notification doesn't get shown,
      we should return false, since it will not go through a setPendingActivity cycle.
      (WebKit::WebNotificationManager::clearNotifications): When clearing notifications,
      finalize them so that they can be cleaned up by the GC.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      90f6ed33
  5. 17 Apr, 2012 2 commits
    • fpizlo@apple.com's avatar
      It should be possible to create an inheritorID for the global this object without crashing · 825f980b
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=84200
      <rdar://problem/11251082>
      
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      * runtime/JSGlobalThis.cpp:
      (JSC::JSGlobalThis::setUnwrappedObject):
      * runtime/JSGlobalThis.h:
      (JSC::JSGlobalThis::unwrappedObject):
      (JSGlobalThis):
      * runtime/JSObject.cpp:
      (JSC::JSObject::createInheritorID):
      * runtime/JSObject.h:
      (JSObject):
      (JSC::JSObject::resetInheritorID):
      
      Source/WebCore: 
      
      No new tests, because the circumstances necessary to make this happen are rather hairy.
      
      * bindings/js/JSDOMWindowShell.h:
      (WebCore::JSDOMWindowShell::window):
      (WebCore::JSDOMWindowShell::setWindow):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      825f980b
    • benm@google.com's avatar
      `localStorage.setItem` can overwrite `localStorage` methods · 3868bff6
      benm@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=30996
      
      Source/WebCore:
      
      Update the JSC and V8 bindings such that if the name of the DOM
      Storage property being retrieved is a match for a property in the
      prototype, always return the prototype version. If there is a DOM
      Storage key of the same name, it can still be retrieved via the
      getItem method. This prevents storage methods from being
      accidentally hidden. This brings WebKit behavior in line with the
      de facto standard implemented by FireFox and IE.
      
      Reviewed by Kentaro Hara.
      
      Test: storage/domstorage/storage-functions-not-overwritten.html
      
      * bindings/js/JSStorageCustom.cpp:
      (WebCore::JSStorage::nameGetter):
      * bindings/v8/custom/V8StorageCustom.cpp:
      (WebCore::V8Storage::namedPropertyGetter):
      
      LayoutTests:
      
      Add a test to verify that setting a DOM Storage key with the same name
      as a function on the Storage object does not prevent that function
      being called, but also that it can still be retrieved via the getItem
      function.
      
      Reviewed by Kentaro Hara.
      
      * storage/domstorage/script-tests/storage-functions-not-overwritten.js: Added.
      (doWedgeThySelf):
      (testStorage):
      (runTest):
      * storage/domstorage/storage-functions-not-overwritten-expected.txt: Added.
      * storage/domstorage/storage-functions-not-overwritten.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3868bff6
  6. 15 Apr, 2012 1 commit
  7. 13 Apr, 2012 1 commit
  8. 12 Apr, 2012 4 commits
    • abarth@webkit.org's avatar
      Prepare window.location for seamless navigation · ff0f4d64
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83843
      
      Reviewed by Eric Seidel.
      
      This patch refactors window.location to flow through
      FrameLoader::findFrameForNavigation, which is where we're going to
      implement the seamless navigation redirect.  This patch shouldn't cause
      any observable changes in behavior today, but it will make all the
      seamless-window-location* tests in
      https://github.com/eseidel/webkit/tree/seamless/LayoutTests/fast/frames/seamless
      pass once we merge the seamlesss branch.  See
      https://github.com/eseidel/webkit/commit/a6e708fa6c643b156397e9a287b40a0868c7959c
      for context.
      
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::JSDOMWindow::setLocation):
      * bindings/v8/custom/V8DOMWindowCustom.cpp:
      (WebCore::V8DOMWindow::locationAccessorSetter):
      * page/Location.cpp:
      (WebCore::Location::setHref):
      (WebCore::Location::setProtocol):
      (WebCore::Location::setHost):
      (WebCore::Location::setHostname):
      (WebCore::Location::setPort):
      (WebCore::Location::setPathname):
      (WebCore::Location::setSearch):
      (WebCore::Location::setHash):
      (WebCore::Location::assign):
      (WebCore::Location::replace):
      (WebCore::Location::setLocation):
      (WebCore):
      * page/Location.h:
      (Location):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ff0f4d64
    • aestes@apple.com's avatar
      REGRESSION (r102262): iAd Producer relies on CSSStyleDeclaration property... · b7aa863e
      aestes@apple.com authored
      REGRESSION (r102262): iAd Producer relies on CSSStyleDeclaration property setters respecting '!important'
      https://bugs.webkit.org/show_bug.cgi?id=83832
      
      Reviewed by Alexey Proskuryakov.
      
      Source/WebCore:
      
      Shipping versions of iAd Producer rely on the pre-r102262 behavior of
      respecting '!important' when specified in a CSSStyleDeclaration
      property setter. Restore this quirky behavior for versions of the app
      that expect it.
      
      * WebCore.exp.in: Export
      Settings::setShouldRespectPriorityInCSSAttributeSetters().
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      (WebCore::JSCSSStyleDeclaration::putDelegate): If
      setShouldRespectPriorityInCSSAttributeSetters() is true, restore the
      pre-r102262 behavior wherein we attempt to parse '!important' out of
      the property value.
      * page/Settings.cpp:
      (WebCore::Settings::setShouldRespectPriorityInCSSAttributeSetters):
      (WebCore::Settings::shouldRespectPriorityInCSSAttributeSetters):
      * page/Settings.h:
      
      Source/WebKit/mac:
      
      * Misc/WebKitVersionChecks.h: Indicate that 535.13.0 was the first
      version of WebKit.framework to ignore '!important' in
      CSSStyleDeclaration property setters.
      * WebView/WebView.mm:
      (shouldRespectPriorityInCSSAttributeSetters):
      (-[WebView _commonInitializationWithFrameName:groupName:]): Enable a
      quirk to restore pre-r102262 behavior if the application is iAd Producer
      and was linked against a version of WebKit.framework that had the old behavior.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114048 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b7aa863e
    • dslomov@google.com's avatar
      Source/WebCore: REGRESSION (r113233):... · fd060da5
      dslomov@google.com authored
      Source/WebCore: REGRESSION (r113233): fast/canvas/webgl/array-message-passing.html crashing on Lion and Snow Leopard bots.
      https://bugs.webkit.org/show_bug.cgi?id=83427.
      Due to incorrect merge by me when landing r113233, call to find got replaces with call to add in
      checking for duplicates in ObjectPool when serializing.
      
      Reviewed by Dean Jackson.
      
      Covered by existing tests.
      
      * bindings/js/SerializedScriptValue.cpp:
      (WebCore::CloneSerializer::checkForDuplicate):
      
      LayoutTests: REGRESSION (r113233): fast/canvas/webgl/array-message-passing.html crashing on Lion and Snow Leopard bots.
      https://bugs.webkit.org/show_bug.cgi?id=83427.
      Bug fixed, unskipping tests.
      
      Reviewed by Dean Jackson.
      
      * platform/mac/Skipped:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fd060da5
    • jonlee@apple.com's avatar
      Implement Dictionary.h on mac (83472) · 18c38150
      jonlee@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83472
      <rdar://problem/11209766>
      
      Reviewed by Kentaro Hara.
      
      A difference between Dictionary and JSDictionary makes it difficult to merge the two together and avoid
      creating a confusing API. The boolean returned by Dictionary::get() represents whether the
      property was found. The boolean returned by JSDictionary::tryGetProperty() represents whether an
      exception was thrown.
      
      * WebCore.xcodeproj/project.pbxproj: Add Dictionary.h and Dictionary.cpp.
      
      * bindings/js/Dictionary.cpp: Added.
      (WebCore::Dictionary::Dictionary):
      (WebCore::Dictionary::get):
      * bindings/js/Dictionary.h: Leverage JSDictionary's functionality to obtain the data.
      (WebCore::Dictionary::isObject): Mark an unimplemented.
      (WebCore::Dictionary::isUndefinedOrNull): Mark an unimplemented.
      (WebCore::Dictionary::getWithUndefinedOrNullCheck): Mark an unimplemented.
      
      * bindings/js/JSDictionary.cpp:
      (WebCore::JSDictionary::tryGetProperty): Convert to a const function.
      * bindings/js/JSDictionary.h:
      (WebCore::JSDictionary::isValid):
      (WebCore::JSDictionary::tryGetProperty): Convert to a const function.
      (WebCore::JSDictionary::get): Similar to tryGetProperty(), but returns true if the
      property was found, converting the value succeeded and the out parameter "result" was set.
      (WebCore::JSDictionary::tryGetPropertyAndResult): Refactor tryGetProperty() to return the enum directly.
      
      Change bindings scripts to use Dictionary constructor.
      * bindings/js/IDBBindingUtilities.cpp: Remove createDictionaryFromValue().
      * bindings/js/IDBBindingUtilities.h: Remove createDictionaryFromValue().
      * bindings/scripts/CodeGeneratorJS.pm:
      (JSValueToNative): Update to remove IDBBindingUtilities.h dependency, and use Dictionary constructor.
      * bindings/scripts/test/JS/JSTestObj.cpp:
      (WebCore::jsTestObjPrototypeFunctionOptionsObject): Update expected generated output.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      18c38150
  9. 10 Apr, 2012 2 commits
    • abarth@webkit.org's avatar
      Source/WebCore: Limit -apple- and -khtml- to ENABLE(DASHBOARD_SUPPORT) · 6ebb4154
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83256
      
      Reviewed by Eric Seidel.
      
      As recommended by David Hyatt in
      <https://lists.webkit.org/pipermail/webkit-dev/2010-July/013536.html>,
      we should phase out support for -khtml- and -apple- vendor prefixes in
      CSS (in favor of -webkit-).
      
      As noted in <https://bugs.webkit.org/show_bug.cgi?id=42093#c29>, Dave's
      proposal is a bit too agressive.  These prefixes appear to be needed
      for a number of dashboard widgets.  For that reason, this patch limits
      the prefixes to ENABLE(LEGACY_CSS_VENDOR_PREFIXES).
      
      This patch enables ENABLE(LEGACY_CSS_VENDOR_PREFIXES) on apple-mac and
      apple-win, which will let us learn whether removing these prefixes
      causes a compatibility problem on the broader web.
      
      * Configurations/FeatureDefines.xcconfig:
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      (WebCore::getCSSPropertyNamePrefix):
      (WebCore::cssPropertyIDForJSCSSPropertyName):
      * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
      (WebCore::cssPropertyInfo):
      * css/CSSParser.cpp:
      (WebCore::cssPropertyID):
      
      Source/WebKit/chromium: Limit -apple- and -khtml- to ENABLE(DASHBOARD_SUPPORT)
      https://bugs.webkit.org/show_bug.cgi?id=83256
      
      Reviewed by Eric Seidel.
      
      * features.gypi:
      
      WebKitLibraries: Limit -apple- and -khtml- to ENABLE(DASHBOARD_SUPPORT)
      https://bugs.webkit.org/show_bug.cgi?id=83256
      
      Reviewed by Eric Seidel.
      
      * win/tools/vsprops/FeatureDefines.vsprops:
      
      LayoutTests: Limit -apple- and -khtml- to ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
      https://bugs.webkit.org/show_bug.cgi?id=83256
      
      Reviewed by Eric Seidel.
      
      Skip these two tests, which are testing that -apple- and -khtml- vendor
      prefixes work correctly.
      
      * platform/chromium/test_expectations.txt:
      * platform/efl/Skipped:
      * platform/gtk/Skipped:
      * platform/qt/Skipped:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6ebb4154
    • loislo@chromium.org's avatar
      Web Inspector: use maxJSObjectId that is provided by back-end. · aa6c982b
      loislo@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82451
      
      Summary view can filter objects in snapshot. It uses maxJSObjectId for this.
      There was no such field in the profile header at the
      moment but I've landed a patch in downstream.
      
      Reviewed by Yury Semikhatsky.
      
      * bindings/js/ScriptHeapSnapshot.h:
      (WebCore):
      (WebCore::ScriptHeapSnapshot::maxSnapshotJSObjectId):
      * bindings/v8/ScriptHeapSnapshot.cpp:
      (WebCore::ScriptHeapSnapshot::maxSnapshotJSObjectId):
      (WebCore):
      * bindings/v8/ScriptHeapSnapshot.h:
      (WebCore):
      (ScriptHeapSnapshot):
      * inspector/InspectorProfilerAgent.cpp:
      (WebCore::InspectorProfilerAgent::createSnapshotHeader):
      * inspector/front-end/DetailedHeapshotView.js:
      (WebInspector.HeapSnapshotConstructorsDataGrid):
      (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.setDataSource):
      (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.populateChildren):
      (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
      (WebInspector.DetailedHeapshotView.prototype._changeFilter):
      * inspector/front-end/HeapSnapshot.js:
      (WebInspector.HeapSnapshot.prototype.updateStaticData):
      * inspector/front-end/HeapSnapshotProxy.js:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aa6c982b
  10. 09 Apr, 2012 2 commits
    • timothy@apple.com's avatar
      Fix the assertion in PageScriptDebugServer::didPause. · 3edb1ce3
      timothy@apple.com authored
      https://webkit.org/b/82943
      
      Reviewed by Simon Fraser.
      
      * bindings/js/PageScriptDebugServer.cpp:
      (WebCore::PageScriptDebugServer::PageScriptDebugServer): Initialize m_pausedPage
      to zero so the assert in didPause will not randomly fire the first time.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3edb1ce3
    • antti@apple.com's avatar
      Don't expose internal CSSValues in API · c7d06d23
      antti@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83426
      
      Reviewed by Andreas Kling.
      
      The CSSValues returned from functions like CSSStyleDeclaration.getPropertyCSSValue() are currently
      the same instances we use internally. This creates various problems. The values can't be shared between
      documents as the wrappers would be shared too. Having to maintain per-document CSSValuePools complicate
      the architecture and increase memory usage. This also blocks sharing style sheet data structures
      between documents.
      
      This patch adds a concept of CSSOM-safe CSSValue. Only the safe values can be wrapped for JS access.
      Values are unsafe by default. The CSSOM functions that return CSSValues create safe instances by
      cloning the internal values.
      
      The use of APIs that return CSSValues is very rare (the currect CSSOM draft deprecates them) and
      cloning is cheap in any case. Future patches will eliminate the per-document value pool in favor
      of a global one for a memory win.
      
      In the future we want to replace internally used CSSValues with true internal types (StyleValues) and
      use CSSValues exclusively as wrappers (similar to how CSSStyleRule wraps internal StyleRule).
      
      * bindings/js/JSCSSValueCustom.cpp:
      (WebCore::toJS):
      * css/CSSComputedStyleDeclaration.cpp:
      (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
      (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValueInternal):
      * css/CSSImageSetValue.cpp:
      (WebCore::CSSImageSetValue::CSSImageSetValue):
      (WebCore):
      (WebCore::CSSImageSetValue::cloneForCSSOM):
      * css/CSSImageSetValue.h:
      (CSSImageSetValue):
      * css/CSSPrimitiveValue.cpp:
      (WebCore::CSSPrimitiveValue::cleanup):
      
          Opportunistically fix a string leak for CSS_COUNTER_NAME values.
          Add all cases, remove default.
      
      (WebCore::CSSPrimitiveValue::cloneForCSSOM):
      (WebCore):
      * css/CSSPrimitiveValue.h:
      (CSSPrimitiveValue):
      (WebCore::CSSPrimitiveValue::setCSSOMSafe):
      * css/CSSValue.cpp:
      (WebCore):
      (TextCloneCSSValue):
      (WebCore::TextCloneCSSValue::create):
      (WebCore::TextCloneCSSValue::cssText):
      (WebCore::TextCloneCSSValue::TextCloneCSSValue):
      
          Most non-primitive value types are not exposed in CSSOM. For those we create a dummy value
          that contains only the data that is accessible though the base CSSValue interface.
      
      (WebCore::CSSValue::addSubresourceStyleURLs):
      (WebCore::CSSValue::cssText):
      (WebCore::CSSValue::destroy):
      (WebCore::CSSValue::cloneForCSSOM):
      * css/CSSValue.h:
      (WebCore):
      (CSSValue):
      (WebCore::CSSValue::isCSSOMSafe):
      (WebCore::CSSValue::isSubtypeExposedToCSSOM):
      (WebCore::CSSValue::CSSValue):
      * css/CSSValueList.cpp:
      (WebCore::CSSValueList::CSSValueList):
      (WebCore):
      (WebCore::CSSValueList::cloneForCSSOM):
      * css/CSSValueList.h:
      (CSSValueList):
      * css/Counter.h:
      (Counter):
      (WebCore::Counter::cloneForCSSOM):
      * css/PropertySetCSSStyleDeclaration.cpp:
      (WebCore::PropertySetCSSStyleDeclaration::setCssText):
      (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
      (WebCore::PropertySetCSSStyleDeclaration::setProperty):
      (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
      (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
      (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
      (WebCore::PropertySetCSSStyleDeclaration::didMutate):
      (WebCore):
      (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM):
      
          Maintain a map of safe CSSValues so we can maintain object identity.
      
      * css/PropertySetCSSStyleDeclaration.h:
      (WebCore::PropertySetCSSStyleDeclaration::setNeedsStyleRecalc):
      (PropertySetCSSStyleDeclaration):
      * css/RGBColor.cpp:
      (WebCore::RGBColor::red):
      (WebCore::RGBColor::green):
      (WebCore::RGBColor::blue):
      (WebCore::RGBColor::alpha):
      * css/Rect.h:
      (WebCore::RectBase::RectBase):
      (RectBase):
      (Rect):
      (WebCore::Rect::cloneForCSSOM):
      (WebCore::Rect::Rect):
      (Quad):
      (WebCore::Quad::cloneForCSSOM):
      (WebCore::Quad::Quad):
      * css/WebKitCSSFilterValue.cpp:
      (WebCore::WebKitCSSFilterValue::WebKitCSSFilterValue):
      (WebCore):
      (WebCore::WebKitCSSFilterValue::cloneForCSSOM):
      * css/WebKitCSSFilterValue.h:
      (WebKitCSSFilterValue):
      * css/WebKitCSSTransformValue.cpp:
      (WebCore::WebKitCSSTransformValue::WebKitCSSTransformValue):
      (WebCore):
      (WebCore::WebKitCSSTransformValue::cloneForCSSOM):
      * css/WebKitCSSTransformValue.h:
      (WebKitCSSTransformValue):
      * svg/SVGColor.cpp:
      (WebCore::SVGColor::SVGColor):
      (WebCore):
      (WebCore::SVGColor::cloneForCSSOM):
      * svg/SVGColor.h:
      (SVGColor):
      * svg/SVGPaint.cpp:
      (WebCore::SVGPaint::SVGPaint):
      (WebCore):
      (WebCore::SVGPaint::cloneForCSSOM):
      * svg/SVGPaint.h:
      (SVGPaint):
      * svg/SVGStyledElement.cpp:
      (WebCore::SVGStyledElement::getPresentationAttribute):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c7d06d23
  11. 06 Apr, 2012 4 commits
    • oliver@apple.com's avatar
      Accessing the returnValue of a modal dialog should be performed directly on the global object. · aced271f
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83414
      
      Reviewed by Gavin Barraclough.
      
      Presumably during the mass-devirtualising of JSObject, this deliberate use of
      the GlobalObject's property lookup logic directly was replaced with a dynamic
      call.  That results in the DOMWindow filtering out the lookup.  This regression
      was masked by r93567.
      
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::DialogHandler::returnValue):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aced271f
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r113442. · 047ecc8a
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/113442
      https://bugs.webkit.org/show_bug.cgi?id=83373
      
      for breaking JSC bindings compilation (Requested by pfeldman
      on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-04-06
      
      * GNUmakefile.list.am:
      * Target.pri:
      * UseJSC.cmake:
      * UseV8.cmake:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/JSMutationCallbackCustom.cpp: Added.
      (WebCore):
      (WebCore::JSMutationCallback::handleEvent):
      * bindings/scripts/CodeGenerator.pm:
      * bindings/scripts/CodeGeneratorJS.pm:
      (AddIncludesForTypeInImpl):
      (GenerateCallbackHeader):
      (GenerateCallbackImplementation):
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateCallbackHeader):
      (GenerateCallbackImplementation):
      * bindings/scripts/test/JS/JSTestCallback.cpp:
      (WebCore::JSTestCallback::callbackWithBoolean):
      * bindings/scripts/test/JS/JSTestCallback.h:
      (JSTestCallback):
      * bindings/scripts/test/TestCallback.idl:
      * bindings/scripts/test/V8/V8TestCallback.cpp:
      (WebCore::V8TestCallback::callbackWithBoolean):
      * bindings/scripts/test/V8/V8TestCallback.h:
      (V8TestCallback):
      * bindings/v8/custom/V8MutationCallbackCustom.cpp: Added.
      (WebCore):
      (WebCore::V8MutationCallback::handleEvent):
      * dom/MutationCallback.idl:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      047ecc8a
    • msaboff@apple.com's avatar
      Call Heap::discardAllCompiledCode() in low memory situations · 03e811fc
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83335
      
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore: 
      
      Restructured Heap::discardAllCompiledCode() to do the "Is JavaScriptRunning?"
      check inline so that it can be called directly without this check.
      
      * heap/Heap.cpp:
      (JSC::Heap::discardAllCompiledCode):
      (JSC::Heap::collectAllGarbage):
      * heap/Heap.h: Added JS_EXPORT_PRIVATE to discardAllCompiledCode() so it can be
      called from WebCore.
      (Heap):
      * runtime/JSGlobalData.h: Removed unused " void discardAllCompiledCode()" declaration.
      (JSGlobalData):
      
      Source/WebCore: 
      
      Added call to discardAllCompiledCode() when under memory pressure.
      We can re-JIT as needed.  This is similar to what we used to do when we did
      a full GC which also cleaned up JIT code.  Doing a full GC typically didn't
      help our memory situation, in fact it made things worse in the really low
      memory situation as it caused more paging.
      
      Added pass through discardAllCompiledCode() method to GCController.
      
      * bindings/js/GCController.cpp:
      (WebCore::GCController::discardAllCompiledCode):
      (WebCore):
      * bindings/js/GCController.h:
      (GCController):
      * platform/mac/MemoryPressureHandlerMac.mm:
      (WebCore::MemoryPressureHandler::releaseMemory):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      03e811fc
    • haraken@chromium.org's avatar
      Add CodeGenerator support for sequence<> in callbacks. · 882f5e3c
      haraken@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83233
      
      Patch by Vineet Chaudhary <rgf748@motorola.com> on 2012-04-06
      Reviewed by Kentaro Hara.
      
      Tests: TestCallback.idl and fast/mutation/callback-arguments.html should pass even after
      the changes.
      
      * GNUmakefile.list.am: Removed unsued custom files V8MutationCallbackCustom.cpp
        and JSMutationCallbackCustom.cpp from builds.
      * Target.pri: Ditto.
      * UseJSC.cmake: Ditto.
      * UseV8.cmake: Ditto.
      * WebCore.gypi: Ditto.
      * WebCore.vcproj/WebCore.vcproj: Ditto.
      * WebCore.xcodeproj/project.pbxproj: Ditto.
      * bindings/js/JSMutationCallbackCustom.cpp: Removed.
      * bindings/scripts/CodeGeneratorJS.pm:
      (AddIncludesForTypeInImpl): Add proper header type.
      (GenerateCallbackHeader): Generate declaration for the callback with sequence<T> argument.
      (GenerateCallbackImplementation): Generate implementation for the callback with sequence<T> argument.
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateCallbackHeader): Generate declaration for the callback with sequence<T> argument.
      (GenerateCallbackImplementation): Generate implementation for the callback with sequence<T> argument.
      * bindings/scripts/test/JS/JSTestCallback.cpp: Modified test results of run-bindings-tests.
      (WebCore):
      (WebCore::JSTestCallback::handleEvent):
      * bindings/scripts/test/JS/JSTestCallback.h: Modified test results of run-bindings-tests.
      (JSTestCallback):
      * bindings/scripts/test/TestCallback.idl: Added test callback with sequence<> argument.
      * bindings/scripts/test/V8/V8TestCallback.cpp: Modified test results of run-bindings-tests.
      (WebCore):
      (WebCore::V8TestCallback::handleEvent):
      * bindings/scripts/test/V8/V8TestCallback.h: Modified test results of run-bindings-tests.
      (V8TestCallback):
      * bindings/v8/custom/V8MutationCallbackCustom.cpp: Removed.
      * dom/MutationCallback.idl: Removed custom bindings using sequence<T>.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      882f5e3c
  12. 05 Apr, 2012 1 commit
    • oliver@apple.com's avatar
      Make WebCore use jsCast rather than static_cast for casting JSC objects · ffe14426
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83320
      
      Reviewed by Stephanie Lewis.
      
      Mechanically replace static_cast with jsCast where ever we can.
      
      * WebCore.exp.in:
      * bindings/js/DOMWrapperWorld.cpp:
      (WebCore::JSStringOwner::finalize):
      * bindings/js/DOMWrapperWorld.h:
      (WebCore::currentWorld):
      * bindings/js/JSArrayBufferCustom.cpp:
      (WebCore::JSArrayBufferConstructor::constructJSArrayBuffer):
      * bindings/js/JSAudioContextCustom.cpp:
      (WebCore::JSAudioContextConstructor::constructJSAudioContext):
      * bindings/js/JSCSSRuleListCustom.cpp:
      (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      (WebCore::cssPropertyGetterPixelOrPosPrefixCallback):
      (WebCore::cssPropertyGetterCallback):
      * bindings/js/JSCSSValueCustom.cpp:
      (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
      (WebCore::JSCSSValueOwner::finalize):
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::reportException):
      * bindings/js/JSDOMBinding.h:
      (WebCore::deprecatedGlobalObjectForPrototype):
      (WebCore::getDOMPrototype):
      * bindings/js/JSDOMFormDataCustom.cpp:
      (WebCore::toHTMLFormElement):
      (WebCore::JSDOMFormDataConstructor::constructJSDOMFormData):
      * bindings/js/JSDOMMimeTypeArrayCustom.cpp:
      (WebCore::JSDOMMimeTypeArray::nameGetter):
      * bindings/js/JSDOMPluginArrayCustom.cpp:
      (WebCore::JSDOMPluginArray::nameGetter):
      * bindings/js/JSDOMPluginCustom.cpp:
      (WebCore::JSDOMPlugin::nameGetter):
      * bindings/js/JSDOMStringMapCustom.cpp:
      (WebCore::JSDOMStringMap::nameGetter):
      * bindings/js/JSDOMWindowBase.cpp:
      (WebCore::toJSDOMWindow):
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::childFrameGetter):
      (WebCore::indexGetter):
      (WebCore::namedItemGetter):
      (WebCore::toDOMWindow):
      * bindings/js/JSDOMWindowCustom.h:
      (WebCore::asJSDOMWindow):
      * bindings/js/JSDOMWindowShell.h:
      (WebCore::JSDOMWindowShell::window):
      * bindings/js/JSDOMWrapper.h:
      (WebCore::JSDOMWrapper::globalObject):
      * bindings/js/JSDataViewCustom.cpp:
      (WebCore::JSDataViewConstructor::constructJSDataView):
      * bindings/js/JSEventListener.cpp:
      (WebCore::JSEventListener::handleEvent):
      * bindings/js/JSEventTarget.cpp:
      (WebCore):
      (WebCore::toEventTarget):
      * bindings/js/JSFloat32ArrayCustom.cpp:
      (WebCore::JSFloat32ArrayConstructor::constructJSFloat32Array):
      * bindings/js/JSFloat64ArrayCustom.cpp:
      (WebCore::JSFloat64ArrayConstructor::constructJSFloat64Array):
      * bindings/js/JSGeolocationCustom.cpp:
      (WebCore::JSGeolocation::getCurrentPosition):
      (WebCore::JSGeolocation::watchPosition):
      * bindings/js/JSHTMLAllCollectionCustom.cpp:
      (WebCore::callHTMLAllCollection):
      (WebCore::JSHTMLAllCollection::nameGetter):
      * bindings/js/JSHTMLCollectionCustom.cpp:
      (WebCore::JSHTMLCollection::nameGetter):
      * bindings/js/JSHTMLDocumentCustom.cpp:
      (WebCore::JSHTMLDocument::nameGetter):
      * bindings/js/JSHTMLFormElementCustom.cpp:
      (WebCore::JSHTMLFormElement::nameGetter):
      * bindings/js/JSHTMLFrameSetElementCustom.cpp:
      (WebCore::JSHTMLFrameSetElement::nameGetter):
      * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
      (WebCore::JSHTMLOptionsCollection::remove):
      * bindings/js/JSImageConstructor.cpp:
      (WebCore::constructImage):
      * bindings/js/JSInjectedScriptManager.cpp:
      (WebCore::InjectedScriptManager::createInjectedScript):
      (WebCore::InjectedScriptManager::discardInjectedScript):
      (WebCore::InjectedScriptManager::injectedScriptFor):
      * bindings/js/JSInt16ArrayCustom.cpp:
      (WebCore::JSInt16ArrayConstructor::constructJSInt16Array):
      * bindings/js/JSInt32ArrayCustom.cpp:
      (WebCore::JSInt32ArrayConstructor::constructJSInt32Array):
      * bindings/js/JSInt8ArrayCustom.cpp:
      (WebCore::JSInt8ArrayConstructor::constructJSInt8Array):
      * bindings/js/JSLazyEventListener.cpp:
      (WebCore::JSLazyEventListener::initializeJSFunction):
      * bindings/js/JSNamedNodeMapCustom.cpp:
      (WebCore::JSNamedNodeMap::nameGetter):
      * bindings/js/JSNodeCustom.cpp:
      (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
      (WebCore::JSNodeOwner::finalize):
      * bindings/js/JSNodeCustom.h:
      (WebCore::toJS):
      * bindings/js/JSNodeFilterCustom.cpp:
      (WebCore::toNodeFilter):
      * bindings/js/JSNodeListCustom.cpp:
      (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
      (WebCore::JSNodeList::nameGetter):
      * bindings/js/JSPluginElementFunctions.cpp:
      (WebCore::runtimeObjectPropertyGetter):
      (WebCore::callPlugin):
      * bindings/js/JSPopStateEventCustom.cpp:
      (WebCore::JSPopStateEvent::state):
      * bindings/js/JSSQLTransactionCustom.cpp:
      (WebCore::JSSQLTransaction::executeSql):
      * bindings/js/JSSharedWorkerCustom.cpp:
      (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker):
      * bindings/js/JSStorageCustom.cpp:
      (WebCore::JSStorage::nameGetter):
      * bindings/js/JSStyleSheetListCustom.cpp:
      (WebCore::JSStyleSheetList::nameGetter):
      * bindings/js/JSTextTrackCueCustom.cpp:
      (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
      * bindings/js/JSTextTrackCustom.cpp:
      (WebCore::JSTextTrackOwner::isReachableFromOpaqueRoots):
      * bindings/js/JSTextTrackListCustom.cpp:
      (WebCore::JSTextTrackListOwner::isReachableFromOpaqueRoots):
      * bindings/js/JSTrackCustom.cpp:
      (WebCore::toTrack):
      * bindings/js/JSUint16ArrayCustom.cpp:
      (WebCore::JSUint16ArrayConstructor::constructJSUint16Array):
      * bindings/js/JSUint32ArrayCustom.cpp:
      (WebCore::JSUint32ArrayConstructor::constructJSUint32Array):
      * bindings/js/JSUint8ArrayCustom.cpp:
      (WebCore::JSUint8ArrayConstructor::constructJSUint8Array):
      * bindings/js/JSUint8ClampedArrayCustom.cpp:
      (WebCore::JSUint8ClampedArrayConstructor::constructJSUint8ClampedArray):
      * bindings/js/JSWebKitMutationObserverCustom.cpp:
      (WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver):
      * bindings/js/JSWebKitPointCustom.cpp:
      (WebCore::JSWebKitPointConstructor::constructJSWebKitPoint):
      * bindings/js/JSWebSocketCustom.cpp:
      (WebCore::JSWebSocketConstructor::constructJSWebSocket):
      * bindings/js/JSWorkerContextBase.cpp:
      (WebCore::toJSDedicatedWorkerContext):
      (WebCore::toJSSharedWorkerContext):
      * bindings/js/JSWorkerCustom.cpp:
      (WebCore::JSWorkerConstructor::constructJSWorker):
      * bindings/js/JSXSLTProcessorCustom.cpp:
      (WebCore::JSXSLTProcessor::importStylesheet):
      (WebCore::JSXSLTProcessor::transformToFragment):
      (WebCore::JSXSLTProcessor::transformToDocument):
      * bindings/js/ScriptCallStackFactory.cpp:
      (WebCore::createScriptCallStackForInspector):
      * bindings/js/ScriptControllerMac.mm:
      (WebCore::updateStyleIfNeededForBindings):
      * bindings/js/ScriptDebugServer.cpp:
      (WebCore::ScriptDebugServer::dispatchDidPause):
      * bindings/js/ScriptObject.cpp:
      (WebCore::ScriptGlobalObject::set):
      * bindings/js/ScriptState.cpp:
      (WebCore::domWindowFromScriptState):
      (WebCore::scriptExecutionContextFromScriptState):
      * bindings/js/SerializedScriptValue.cpp:
      (WebCore::CloneSerializer::fillTransferMap):
      (WebCore::CloneSerializer::dumpArrayBufferView):
      (WebCore::CloneDeserializer::getJSValue):
      (WebCore::CloneDeserializer::readTerminal):
      * bindings/objc/WebScriptObject.mm:
      (-[WebScriptObject _isSafeScript]):
      (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateGetOwnPropertySlotBody):
      (GenerateGetOwnPropertyDescriptorBody):
      (GenerateImplementation):
      (GenerateCallWith):
      (NativeToJSValue):
      (GenerateConstructorDefinition):
      * bridge/jni/jni_jsobject.h:
      * bridge/jni/jni_jsobject.mm:
      (JavaJSObject::convertJObjectToValue):
      * bridge/jni/jsc/JavaInstanceJSC.cpp:
      (JavaInstance::invokeMethod):
      * bridge/objc/objc_utility.mm:
      (JSC::Bindings::convertValueToObjcValue):
      * bridge/runtime_method.cpp:
      (JSC::callRuntimeMethod):
      * bridge/runtime_object.cpp:
      (JSC::Bindings::callRuntimeConstructor):
      * testing/js/WebCoreTestSupport.cpp:
      (WebCoreTestSupport::injectInternalsObject):
      (WebCoreTestSupport::resetInternalsObject):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ffe14426
  13. 04 Apr, 2012 2 commits
    • dslomov@google.com's avatar
      Source/WebCore: [JSC] ArrayBufferView and its ArrayBuffer are appended to... · 6c31be5e
      dslomov@google.com authored
      Source/WebCore: [JSC] ArrayBufferView and its ArrayBuffer are appended to object pool in wrong order
      https://bugs.webkit.org/show_bug.cgi?id=82090
      The implementation of structured cloning algorithm (http://www.w3.org/TR/html5/common-dom-interfaces.html#internal-structured-cloning-algorithm)
      in SerializedScriptValue.cpp assigns numerical identifiers to encontered objects as it traverses
      the cloned object during serialization.
      When the cloning encounters an already seen object, it transfers the assigned numerical id
      instead of cloning the object again. Deserialization process then repeats the process in
      the mirror fashion, i.e. on deserializing the object it assigns deserialized object a numeric id and if it
      deserializes the id it substitutes the perviously deserialized objects. It is critical that serialization and deserialization
      assigns numeric ids in the same order.
      
      The bug (discovered by Yong Li) is that when serializing ArrayBufferView, the ids were assigned first to
      the ArrayBufferView and then to underlying ArrayBuffer; however on deserialization the ids were assigned another way round.
      
      This patch fixes that by assigning the id first to ArrayBuffer and then to ArrayBufferView, and adds corresponding test cases.
      
      Reviewed by Kenneth Russell.
      
      New test cases added to fast/canvas/web-gl/array-message-passing.html.
      
      * bindings/js/SerializedScriptValue.cpp:
      (WebCore::CloneSerializer::checkForDuplicate):
      (CloneSerializer):
      (WebCore::CloneSerializer::recordObject):
      (WebCore::CloneSerializer::startObjectInternal):
      (WebCore::CloneSerializer::dumpIfTerminal):
      
      LayoutTests: [JSC] ArrayBufferView and its ArrayBuffer are appended to object pool in wrong order
      https://bugs.webkit.org/show_bug.cgi?id=82090
      Adds tests that cover more than one view of the same ArrayBuffer being cloned.
      
      Reviewed by Kenneth Russell.
      
      * fast/canvas/webgl/array-message-passing-expected.txt:
      * fast/canvas/webgl/script-tests/array-message-passing.js:
      (typedArrayCompare):
      (dataViewCompare):
      (dataViewCompare2):
      (dataViewCompare3):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6c31be5e
    • joepeck@webkit.org's avatar
      <http://webkit.org/b/83108> Web Inspector: JSC Crash inspecting node with object event listener · 033d4916
      joepeck@webkit.org authored
      Reviewed by Geoff Garen.
      
      Source/WebCore:
      
      * bindings/js/ScriptEventListener.cpp:
      (WebCore::eventListenerHandlerLocation):
      Use jsDynamicCast to bail when the JSObject is not a JSFunction.
      
      LayoutTests:
      
      * inspector/elements/event-listener-sidebar.html:
      * inspector/elements/event-listener-sidebar-expected.txt:
      * platform/chromium/inspector/elements/event-listener-sidebar-expected.txt:
      Add an EventListener that uses an object listener instead of a function.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      033d4916
  14. 03 Apr, 2012 5 commits
    • ggaren@apple.com's avatar
      First step toward incremental Weak<T> finalization · 76215811
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=82670
      
      Reviewed by Filip Pizlo.
      
      Source/JavaScriptCore: 
      
      This patch implements a Weak<T> heap that is compatible with incremental
      finalization, while making as few behavior changes as possible. The behavior
      changes it makes are:
      
      (*) Weak<T>'s raw JSValue no longer reverts to JSValue() automatically --
      instead, a separate flag indicates that the JSValue is no longer valid.
      (This is required so that the JSValue can be preserved for later finalization.)
      Objects dealing with WeakImpls directly must change to check the flag.
      
      (*) Weak<T> is no longer a subclass of Handle<T>.
      
      (*) DOM GC performance is different -- 9% faster in the geometric mean,
      but 15% slower in one specific case:
              gc-dom1.html: 6%  faster
              gc-dom2.html: 23% faster
              gc-dom3.html: 17% faster
              gc-dom4.html: 15% *slower*
      
      The key features of this new heap are:
      
      (*) Each block knows its own state, independent of any other blocks.
      
      (*) Each block caches its own sweep result.
      
      (*) The heap visits dead Weak<T>s at the end of GC. (It doesn't
      mark them yet, since that would be a behavior change.)
      
      * API/JSCallbackObject.cpp:
      (JSC::JSCallbackObjectData::finalize):
      * API/JSCallbackObjectFunctions.h:
      (JSC::::init): Updated to use the new WeakHeap API.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.gypi:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri: Paid the build system tax since I added some new files.
      
      * heap/Handle.h: Made WeakBlock a friend and exposed slot() as public,
      so we can keep passing a Handle<T> to finalizers, to avoid more surface
      area change in this patch. A follow-up patch should change the type we
      pass to finalizers.
      
      * heap/HandleHeap.cpp:
      (JSC):
      (JSC::HandleHeap::writeBarrier):
      (JSC::HandleHeap::isLiveNode):
      * heap/HandleHeap.h:
      (JSC):
      (HandleHeap):
      (Node):
      (JSC::HandleHeap::Node::Node): Removed all code related to Weak<T>, since
      we have a separate WeakHeap now.
      
      * heap/Heap.cpp:
      (JSC::Heap::Heap): Removed m_extraCost because extra cost is accounted
      for through our watermark now. Removed m_waterMark because it was unused.
      
      (JSC::Heap::destroy): Updated for addition of WeakHeap.
      
      (JSC::Heap::reportExtraMemoryCostSlowCase): Changed from using its own
      variable to participating in the watermark strategy. I wanted to standardize
      WeakHeap and all other Heap clients on this strategy, to make sure it's
      accurate.
       
      (JSC::Heap::markRoots): Updated for addition of WeakHeap. Added WeakHeap
      dead visit pass, as explained above.
      
      (JSC::Heap::collect):
      (JSC::Heap::resetAllocators): Updated for addition of WeakHeap.
      
      (JSC::Heap::addFinalizer):
      (JSC::Heap::FinalizerOwner::finalize): Updated for new Weak<T> API.
      
      * heap/Heap.h:
      (JSC::Heap::weakHeap):
      (Heap):
      (JSC::Heap::addToWaterMark): Added a way to participate in the watermarking
      strategy, since this is the best way for WeakHeap to report its memory
      cost. (I plan to update this in a follow-up patch to make it more accurate,
      but for now it is not less accurate than it used to be.)
      
      * heap/MarkedSpace.cpp:
      (JSC::MarkedSpace::MarkedSpace):
      (JSC::MarkedSpace::resetAllocators):
      * heap/MarkedSpace.h:
      (MarkedSpace):
      (JSC::MarkedSpace::addToWaterMark):
      (JSC::MarkedSpace::didConsumeFreeList): Removed m_nurseryWaterMark because
      it was unused, and I didn't want to update WeakHeap to keep an usused
      variable working. Added API for above.
      
      * heap/PassWeak.h:
      (JSC):
      (WeakImplAccessor):
      (PassWeak):
      (JSC::::operator):
      (JSC::::get):
      (JSC::::was):
      (JSC::::PassWeak):
      (JSC::::~PassWeak):
      (JSC::UnspecifiedBoolType):
      (JSC::::leakImpl):
      (JSC::adoptWeak):
      * heap/Strong.h:
      (JSC::Strong::operator!):
      (Strong):
      (JSC::Strong::operator UnspecifiedBoolType*):
      (JSC::Strong::get):
      * heap/Weak.h:
      (Weak):
      (JSC::::Weak):
      (JSC):
      (JSC::::isHashTableDeletedValue):
      (JSC::::~Weak):
      (JSC::::swap):
      (JSC::=):
      (JSC::::operator):
      (JSC::UnspecifiedBoolType):
      (JSC::::release):
      (JSC::::clear):
      (JSC::::hashTableDeletedValue): Lots of code changes here, but they boil
      down to two things:
      
      (*) Allocate WeakImpls from the WeakHeap instead of Handles from the HandleHeap.
      
      (*) Explicitly check WeakImpl::state() for non-liveness before returning
      a value (explained above).
      
      These files implement the new Weak<T> heap behavior described above:
      
      * heap/WeakBlock.cpp: Added.
      * heap/WeakBlock.h: Added.
      * heap/WeakHandleOwner.cpp: Added.
      * heap/WeakHandleOwner.h: Added.
      * heap/WeakHeap.cpp: Added.
      * heap/WeakHeap.h: Added.
      * heap/WeakImpl.h: Added.
      
      One interesting difference from the old heap is that we don't allow
      clients to overwrite a WeakImpl after allocating it, and we don't recycle
      WeakImpls prior to garbage collection. This is required for lazy finalization,
      but it will also help us esablish a useful invariant in the future: allocating
      a WeakImpl will be a binding contract to run a finalizer at some point in the
      future, even if the WeakImpl is later deallocated.
      
      * jit/JITStubs.cpp:
      (JSC::JITThunks::hostFunctionStub): Check the Weak<T> for ! instead of
      its JSValue, since that's our API contract now, and the JSValue might
      be stale.
      
      * runtime/JSCell.h:
      (JSC::jsCast): Allow casting NULL pointers because it's useful and harmless.
      
      * runtime/Structure.cpp:
      (JSC::StructureTransitionTable::add): I can't remember why I did this.
      
      * runtime/StructureTransitionTable.h:
      * runtime/WeakGCMap.h: I had to update these classes because they allocate
      and deallocate weak pointers manually. They should probably stop doing that.
      
      Source/WebCore: 
      
      Updated WebCore for Weak<T> API changes.
      
      * bindings/js/DOMWrapperWorld.cpp:
      (WebCore::JSStringOwner::finalize): We're not allowed to get() a dead Weak<T>
      anymore, so use the debug-only was() helper function instead.
      
      * bindings/js/JSDOMBinding.h:
      (WebCore::uncacheWrapper): Ditto.
      
      * bindings/js/JSNodeCustom.h:
      (WebCore::setInlineCachedWrapper):
      (WebCore::clearInlineCachedWrapper): We're not allowed to get() a dead
      Weak<T>, so I had to push down these ASSERTs into ScriptWrappable.
      
      * bindings/js/JSNodeFilterCondition.cpp:
      (WebCore::JSNodeFilterCondition::acceptNode): Updated for non-Handle-ness
      of Weak<T>.
      
      * bindings/js/ScriptWrappable.h:
      (WebCore::ScriptWrappable::setWrapper):
      (WebCore::ScriptWrappable::clearWrapper): Use was(), as above.
      
      Source/WebKit2: 
      
      Updated for API change.
      
      * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
      (WebKit::NPRuntimeObjectMap::finalize):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      76215811
    • alexis.menard@openbossa.org's avatar
      [Part 3] We should use CSSPropertyID rather than integers when manipulating CSS property ids. · 2a90339d
      alexis.menard@openbossa.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83032
      
      Reviewed by Kentaro Hara.
      
      CSSPropertyID enum holds all the CSS property ids but many parts of WebKit treat the ids
      as integers. While it's not incorrect it is nicer to use the enum as a parameter of
      functions manipulating property ids, as we ensure that the value passed will be an
      existing value. This patch clean up some remaining part of code.
      
      No new tests : There should be no behavior change in this patch.
      
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      (CSSPropertyInfo):
      (WebCore::cssPropertyIDForJSCSSPropertyName):
      * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
      (CSSPropertyInfo):
      (WebCore::cssPropertyInfo):
      * css/CSSComputedStyleDeclaration.cpp:
      (WebCore::getPositionOffsetValue):
      (WebCore::counterToCSSValue):
      * css/CSSParser.cpp:
      (WebCore::CSSParser::parseValidPrimitive):
      Remove the parameter's name from the h file as it doesn't follow the style and also because the
      name was simply wrong we don't expect a propId here but an indentifier. Make it clear in the
      cpp file too.
      * css/CSSParser.h:
      (CSSParser):
      * page/animation/AnimationBase.cpp:
      (WebCore::addPropertyWrapper):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2a90339d
    • yurys@chromium.org's avatar
      Web Inspector: Database::Database::id field in the protocol should have type integer not string · fff9d7f8
      yurys@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83003
      
      Reviewed by Pavel Feldman.
      
      Changed DOM storage and database identifier type from int to String. This
      is aligned with other domains and gives us more flexibility.
      
      * bindings/js/JSInjectedScriptHostCustom.cpp:
      (WebCore::JSInjectedScriptHost::databaseId):
      (WebCore::JSInjectedScriptHost::storageId):
      * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
      (WebCore::V8InjectedScriptHost::databaseIdCallback):
      (WebCore::V8InjectedScriptHost::storageIdCallback):
      * inspector/InjectedScriptHost.cpp:
      (WebCore::InjectedScriptHost::databaseIdImpl):
      (WebCore::InjectedScriptHost::storageIdImpl):
      * inspector/InjectedScriptHost.h:
      (InjectedScriptHost):
      * inspector/InjectedScriptHost.idl:
      * inspector/Inspector.json:
      * inspector/InspectorDOMStorageAgent.cpp:
      (WebCore::InspectorDOMStorageAgent::getDOMStorageEntries):
      (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
      (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
      (WebCore::InspectorDOMStorageAgent::storageId):
      (WebCore::InspectorDOMStorageAgent::getDOMStorageResourceForId):
      * inspector/InspectorDOMStorageAgent.h:
      (InspectorDOMStorageAgent):
      * inspector/InspectorDOMStorageResource.cpp:
      (WebCore::InspectorDOMStorageResource::InspectorDOMStorageResource):
      (WebCore::InspectorDOMStorageResource::bind):
      * inspector/InspectorDOMStorageResource.h:
      (WebCore::InspectorDOMStorageResource::id):
      (InspectorDOMStorageResource):
      * inspector/InspectorDatabaseAgent.cpp:
      (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
      (WebCore::InspectorDatabaseAgent::executeSQL):
      (WebCore::InspectorDatabaseAgent::databaseId):
      (WebCore::InspectorDatabaseAgent::databaseForId):
      * inspector/InspectorDatabaseAgent.h:
      (InspectorDatabaseAgent):
      * inspector/InspectorDatabaseResource.cpp:
      (WebCore::InspectorDatabaseResource::InspectorDatabaseResource):
      (WebCore::InspectorDatabaseResource::bind):
      * inspector/InspectorDatabaseResource.h:
      (WebCore::InspectorDatabaseResource::id):
      (InspectorDatabaseResource):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fff9d7f8
    • loislo@chromium.org's avatar
      Unreviewed, rolling out r112994. · c8aef5e0
      loislo@chromium.org authored
      http://trac.webkit.org/changeset/112994
      https://bugs.webkit.org/show_bug.cgi?id=83008
      
      This patch has to wait until v8 roll. (Requested by loislo on
      #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-04-03
      
      * bindings/js/ScriptHeapSnapshot.h:
      * bindings/v8/ScriptHeapSnapshot.cpp:
      (WebCore):
      * bindings/v8/ScriptHeapSnapshot.h:
      (WebCore):
      (ScriptHeapSnapshot):
      * inspector/InspectorProfilerAgent.cpp:
      (WebCore::InspectorProfilerAgent::createSnapshotHeader):
      * inspector/front-end/DetailedHeapshotView.js:
      (WebInspector.HeapSnapshotConstructorsDataGrid):
      (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.setDataSource):
      (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.populateChildren):
      (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.firstSnapshotLoaded):
      (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.secondSnapshotLoaded):
      (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
      (WebInspector.DetailedHeapshotView.prototype._changeFilter):
      * inspector/front-end/HeapSnapshot.js:
      (WebInspector.HeapSnapshot.prototype.get maxNodeId):
      (WebInspector.HeapSnapshot.prototype.updateStaticData):
      * inspector/front-end/HeapSnapshotProxy.js:
      (WebInspector.HeapSnapshotProxy.prototype.get maxNodeId):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c8aef5e0
    • loislo@chromium.org's avatar
      Web Inspector: use maxJSObjectId that is provided by back-end. · 94f0a330
      loislo@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82451
      
      Summary view can filter objects in snapshot. It uses maxJSObjectId for this.
      There was no such field in the profile header at the
      moment but I've landed a patch in downstream.
      
      Reviewed by Yury Semikhatsky.
      
      * bindings/v8/ScriptHeapSnapshot.cpp:
      (WebCore::ScriptHeapSnapshot::maxSnapshotJSObjectId):
      (WebCore):
      * bindings/v8/ScriptHeapSnapshot.h:
      (WebCore):
      (ScriptHeapSnapshot):
      * inspector/InspectorProfilerAgent.cpp:
      (WebCore::InspectorProfilerAgent::createSnapshotHeader):
      * inspector/front-end/DetailedHeapshotView.js:
      (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
      (WebInspector.DetailedHeapshotView.prototype._changeFilter):
      * inspector/front-end/HeapSnapshot.js:
      (WebInspector.HeapSnapshot.prototype.updateStaticData):
      * inspector/front-end/HeapSnapshotProxy.js:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      94f0a330
  15. 01 Apr, 2012 1 commit
  16. 29 Mar, 2012 3 commits
    • caio.oliveira@openbossa.org's avatar
      HashMap<>::add should return a more descriptive object · 4c11ee05
      caio.oliveira@openbossa.org authored
      https://bugs.webkit.org/show_bug.cgi?id=71063
      
      Reviewed by Ryosuke Niwa.
      
      Source/JavaScriptCore:
      
      Update code to use AddResult instead of a pair. Note that since WeakGCMap wraps
      the iterator type, there's a need for its own AddResult type -- instantiated from
      HashTableAddResult template class.
      
      * API/JSCallbackObject.h:
      (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
      * API/JSClassRef.cpp:
      (OpaqueJSClass::contextData):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::addVar):
      (JSC::BytecodeGenerator::addGlobalVar):
      (JSC::BytecodeGenerator::addConstant):
      (JSC::BytecodeGenerator::addConstantValue):
      (JSC::BytecodeGenerator::emitLoad):
      (JSC::BytecodeGenerator::addStringConstant):
      (JSC::BytecodeGenerator::emitLazyNewFunction):
      * bytecompiler/NodesCodegen.cpp:
      (JSC::PropertyListNode::emitBytecode):
      * debugger/Debugger.cpp:
      * dfg/DFGAssemblyHelpers.cpp:
      (JSC::DFG::AssemblyHelpers::decodedCodeMapFor):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::cellConstant):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
      * jit/JITStubs.cpp:
      (JSC::JITThunks::ctiStub):
      (JSC::JITThunks::hostFunctionStub):
      * parser/Parser.cpp:
      (JSC::::parseStrictObjectLiteral):
      * parser/Parser.h:
      (JSC::Scope::declareParameter):
      * runtime/Identifier.cpp:
      (JSC::Identifier::add):
      (JSC::Identifier::add8):
      (JSC::Identifier::addSlowCase):
      * runtime/Identifier.h:
      (JSC::Identifier::add):
      (JSC::IdentifierTable::add):
      * runtime/JSArray.cpp:
      (JSC::SparseArrayValueMap::add):
      (JSC::SparseArrayValueMap::put):
      (JSC::SparseArrayValueMap::putDirect):
      (JSC::JSArray::enterDictionaryMode):
      (JSC::JSArray::defineOwnNumericProperty):
      * runtime/JSArray.h:
      (SparseArrayValueMap):
      * runtime/PropertyNameArray.cpp:
      (JSC::PropertyNameArray::add):
      * runtime/StringRecursionChecker.h:
      (JSC::StringRecursionChecker::performCheck):
      * runtime/Structure.cpp:
      (JSC::StructureTransitionTable::add):
      * runtime/WeakGCMap.h:
      (WeakGCMap):
      (JSC::WeakGCMap::add):
      (JSC::WeakGCMap::set):
      * tools/ProfileTreeNode.h:
      (JSC::ProfileTreeNode::sampleChild):
      
      Source/WebCore:
      
      Update code to use AddResult instead of a pair. No new tests, just a refactoring.
      
      * Modules/webdatabase/SQLTransactionCoordinator.cpp:
      (WebCore::SQLTransactionCoordinator::acquireLock):
      * Modules/webdatabase/chromium/QuotaTracker.cpp:
      (WebCore::QuotaTracker::updateDatabaseSize):
      * bindings/js/DOMObjectHashTableMap.h:
      (WebCore::DOMObjectHashTableMap::get):
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::cacheDOMStructure):
      * bindings/js/JSDOMBinding.h:
      (WebCore::cacheWrapper):
      * bindings/js/JSDOMGlobalObject.h:
      (WebCore::getDOMConstructor):
      * bindings/js/PageScriptDebugServer.cpp:
      (WebCore::PageScriptDebugServer::addListener):
      * bindings/js/ScriptDebugServer.cpp:
      (WebCore::ScriptDebugServer::setBreakpoint):
      * bindings/js/SerializedScriptValue.cpp:
      (WebCore::CloneSerializer::startObjectInternal):
      (WebCore::CloneSerializer::write):
      * bindings/v8/NPV8Object.cpp:
      (WebCore::npCreateV8ScriptObject):
      * bridge/IdentifierRep.cpp:
      (WebCore::IdentifierRep::get):
      * bridge/NP_jsobject.cpp:
      (ObjectMap::add):
      * css/CSSComputedStyleDeclaration.cpp:
      (WebCore::logUnimplementedPropertyID):
      * css/CSSFontFaceSource.cpp:
      (WebCore::CSSFontFaceSource::getFontData):
      * css/CSSFontSelector.cpp:
      (WebCore::CSSFontSelector::addFontFaceRule):
      (WebCore::CSSFontSelector::getFontData):
      * css/CSSSegmentedFontFace.cpp:
      (WebCore::CSSSegmentedFontFace::getFontData):
      * css/CSSStyleApplyProperty.cpp:
      (WebCore::ApplyPropertyCounter::applyInheritValue):
      (WebCore::ApplyPropertyCounter::applyValue):
      * css/CSSStyleSelector.cpp:
      (WebCore::CSSStyleSelector::appendAuthorStylesheets):
      (WebCore::CSSStyleSelector::collectMatchingRulesForList):
      * css/CSSValuePool.cpp:
      (WebCore::CSSValuePool::createIdentifierValue):
      (WebCore::CSSValuePool::createColorValue):
      (WebCore::CSSValuePool::createValue):
      (WebCore::CSSValuePool::createFontFamilyValue):
      (WebCore::CSSValuePool::createFontFaceValue):
      * dom/CheckedRadioButtons.cpp:
      (WebCore::RadioButtonGroup::add):
      (WebCore::CheckedRadioButtons::addButton):
      * dom/ChildListMutationScope.cpp:
      (WebCore::ChildListMutationScope::MutationAccumulationRouter::incrementScopingLevel):
      * dom/Document.cpp:
      (WebCore::Document::windowNamedItems):
      (WebCore::Document::documentNamedItems):
      (WebCore::Document::getCSSCanvasElement):
      (WebCore::Document::getItems):
      * dom/DocumentEventQueue.cpp:
      (WebCore::DocumentEventQueue::enqueueEvent):
      (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
      (WebCore::DocumentEventQueue::pendingEventTimerFired):
      * dom/DocumentOrderedMap.cpp:
      (WebCore::DocumentOrderedMap::add):
      * dom/EventListenerMap.cpp:
      (WebCore::EventListenerMap::add):
      * dom/Node.cpp:
      (WebCore::Node::dumpStatistics):
      (WebCore::Node::getElementsByTagName):
      (WebCore::Node::getElementsByTagNameNS):
      (WebCore::Node::getElementsByName):
      (WebCore::Node::getElementsByClassName):
      (WebCore::Node::collectMatchingObserversForMutation):
      * dom/QualifiedName.cpp:
      (WebCore::QualifiedName::init):
      * dom/SpaceSplitString.cpp:
      (WebCore::SpaceSplitStringData::create):
      * dom/StyledElement.cpp:
      (WebCore::StyledElement::updateAttributeStyle):
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::append):
      * inspector/DOMPatchSupport.cpp:
      (WebCore::DOMPatchSupport::diff):
      * inspector/InspectorCSSAgent.cpp:
      (WebCore::SelectorProfile::commitSelector):
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::performSearch):
      * inspector/InspectorDebuggerAgent.cpp:
      (WebCore::InspectorDebuggerAgent::resolveBreakpoint):
      * inspector/InspectorValues.h:
      (WebCore::InspectorObject::setValue):
      (WebCore::InspectorObject::setObject):
      (WebCore::InspectorObject::setArray):
      * loader/appcache/ApplicationCacheGroup.cpp:
      (WebCore::ApplicationCacheGroup::addEntry):
      * loader/appcache/ApplicationCacheStorage.cpp:
      (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
      * page/EventHandler.cpp:
      (WebCore::EventHandler::handleTouchEvent):
      * page/PageGroup.cpp:
      (WebCore::PageGroup::pageGroup):
      (WebCore::PageGroup::addVisitedLink):
      (WebCore::PageGroup::addUserScriptToWorld):
      (WebCore::PageGroup::addUserStyleSheetToWorld):
      * page/SecurityPolicy.cpp:
      (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
      * page/TouchAdjustment.cpp:
      (WebCore::TouchAdjustment::compileSubtargetList):
      * platform/cf/BinaryPropertyList.cpp:
      (WebCore::BinaryPropertyListPlan::writeInteger):
      (WebCore::BinaryPropertyListPlan::writeString):
      (WebCore::BinaryPropertyListPlan::writeIntegerArray):
      * platform/graphics/blackberry/LayerTiler.cpp:
      (WebCore::LayerTiler::addTileJob):
      * platform/graphics/ca/GraphicsLayerCA.cpp:
      (WebCore::GraphicsLayerCA::findOrMakeClone):
      * platform/graphics/ca/mac/TileCache.mm:
      (WebCore::TileCache::revalidateTiles):
      * platform/graphics/ca/win/LayerChangesFlusher.cpp:
      (WebCore::LayerChangesFlusher::flushPendingLayerChangesSoon):
      * platform/graphics/chromium/FontUtilsChromiumWin.cpp:
      (WebCore::getDerivedFontData):
      * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
      (WebCore::CCLayerAnimationController::startAnimationsWaitingForTargetAvailability):
      * platform/graphics/mac/ComplexTextControllerATSUI.cpp:
      (WebCore::initializeATSUStyle):
      * platform/graphics/mac/SimpleFontDataCoreText.cpp:
      (WebCore::SimpleFontData::getCFStringAttributes):
      * platform/graphics/mac/SimpleFontDataMac.mm:
      (WebCore::SimpleFontData::canRenderCombiningCharacterSequence):
      * platform/graphics/wince/FontPlatformData.cpp:
      (WebCore::FixedSizeFontData::create):
      * platform/gtk/RenderThemeGtk3.cpp:
      (WebCore::getStyleContext):
      * platform/mac/ThreadCheck.mm:
      (WebCoreReportThreadViolation):
      * platform/network/HTTPHeaderMap.cpp:
      (WebCore::HTTPHeaderMap::add):
      * platform/network/HTTPHeaderMap.h:
      (HTTPHeaderMap):
      * platform/network/ResourceRequestBase.cpp:
      (WebCore::ResourceRequestBase::addHTTPHeaderField):
      * plugins/PluginDatabase.cpp:
      (WebCore::PluginDatabase::add):
      (WebCore::PluginDatabase::loadPersistentMetadataCache):
      * plugins/win/PluginDatabaseWin.cpp:
      (WebCore::PluginDatabase::getPluginPathsInDirectories):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::addPercentHeightDescendant):
      * rendering/RenderBlockLineLayout.cpp:
      (WebCore::setLogicalWidthForTextRun):
      * rendering/RenderNamedFlowThread.cpp:
      (WebCore::RenderNamedFlowThread::addDependencyOnFlowThread):
      * rendering/RenderRegion.cpp:
      (WebCore::RenderRegion::setRenderBoxRegionInfo):
      * rendering/svg/RenderSVGResourceGradient.cpp:
      (WebCore::RenderSVGResourceGradient::applyResource):
      * rendering/svg/RenderSVGResourcePattern.cpp:
      (WebCore::RenderSVGResourcePattern::applyResource):
      * storage/StorageMap.cpp:
      (WebCore::StorageMap::setItem):
      (WebCore::StorageMap::importItem):
      * svg/SVGDocumentExtensions.cpp:
      (WebCore::SVGDocumentExtensions::addPendingResource):
      * xml/XMLHttpRequest.cpp:
      (WebCore::XMLHttpRequest::setRequestHeaderInternal):
      * xml/XPathFunctions.cpp:
      (WebCore::XPath::FunId::evaluate):
      * xml/XPathPath.cpp:
      (WebCore::XPath::LocationPath::evaluate):
      * xml/XPathPredicate.cpp:
      (WebCore::XPath::Union::evaluate):
      
      Source/WebKit/chromium:
      
      Update code to use AddResult instead of a pair.
      
      * src/WebHTTPLoadInfo.cpp:
      (WebKit::addHeader):
      * src/WebURLResponse.cpp:
      (WebKit::WebURLResponse::addHTTPHeaderField):
      
      Source/WebKit/mac:
      
      Update code to use AddResult instead of a pair.
      
      * Plugins/Hosted/NetscapePluginHostManager.mm:
      (WebKit::NetscapePluginHostManager::hostForPlugin):
      * Plugins/Hosted/ProxyInstance.mm:
      (WebKit::ProxyInstance::methodsNamed):
      (WebKit::ProxyInstance::fieldNamed):
      * WebCoreSupport/WebNotificationClient.mm:
      (WebNotificationClient::show):
      
      Source/WebKit/win:
      
      Update code to use AddResult instead of a pair.
      
      * WebKitCOMAPI.cpp:
      (classFactory):
      
      Source/WebKit2:
      
      Update code to use AddResult instead of a pair.
      
      * Platform/CoreIPC/ArgumentCoders.h:
      * Platform/CoreIPC/Connection.cpp:
      (CoreIPC::Connection::SyncMessageState::getOrCreate):
      * Shared/MutableDictionary.cpp:
      (WebKit::MutableDictionary::add):
      (WebKit::MutableDictionary::set):
      * Shared/UserMessageCoders.h:
      (WebKit::UserMessageDecoder::baseDecode):
      * Shared/mac/CommandLineMac.cpp:
      (WebKit::CommandLine::parse):
      * UIProcess/API/mac/WKPrintingView.mm:
      (pageDidDrawToPDF):
      * UIProcess/API/mac/WKView.mm:
      (-[WKView validateUserInterfaceItem:]):
      * UIProcess/WebProcessProxy.cpp:
      (WebKit::WebProcessProxy::addBackForwardItem):
      * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
      (WebKit::InjectedBundleNodeHandle::getOrCreate):
      * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
      (WebKit::InjectedBundleRangeHandle::getOrCreate):
      * WebProcess/Notifications/WebNotificationManager.cpp:
      (WebKit::WebNotificationManager::show):
      * WebProcess/WebProcess.cpp:
      (WebKit::WebProcess::createWebPage):
      (WebKit::WebProcess::webPageGroup):
      
      Source/WTF:
      
      Make HashTable<>::add() and derivate functions return an AddResult struct instead
      of a pair. This struct contains contains 'iterator' and 'isNewEntry' members, that are
      more readable at callsites than previous 'first' and 'second'.
      
      * wtf/HashCountedSet.h:
      (HashCountedSet):
      (WTF::::add):
      * wtf/HashMap.h:
      (HashMap):
      (WTF):
      (WTF::::set):
      * wtf/HashSet.h:
      (HashSet):
      (WTF::::add):
      (WTF):
      * wtf/HashTable.h:
      (WTF::HashTableAddResult::HashTableAddResult):
      (HashTableAddResult):
      (WTF):
      (HashTable):
      (WTF::HashTable::add):
      (WTF::::add):
      (WTF::::addPassingHashCode):
      * wtf/ListHashSet.h:
      (ListHashSet):
      (WTF::::add):
      (WTF::::insertBefore):
      * wtf/RefPtrHashMap.h:
      (WTF):
      (WTF::::set):
      * wtf/Spectrum.h:
      (WTF::Spectrum::add):
      * wtf/WTFThreadData.cpp:
      (JSC::IdentifierTable::add):
      * wtf/WTFThreadData.h:
      (IdentifierTable):
      * wtf/text/AtomicString.cpp:
      (WTF::addToStringTable):
      (WTF::AtomicString::addSlowCase):
      
      Tools:
      
      Update code to use AddResult instead of a pair.
      
      * DumpRenderTree/mac/LayoutTestControllerMac.mm:
      (LayoutTestController::evaluateScriptInIsolatedWorld):
      * DumpRenderTree/win/LayoutTestControllerWin.cpp:
      (LayoutTestController::evaluateScriptInIsolatedWorld):
      * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
      (WTR::LayoutTestController::evaluateScriptInIsolatedWorld):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4c11ee05
    • commit-queue@webkit.org's avatar
      Fix the error type in JSAudioBufferSourceNodeCustom to pass layout test. · ab024544
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=81639
      
      Patch by Sanghyun Park <sh919.park@samsung.com> on 2012-03-29
      Reviewed by Eric Carlson.
      
      Test : LayoutTest/webaudio/audiobuffersource-channels.html
      
      * bindings/js/JSAudioBufferSourceNodeCustom.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ab024544
    • commit-queue@webkit.org's avatar
      Remove custom bindings form Internals.idl of attribute type Array. · 37349ec6
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82319
      
      Patch by Vineet Chaudhary <rgf748@motorola.com> on 2012-03-29
      Reviewed by Kentaro Hara.
      
      Source/WebCore:
      
      Remove custom bindings for Array type and replace Array type with sequence<String>.
      
      No new tests. LayoutTests/fast/harness/user-preferred-language.html should pass
      even after these changes.
      
      * Target.pri: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
      * UseJSC.cmake: Remove JSInternalsCustom.cpp.
      * UseV8.cmake: Remove V8InternalsCustom.cpp.
      * WebCore.gypi: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
      * WebCore.vcproj/WebCoreTestSupport.vcproj: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
      * WebCore.xcodeproj/project.pbxproj: Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp.
      * bindings/js/JSDOMBinding.h:
      (WebCore):
      (WebCore::jsArray): Added new specialize function template for Strings.
      * bindings/scripts/CodeGeneratorJS.pm:
      (JSValueToNative): Add jsArray<String>() to deduce return type.
      (NativeToJSValue): Added check for type String.
      * bindings/scripts/CodeGeneratorV8.pm:
      (JSValueToNative): Add v8Array<String>() to deduce return type.
      (NativeToJSValue): Added check for type String.
      * bindings/scripts/test/JS/JSTestObj.cpp:
      (WebCore::setJSTestObjSequenceAttr): Modified results from run-binding-tests.
      * bindings/scripts/test/V8/V8TestObj.cpp: Modified results from run-binding-tests.
      (WebCore::TestObjInternal::sequenceAttrAttrSetter):
      * bindings/v8/V8Binding.h: Added new specialize function template for Strings.
      (WebCore):
      (WebCore::v8Array):
      (WebCore::toNativeArray):
      * testing/Internals.idl: Replace Array type with sequence<String>
      * testing/js/JSInternalsCustom.cpp: Removed.
      * testing/v8/V8InternalsCustom.cpp: Removed.
      
      Tools:
      
      Remove JSInternalsCustom.cpp and V8InternalsCustom.cpp as no longer required.
      
      * GNUmakefile.am:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112506 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      37349ec6
  17. 28 Mar, 2012 1 commit
  18. 22 Mar, 2012 3 commits
    • barraclough@apple.com's avatar
      Add JSValue::isFunction · 484a9d31
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=81935
      
      Reviewed by Geoff Garen.
      
      This would be useful in the WebCore bindings code.
      Also, remove asFunction, replace with jsCast<JSFunction*>.
      
      Source/JavaScriptCore: 
      
      * API/JSContextRef.cpp:
      * debugger/Debugger.cpp:
      * debugger/DebuggerCallFrame.cpp:
      (JSC::DebuggerCallFrame::functionName):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::valueOfFunctionConstant):
      * dfg/DFGOperations.cpp:
      * interpreter/CallFrame.cpp:
      (JSC::CallFrame::isInlineCallFrameSlow):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      (JSC::jitCompileFor):
      (JSC::lazyLinkFor):
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::traceFunctionPrologue):
      (JSC::LLInt::LLINT_SLOW_PATH_DECL):
      (JSC::LLInt::setUpCall):
      * runtime/Arguments.h:
      (JSC::Arguments::finishCreation):
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncFilter):
      (JSC::arrayProtoFuncMap):
      (JSC::arrayProtoFuncEvery):
      (JSC::arrayProtoFuncForEach):
      (JSC::arrayProtoFuncSome):
      (JSC::arrayProtoFuncReduce):
      (JSC::arrayProtoFuncReduceRight):
      * runtime/CommonSlowPaths.h:
      (JSC::CommonSlowPaths::arityCheckFor):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::compileFor):
      (JSC::FunctionExecutable::compileOptimizedFor):
      * runtime/FunctionPrototype.cpp:
      (JSC::functionProtoFuncToString):
      * runtime/JSArray.cpp:
      (JSC::JSArray::sort):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::argumentsGetter):
      (JSC::JSFunction::callerGetter):
      (JSC::JSFunction::lengthGetter):
      * runtime/JSFunction.h:
      (JSC):
      (JSC::asJSFunction):
      (JSC::JSValue::isFunction):
      * runtime/JSGlobalData.cpp:
      (WTF::Recompiler::operator()):
      (JSC::JSGlobalData::releaseExecutableMemory):
      * runtime/JSValue.h:
      * runtime/StringPrototype.cpp:
      (JSC::replaceUsingRegExpSearch):
      
      Source/WebCore: 
      
      * bindings/js/JSInjectedScriptHostCustom.cpp:
      (WebCore::JSInjectedScriptHost::functionDetails):
      * bindings/js/ScriptCallStackFactory.cpp:
      (WebCore::createScriptCallStack):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      484a9d31
    • kkristof@inf.u-szeged.hu's avatar
      [Qt] Fix Qt minimal build after r111692 · c3051bef
      kkristof@inf.u-szeged.hu authored
      Reviewed by Csaba Osztrogonác.
      
      * bindings/js/JSScriptProfileNodeCustom.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c3051bef
    • commit-queue@webkit.org's avatar
      https://bugs.webkit.org/show_bug.cgi?id=81893 · 07589066
      commit-queue@webkit.org authored
      Remove custom bindings form ScriptProfileNode.idl of attribute type Array.
      
      Patch by Vineet Chaudhary <rgf748@motorola.com> on 2012-03-22
      Reviewed by Kentaro Hara.
      
      Replace [CustomGetter] Array with sequence<ScriptProfileNode>.
      To remove the custom bindings code.
      
      Test: No new tests. LayoutTests/fast/profiler/* test are enough for this.
      
      * bindings/js/JSScriptProfileNodeCustom.cpp: Removed custom function.
      (WebCore::JSScriptProfileNode::callUID):
      * bindings/v8/custom/V8ScriptProfileNodeCustom.cpp: Removed custom function.
      (WebCore):
      * inspector/ScriptProfileNode.idl: Replaced Array with sequence<ScriptProfileNode>.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      07589066