Add better comments to code that boosts the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=128431

Rubber stamped by Tim Horton

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
(WebKit::XPCServiceEventHandler):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceEventHandler):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToService):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unify JSLock implementation for iOS and non-iOS ports.
<https://webkit.org/b/128409>

Reviewed by Michael Saboff.

The iOS and non-iOS implementations of dropAllLocks(),
dropAllLocksUnconditionally(), and grabAllLocks() effectively do the
same work. The main difference is that the iOS implementation acquires
the JSLock spin lock in the DropAllLocks class while the other ports
acquire it when it calls JSLock::lock() and unlock().

The other difference is that the iOS implementation will only increment
m_locksDropDepth if it actually drops locks, whereas other ports will
increment it unconditionally. Analogously, iOS decrements the depth only
when needed while other ports will decrement it unconditionally when
re-grabbing locks.

We can unify the 2 implementations by having both use the iOS
implementation for a start.

* runtime/JSLock.cpp:
(JSC::JSLock::dropAllLocks):
(JSC::JSLock::dropAllLocksUnconditionally):
(JSC::JSLock::grabAllLocks):
(JSC::JSLock::DropAllLocks::DropAllLocks):
(JSC::JSLock::DropAllLocks::~DropAllLocks):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Per CSSOM, computed rect() function values must be comma separated
https://bugs.webkit.org/show_bug.cgi?id=128401

Reviewed by Simon Fraser.

Updated tests.

* css/Rect.h:
(WebCore::Rect::generateCSSString):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for the GTK+ CMake build

* PlatformGTK.cmake: VTTCue.idl was unintentionally added to the list of GObject DOM bindings
output files. Remove it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge database-common.js and utility.js into run-tests.js.

Reviewed by Matthew Hanson.

Now that run-tests is the only node.js script, merged database-common.js and utility.js into it.
Also moved init-database.sql out of the database directory and removed the directory entirely.

* database: Removed.
* database/database-common.js: Removed.
* database/utility.js: Removed.
* init-database.sql: Moved from database/init-database.sql.
* run-tests.js:
(connect): Moved from database-common.js.
(pathToDatabseSQL): Extracted from pathToLocalScript.
(pathToTests): Moved from database-common.js.
(config): Ditto.
(TaskQueue): Ditto.
(SerializedTaskQueue): Ditto.
(main):
(initializeDatabase):
(TestEnvironment.it):
(TestEnvironment.queryAndFetchAll):
(sendHttpRequest):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FrameSelection's destructor shouldn't notify accessibility
https://bugs.webkit.org/show_bug.cgi?id=128421

Reviewed by Benjamin Poulain.

Extracted setSelectionWithoutUpdatingAppearance out of setSelection and called it in prepareForDestruction
instead of setting DoNotUpdateAppearance option. This new function doesn't reveal selection or notify
accessibility code in addition to not updating appearance.

Note that all implementations of notifyAccessibilityForSelectionChange in FrameSelectionAtk.cpp and
FrameSelectionMac.mm exit early when the selection type is not caret or either start or end is null,
which is already the case inside FrameSelection's destructor. In addition, revealSelection is never called
when selection change was not triggered by user so there should be no behavioral change from this patch.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::prepareForDestruction):
* editing/FrameSelection.h:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange): Added the trivial implementation in the case
accessibility is disabled to tidy up call sites.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
EFL build fix attempt after r163662.

* Modules/indexeddb/leveldb/IDBLevelDBCoding.cpp:
(WebCore::IDBLevelDBCoding::encodeIDBKey):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GC should safepoint the DFG worklist in a smarter way rather than just waiting for everything to complete
https://bugs.webkit.org/show_bug.cgi?id=128297

Reviewed by Oliver Hunt.
        
This makes DFG worklist threads have a rightToRun lock that gives them the ability to
be safepointed by the GC in much the same way as you'd expect from a fully
multithreaded VM.
        
The idea is that the worklist threads's roots are the DFG::Plan. They only touch those
roots when holding the rightToRun lock. They currently grab that lock to run the
compiler, but relinquish it when accessing - and waiting on - the worklist.

* bytecode/CodeBlock.h:
(JSC::CodeBlockSet::mark):
* dfg/DFGCompilationKey.cpp:
(JSC::DFG::CompilationKey::visitChildren):
* dfg/DFGCompilationKey.h:
* dfg/DFGDesiredStructureChains.cpp:
(JSC::DFG::DesiredStructureChains::visitChildren):
* dfg/DFGDesiredStructureChains.h:
* dfg/DFGDesiredTransitions.cpp:
(JSC::DFG::DesiredTransition::visitChildren):
(JSC::DFG::DesiredTransitions::visitChildren):
* dfg/DFGDesiredTransitions.h:
* dfg/DFGDesiredWeakReferences.cpp:
(JSC::DFG::DesiredWeakReferences::visitChildren):
* dfg/DFGDesiredWeakReferences.h:
* dfg/DFGDesiredWriteBarriers.cpp:
(JSC::DFG::DesiredWriteBarrier::visitChildren):
(JSC::DFG::DesiredWriteBarriers::visitChildren):
* dfg/DFGDesiredWriteBarriers.h:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::visitChildren):
* dfg/DFGPlan.h:
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::~Worklist):
(JSC::DFG::Worklist::finishCreation):
(JSC::DFG::Worklist::suspendAllThreads):
(JSC::DFG::Worklist::resumeAllThreads):
(JSC::DFG::Worklist::visitChildren):
(JSC::DFG::Worklist::runThread):
(JSC::DFG::Worklist::threadFunction):
* dfg/DFGWorklist.h:
(JSC::DFG::numberOfWorklists):
(JSC::DFG::worklistForIndexOrNull):
* heap/CodeBlockSet.h:
* heap/Heap.cpp:
(JSC::Heap::markRoots):
(JSC::Heap::collect):
* runtime/IntendedStructureChain.cpp:
(JSC::IntendedStructureChain::visitChildren):
* runtime/IntendedStructureChain.h:
* runtime/VM.cpp:
(JSC::VM::~VM):
(JSC::VM::prepareToDiscardCode):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge updateSelectionCachesIfSelectionIsInsideTextFormControl into setSelectionWithoutUpdatingAppearance
https://bugs.webkit.org/show_bug.cgi?id=128439

Reviewed by Anders Carlsson.

FrameSelection::selectAll had a superfluous call to updateSelectionCachesIfSelectionIsInsideTextFormControl
because it wasn't setting UserTriggered option to avoid revealing selection.

Call setSelection with UserTriggered and recently added DoNotRevealSelection option and merge
updateSelectionCachesIfSelectionIsInsideTextFormControl into setSelectionWithoutUpdatingAppearance.

Also rename local variables in setSelectionWithoutUpdatingAppearance, newSelection to
newSelectionPossiblyWithoutDirection and s to newSelection so that they're self explanatory.

In addition, we now update the input element's selection caches before calling
selectFrameElementInParentIfFullySelected but this should be fine because selection cannot simultaneously
select the entire document and be inside a text form control.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
(WebCore::FrameSelection::selectAll):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ASan] Use new/delete in PODFreeListArena
<http://webkit.org/b/128437>

Reviewed by Oliver Hunt.

* platform/PODFreeListArena.h:
(WebCore::PODFreeListArena::allocateObject): Use new when
ADDRESS_SANITIZER is defined.
(WebCore::PODFreeListArena::freeObject): Use delete when
ADDRESS_SANITIZER is defined.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL WebKit2 build fix after r163671.

* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::WebView): Use WebPageConfiguration in creating WebPage.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't throw away code if there is code on the worklists
https://bugs.webkit.org/show_bug.cgi?id=128443

Reviewed by Joseph Pecoraro.
        
If we throw away compiled code and there is code currently being JITed then the JIT
will get confused after it resumes: it will see a code block that had claimed to belong
to an executable except that it doesn't belong to any executables anymore.

* dfg/DFGWorklist.h:
(JSC::DFG::Worklist::isActive):
* heap/Heap.cpp:
(JSC::Heap::deleteAllCompiledCode):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Build break in WebKitSettings
https://bugs.webkit.org/show_bug.cgi?id=128446

Patch by Piotr Grad <p.grad@samsung.com> on 2014-02-08
Reviewed by Ryosuke Niwa.

Argument for WebPreferences::create was missing

* UIProcess/API/gtk/WebKitSettings.cpp:
(_WebKitSettingsPrivate::_WebKitSettingsPrivate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] build-webkit script always generate-gtk-doc even if '--disable-gtk-doc' param is passed
https://bugs.webkit.org/show_bug.cgi?id=128376

Patch by Diego Pino Garcia <dpino@igalia.com> on 2014-02-08
Reviewed by Carlos Garcia Campos.

* Scripts/webkitdirs.pm:
(buildAutotoolsProject):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Make process model names properly meaningful
https://bugs.webkit.org/show_bug.cgi?id=128389

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2014-02-08
Reviewed by Carlos Garcia Campos.

The name WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW
is misleading because there are situations in which web views may
share the same web process even when multi-process mode is enabled;
for example when opening a related view and both interact using JS.

Source/WebKit2:

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_set_process_model):
(webkit_web_context_get_process_model):
Update names of WebKitProcessModel enum values.
* UIProcess/API/gtk/WebKitWebContext.h:
Ditto.

Tools:

* MiniBrowser/gtk/main.c:
(main):
Update usage of WebKitProcessModel enum values.
* TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp:
(beforeAll):
Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Minibrowser: Matched words of a searched text are not highlighted after reopening search bar
https://bugs.webkit.org/show_bug.cgi?id=128380

Patch by Diego Pino Garcia <dpino@igalia.com> on 2014-02-08
Reviewed by Carlos Garcia Campos.

When open the search bar, perform last search if there is any.

* MiniBrowser/gtk/BrowserSearchBar.c:
(browser_search_bar_open):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSLock should not "restore" VM stack values if it did not re-grab locks.
<https://webkit.org/b/128447>

Reviewed by Geoffrey Garen.

In the existing code, if DropAllLocks is instantiate with DontAlwaysDropLocks
in a thread that does not own the JSLock, then a bug will manifest where:

1. The DropAllLocks constructor will save the VM's stackPointerAtEntry,
   lastStackTop, and reservedZoneSize even though it will not drop the JSLock.
2. The DropAllLocks destructor will restore those 3 values to the VM even
   though the JSLock will not grab its internal lock.

The former only causes busy work but does not impact correctness. The latter
however, will corrupt those 3 VM values which belong to the thread that
actually owns the JSLock.

The fix is to only save the values when the JSLock will actually drop its
internal lock, and only restore the values if it did re-grab the internal lock.

* runtime/JSLock.cpp:
(JSC::JSLock::dropAllLocks):
(JSC::JSLock::dropAllLocksUnconditionally):
(JSC::JSLock::grabAllLocks):
(JSC::JSLock::DropAllLocks::DropAllLocks):
- Moved the saving of VM stack values to dropAllLocks() and
  dropAllLocksUnconditionally().
(JSC::JSLock::DropAllLocks::~DropAllLocks):
- Moved the restoring of VM stack values to grabAllLocks().



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused ENABLE(REPAINT_THROTTLING) flag.
<https://webkit.org/b/128329>

Reviewed by Antti Koivisto.

.:

* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake:

Source/WTF:

* wtf/FeatureDefines.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Font size-related preference values should be CGFloats backed by doubles
https://bugs.webkit.org/show_bug.cgi?id=128445

Reviewed by Filip Pizlo.

* Shared/WebPreferencesStore.h: Changed minimumFontSize, minimumLogicalFontSize,
defaultFontSize, and defaultFixedFontSize into double-value preferences.
* UIProcess/API/Cocoa/WKPreferences.h: Changed minimumFontSize into CGFloat.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences minimumFontSize]): Changed return type.
(-[WKPreferences setMinimumFontSize:]): Changed parameter type.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Changed to use double getters.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use renderer iterators in two more places.
<https://webkit.org/b/128371>

Reviewed by Antti Koivisto.

* dom/Position.cpp:
(WebCore::Position::primaryDirection):

    Use lineageOfType instead of walking the parent chain.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::insertOnlyThisLayer):

    Use childrenOfType instead of walking the children.

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