Invalid Content Security Policy sources should generate console warnings.
https://bugs.webkit.org/show_bug.cgi?id=93599

Patch by Mike West <mkwst@chromium.org> on 2012-08-09
Reviewed by Adam Barth.

Source/WebCore:

Given a Content Security Policy directive, we're currently correctly
ignoring sources that we can't parse: "'slef'", "http:///", etc. have
no effect on the protected resource's active policy. We're not, however
telling the developer what we're doing, which can lead to confusion.
This patch adds a console warning whenever an invalid source expression
is encountered while parsing a directive in order to make WebKit's
behavior more transparent to the developer.

There should be no functional change as a result of this patch: the
policy should be parsed exactly as before, it should simply be more
verbose.

Test: http/tests/security/contentSecurityPolicy/source-list-parsing-07.html

* page/ContentSecurityPolicy.cpp:
(WebCore::CSPSourceList::parse):
    Two changes: First, if 'parseSource' returns false, then log a
    warning to the developer's console. Second, if both the source and
    host are empty, but parsing succeeded, then we know we're dealing
    with either a wildcard- or keyword-source that was properly handled
    inside 'parseSource', so jump to the next source.
(WebCore::CSPSourceList::parseSource):
    Wildcard- and keyword-sources now return 'true'. They parsed
    correctly, after all.
(WebCore::ContentSecurityPolicy::reportInvalidSourceExpression):
    Log a console warning if an invalid source expression is present in
    a CSP directive's value.
(WebCore):
* page/ContentSecurityPolicy.h:

LayoutTests:

* http/tests/security/contentSecurityPolicy/source-list-parsing-02-expected.txt:
* http/tests/security/contentSecurityPolicy/source-list-parsing-02.html:
    Move two invalid source tests out into 07.
* http/tests/security/contentSecurityPolicy/source-list-parsing-07-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/source-list-parsing-07.html: Added.
    Many invalid source tests, all of which should generate warnings.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, typo fix.

* platform/qt-5.0-wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Unskip tests requiring layoutTestController.dumpResourceResponseMIMETypes
https://bugs.webkit.org/show_bug.cgi?id=93638

Unreviewed. Unskip tests requiring layoutTestController.dumpResourceResponseMIMETypes.

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-08-09

* platform/wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Rename V8BindingPerIsolateData to V8PerIsolateData
https://bugs.webkit.org/show_bug.cgi?id=93592

Reviewed by Adam Barth.

For a better name. See discussion in bug 93333.

No tests. No change in behavior.

Source/WebCore:

* UseV8.cmake:
* WebCore.gypi:
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateImplementation):
* bindings/scripts/test/V8/V8Float64Array.cpp:
(WebCore::V8Float64Array::GetRawTemplate):
(WebCore::V8Float64Array::GetTemplate):
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore::V8TestActiveDOMObject::GetRawTemplate):
(WebCore::V8TestActiveDOMObject::GetTemplate):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
(WebCore::V8TestCustomNamedGetter::GetRawTemplate):
(WebCore::V8TestCustomNamedGetter::GetTemplate):
* bindings/scripts/test/V8/V8TestEventConstructor.cpp:
(WebCore::V8TestEventConstructor::GetRawTemplate):
(WebCore::V8TestEventConstructor::GetTemplate):
* bindings/scripts/test/V8/V8TestEventTarget.cpp:
(WebCore::V8TestEventTarget::GetRawTemplate):
(WebCore::V8TestEventTarget::GetTemplate):
* bindings/scripts/test/V8/V8TestException.cpp:
(WebCore::V8TestException::GetRawTemplate):
(WebCore::V8TestException::GetTemplate):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore::V8TestInterface::GetRawTemplate):
(WebCore::V8TestInterface::GetTemplate):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
(WebCore::V8TestMediaQueryListListener::GetRawTemplate):
(WebCore::V8TestMediaQueryListListener::GetTemplate):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore::V8TestNamedConstructor::GetRawTemplate):
(WebCore::V8TestNamedConstructor::GetTemplate):
* bindings/scripts/test/V8/V8TestNode.cpp:
(WebCore::V8TestNode::GetRawTemplate):
(WebCore::V8TestNode::GetTemplate):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::V8TestObj::GetRawTemplate):
(WebCore::V8TestObj::GetTemplate):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
(WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate):
(WebCore::V8TestSerializedScriptValueInterface::GetTemplate):
* bindings/v8/DOMData.cpp:
(WebCore::DOMData::getCurrentStore):
* bindings/v8/DOMDataStore.cpp:
(WebCore::DOMDataStore::allStores):
* bindings/v8/ScriptGCEvent.cpp:
(WebCore::isolateGCEventData):
* bindings/v8/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::visitExternalStrings):
(WebCore::ScriptProfiler::collectBindingMemoryInfo):
* bindings/v8/StaticDOMDataStore.cpp:
(WebCore::StaticDOMDataStore::StaticDOMDataStore):
(WebCore::StaticDOMDataStore::~StaticDOMDataStore):
* bindings/v8/V8Binding.cpp:
(WebCore::V8PerIsolateData::visitExternalStrings):
(WebCore::getToStringName):
(WebCore::getToStringTemplate):
* bindings/v8/V8Binding.h:
(WebCore::ConstructorMode::ConstructorMode):
(WebCore::ConstructorMode::~ConstructorMode):
(WebCore::ConstructorMode::current):
(WebCore::v8ExternalString):
(WebCore::v8Integer):
(WebCore::v8UnsignedInteger):
* bindings/v8/V8DOMMap.cpp:
(WebCore::DOMDataStoreHandle::DOMDataStoreHandle):
(WebCore::DOMDataStoreHandle::~DOMDataStoreHandle):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::initContextIfNeeded):
* bindings/v8/V8GCController.cpp:
(WebCore::currentGlobalHandleMap):
(WebCore::V8GCController::gcPrologue):
* bindings/v8/V8HiddenPropertyName.cpp:
(WebCore):
* bindings/v8/V8LazyEventListener.cpp:
(WebCore::V8LazyEventListener::prepareListenerObject):
* bindings/v8/V8PerIsolateData.cpp: Renamed from Source/WebCore/bindings/v8/V8BindingPerIsolateData.cpp.
(WebCore):
(WebCore::V8PerIsolateData::V8PerIsolateData):
(WebCore::V8PerIsolateData::~V8PerIsolateData):
(WebCore::V8PerIsolateData::create):
(WebCore::V8PerIsolateData::ensureInitialized):
(WebCore::V8PerIsolateData::dispose):
(WebCore::V8PerIsolateData::reportMemoryUsage):
* bindings/v8/V8PerIsolateData.h: Renamed from Source/WebCore/bindings/v8/V8BindingPerIsolateData.h.
(WebCore):
(V8PerIsolateData):
(WebCore::V8PerIsolateData::current):
(WebCore::V8PerIsolateData::rawTemplateMap):
(WebCore::V8PerIsolateData::templateMap):
(WebCore::V8PerIsolateData::toStringName):
(WebCore::V8PerIsolateData::toStringTemplate):
(WebCore::V8PerIsolateData::lazyEventListenerToStringTemplate):
(WebCore::V8PerIsolateData::stringCache):
(WebCore::V8PerIsolateData::integerCache):
(WebCore::V8PerIsolateData::allStores):
(WebCore::V8PerIsolateData::hiddenPropertyName):
(WebCore::V8PerIsolateData::auxiliaryContext):
(WebCore::V8PerIsolateData::registerDOMDataStore):
(WebCore::V8PerIsolateData::unregisterDOMDataStore):
(WebCore::V8PerIsolateData::domDataStore):
(WebCore::V8PerIsolateData::setDOMDataStore):
(WebCore::V8PerIsolateData::recursionLevel):
(WebCore::V8PerIsolateData::incrementRecursionLevel):
(WebCore::V8PerIsolateData::decrementRecursionLevel):
(WebCore::V8PerIsolateData::globalHandleMap):
(WebCore::V8PerIsolateData::internalScriptRecursionLevel):
(WebCore::V8PerIsolateData::incrementInternalScriptRecursionLevel):
(WebCore::V8PerIsolateData::decrementInternalScriptRecursionLevel):
(WebCore::V8PerIsolateData::gcEventData):
(WebCore::V8PerIsolateData::setShouldCollectGarbageSoon):
(WebCore::V8PerIsolateData::clearShouldCollectGarbageSoon):
(WebCore::V8PerIsolateData::shouldCollectGarbageSoon):
* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::hintForGCIfNecessary):
* bindings/v8/V8RecursionScope.h:
(WebCore::V8RecursionScope::V8RecursionScope):
(WebCore::V8RecursionScope::~V8RecursionScope):
(WebCore::V8RecursionScope::recursionLevel):
(WebCore::V8RecursionScope::properlyUsed):
(WebCore::V8RecursionScope::MicrotaskSuppression::MicrotaskSuppression):
(WebCore::V8RecursionScope::MicrotaskSuppression::~MicrotaskSuppression):
* bindings/v8/V8Utilities.cpp:
(WebCore::V8AuxiliaryContext::auxiliaryContext):
* bindings/v8/V8ValueCache.cpp:
(WebCore::cachedStringCallback):
* bindings/v8/WorkerContextExecutionProxy.cpp:
(WebCore::WorkerContextExecutionProxy::initIsolate):
* bindings/v8/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::WorkerScriptController):
(WebCore::WorkerScriptController::~WorkerScriptController):
* bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
(WebCore::V8HTMLCanvasElement::getContextCallback):

Source/WebKit/chromium:

* src/WebKit.cpp:
(WebKit::initialize):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Remove V8Proxy::throwError(ExceptionCode&)
https://bugs.webkit.org/show_bug.cgi?id=93605

Reviewed by Adam Barth.

(1) Pass Isolate around to V8Utilities::extractTransferables().
(2) Replace throwError(ExceptionCode&) in V8Utilities::extractTransferables()
with setDOMException(ExceptionCode&, Isolate*), which completely removes
V8Proxy::throwError(ExceptionCode&) from the code base.
(3) Remove V8Proxy::throwError(ExceptionCode&).

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateParametersCheck):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
(WebCore::TestSerializedScriptValueInterfaceV8Internal::acceptTransferListCallback):
(WebCore::TestSerializedScriptValueInterfaceV8Internal::multiTransferListCallback):
(WebCore::V8TestSerializedScriptValueInterface::constructorCallback):
* bindings/v8/Dictionary.cpp:
(WebCore::Dictionary::get):
* bindings/v8/V8Proxy.h:
(WebCore):
* bindings/v8/V8Utilities.cpp:
(WebCore::extractTransferables):
(WebCore::getMessagePortArray):
* bindings/v8/V8Utilities.h:
(WebCore):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::handlePostMessageCallback):
* bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
(WebCore::handlePostMessageCallback):
* bindings/v8/custom/V8IntentConstructor.cpp:
(WebCore::V8Intent::constructorCallback):
* bindings/v8/custom/V8MessageEventCustom.cpp:
(WebCore::V8MessageEvent::initMessageEventCallback):
* bindings/v8/custom/V8MessagePortCustom.cpp:
(WebCore::handlePostMessageCallback):
* bindings/v8/custom/V8WorkerCustom.cpp:
(WebCore::handlePostMessageCallback):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r125212.
http://trac.webkit.org/changeset/125212
https://bugs.webkit.org/show_bug.cgi?id=92890

Compile failure on mac dbg builder

Source/Platform:

* Platform.gypi:
* chromium/public/WebCompositorOutputSurface.h: Removed.
* chromium/public/WebCompositorOutputSurfaceClient.h: Removed.
* chromium/public/WebLayerTreeView.h:
(WebKit::WebLayerTreeView::Settings::Settings):
(Settings):
* chromium/public/WebLayerTreeViewClient.h:
(WebKit):
(WebLayerTreeViewClient):

Source/WebCore:

* platform/graphics/chromium/cc/CCGraphicsContext.h:
(WebCore):
(CCGraphicsContext):
(WebCore::CCGraphicsContext::create2D):
(WebCore::CCGraphicsContext::create3D):
(WebCore::CCGraphicsContext::context3D):
(WebCore::CCGraphicsContext::CCGraphicsContext):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::initializeLayerRenderer):
(WebCore::CCLayerTreeHost::recreateContext):
(WebCore::CCLayerTreeHost::createContext):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore):
(CCLayerTreeHostClient):
(WebCore::CCLayerTreeSettings::CCLayerTreeSettings):
(CCLayerTreeSettings):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImplClient):
* platform/graphics/chromium/cc/CCProxy.h:
(WebCore):
* platform/graphics/chromium/cc/CCRenderer.h:
(CCRendererClient):
* platform/graphics/chromium/cc/CCResourceProvider.cpp:
* platform/graphics/chromium/cc/CCResourceProvider.h:
(WebCore):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::recreateContext):
(WebCore::CCThreadProxy::beginFrame):
* platform/graphics/chromium/cc/CCThreadProxy.h:

Source/WebKit/chromium:

* WebKit.gyp:
* WebKit.gypi:
* public/WebSettings.h:
* public/WebViewClient.h:
(WebKit):
(WebViewClient):
* src/WebLayerTreeView.cpp:
(WebKit::WebLayerTreeView::Settings::operator CCLayerTreeSettings):
* src/WebLayerTreeViewImpl.cpp:
(WebKit::WebLayerTreeViewClientAdapter::WebLayerTreeViewClientAdapter):
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::WebSettingsImpl):
(WebKit::WebSettingsImpl::setForceSoftwareCompositing):
(WebKit):
* src/WebSettingsImpl.h:
(WebKit::WebSettingsImpl::forceSoftwareCompositing):
(WebSettingsImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
(WebKit::WebViewImpl::createCompositorGraphicsContext3D):
(WebKit::WebViewImpl::createContext3D):
(WebKit::WebViewImpl::didRebindGraphicsContext):
* src/WebViewImpl.h:
(WebViewImpl):
* tests/CCLayerTreeHostImplTest.cpp:
* tests/CCLayerTreeHostTest.cpp:
(WTF):
(WTF::CCLayerTreeHostTestSetSingleLostContext::didRecreateContext):
(WTF::CCLayerTreeHostTestSetRepeatedLostContext::didRecreateContext):
* tests/CCResourceProviderTest.cpp:
(WebKit::CCResourceProviderTest::CCResourceProviderTest):
* tests/CCTextureUpdateControllerTest.cpp:
* tests/CCThreadedTest.cpp:
(WebKitTests::TestHooks::createContext):
* tests/CCThreadedTest.h:
(WebKitTests::TestHooks::didRecreateContext):
* tests/Canvas2DLayerBridgeTest.cpp:
(Canvas2DLayerBridgeTest::fullLifecycleTest):
* tests/FakeCCGraphicsContext.h:
(WebKit::createFakeCCGraphicsContext):
* tests/FakeCCLayerTreeHostClient.h:
* tests/FakeWebCompositorOutputSurface.h: Removed.
* tests/LayerRendererChromiumTest.cpp:
(LayerRendererChromiumTest::LayerRendererChromiumTest):
(TEST):
* tests/WebLayerTest.cpp:
* tests/WebLayerTreeViewTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Expose CCGraphicsContext as WebCompositorOutputSurface
https://bugs.webkit.org/show_bug.cgi?id=92890

Reviewed by James Robinson.

Source/Platform:

The CCGraphicsContext was introduced as a wrapper around the 2D
and 3D output for the compositor. However, it is a CC only
concept. We want to be able to make 2D and ubercomp-mode IPCs on
behalf of the compositor. This patch allows this by pushing this
abstraction out to the Chrome-visible layer of the compositor,
changing the name to OutputSurface based on discussions on
wkb.ug/90736. A future patch will rename the CCGraphicsContext to
CCOutputSurface.

* Platform.gypi:
* chromium/public/WebCompositorOutputSurface.h: Added.
(WebKit):
(WebCompositorOutputSurface):
(WebKit::WebCompositorOutputSurface::~WebCompositorOutputSurface):
(WebKit::WebCompositorOutputSurface::Capabilities::Capabilities):
(Capabilities):
* chromium/public/WebCompositorOutputSurfaceClient.h: Added.
(WebKit):
(WebCompositorOutputSurfaceClient):
(WebKit::WebCompositorOutputSurfaceClient::~WebCompositorOutputSurfaceClient):
* chromium/public/WebLayerTreeView.h:
(WebKit::WebLayerTreeView::Settings::Settings):
(Settings):
* chromium/public/WebLayerTreeViewClient.h:
(WebKit):
(WebLayerTreeViewClient):
(WebKit::WebLayerTreeViewClient::createContext3D):
(WebKit::WebLayerTreeViewClient::createOutputSurface):

Source/WebCore:

* platform/graphics/chromium/cc/CCGraphicsContext.h:
(WebCore):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::initializeLayerRenderer):
(WebCore::CCLayerTreeHost::recreateContext):
(WebCore::CCLayerTreeHost::createContext):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore):
(CCLayerTreeHostClient):
(WebCore::CCLayerTreeSettings::CCLayerTreeSettings):
(CCLayerTreeSettings):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::onVSyncParametersChanged):
(WebCore):
(WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImplClient):
* platform/graphics/chromium/cc/CCProxy.h:
(WebKit):
(WebCore):
* platform/graphics/chromium/cc/CCRenderer.h:
(CCRendererClient):
(WebCore::CCRendererClient::~CCRendererClient):
* platform/graphics/chromium/cc/CCResourceProvider.cpp:
* platform/graphics/chromium/cc/CCResourceProvider.h:
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::recreateContext):
(WebCore::CCThreadProxy::onVSyncParametersChanged):
(WebCore):
(WebCore::CCThreadProxy::beginFrame):
* platform/graphics/chromium/cc/CCThreadProxy.h:

Source/WebKit/chromium:

* WebKit.gyp:
* WebKit.gypi:
* public/WebSettings.h:
* public/WebViewClient.h:
(WebKit):
(WebViewClient):
(WebKit::WebViewClient::createOutputSurface):
* src/WebLayerTreeView.cpp:
(WebKit::WebLayerTreeView::Settings::operator CCLayerTreeSettings):
* src/WebLayerTreeViewImpl.cpp:
(WebKit):
(WebGraphicsContextToOutputSurfaceAdapter):
(WebKit::WebGraphicsContextToOutputSurfaceAdapter::WebGraphicsContextToOutputSurfaceAdapter):
(WebKit::WebLayerTreeViewClientAdapter::WebLayerTreeViewClientAdapter):
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::WebSettingsImpl):
* src/WebSettingsImpl.h:
(WebSettingsImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
(WebKit::WebViewImpl::createOutputSurface):
(WebKit):
(WebKit::WebViewImpl::didRebindGraphicsContext):
(WebKit::WebViewImpl::didRecreateOutputSurface):
* src/WebViewImpl.h:
(WebViewImpl):
* tests/CCLayerTreeHostImplTest.cpp:
* tests/CCLayerTreeHostTest.cpp:
(WTF):
(WTF::CCLayerTreeHostTestSetSingleLostContext::didRecreateOutputSurface):
(WTF::CCLayerTreeHostTestSetRepeatedLostContext::didRecreateOutputSurface):
* tests/CCResourceProviderTest.cpp:
(WebKit::CCResourceProviderTest::CCResourceProviderTest):
* tests/CCTextureUpdateControllerTest.cpp:
* tests/CCThreadedTest.cpp:
(WebKitTests::TestHooks::createOutputSurface):
* tests/CCThreadedTest.h:
(WebKitTests::TestHooks::didRecreateOutputSurface):
* tests/Canvas2DLayerBridgeTest.cpp:
(Canvas2DLayerBridgeTest::fullLifecycleTest):
* tests/FakeCCGraphicsContext.h:
(WebKit::createFakeCCGraphicsContext):
* tests/FakeCCLayerTreeHostClient.h:
* tests/FakeWebCompositorOutputSurface.h: Copied from Source/WebCore/platform/graphics/chromium/cc/CCGraphicsContext.h.
(WebKit):
(FakeWebCompositorOutputSurface):
(WebKit::FakeWebCompositorOutputSurface::create):
(WebKit::FakeWebCompositorOutputSurface::FakeWebCompositorOutputSurface):
* tests/LayerRendererChromiumTest.cpp:
(LayerRendererChromiumTest::LayerRendererChromiumTest):
(TEST):
* tests/WebLayerTest.cpp:
* tests/WebLayerTreeViewTest.cpp:

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