HTMLFormControlElement and HTMLObjectElement need not to look for an ancestor on construction
https://bugs.webkit.org/show_bug.cgi?id=139791

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-12-18
Reviewed by Alexey Proskuryakov.

The objects are being constructed, they have not been inserted into the tree yet.
There is not chance of finding the owner form at this point,
that is done when inserting the node into the tree.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::HTMLFormControlElement):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::HTMLObjectElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177538 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix some builds.

* UIProcess/mac/WKPreviewPopoverAnimationController.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177539 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable retries on Mac Release WK2 testers
https://bugs.webkit.org/show_bug.cgi?id=139798

Reviewed by Simon Fraser.

* BuildSlaveSupport/build.webkit.org-config/config.json:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add strong typing to RefCounter interface, return value as a bool.
https://bugs.webkit.org/show_bug.cgi?id=139776

Reviewed by Geoff Garen.

Currently all token vended by a RefCounter have the same type - Ref<RefCounter::Count>.
This means there is no compile time type checking to prevent mistakes. Update the count()
method to token<>(), templated on type used to identify the token being returned.
Calls to token<T>() will return a result of type RefCounter::Token<T>.

There are a few problems with the fact the counter will return you an exact count of the
number of outstanding tokens:
  - It is desirable to only fire the callback on zero-edge changes; it is more consistent
    to do so if the value is only readable as a boolean.
  - It is desirable to provide the value as an argument to the callback, however to make
    this useful for integer values it is also necessary to indicate the direction of change
    (0->1 is often interesting where 2->1 is not).
  - There is a mismatch between the precision of returning a count, and the inherent
    imprecision of a token based mechanism, where it may be difficult to guarantee
    absolutely no unnecessary refcount churn, and thus unintentional counter values.

Source/WebCore:

* page/PageThrottler.cpp:
(WebCore::m_mediaActivityCounter):
(WebCore::m_pageLoadActivityCounter):
    - lambdas now passed the value.
(WebCore::PageThrottler::mediaActivityToken):
(WebCore::PageThrottler::pageLoadActivityToken):
    - count() -> token<>().
* page/PageThrottler.h:
    - specify tpoken type for PageActivityAssertionToken.

Source/WebKit2:

Removed PluginProcessManager::m_processSuppressionEnabled. Now the callback only fires on
zero-edge transitions we no longer need this to filter changes.

* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::PluginProcessManager):
    - updateProcessSuppressionState -> updateProcessSuppressionDisabled.
* UIProcess/Plugins/PluginProcessManager.h:
(WebKit::PluginProcessManager::processSuppressionDisabledForPageCount): Deleted.
(WebKit::PluginProcessManager::processSuppressionDisabledToken):
    - processSuppressionDisabledForPageCount -> processSuppressionDisabledToken.
(WebKit::PluginProcessManager::processSuppressionEnabled): Deleted.
(WebKit::PluginProcessManager::processSuppressionDisabled):
    - processSuppressionEnabled -> processSuppressionDisabled.
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::didFinishLaunching):
    - processSuppressionEnabled -> processSuppressionDisabled.
* UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
(WebKit::PluginProcessManager::updateProcessSuppressionState): Deleted.
(WebKit::PluginProcessManager::updateProcessSuppressionDisabled):
    - updateProcessSuppressionState -> updateProcessSuppressionDisabled
* UIProcess/ProcessThrottler.h:
    - added UserObservablePageToken, ProcessSuppressionDisabledToken types.
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::m_processSuppressionDisabledForPageCounter):
    - lambda now has bool argument.
* UIProcess/WebContext.h:
(WebKit::WebContext::userObservablePageCount):
(WebKit::WebContext::processSuppressionDisabledForPageCount):
    - count() -> token<>(), changed return type.
* UIProcess/WebPageProxy.h:
    - changed types of token members.
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::updateProcessSuppressionState):
    renamed m_pluginProcessManagerProcessSuppressionDisabledCount -> m_pluginProcessManagerProcessSuppressionDisabledToken.

Source/WTF:

* wtf/RefCounter.cpp:
(WTF::RefCounter::Count::ref):
(WTF::RefCounter::Count::deref):
    - only call the callback on zero-edge changes; provide the value.
(WTF::RefCounter::RefCounter):
    - callback now takes a bool argument.
* wtf/RefCounter.h:
(WTF::RefCounter::Token::Token):
    - New opaque type to reference the RefCounter::Count.
(WTF::RefCounter::Token::operator!):
    - ! operator checks for null / anasigned Tokens.
(WTF::RefCounter::RefCounter):
    - callback now takes a bool argument.
(WTF::RefCounter::token):
    - renamed from count(), templated on type of token returned.
(WTF::RefCounter::value):
    - now returns a bool.
(WTF::RefCounter::Token<T>::Token):
(WTF::=):
    - Tokens can be copied & assigned.
(WTF::RefCounter::count): Deleted.
    - renamed to token<>().

Tools:

* TestWebKitAPI/Tests/WTF/RefCounter.cpp:
(TestWebKitAPI::TEST):
    - update API test.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Update DumpRenderTree to more closely match Mac version
https://bugs.webkit.org/show_bug.cgi?id=139799

Reviewed by Tim Horton.

Source/WebKit/win:

* Interfaces/IWebSecurityOrigin.idl: Add initializer from URL.
* Interfaces/WebKit.idl: Add CLSID so we can instantiate a
WebSecurityOrigin from COM.
* WebApplicationCache.h: Decorate class declaration with CLSID
to support COM introspection.
* WebSecurityOrigin.cpp: Get rid of meaningless STDMETHODCALLTYPE
declarations inside implementation.
(WebSecurityOrigin::QueryInterface):
(WebSecurityOrigin::AddRef):
(WebSecurityOrigin::Release):
(WebSecurityOrigin::protocol):
(WebSecurityOrigin::host):
(WebSecurityOrigin::port):
(WebSecurityOrigin::usage):
(WebSecurityOrigin::quota):
(WebSecurityOrigin::setQuota):
(WebSecurityOrigin::initWithURL): Added.
* WebSecurityOrigin.h:

Tools:

* DumpRenderTree/win/AccessibilityControllerWin.cpp:
(AccessibilityController::accessibleElementById): Correct
use of BSTR to avoid leak.
* DumpRenderTree/win/DumpRenderTree.cpp: Reorder methods and
update to match Mac version more closely.
(dumpFramesAsText):
(dump):
(resetDefaultsToConsistentValues):
(resetWebViewToConsistentStateBeforeTesting):
(sizeWebViewForCurrentTest):
(runTest):
(openWindows):
(windowToWebViewMap):
(createWebViewAndOffscreenWindow):
(sharedCFURLCache):
(initializeGlobalsFromCommandLineOptions):
(main):
* DumpRenderTree/win/TestRunnerWin.cpp: Ditto.
(TestRunner::addDisallowedURL):
(TestRunner::applicationCacheDiskUsageForOrigin):
(TestRunner::syncLocalStorage):
(TestRunner::localStorageDiskUsageForOrigin):
(TestRunner::observeStorageTrackerNotifications):
(TestRunner::clearApplicationCacheForOrigin):
(TestRunner::originsWithApplicationCache):
(TestRunner::deleteAllLocalStorage):
(TestRunner::setStorageDatabaseIdleInterval):
(TestRunner::closeIdleLocalStorageDatabases):
(TestRunner::originsWithLocalStorage):
(TestRunner::deleteLocalStorageForOrigin):
(TestRunner::copyDecodedHostName):
(TestRunner::copyEncodedHostName):
(TestRunner::keepWebHistory):
(TestRunner::numberOfPendingGeolocationPermissionRequests):
(TestRunner::setAppCacheMaximumSize):
(TestRunner::setCustomPolicyDelegate):
(TestRunner::goBack):
(TestRunner::setDefersLoading):
(TestRunner::setDomainRelaxationForbiddenForURLScheme):
(TestRunner::setMockDeviceOrientation):
(TestRunner::setMockGeolocationPosition):
(TestRunner::setMockGeolocationPositionUnavailableError):
(TestRunner::setIconDatabaseEnabled):
(TestRunner::setMainFrameIsFirstResponder):
(TestRunner::setSpatialNavigationEnabled):
(TestRunner::setPluginsEnabled):
(TestRunner::setAutomaticLinkDetectionEnabled):
(TestRunner::setUseDashboardCompatibilityMode):
(TestRunner::dispatchPendingLoadRequests):
(TestRunner::findString):
(TestRunner::setCacheModel):
(TestRunner::apiTestNewWindowDataLoadBaseURL):
(TestRunner::setWebViewEditable):
(TestRunner::authenticateSession):
(TestRunner::abortModal):
(TestRunner::setSerializeHTTPLoads):
(TestRunner::addChromeInputField):
(TestRunner::removeChromeInputField):
(TestRunner::focusWebView):
(TestRunner::setBackingScaleFactor):
(TestRunner::grantWebNotificationPermission):
(TestRunner::denyWebNotificationPermission):
(TestRunner::removeAllWebNotificationPermissions):
(TestRunner::simulateWebNotificationClick):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use MachSendRight in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=139800

Reviewed by Tim Horton.

Source/WebCore:

* WebCore.exp.in:
* platform/cocoa/MachSendRight.h:
(WebCore::MachSendRight::MachSendRight):
(WebCore::MachSendRight::sendRight):
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::createFromSendRight):
(IOSurface::createFromMachPort): Deleted.

Source/WebKit2:

* Platform/IPC/ArgumentEncoder.h:
(IPC::ArgumentEncoder::encode):
(IPC::ArgumentEncoder::operator<<):
* Shared/WebCoreArgumentCoders.h:
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::encode):
(WebKit::RemoteLayerBackingStore::decode):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<MachSendRight>::encode):
(IPC::ArgumentCoder<MachSendRight>::decode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Build correction after r177541.

* wtf/RefCounter.h:
(WTF::RefCounter::Token<T>::Token): Revise constructor inlines to correct
syntax error.



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

* jsc.cpp: Remove typo.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Unreviewed build correction after r177513.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Correct for new
method signature.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use MachSendRight in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=139800

Patch by Anders Carlsson <andersca@apple.com> on 2014-12-18
Reviewed by Tim Horton.

* Platform/IPC/ArgumentEncoder.h:
(IPC::ArgumentEncoder::encode):
(IPC::ArgumentEncoder::operator<<):
* Shared/WebCoreArgumentCoders.h:
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::encode):
(WebKit::RemoteLayerBackingStore::decode):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<MachSendRight>::encode):
(IPC::ArgumentCoder<MachSendRight>::decode):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add strong typing to RefCounter interface, return value as a bool.
https://bugs.webkit.org/show_bug.cgi?id=139776

Unreviewed style fixes.

* wtf/RefCounter.h:
(WTF::=):



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