Add branch-prediction hint to FAST_RETURN_IF_NO_FRONTENDS.
<http://webkit.org/b/115357>

Reviewed by Anders Carlsson.

Since this macro is used in some very hot code paths, give the compiler an extra hint
to try and minimize the impact it has when the inspector is not active.

* inspector/InspectorInstrumentation.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WIN] Add workaround for UNUSED_PARAM()
https://bugs.webkit.org/show_bug.cgi?id=115350

Reviewed by Andreas Kling.

r147882 added an workaround for the MSVC compiler on Windows CE.
Extend this workaround to whole MSVC compiler, since the same
problem occurs with the Visual Studio 10 compiler too.

* wtf/UnusedParam.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Set up the TestJavaScriptCore in TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=115236

Reviewed by Gustavo Noronha Silva.

Set up the TestJavaScriptCore unit test program, consisting of the unit tests
under the TestWebKitAPI/Tests/JavaScriptCore directory.

* TestWebKitAPI/GNUmakefile.am:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of StorageTask
https://bugs.webkit.org/show_bug.cgi?id=115313

Reviewed by Andreas Kling.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* storage/StorageSyncManager.cpp:
* storage/StorageTask.cpp: Removed.
* storage/StorageTask.h: Removed.
* storage/StorageThread.cpp:
(WebCore::StorageThread::threadEntryPoint):
(WebCore::StorageThread::dispatch):
(WebCore::StorageThread::terminate):
* storage/StorageThread.h:
(StorageThread):
* storage/StorageTracker.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Threads get stuck in NetworkProcess when canceling loads
        https://bugs.webkit.org/show_bug.cgi?id=115319

        Backing out part of the fix, as it's causing crashes.

        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Re-indent StorageSyncManager and remove SecurityOrigin forward declaration.

Rubber-stamped by Andreas Kling.

* storage/StorageSyncManager.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a StorageSyncManager::dispatch helper function
https://bugs.webkit.org/show_bug.cgi?id=115365

Reviewed by Andreas Kling.

* storage/StorageSyncManager.cpp:
(WebCore::StorageSyncManager::dispatch):
(WebCore):
(WebCore::StorageSyncManager::close):
(WebCore::StorageSyncManager::scheduleImport):
(WebCore::StorageSyncManager::scheduleSync):
(WebCore::StorageSyncManager::scheduleDeleteEmptyDatabase):
* storage/StorageSyncManager.h:
(StorageSyncManager):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix. Point the Network process towards its own version of SecItemShim.dyld.

* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: We see authentication challenge sheets for favicon requests.
<rdar://problem/13753470> and https://bugs.webkit.org/show_bug.cgi?id=115288

Reviewed by Alexey Proskuryakov.

Source/WebCore:

No new tests (Not in a tested config, might fix existing test).

Rename ClientCrossOriginCredentialPolicy to ClientCredentialPolicy, make it be three options.
and move it to ResourceHandleTypes where it belongs:
* loader/ResourceLoaderOptions.h:
* platform/network/ResourceHandleTypes.h:

Expose the ClientCredentialPolicy the ResourceLoader was created with:
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::clientCredentialPolicy):

Rework the “should ask client” clause for the new values of ClientCredentialPolicy:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):

Rework loadResourceSynchronously() to include a ClientCredentialPolicy argument:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/FrameLoader.h:
* loader/LoaderStrategy.cpp:
(WebCore::LoaderStrategy::loadResourceSynchronously):
* loader/LoaderStrategy.h:

Never ask the client for credentials for icon loads:
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):

Update all other users of ClientCredentialPolicy to the appropriate new value,
and update all users of loadResourceSynchronously to the new function signature:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::loadResourceSynchronously):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/FrameLoader.h:
(FrameLoader):
* loader/LoaderStrategy.cpp:
(WebCore::LoaderStrategy::loadResourceSynchronously):
* loader/LoaderStrategy.h:
(LoaderStrategy):
* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::defaultCachedResourceOptions):
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::docLoaderFunc):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::openFunc):

* WebCore.exp.in:

Source/WebKit2:

Have NetworkResourceLoadParameters remember the ClientCredentialPolicy:
* Shared/Network/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
(WebKit::NetworkResourceLoadParameters::encode):
(WebKit::NetworkResourceLoadParameters::decode):
* Shared/Network/NetworkResourceLoadParameters.h:

Pass along the ClientCredentialPolicy to the NetworkProcess:
* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::loadResourceSynchronously):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

Have the SchedulableLoader remember the ClientCredentialPolicy:
* NetworkProcess/SchedulableLoader.cpp:
(WebKit::SchedulableLoader::SchedulableLoader):
* NetworkProcess/SchedulableLoader.h:
(WebKit::SchedulableLoader::clientCredentialPolicy):

Don’t message for credentials if the ClientCredentialPolicy forbids it:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveAuthenticationChallenge):
* NetworkProcess/NetworkResourceLoader.h:

Update for the new loadResourceSynchronously signature (which is still a no-op on the NetworkProcess side):
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::loadResourceSynchronously):
* NetworkProcess/NetworkProcessPlatformStrategies.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexingTypes should use hex
https://bugs.webkit.org/show_bug.cgi?id=115286

Decimal is kind of confusing/hard to read because they're used as bit masks. Hex seems more appropriate.

Reviewed by Geoffrey Garen.

* runtime/IndexingType.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
~BlockAllocator should ASSERT that it has no more Regions left
https://bugs.webkit.org/show_bug.cgi?id=115287

Reviewed by Andreas Kling.

* heap/BlockAllocator.cpp:
(JSC::BlockAllocator::~BlockAllocator):
(JSC::BlockAllocator::allRegionSetsAreEmpty):
* heap/BlockAllocator.h:
(RegionSet):
(JSC::BlockAllocator::RegionSet::isEmpty):
(BlockAllocator):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVGElement destructor can use invalid iterator
https://bugs.webkit.org/show_bug.cgi?id=115361

Reviewed by Philip Rogers.

Source/WebCore:

When an SVGElement object has rare data, its destructor gets a
hash map iterator for the rare data, uses it to clear resources,
then uses the iterator to delete the rare data. However, the resource
cleanup can delete other SVG elements, thus modifying the hash map
from which the iterator came and hence invalidating the iterator
itself.

The fix is to re-get the iterator before deleting the rare data.

Test: svg/custom/svg-element-destructor-iteration-crash.html

* svg/SVGElement.cpp:
(WebCore::SVGElement::~SVGElement): Get a new iterator after clearing rare data.

LayoutTests:

Test asserts in Debug and should also crash in memory checking builds.

* svg/custom/svg-element-destructor-iteration-crash-expected.txt: Added.
* svg/custom/svg-element-destructor-iteration-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove two more StorageSyncManager wrapper functions
https://bugs.webkit.org/show_bug.cgi?id=115367

Reviewed by Andreas Kling.

* storage/StorageAreaSync.cpp:
(WebCore::StorageAreaSync::scheduleFinalSync):
(WebCore::StorageAreaSync::syncTimerFired):
* storage/StorageSyncManager.cpp:
* storage/StorageSyncManager.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused method RenderMeter::valueRatio()
https://bugs.webkit.org/show_bug.cgi?id=115266

Patch by Daker Fernandes Pinheiro <daker.pinheiro@openbossa.org> on 2013-04-29
Reviewed by Darin Adler.

The removed method is not used anywhere.
No new tests are required.

* rendering/RenderMeter.cpp:
* rendering/RenderMeter.h:
(RenderMeter):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Set up the TestWebCore in TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=115237

Reviewed by Gustavo Noronha Silva.

Set up the WebCore unit test program, consisting of the unit tests under the TestWebKitAPI/Tests/WebCore directory.
Again the approach of specifying libtool libraries multiple times in the TestWebCore program's LDFLAGS is used as
a workaround for the layer violations and circular dependencies between various static libraries. Linking against
either libwebkitgtk or libwebkit2gtk shared libraries is avoided due to the unit tests covering WebCore, which
shouldn't rely on neither of the two distributable libraries (hence the dirty workaround).

* TestWebKitAPI/GNUmakefile.am:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [WK2][Mac] Test with NetworkProcess enabled.

        Reviewed by Sam Weinig.

        * WebKitTestRunner/TestController.cpp:
        (WTR::TestController::initialize):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove the last StorageSyncManager function
https://bugs.webkit.org/show_bug.cgi?id=115371

Reviewed by Sam Weinig.

Move the import scheduling to the StorageAreaSync constructor. Remove code to set m_importComplete to true
since that could only happen if the StorageSyncManager's thread is null which doesn't make any sense.

* storage/StorageAreaSync.cpp:
(WebCore::StorageAreaSync::StorageAreaSync):
(WebCore::StorageAreaSync::create):
* storage/StorageSyncManager.cpp:
* storage/StorageSyncManager.h:
(StorageSyncManager):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Need a tools32 folder for VS2010 builds. 
tools folder will be nuked when we nuke VS2005.

* win/tools32: Copied from WebKitLibraries/win/tools.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't check for @media rules affected by viewport changes in every layout.
<http://webkit.org/b/115370>
<rdar://problem/13765739>

Reviewed by Antti Koivisto.

Move the logic that checks if any @media rules are affected by a change in the viewport
size to FrameView::setFrameRect(). This way it's no longer necessary to do the style
recalc synchronously, which allows us to coalesce multiple updates in some cases.

* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::layout):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149313 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Begin cleaning up StorageTracker
https://bugs.webkit.org/show_bug.cgi?id=115373

Reviewed by Andreas Kling.

Rename Mutexes to use "Mutex" and not "Guard".
Don't use static locals for ".localstorage" and "*.localstorage" strings.
Put end iterator declarations together with begin declarations.

* storage/StorageTracker.cpp:
(WebCore::StorageTracker::setDatabaseDirectoryPath):
(WebCore::StorageTracker::trackerDatabasePath):
(WebCore::StorageTracker::openTrackerDatabase):
(WebCore::StorageTracker::finishedImportingOriginIdentifiers):
(WebCore::StorageTracker::syncImportOriginIdentifiers):
(WebCore::StorageTracker::syncFileSystemAndTrackerDatabase):
(WebCore::StorageTracker::setOriginDetails):
(WebCore::StorageTracker::syncSetOriginDetails):
(WebCore::StorageTracker::origins):
(WebCore::StorageTracker::deleteAllOrigins):
(WebCore::StorageTracker::syncDeleteAllOrigins):
(WebCore::StorageTracker::deleteOrigin):
(WebCore::StorageTracker::syncDeleteOrigin):
(WebCore::StorageTracker::willDeleteAllOrigins):
(WebCore::StorageTracker::willDeleteOrigin):
(WebCore::StorageTracker::canDeleteOrigin):
(WebCore::StorageTracker::cancelDeletingOrigin):
(WebCore::StorageTracker::setClient):
(WebCore::StorageTracker::databasePathForOrigin):
(WebCore::StorageTracker::diskUsageForOrigin):
* storage/StorageTracker.h:
(StorageTracker):

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