IndexedDB: Use non-const buffers in put() to avoid copies
https://bugs.webkit.org/show_bug.cgi?id=105572

Reviewed by Adam Barth.

Source/WebCore:

Change the new put() method to allow the implementation to consume
or adopt the vector, to avoid copying.

No new tests as this is an interface change that will be implemented later.

* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::put):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBDatabaseBackendInterface.h:

Source/WebKit/chromium:

Pass on non-const Vectors to allow buffer adoption rather than copies.

* public/WebIDBDatabase.h:
(WebIDBDatabase):
(WebKit::WebIDBDatabase::put):
* src/IDBDatabaseBackendProxy.cpp:
(WebKit::IDBDatabaseBackendProxy::put):
* src/IDBDatabaseBackendProxy.h:
(IDBDatabaseBackendProxy):
* src/WebIDBDatabaseImpl.cpp:
(WebKit::WebIDBDatabaseImpl::put):
* src/WebIDBDatabaseImpl.h:
(WebIDBDatabaseImpl):
* tests/IDBDatabaseBackendTest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, force InternalSettings.cpp to rebuild to try and fix the Apple Win build.

* testing/InternalSettings.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
When a block's height is determined by min-height/max-height, children with percentage heights are sized incorrectly
https://bugs.webkit.org/show_bug.cgi?id=26559

Patch by Bem Jones-Bey <bjonesbe@adobe.com> on 2013-01-02
Reviewed by Tony Chang.

Source/WebCore:

Percentage logical height computation now takes into account the min and max height of the container.

Test: fast/block/min-max-height-percent-height-child.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax): Added. Like constrainLogicalHeightByMinMax,
    but constrains the content box instead of the border box.
(WebCore):
(WebCore::RenderBox::computeContentLogicalHeight): Make const so it can be called from the const method
    constrainContentBoxLogicalHeightByMinMax.
(WebCore::RenderBox::computePercentageLogicalHeight): Use constrainContentBoxLogicalHeightByMinMax to properly
    respect min and max height on the containing box when computing the percentage height.
* rendering/RenderBox.h:
(RenderBox):

LayoutTests:

Add tests to ensure percent heights are correctly determined.

* fast/block/min-max-height-percent-height-child-expected.txt: Added.
* fast/block/min-max-height-percent-height-child.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG inlining machinery should be robust against the inline callee varying while the executable stays the same
https://bugs.webkit.org/show_bug.cgi?id=105953

Reviewed by Mark Hahnenberg.
        
This institutes the policy that if InlineCallFrame::callee is null, then the callee and scope have already
been stored into the true call frame (i.e. the place where the call frame of the inlined call would have
been) and so any attempt to access the callee or scope should do a load instead of assuming that the value
is constant. This wires the changes through the bytecode parser, the stack scanning logic, and the compiler
optimization phases and backends.

* bytecode/CodeOrigin.cpp:
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
(JSC::InlineCallFrame::isClosureCall):
(JSC::CodeOrigin::stackOffset):
(JSC):
* dfg/DFGAssemblyHelpers.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::get):
(InlineStackEntry):
(JSC::DFG::ByteCodeParser::getScope):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
* dfg/DFGCSEPhase.cpp:
(CSEPhase):
(JSC::DFG::CSEPhase::genericPureCSE):
(JSC::DFG::CSEPhase::pureCSE):
(JSC::DFG::CSEPhase::pureCSERequiringSameInlineCallFrame):
(JSC::DFG::CSEPhase::getMyScopeLoadElimination):
(JSC::DFG::CSEPhase::performNodeCSE):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::trueCallFrame):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Surface a few more leveldb errors.
https://bugs.webkit.org/show_bug.cgi?id=105670

Reviewed by Tony Chang.

Two calls to old LevelDBTransaction::get slipped through the cracks.

* Modules/indexeddb/IDBBackingStore.cpp:
(WebCore::IndexKeyCursorImpl::loadCurrentRow):
(WebCore::IndexCursorImpl::loadCurrentRow):
  Make these two functions use safeGet instead of get.

* platform/leveldb/LevelDBTransaction.cpp:
* platform/leveldb/LevelDBTransaction.h:
  Remove get now that it is unused.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Add Platform/chromium to include_dirs
https://bugs.webkit.org/show_bug.cgi?id=105955

Reviewed by James Robinson.

Currently the headers in WebKit/chromium/public/Web*.h can not
include headers from the new Platform/chromium/ directory with the
"#include <public/WebFoo.h>" syntax, because the include_dirs for
dependent builds (like Chromium-within-WebKit) do not include the
new Platform/chromium/ directory. This patch adds that capability
without managing to break anything else.

* WebKit.gyp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up dispatchEvent overrides and overloads
https://bugs.webkit.org/show_bug.cgi?id=105959

Reviewed by Adam Barth.

Add OVERRIDE to all dispatchEvent overrides and use "using" instead of
reimplementing EventTarget::dispatchEvent in subclasses where having the
virtual override of dispatchEvent hides the overloads in
the superclass.

No new tests, just refactoring.

* Modules/indexeddb/IDBDatabase.h:
(IDBDatabase):
* Modules/indexeddb/IDBOpenDBRequest.h:
(IDBOpenDBRequest):
* Modules/indexeddb/IDBRequest.h:
(IDBRequest):
* Modules/indexeddb/IDBTransaction.h:
(IDBTransaction):
* dom/EventDispatchMediator.h:
(FocusEventDispatchMediator):
(BlurEventDispatchMediator):
* dom/GestureEvent.h:
(GestureEventDispatchMediator):
* dom/KeyboardEvent.h:
(KeyboardEventDispatchMediator):
* dom/MouseEvent.h:
* dom/Node.h:
(Node):
* dom/UIEvent.h:
(FocusInEventDispatchMediator):
(FocusOutEventDispatchMediator):
* dom/WheelEvent.h:
(WheelEventDispatchMediator):
* html/HTMLMediaElement.h:
* html/track/TextTrackCue.cpp:
* html/track/TextTrackCue.h:
(TextTrackCue):
* page/DOMWindow.h:
(DOMWindow):
* svg/SVGElementInstance.h:
(SVGElementInstance):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Some renaming in the CodeCache
https://bugs.webkit.org/show_bug.cgi?id=105966

Reviewed by Gavin Barraclough.

CodeBlockKey => SourceCodeKey because the key is not a CodeBlock.

m_recentlyUsedFunctionCode => m_recentlyUsedFunctions to match other names.

GlobalFunctionKey => FunctionKey because the key is not unique to globalness.

m_cachedGlobalFunctions => m_globalFunctions because "cached" is redundant
for data members in an object called "CodeCache".

kMaxRootCodeBlockEntries => kMaxRootEntries because there are no non-CodeBlock
entries in a CodeBlock cache.

kMaxFunctionCodeBlocks => kMaxChildFunctionEntries to clarify that this
number models a parent-child relationship.

Also removed the initial "k" from enum constants. That's an interesting
style for calling out constants, but it's not the WebKit style.

Finally, a behavior change: Use MaxRootEntries for the limit on global
functions, and not MaxChildFunctionEntries. Previously, there was an
unused constant that seemed to have been intended for this purpose.

* runtime/CodeCache.cpp:
(JSC::CodeCache::makeSourceCodeKey):
(JSC::CodeCache::getCodeBlock):
(JSC::CodeCache::generateFunctionCodeBlock):
(JSC::CodeCache::makeFunctionKey):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
(JSC::CodeCache::usedFunctionCode):
* runtime/CodeCache.h:
(JSC::CodeCache::clear):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [WK2 NetworkProcess] Uploading fails if a client modified the request
        https://bugs.webkit.org/show_bug.cgi?id=105965

        Reviewed by Brady Eidson.

        Associating streams with additional information via a side HashMap does not work,
        because the stream we can see is an internal one, with address and other information
        not matching a stream that we created.

        It's surprising that this design issue was not causing major trouble without NetworkProcess.

        * platform/network/cf/FormDataStreamCFNet.cpp:
        (WebCore): Renamed FormContext to FormCreationContext, because this type only used
        for creation. Later, we use FormStreamFields as context.
        (WebCore::closeCurrentStream): Moved a star.
        (WebCore::formCreate): We no longer have a side map to keep updated.
        (WebCore::formFinalize): Ditto.
        (WebCore::formCopyProperty): Added an accessor to get FormData pointer from a stream.
        (WebCore::setHTTPBody): Ditto.
        (WebCore::httpBodyFromStream): Use the new property to get FormData pointer.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] There are some extra blank lines after removing INC_STATS
https://bugs.webkit.org/show_bug.cgi?id=105964

Reviewed by Ojan Vafai.

This patch is a followup to http://trac.webkit.org/changeset/138665
that removes some extra blank lines that sed wasn't smart enough to
delete for us.

* bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
(WebCore::V8CSSStyleDeclaration::namedPropertyQuery):
* bindings/v8/custom/V8DOMFormDataCustom.cpp:
(WebCore::V8DOMFormData::appendCallback):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::addEventListenerCallback):
(WebCore::V8DOMWindow::removeEventListenerCallback):
(WebCore::V8DOMWindow::postMessageCallback):
* bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
(WebCore::V8DedicatedWorkerContext::postMessageCallback):
* bindings/v8/custom/V8DocumentCustom.cpp:
(WebCore::V8Document::evaluateCallback):
* bindings/v8/custom/V8GeolocationCustom.cpp:
(WebCore::V8Geolocation::getCurrentPositionCallback):
(WebCore::V8Geolocation::watchPositionCallback):
* bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
(WebCore::V8HTMLAllCollection::namedPropertyGetter):
* bindings/v8/custom/V8HTMLCollectionCustom.cpp:
(WebCore::V8HTMLCollection::namedPropertyGetter):
* bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp:
(WebCore::V8HTMLFormControlsCollection::namedPropertyGetter):
* bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
(WebCore::v8HTMLImageElementConstructorCallback):
* bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
(WebCore::V8HTMLOptionsCollection::namedPropertyGetter):
* bindings/v8/custom/V8MessagePortCustom.cpp:
(WebCore::V8MessagePort::postMessageCallback):
* bindings/v8/custom/V8NamedNodeMapCustom.cpp:
(WebCore::V8NamedNodeMap::namedPropertyGetter):
* bindings/v8/custom/V8NotificationCustom.cpp:
(WebCore::V8Notification::requestPermissionCallback):
* bindings/v8/custom/V8PopStateEventCustom.cpp:
(WebCore::V8PopStateEvent::stateAccessorGetter):
* bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
(WebCore::V8SQLResultSetRowList::itemCallback):
* bindings/v8/custom/V8SQLTransactionCustom.cpp:
(WebCore::V8SQLTransaction::executeSqlCallback):
* bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
(WebCore::V8SQLTransactionSync::executeSqlCallback):
* bindings/v8/custom/V8StorageCustom.cpp:
(WebCore::V8Storage::namedPropertyQuery):
* bindings/v8/custom/V8StyleSheetListCustom.cpp:
(WebCore::V8StyleSheetList::namedPropertyGetter):
* bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
(WebCore::V8WebGLRenderingContext::getAttachedShadersCallback):
(WebCore::V8WebGLRenderingContext::getFramebufferAttachmentParameterCallback):
(WebCore::V8WebGLRenderingContext::getParameterCallback):
(WebCore::V8WebGLRenderingContext::getProgramParameterCallback):
(WebCore::V8WebGLRenderingContext::getShaderParameterCallback):
(WebCore::V8WebGLRenderingContext::getUniformCallback):
* bindings/v8/custom/V8WorkerCustom.cpp:
(WebCore::V8Worker::postMessageCallback):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r138661.
http://trac.webkit.org/changeset/138661
https://bugs.webkit.org/show_bug.cgi?id=104740

Compile problems on EFL

.:

* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.am:
* UseJSC.cmake:
* UseV8.cmake:
* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* WebCore.vcproj/WebCoreTestSupport.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(IDLFileForInterface):
* page/make_settings.pl:
(generateCode):
(generateHeader):
(printGetterAndSetter):
(printInitializer):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::from):
(WebCore::InternalSettings::InternalSettings):
(WebCore::InternalSettings::reset):
(WebCore::InternalSettings::setPasswordEchoEnabled):
(WebCore):
(WebCore::InternalSettings::setPasswordEchoDurationInSeconds):
* testing/InternalSettings.h:
(Backup):
(InternalSettings):
* testing/InternalSettings.idl:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::resetInternalsObject):
* testing/v8/WebCoreTestSupport.cpp:
(WebCoreTestSupport::resetInternalsObject):

Tools:

* GNUmakefile.am:
* qmake/mkspecs/features/default_post.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Release build fix.

        * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::formFinalize):
        Use ASSERT_UNUSED for an otherwise unused variable.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Chromium needs platform localized strings for media controls.
https://bugs.webkit.org/show_bug.cgi?id=105940

Patch by David Tseng <dtseng@google.com> on 2013-01-02
Reviewed by Tony Chang.

Source/Platform:

* chromium/public/WebLocalizedString.h:

Source/WebKit/chromium:

* src/LocalizedStrings.cpp:
(WebCore::localizedMediaControlElementString):
(WebCore):
(WebCore::localizedMediaControlElementHelpText):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][CMAKE] Remove duplicated conditionals
https://bugs.webkit.org/show_bug.cgi?id=105905

Reviewed by Laszlo Gombos.

.:

* Source/cmake/OptionsEfl.cmake: Remove set(WTF_USE_GLX 1).

Source/WebCore:

Remove conditionals from CMake build system, where the files being built are already wrapped with
the conditionals. It just messes cmake file up.

* PlatformEfl.cmake:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] V8DOMWrapper.cpp has many more includes than necessary
https://bugs.webkit.org/show_bug.cgi?id=105968

Reviewed by Kentaro Hara.

Now that this file isn't in charge of doing everything under the sun,
it can have a more focused set of include directives.

* bindings/v8/V8DOMWrapper.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop pretending its possible to run the WebProcess in threaded mode
https://bugs.webkit.org/show_bug.cgi?id=105969

Reviewed by Alexey Proskuryakov.

- Removes WebProcess::isSeparateProcess()
- Stop storing a RunLoop on the WebProcess and just use RunLoop::main().

* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::NetworkProcessConnection):
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::NPRuntimeObjectMap):
* WebProcess/Plugins/PluginProcessConnection.cpp:
(WebKit::PluginProcessConnection::PluginProcessConnection):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl):
* WebProcess/WebPage/PageOverlay.cpp:
(WebKit::PageOverlay::PageOverlay):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::close):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeConnection):
(WebKit::WebProcess::shouldTerminate):
(WebKit::WebProcess::terminate):
(WebKit::WebProcess::didClose):
* WebProcess/WebProcess.h:
(WebProcess):
* WebProcess/efl/WebProcessMainEfl.cpp:
(WebKit::WebProcessMainEfl):
* WebProcess/gtk/WebProcessMainGtk.cpp:
(WebKit::WebProcessMainGtk):
* WebProcess/mac/WebProcessInitialization.mm:
(WebKit::initializeWebProcess):
* WebProcess/qt/WebProcessMainQt.cpp:
(WebKit::WebProcessMainQt):
* WebProcess/win/WebProcessMainWin.cpp:
(WebKit::WebProcessMain):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Initialize WebInputEvent to prevent sending uninitialized bytes with IPC messages.
https://bugs.webkit.org/show_bug.cgi?id=105934

Reviewed by James Robinson.

* public/WebInputEvent.h:
(WebKit::WebInputEvent::WebInputEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Chromium gardening.

Rebaseline win-xp image for svg/dynamic-updates/SVGFEComponentTransferElement-dom-tableValues-attr-expected.html.

* platform/chromium-win-xp/svg/dynamic-updates/SVGFEComponentTransferElement-dom-tableValues-attr-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac and Chromium rebaselines after r138654.

* editing/deleting/delete-to-select-table-expected.txt: Added.
* platform/chromium-mac/editing/deleting/delete-to-select-table-expected.txt: Added.
* platform/chromium/editing/deleting/delete-to-select-table-expected.txt: Removed.
* platform/efl/editing/deleting/delete-to-select-table-expected.txt: Removed.
* platform/gtk/editing/deleting/delete-to-select-table-expected.txt: Removed.
* platform/mac-lion/editing/deleting/delete-to-select-table-expected.txt: Added.
* platform/mac-wk2/editing/deleting: Added.
* platform/mac-wk2/editing/deleting/delete-to-select-table-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Remove unused transitional #defines from Platform API
https://bugs.webkit.org/show_bug.cgi?id=105971

Patch by James Robinson <jamesr@chromium.org> on 2013-01-02
Reviewed by Adrienne Walker.

These are leftovers from multi-sided patches that landed months ago.

* chromium/public/WebContentLayerClient.h:
(WebContentLayerClient):
* chromium/public/WebLayer.h:
* chromium/public/WebLayerTreeView.h:
* chromium/public/WebThread.h:

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