Get rid of MessageID::is()
https://bugs.webkit.org/show_bug.cgi?id=108234

Reviewed by Beth Dakin.

Add explicit message receiver name equality checks instead of using MessageID::is.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
* Platform/CoreIPC/MessageID.h:
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::didReceiveMessage):
(WebKit::WebProcessConnection::didReceiveSyncMessage):
* Shared/mac/SecItemShim.cpp:
(WebKit::SecItemShim::didReceiveMessageOnConnectionWorkQueue):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveMessage):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::didReceiveMessage):
(WebKit::WebContext::didReceiveSyncMessage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveMessage):
(WebKit::WebPageProxy::didReceiveSyncMessage):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveMessage):
(WebKit::WebProcessProxy::didReceiveSyncMessage):
(WebKit::WebProcessProxy::didReceiveMessageOnConnectionWorkQueue):
* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::didReceiveMessageOnConnectionWorkQueue):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
(WebKit::NetworkProcessConnection::didReceiveSyncMessage):
* WebProcess/Plugins/PluginProcessConnection.cpp:
(WebKit::PluginProcessConnection::didReceiveSyncMessage):
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::didReceiveMessageOnConnectionWorkQueue):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceiveMessage):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::didReceiveMessageOnConnectionWorkQueue):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor ShadowRoot exception handling
https://bugs.webkit.org/show_bug.cgi?id=108209

Reviewed by Dimitri Glazkov.

Source/WebCore:

Many of the exception cases for ShadowRoot are actually impossible and
should be asserts instead. We can also move the one case of exception logic,
for elements that don't allow author shadows into Element::createShadowRoot
instead of having it all over the ShadowRoot and ElementShadow classes. This
is the first step in centralizing all ShadowRoot creation inside ElementShadow.

No new tests, covered by existing tests.

* WebCore.exp.in:
* dom/Element.cpp:
(WebCore::Element::createShadowRoot): Be explicit about what kind of ShadowRoot you're creating.
(WebCore::Element::ensureUserAgentShadowRoot): No more exceptions.
* dom/ElementShadow.cpp:
(WebCore::ElementShadow::addShadowRoot): This never actually throws exceptions, remove ExceptionCode.
* dom/ElementShadow.h:
(ElementShadow):
* dom/ShadowRoot.cpp:
(WebCore::determineUsageType): Merge with Element::createShadowRoot.
(WebCore):
(WebCore::ShadowRoot::ShadowRoot): Moved Histogram logic here since it's actually about the constructor anyway.
(WebCore::ShadowRoot::create): Removed overload that made the code less obvious.
* dom/ShadowRoot.h:
(ShadowRoot):
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::HTMLKeygenElement):
* html/shadow/TextFieldDecorationElement.cpp:
(WebCore::getDecorationRootAndDecoratedRoot):
* testing/Internals.cpp:
(WebCore::Internals::ensureShadowRoot):
(WebCore::Internals::createShadowRoot):

Source/WebKit/win:

* WebKit.vcproj/WebKitExports.def.in: Swap ShadowRoot::create export with Element::createShadowRoot.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Objective-C API: JSObjCClassInfo creates reference cycle with JSContext
https://bugs.webkit.org/show_bug.cgi?id=107839

Reviewed by Oliver Hunt.

JSContext has a JSWrapperMap, which has an NSMutableDictionary m_classMap, which has values that
are JSObjCClassInfo objects, which have strong references to two JSValue *'s, m_prototype and
m_constructor, which in turn have strong references to the JSContext, creating a reference cycle.
We should make m_prototype and m_constructor Weak<JSObject>. This gets rid of the strong reference
to the JSContext and also prevents clients from accidentally creating reference cycles by assigning
to the prototype of the constructor. If Weak<JSObject> fields are ever garbage collected, we will
reallocate them.

* API/JSContext.mm:
(-[JSContext wrapperMap]):
* API/JSContextInternal.h:
* API/JSWrapperMap.mm:
(-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]):
(-[JSObjCClassInfo dealloc]):
(-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]):
(-[JSObjCClassInfo allocateConstructorAndPrototype]):
(-[JSObjCClassInfo wrapperForObject:]):
(-[JSObjCClassInfo constructor]):


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