Fix several memory leaks found by code inspection
https://bugs.webkit.org/show_bug.cgi?id=132472

Reviewed by Geoffrey Garen.

Fix memory leaks.

* TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm:
(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::willSendRequestForFrame):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::changeWindowScaleIfNeeded):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a DFG function whitelist
https://bugs.webkit.org/show_bug.cgi?id=132437

Reviewed by Geoffrey Garen.

Often times when debugging, using bytecode ranges isn't enough to narrow down to the 
particular DFG block that's causing issues. This patch adds the ability to whitelist 
specific functions specified in a file to enable further filtering without having to recompile.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGCapabilities.cpp:
(JSC::DFG::isSupported):
(JSC::DFG::mightInlineFunctionForCall):
(JSC::DFG::mightInlineFunctionForClosureCall):
(JSC::DFG::mightInlineFunctionForConstruct):
* dfg/DFGFunctionWhitelist.cpp: Added.
(JSC::DFG::FunctionWhitelist::ensureGlobalWhitelist):
(JSC::DFG::FunctionWhitelist::FunctionWhitelist):
(JSC::DFG::FunctionWhitelist::parseFunctionNamesInFile):
(JSC::DFG::FunctionWhitelist::contains):
* dfg/DFGFunctionWhitelist.h: Added.
* runtime/Options.cpp:
(JSC::parse):
(JSC::Options::dumpOption):
* runtime/Options.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unsuccessful build fix attempts
https://bugs.webkit.org/show_bug.cgi?id=132476

Reviewed by Dan Bernstein.

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] WebKit2 File Upload Support
https://bugs.webkit.org/show_bug.cgi?id=132024

Reviewed by Enrica Casucci.

Source/WebCore:
* English.lproj/Localizable.strings:
New localized strings for <input type="file"> on iOS.

Source/WebKit2:
* Configurations/WebKit2.xcconfig:
Include MobileCoreServices on iOS for kUTTypeImage/kUTTypeMovie.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

* UIProcess/WebOpenPanelResultListenerProxy.h:
* UIProcess/WebOpenPanelResultListenerProxy.cpp:
(WebKit::filePathsFromFileURLs):
(WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runOpenPanel):
(WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
* WebProcess/WebPage/WebOpenPanelResultListener.h:
* WebProcess/WebPage/WebOpenPanelResultListener.cpp:
(WebKit::WebOpenPanelResultListener::didChooseFilesWithDisplayStringAndIcon):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
Message forwarding for choosing files and providing a display string and icon,
leading down to the existing WebCore FileChooser method.

* UIProcess/PageClient.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::handleRunOpenPanel):
Add a default handler for file open panel on iOS.
Forwards to the content view.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView lastInteractionLocation]):
(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _longPressRecognized:]):
(-[WKContentView _singleTapRecognized:]):
(-[WKContentView _doubleTapRecognized:]):
(-[WKContentView _twoFingerDoubleTapRecognized:]):
Keep track of the last interaction location. This matches previous behavior
of showing the file upload popover where the user tapped, to handle
cases where the <input> is hidden.

(-[WKContentView _showRunOpenPanel:resultListener:]):
(-[WKContentView fileUploadPanelDidDismiss:]):
Handle showing the cleaning up after the file upload panel.

* UIProcess/ios/forms/WKFileUploadPanel.h:
* UIProcess/ios/forms/WKFileUploadPanel.mm: Added.
(squareCropRectForSize):
(squareImage):
(thumbnailSizedImageForImage):
(-[_WKFileUploadItem isVideo]):
(-[_WKFileUploadItem fileURL]):
(-[_WKFileUploadItem displayImage]):
(-[_WKImageFileUploadItem initWithFilePath:originalImage:]):
(-[_WKImageFileUploadItem isVideo]):
(-[_WKImageFileUploadItem fileURL]):
(-[_WKImageFileUploadItem displayImage]):
(-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]):
(-[_WKVideoFileUploadItem isVideo]):
(-[_WKVideoFileUploadItem fileURL]):
(-[_WKVideoFileUploadItem displayImage]):
Helper class for each image picker selection. Knows how to get
a file URL and thumbnail display image for the item.

(-[WKFileUploadPanel initWithView:]):
(-[WKFileUploadPanel dealloc]):
(-[WKFileUploadPanel _dispatchDidDismiss]):
(-[WKFileUploadPanel _cancel]):
(-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
Lifetime of the upload panel requires that either cancel or choose
must happen as we go through the file picking process.

(-[WKFileUploadPanel presentWithParameters:WebKit::resultListener:WebKit::]):
(-[WKFileUploadPanel dismiss]):
API to show or dismiss the panel.

(-[WKFileUploadPanel _dismissDisplayAnimated:]):
Helper to clean up the UI as it progresses or completes no matter the device idiom.

(-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
(-[WKFileUploadPanel _presentFullscreenViewController:animated:]):
UI presentation for the appropriate idiom.

(-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
(-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
(-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
Showing the action sheet or image picker.

(-[WKFileUploadPanel popoverControllerDidDismissPopover:]):
(-[WKFileUploadPanel _willMultipleSelectionDelegateBeCalled]):
(-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]):
(-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]):
(-[WKFileUploadPanel imagePickerControllerDidCancel:]):
Action sheet or image picker handlers.

(-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
(-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
(-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
(-[WKFileUploadPanel _displayStringForPhotos:videos:]):
Processing selections from the image picker to FileUploadItems.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add and implement KeyedDecoder::decodeBytes
https://bugs.webkit.org/show_bug.cgi?id=132479

Reviewed by Tim Horton.

Source/WebCore:
* platform/KeyedCoding.h:
(WebCore::KeyedDecoder::decodeBytes):

Source/WebKit2:
* Shared/cf/KeyedDecoder.cpp:
(WebKit::KeyedDecoder::decodeBytes):
* Shared/cf/KeyedDecoder.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't abuse Blob deserialization constructor in WebSocket
https://bugs.webkit.org/show_bug.cgi?id=132478

Reviewed by Sam Weinig.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::send):
(WebCore::WebSocketChannel::enqueueBlobFrame): This is the important change -
Blob::create was called for no reason. If the blob came from a worker, it was
already cloned for cross-thread messaging, otherwise there is no reason to make
a new one.

* fileapi/Blob.h:
(WebCore::Blob::deserialize):
(WebCore::Blob::create): Deleted.
* fileapi/File.h:
(WebCore::File::deserialize):
(WebCore::File::create): Deleted.
Renamed a special case of "create" function to avoid explaining what it is for.

* Modules/websockets/ThreadableWebSocketChannel.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::send):
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::send): Print a full URL in LOG(),
not one shortened to 1024 characters.
(WebCore::WorkerThreadableWebSocketChannel::Peer::send):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadSendBlob):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readFile):
(WebCore::CloneDeserializer::readTerminal):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hard to figure out how to run a single test with run-api-tests
https://bugs.webkit.org/show_bug.cgi?id=116332

Reviewed by Alexey Proskuryakov.

* Scripts/run-api-tests: add two examples to the help message.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash inside [WebSharingServicePickerController clear]
<rdar://problem/16791944> and https://bugs.webkit.org/show_bug.cgi?id=132477

Reviewed by Tim Horton.

* Misc/WebSharingServicePickerController.h:
* Misc/WebSharingServicePickerController.mm:
(-[WebSharingServicePickerController clear]): clear can be called twice, so null check _menuClient.

* WebCoreSupport/WebContextMenuClient.h:
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::~WebContextMenuClient): For a sanity check, call clear on the picker here.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Wireless playback button not blue when active
https://bugs.webkit.org/show_bug.cgi?id=132473

Reviewed by Simon Fraser.

The playback button's class was being set to 'undefined', due to Controller.ClassNames.active being undefined.

* Modules/mediacontrols/mediaControlsApple.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update ANGLE Windows build.
https://bugs.webkit.org/show_bug.cgi?id=132456

Patch by Alex Christensen <achristensen@webkit.org> on 2014-05-02
Reviewed by Brent Fulgham.

* ANGLE.vcxproj/libEGLCommon.props:
* ANGLE.vcxproj/libGLESv2.vcxproj:
* ANGLE.vcxproj/libGLESv2.vcxproj.filters:
* ANGLE.vcxproj/libGLESv2Common.props:
* ANGLE.vcxproj/translator_common.vcxproj:
* ANGLE.vcxproj/translator_common.vcxproj.filters:
* ANGLE.vcxproj/translator_glsl.vcxproj:
* ANGLE.vcxproj/translator_glsl.vcxproj.filters:
* ANGLE.vcxproj/translator_hlsl.vcxproj:
* ANGLE.vcxproj/translator_hlsl.vcxproj.filters:
Updated ANGLE build.
* src/ANGLE.sln: Removed.
* src/build_angle.gyp: Removed.
* src/commit.h: Added.
* changes.diff:
* src/libGLESv2/Program.cpp:
(gl::InfoLog::append):
Fixed typo.

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