https://bugs.webkit.org/show_bug.cgi?id=127138
Add more delegate callback methods to WKWebProcessPlugInLoadDelegate.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2014-01-17
Reviewed by Sam Weinig.

Add more WKWebProcessPlugInLoadDelegate callback methods so that a injected
bundle can listen/react to more frame loading events.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: Add more delegate callback methods for
    WKWebProcessPlugInLoadDelegate.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didCommitLoadForFrame):
(didFinishDocumentLoadForFrame):
(didFailLoadWithErrorForFrame):
(didSameDocumentNavigationForFrame):
(didLayoutForFrame):
(setUpPageLoaderClient):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support WebSelections in WK2 on iOS.
https://bugs.webkit.org/show_bug.cgi?id=127015
<rdar://problem/15843090>

Reviewed by Dan Bernstein.

Removing unused variable in selectWithGesture that
causes Release build to fail after r162103.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of OpaqueJSString::deprecatedCharacters()
https://bugs.webkit.org/show_bug.cgi?id=127161

Reviewed by Sam Weinig.

Handle OpaqueJSString::m_string being either 8-bit or 16-bit and add extra
code paths for the 8-bit cases.

Unfortunately, JSStringGetCharactersPtr is still expected to return a 16-bit character pointer.
Handle this by storing a separate 16-bit string and initializing it on demand when JSStringGetCharactersPtr
is called and the backing string is 8-bit.

This has the nice side effect of making JSStringGetCharactersPtr thread-safe when it wasn't before.
(In theory, someone could have a JSStringRef backed by an 8-bit string and call JSStringGetCharactersPtr on it
causing an unsafe upconversion to a 16-bit string).

* API/JSStringRef.cpp:
(JSStringGetCharactersPtr):
Call OpaqueJSString::characters.

(JSStringGetUTF8CString):
Add a code path that handles 8-bit strings.

(JSStringIsEqual):
Call OpaqueJSString::equal.

* API/JSStringRefCF.cpp:
(JSStringCreateWithCFString):
Reformat the code to use an early return instead of putting most of the code inside the body of an if statement.

(JSStringCopyCFString):
Create an 8-bit CFStringRef if possible.

* API/OpaqueJSString.cpp:
(OpaqueJSString::create):
Use nullptr.

(OpaqueJSString::~OpaqueJSString):
Free m_characters.

(OpaqueJSString::characters):
Do the up-conversion and store the result in m_characters.

(OpaqueJSString::equal):
New helper function.

* API/OpaqueJSString.h:
(OpaqueJSString::is8Bit):
New function that returns whether a string is 8-bit or not.

(OpaqueJSString::characters8):
(OpaqueJSString::characters16):
Add getters.

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