Add WKVisitedLinkProvider
https://bugs.webkit.org/show_bug.cgi?id=129343

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKVisitedLinkProvider.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h.
* UIProcess/API/Cocoa/WKVisitedLinkProvider.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h.
* UIProcess/API/Cocoa/WKVisitedLinkProviderInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h.
* UIProcess/API/Cocoa/WKVisitedLinkProviderPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration visitedLinkProvider]):
(-[WKWebViewConfiguration setVisitedLinkProvider:]):
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DrawingAreaProxy is using WebCore's Timer
https://bugs.webkit.org/show_bug.cgi?id=129347
<rdar://problem/16078133>

Reviewed by Tim Horton.

Use a RunLoop::Timer instead.

* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::exposedRectChangedTimerFired):
* UIProcess/DrawingAreaProxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Need to initialize VM stack data even when the VM is on an exclusive thread.
<https://webkit.org/b/129265>

Not reviewed.

Source/JavaScriptCore: 

Relanding r164627 now that <https://webkit.org/b/129341> is fixed.

* API/APIShims.h:
(JSC::APIEntryShim::APIEntryShim):
(JSC::APICallbackShim::shouldDropAllLocks):
* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::addCurrentThread):
* runtime/JSLock.cpp:
(JSC::JSLockHolder::JSLockHolder):
(JSC::JSLockHolder::init):
(JSC::JSLockHolder::~JSLockHolder):
(JSC::JSLock::JSLock):
(JSC::JSLock::setExclusiveThread):
(JSC::JSLock::lock):
(JSC::JSLock::unlock):
(JSC::JSLock::currentThreadIsHoldingLock):
(JSC::JSLock::dropAllLocks):
(JSC::JSLock::grabAllLocks):
* runtime/JSLock.h:
(JSC::JSLock::hasExclusiveThread):
(JSC::JSLock::exclusiveThread):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::hasExclusiveThread):
(JSC::VM::exclusiveThread):
(JSC::VM::setExclusiveThread):
(JSC::VM::currentThreadIsHoldingAPILock):

Source/WebCore: 

No new tests.

Relanding r164627 now that <https://webkit.org/b/129341> is fixed.

* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make WebContext handle populating visited links
https://bugs.webkit.org/show_bug.cgi?id=129348

Reviewed by Tim Horton.

This makes it possible to decouple VisitedLinkProvider from WebContext.

* UIProcess/VisitedLinkProvider.cpp:
(WebKit::VisitedLinkProvider::VisitedLinkProvider):
(WebKit::VisitedLinkProvider::processDidFinishLaunching):
* UIProcess/VisitedLinkProvider.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::processDidFinishLaunching):
* UIProcess/WebContext.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add accessibility search predicate support for AXOutlines
https://bugs.webkit.org/show_bug.cgi?id=123748

Reviewed by Chris Fleizach.

Source/WebCore:

Added new AXOutlineSearchKey to support finding elements with aria role=tree.

No new tests, updated existing search-predicate.html test to cover AXOutlineSearchKey.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilitySearchKeyMap):

LayoutTests:

Updated test to validate support for AXOutlineSearchKey (elements with aria role=tree).

* platform/mac/accessibility/search-predicate-expected.txt:
* platform/mac/accessibility/search-predicate.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
VisitedLinkProvider should be refcounted
https://bugs.webkit.org/show_bug.cgi?id=129351

Reviewed by Sam Weinig.

* UIProcess/VisitedLinkProvider.cpp:
(WebKit::VisitedLinkProvider::create):
(WebKit::VisitedLinkProvider::~VisitedLinkProvider):
* UIProcess/VisitedLinkProvider.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::processDidFinishLaunching):
(WebKit::WebContext::disconnectProcess):
(WebKit::WebContext::addVisitedLinkHash):
* UIProcess/WebContext.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: CRASH when evaluating in console of JSContext RWI with disabled breakpoints.
<https://webkit.org/b/128766>

Reviewed by Geoffrey Garen.

Make the JSLock::grabAllLocks() work the same way as for the C loop LLINT.
The reasoning is that we don't know of any clients that need unordered
re-entry into the VM from different threads. So, we're enforcing ordered
re-entry i.e. we must re-grab locks in the reverse order of dropping locks.

The crash in this bug happened because we were allowing unordered re-entry,
and the following type of scenario occurred:

1. Thread T1 locks the VM, and enters the VM to execute some JS code.
2. On entry, T1 detects that VM::m_entryScope is null i.e. this is the
   first time it entered the VM.
   T1 sets VM::m_entryScope to T1's entryScope.
3. T1 drops all locks.

4. Thread T2 locks the VM, and enters the VM to execute some JS code.
   On entry, T2 sees that VM::m_entryScope is NOT null, and therefore
   does not set the entryScope.
5. T2 drops all locks.

6. T1 re-grabs locks.
7. T1 returns all the way out of JS code. On exit from the outer most
   JS function, T1 clears VM::m_entryScope (because T1 was the one who
   set it).
8. T1 unlocks the VM.

9. T2 re-grabs locks.
10. T2 proceeds to execute some code and expects VM::m_entryScope to be
    NOT null, but it turns out to be null. Assertion failures and
    crashes ensue.

With ordered re-entry, at step 6, T1 will loop and yield until T2 exits
the VM. Hence, the issue will no longer manifest.

* runtime/JSLock.cpp:
(JSC::JSLock::dropAllLocks):
(JSC::JSLock::grabAllLocks):
* runtime/JSLock.h:
(JSC::JSLock::DropAllLocks::dropDepth):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Port some profiler tests to inspector-protocol
https://bugs.webkit.org/show_bug.cgi?id=129353

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-02-25
Reviewed by Timothy Hatcher.

* inspector-obsolete/profiler/cpu-profiler-parameterless-profile-end-crash-expected.txt: Removed.
* inspector-obsolete/profiler/cpu-profiler-parameterless-profile-end-crash.html: Removed.
* inspector-obsolete/profiler/cpu-profiler-profiling-without-inspector-expected.txt: Removed.
* inspector-obsolete/profiler/cpu-profiler-profiling-without-inspector.html: Removed.
* inspector-protocol/profiler/console-profile-expected.txt: Added.
* inspector-protocol/profiler/console-profile.html: Added.
* inspector-protocol/profiler/console-profileEnd-parameterless-expected.txt: Added.
* inspector-protocol/profiler/console-profileEnd-parameterless.html: Added.

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