[iOS] Make some headers Private
https://bugs.webkit.org/show_bug.cgi?id=123626

Reviewed by Sam Weinig.

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix build on non-linux platforms
https://bugs.webkit.org/show_bug.cgi?id=123622

Patch by Emilio Pozuelo Monfort <pochu27@gmail.com> on 2013-11-01
Reviewed by Darin Adler.

* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HPPA build fixes
https://bugs.webkit.org/show_bug.cgi?id=123625

Original patch from John David Anglin <dave.anglin@bell.net>

Patch by Emilio Pozuelo Monfort <pochu27@gmail.com> on 2013-11-01
Reviewed by Darin Adler.

* wtf/Platform.h:
* wtf/dtoa/utils.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reverted r158443. It broke the build.

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: Crashes in -[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:].
https://bugs.webkit.org/show_bug.cgi?id=123383.

Reviewed by Geoffrey Garen.

Tools: 

Removed an inappropriate assertion in DumpRenderTree/mac/UIDelegate.mm and
added 2 attributes (databaseDefaultQuota and databaseMaxQuota) to allow
tests to set appropriate quota settings to exercise quota expansion tests
when needed.

* DumpRenderTree/TestRunner.cpp:
(TestRunner::TestRunner):
(getDatabaseDefaultQuotaCallback):
(getDatabaseMaxQuotaCallback):
(setDatabaseDefaultQuotaCallback):
(setDatabaseMaxQuotaCallback):
(TestRunner::staticValues):
* DumpRenderTree/TestRunner.h:
(TestRunner::databaseDefaultQuota):
(TestRunner::setDatabaseDefaultQuota):
(TestRunner::databaseMaxQuota):
(TestRunner::setDatabaseMaxQuota):
* DumpRenderTree/blackberry/DumpRenderTree.cpp:
(BlackBerry::WebKit::DumpRenderTree::exceededDatabaseQuota):
* DumpRenderTree/efl/DumpRenderTreeView.cpp:
(onExceededDatabaseQuota):
* DumpRenderTree/mac/UIDelegate.mm:
(-[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]):
* DumpRenderTree/win/UIDelegate.cpp:
(UIDelegate::exceededDatabaseQuota):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didExceedDatabaseQuota):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::TestRunner):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::databaseDefaultQuota):
(WTR::TestRunner::setDatabaseDefaultQuota):
(WTR::TestRunner::databaseMaxQuota):
(WTR::TestRunner::setDatabaseMaxQuota):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):

LayoutTests: 

Removed an inappropriate assertion in DumpRenderTree/mac/UIDelegate.mm and
added 2 attributes (databaseDefaultQuota and databaseMaxQuota) to allow
tests to set appropriate quota settings to exercise quota expansion tests
when needed.
        
* storage/websql/open-database-expand-quota.html:
- Set databaseDefaultQuota and databaseMaxQuota as needed for this test.
* storage/websql/open-database-over-quota-expected.txt:
* storage/websql/open-database-over-quota.html:
- Revert the change from r157874 which is no longer needed for this test.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't use the C API in WKRemoteObjectCoder
https://bugs.webkit.org/show_bug.cgi?id=123627

Reviewed by Dan Bernstein.

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(-[WKRemoteObjectEncoder init]):
(-[WKRemoteObjectEncoder encodeBytes:length:forKey:]):
(-[WKRemoteObjectEncoder _encodeObjectForKey:usingBlock:]):
* Shared/ImmutableDictionary.h:
* Shared/MutableDictionary.cpp:
(WebKit::MutableDictionary::add):
(WebKit::MutableDictionary::set):
* Shared/MutableDictionary.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remote Layer Tree: Vend layer contents via IOSurfaces
https://bugs.webkit.org/show_bug.cgi?id=123600

Reviewed by Anders Carlsson.

Address some review comments from Darin (and subsequently Anders).

* WebProcess/WebPage/mac/RemoteLayerBackingStore.h:
(WebKit::RemoteLayerBackingStore::surface):
No need for .get() here.

* WebProcess/WebPage/mac/RemoteLayerBackingStore.mm:
(RemoteLayerBackingStore::ensureBackingStore):
All on one line for readability.

(createIOSurfaceContext):
This 'if' is meaningless.

(createIOSurface):
No need for a RetainPtr here, the dictionary is autoreleased.

(RemoteLayerBackingStore::display):
Snuggle 'context' up next to the other declarations.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Expose setApplicationCacheOriginQuota via window.internals
https://bugs.webkit.org/show_bug.cgi?id=87838

Patch by Afonso R. Costa Jr. <afonso.costa@samsung.com> on 2013-11-01
Reviewed by Joseph Pecoraro.

Source/WebCore:

Also reset the default origin quota in resetToConsistentState().

* testing/Internals.cpp: Add setApplicationCacheOriginQuota.
(WebCore::Internals::resetToConsistentState): Reset the default origin
quota.
(WebCore::Internals::setApplicationCacheOriginQuota): Added.
* testing/Internals.h: Add setApplicationCacheOriginQuota.
* testing/Internals.idl: Ditto.

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Add
symbols for setApplicationCacheOriginQuota from Internals.

Tools:

* DumpRenderTree/TestRunner.cpp: Move setApplicationCacheOriginQuota
to window.internals
(TestRunner::staticFunctions):
* DumpRenderTree/TestRunner.h: Ditto.
* DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp: Remove setApplicationCacheOriginQuota.
* DumpRenderTree/efl/TestRunnerEfl.cpp: Ditto.
* DumpRenderTree/gtk/TestRunnerGtk.cpp: Ditto.
* DumpRenderTree/mac/TestRunnerMac.mm: Ditto.
* DumpRenderTree/win/TestRunnerWin.cpp: Ditto.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: Ditto.
* WebKitTestRunner/InjectedBundle/TestRunner.cpp: Ditto.
* WebKitTestRunner/InjectedBundle/TestRunner.h: Ditto.

LayoutTests:

* http/tests/appcache/origin-quota-continued-download-multiple-manifests.html: Updated
to use setApplicationCacheOriginQuota from window.internals
* http/tests/appcache/origin-quota-continued-download.html: Ditto.
* http/tests/appcache/origin-quota.html: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename InWindowState -> ViewState
https://bugs.webkit.org/show_bug.cgi?id=123584

Rubber stamped by Sam Weinig.

WebPageProxy::setViewState offers the option to wait for a reply. Previously this option
was only available via setIsInWindow, hence the mechanism to wait to the update has
'InWindowState' in method and variable names (i.e.
'WebPageProxy::waitForDidUpdateInWindowState'). Since the mechanism is now applicable to
all ViewState changes, rename to reflect this.

* UIProcess/API/mac/WKView.mm:
(-[WKView endDeferringViewInWindowChangesSync]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::waitForDidUpdateViewState):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::didUpdateViewState):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::didUpdateViewStateTimerFired):
(WebKit::WebPage::setViewState):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::didUpdateViewStateTimerFired):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Begin work on encoding argument types
https://bugs.webkit.org/show_bug.cgi?id=123631

Reviewed by Dan Bernstein.

Source/WebKit2:

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(-[WKRemoteObjectEncoder _encodeInvocation:forKey:]):
Encode argument types in an array.

(-[WKRemoteObjectEncoder _encodedObjectUsingBlock:]):
Add new helper method that encodes an object and returns the dictionary.

(-[WKRemoteObjectEncoder _encodeObjectForKey:usingBlock:]):
Implement this in terms of _encodedObjectUsingBlock:.

* Shared/MutableArray.cpp:
(WebKit::MutableArray::append):
* Shared/MutableArray.h:
Change append to take a PassRefPtr.

Tools:

Add another test method.

* TestWebKitAPI/Tests/WebKit2ObjC/WKRemoteObjectRegistry.mm:
* TestWebKitAPI/Tests/mac/WKRemoteObjectRegistry_Shared.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Take BidiRuns out of the arena.
<https://webkit.org/b/123630>

Stop arena-allocating BidiRun objects and use regular new/delete.

With this, there are no remaining clients of RenderArena.
It will be removed in a subsequent patch.

Reviewed by Anders Carlsson.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Make some headers Private
https://bugs.webkit.org/show_bug.cgi?id=123626

Reviewed by Andreas Kling.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

* Configurations/WebKit.xcconfig: Exclude iOS Private headers from the Mac build.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Regression: media controls are no longer accessible
https://bugs.webkit.org/show_bug.cgi?id=121990

Patch by James Craig <jcraig@apple.com> on 2013-11-01
Reviewed by Jer Noble.

Source/WebCore:

Updated existing test coverage.
Added ARIA roles, attrs, and labels to the new media controls shadow DOM.
Localization will be handled in http://webkit.org/b/120956

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.UIString):
(Controller.prototype.createControls):
(Controller.prototype.handleLoadStart):
(Controller.prototype.handleError):
(Controller.prototype.handleAbort):
(Controller.prototype.handleSuspend):
(Controller.prototype.handleStalled):
(Controller.prototype.handleWaiting):
(Controller.prototype.handleFullscreenChange):
(Controller.prototype.handleMuteButtonClicked):
(Controller.prototype.handleMinButtonClicked):
(Controller.prototype.handleMaxButtonClicked):
(Controller.prototype.handleVolumeSliderChange):
(Controller.prototype.updatePlaying):

LayoutTests:

Removed failure expectation and updated expected render dump output.

* platform/mac/TestExpectations:
* platform/mac/accessibility/media-element-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Avoid some double-wrapping of strings and URLs
https://bugs.webkit.org/show_bug.cgi?id=123632

Reviewed by Anders Carlsson.

* Shared/API/c/cf/WKStringCF.cpp: Removed.
* Shared/API/c/cf/WKStringCF.mm: Copied from Source/WebKit2/Shared/API/c/cf/WKStringCF.cpp.
(wkNSStringClass): Added this helper.
(WKStringCreateWithCFString): If the passed-in CFString is already wrapping a WebString,
then retain it and return it.
* Shared/API/c/cf/WKURLCF.cpp: Removed.
* Shared/API/c/cf/WKURLCF.mm: Copied from Source/WebKit2/Shared/API/c/cf/WKURLCF.cpp.
(wkNSURLClass): Added this helper.
(WKURLCreateWithCFURL): If the passed-in CFURL is already wrapping a WebURL, then retain it
and return it.
* WebKit2.xcodeproj/project.pbxproj: Updated for renames.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Create a unique identifier for WebPageGroup if the input name is empty
https://bugs.webkit.org/show_bug.cgi?id=123606

Reviewed by Andreas Kling.

Strengthen the "public" API of page group.
If someone uses WKBrowsingContextGroup with a nil or empty string, the related WKString
would be empty, and all the WKBrowsingContextGroup end up with the same identifier.

* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::WebPageGroup):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Teach check-for-webkit-framework-include-consistency to ignore stale iOS Private headers that might exist in build directories due to r158443
https://bugs.webkit.org/show_bug.cgi?id=123636

Reviewed by Andreas Kling.

* Scripts/check-for-webkit-framework-include-consistency:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
OSR exit profiling should be robust against all code being cleared
https://bugs.webkit.org/show_bug.cgi?id=123629
<rdar://problem/15365476>

Reviewed by Michael Saboff.
        
The problem here is two-fold:

1) A watchpoint (i.e. ProfiledCodeBlockJettisoningWatchpoint) may be fired after we
have cleared the CodeBlock for all or some Executables.  This means that doing
codeBlock->baselineVersion() would either crash or return a bogus CodeBlock, since
there wasn't a baseline code block reachable from the Executable anymore.  The
solution is that we shouldn't be asking for the baseline code block reachable from
the owning executable (what baselineVersion did), but instead we should be asking
for the baseline version reachable from the code block being watchpointed (basically
what CodeBlock::alternative() did).

2) If dealing with inlined code, baselienCodeBlockForOriginAndBaselineCodeBlock()
may return null, for the same reason as above - we might have cleared the baseline
codeblock for the executable that was inlined.  The solution is to just not do
profiling if there isn't a baseline code block anymore.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::baselineAlternative):
(JSC::CodeBlock::baselineVersion):
(JSC::CodeBlock::jettison):
* bytecode/CodeBlock.h:
* bytecode/CodeBlockJettisoningWatchpoint.cpp:
(JSC::CodeBlockJettisoningWatchpoint::fireInternal):
* bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp:
(JSC::ProfiledCodeBlockJettisoningWatchpoint::fireInternal):
* dfg/DFGOSRExitBase.cpp:
(JSC::DFG::OSRExitBase::considerAddingAsFrequentExitSiteSlow):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::AssemblyHelpers):
* runtime/Executable.cpp:
(JSC::FunctionExecutable::baselineCodeBlockFor):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] WKObject seems to be initializing its target in a thread-safe manner, but really is not
https://bugs.webkit.org/show_bug.cgi?id=123640

Reviewed by Darin Adler.

* Shared/Cocoa/WKObject.mm:
(initializeTargetIfNeeded): Removed misleading incorrect code.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Kill RenderArena.
<https://webkit.org/b/123634>

There are no remaining users of the RenderArena allocator.

Reviewed by Geoffrey Garen.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remote Layer Tree: Move RemoteLayerBackingStore to Shared/
https://bugs.webkit.org/show_bug.cgi?id=123646

Reviewed by Darin Adler.

Move RemoteLayerBackingStore to Shared/, since it is
used on both the UI and Web process side of things.

* Shared/mac/RemoteLayerBackingStore.h: Renamed from Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerBackingStore.h.
* Shared/mac/RemoteLayerBackingStore.mm: Renamed from Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerBackingStore.mm.
* WebKit2.xcodeproj/project.pbxproj:


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