[EFL][WK2] Stop calling mktemp(3).
https://bugs.webkit.org/show_bug.cgi?id=128826

Reviewed by Gyuyoung Kim.

mktemp(3) is an insecure function and should be avoided at all costs.
Replace its usage with mkdtemp(3): instead of just getting a file name
that is supposed to be random and unused, we now create a directory
with a random name and then put whatever files we need there with fixed
names.

* UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
(TEST_F):
* UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
(TEST_F):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
computeSelectionStart and computeSelectionEnd shouldn't trigger synchronous layout
https://bugs.webkit.org/show_bug.cgi?id=128806

Reviewed by Darin Adler.

Added indexForPosition to HTMLTextFormControlElement. Like r163825, this patch traverses the DOM tree
instead of the render tree to compute the index for a given position.

We traverse the DOM Tree backwards starting at the specified Position all the way back to the beginning
of the inner text element. The index is computed as the number of characters we encountered during
this backwards DOM traversal.

It's worth noting that passedPosition.computeNodeBeforePosition() returns and only returns 0 when the
position is before the first node of its parent or inside a text node. In such cases, we call
passedPosition.containerNode() to find the parent or the text node.

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::indexForVisiblePosition): Use indexForPosition.
(WebCore::HTMLTextFormControlElement::computeSelectionStart): Ditto.
(WebCore::HTMLTextFormControlElement::computeSelectionEnd): Dotto.
(WebCore::finishText): Cleanup. Use newlineCharacter instead of hard-coding '\n'.
(WebCore::HTMLTextFormControlElement::indexForPosition): Added. See above for the description.
* html/HTMLTextFormControlElement.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] All WebKit clients should encrypt WebCrypto keys automatically
https://bugs.webkit.org/show_bug.cgi?id=128852

Reviewed by Oliver Hunt.

Source/WebCore: 

Install a persistent master key in Keychain on first use of WebCrypto key serialization.
The key is per application, protected with ACL.

* English.lproj/Localizable.strings:
* WebCore.exp.in:
* crypto/SerializedCryptoKeyWrap.h:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::masterKeyAccountNameForCurrentApplication):
(WebCore::getDefaultWebCryptoMasterKey):
(WebCore::createAndStoreMasterKey):
(WebCore::findMasterKey):
* platform/LocalizedStrings.cpp:
(WebCore::webCryptoMasterKeyKeychainLabel):
(WebCore::webCryptoMasterKeyKeychainComment):
* platform/LocalizedStrings.h:

Source/WebKit/mac: 

* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::wrapCryptoKey):
(WebChromeClient::unwrapCryptoKey):
Call the default implementation if key is not provided by a client.

Source/WebKit2: 

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::wrapCryptoKey):
(WebKit::WebPageProxy::unwrapCryptoKey):
Call the default implementation if key is not provided by a client.



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