IndexedDB: Check SSV version when opening database
https://bugs.webkit.org/show_bug.cgi?id=102243

Reviewed by Tony Chang.

Ensure that the data format (SerializedScriptValue) isn't "from the future" when opening
a backing store. Treat an unknown version the same as an unknown schema version.

Chromium-side test at https://codereview.chromium.org/11470013/ (same as other schema version tests)

* Modules/indexeddb/IDBBackingStore.cpp:
(WebCore):
(WebCore::isSchemaKnown): Check data version as well.
(WebCore::setUpMetadata): Ensure data version is recorded; bump schema version.
* Modules/indexeddb/IDBLevelDBCoding.cpp: Encoding for "DataVersion" global metadata entry.
(IDBLevelDBCoding):
(WebCore::IDBLevelDBCoding::compare):
(WebCore::IDBLevelDBCoding::DataVersionKey::encode):
* Modules/indexeddb/IDBLevelDBCoding.h:
(DataVersionKey):
(IDBLevelDBCoding):
* bindings/js/SerializedScriptValue.cpp:
(SerializedScriptValue::wireFormatVersion): New method (JSC side).
* bindings/js/SerializedScriptValue.h:
* bindings/v8/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::wireFormatVersion): New method (V8 side).
(WebCore):
* bindings/v8/SerializedScriptValue.h:
(SerializedScriptValue):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Provide the backend for exposing the layer tree to the Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=103513

Patch by Antoine Quint <graouts@apple.com> on 2012-12-07
Reviewed by Pavel Feldman.

Source/WebCore:

The purpose of this patch is to provide a new agent enabling the Web Inspector to interface
with WebCore to access information about the render layer tree and, more specifically, expose
useful information about layers backed by textures composited on the GPU such as metrics and
backing store. Thus we now provide a LayerTreeAgent which will inform the front-end of
changes to the render layer tree via a new layerTreeDidChange event, providing an object
containing the entire hierarchy of RenderLayers for the inspected document. This hierarchy
can be queried at any time using the .getLayerTree() method on the LayerTreeAgent. Finally,
the LayerTreeAgent also exposes a .nodeIdForLayerId() method allowing to get the id of the
node associated with the RenderLayer with the provided layer id.

In terms of implementation, RenderLayerCompositor has been changed such that in its
updateCompositingLayers() method we call the layerTreeDidChange method on the
InspectorLayerTreeAgent instance via the InspectorInstrumentation.

Test: inspector-protocol/layer-tree.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* inspector/Inspector.json: Define new types IntRect (x, y, width, height) and Layer, which
holds the information for a RenderLayer (layerId, bounds, isComposited, memory,
compositedBounds) and its children (childLayers). We also define the methods of the
LayerTreeAgent object (enable, disable, getLayerTree, nodeIdForLayerId) and the
layerTreeDidChange event it
fires.
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::pushNodePathForRenderLayerToFrontend): New method facilitating
pushing the node associated with a given RenderLayer to the front-end.
(WebCore):
* inspector/InspectorDOMAgent.h:
(InspectorDOMAgent):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::layerTreeDidChangeImpl):
(WebCore::InspectorInstrumentation::renderLayerDestroyedImpl):
* inspector/InspectorInstrumentation.h:
(WebCore):
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::layerTreeDidChange):
(WebCore::InspectorInstrumentation::renderLayerDestroyed):
* inspector/InspectorLayerTreeAgent.cpp: Added.
(WebCore):
(LayerTreeAgentState):
(WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
(WebCore::InspectorLayerTreeAgent::~InspectorLayerTreeAgent):
(WebCore::InspectorLayerTreeAgent::setFrontend):
(WebCore::InspectorLayerTreeAgent::clearFrontend):
(WebCore::InspectorLayerTreeAgent::restore):
(WebCore::InspectorLayerTreeAgent::reset):
(WebCore::InspectorLayerTreeAgent::enable):
(WebCore::InspectorLayerTreeAgent::disable):
(WebCore::InspectorLayerTreeAgent::layerTreeDidChange):
(WebCore::InspectorLayerTreeAgent::renderLayerDestroyed):
(WebCore::InspectorLayerTreeAgent::getLayerTree):
(WebCore::InspectorLayerTreeAgent::buildObjectForRootLayer):
(WebCore::InspectorLayerTreeAgent::buildObjectForLayer): Build the entire hierarchy of
RenderLayers from the provided RenderLayer.
(WebCore::InspectorLayerTreeAgent::buildObjectForIntRect):
(WebCore::InspectorLayerTreeAgent::bind):
(WebCore::InspectorLayerTreeAgent::unbind):
(WebCore::InspectorLayerTreeAgent::nodeIdForLayerId):
* inspector/InspectorLayerTreeAgent.h: Added.
(WebCore):
(InspectorLayerTreeAgent):
(WebCore::InspectorLayerTreeAgent::create):
* inspector/InstrumentingAgents.h:
(WebCore):
(WebCore::InstrumentingAgents::InstrumentingAgents):
(InstrumentingAgents):
(WebCore::InstrumentingAgents::inspectorLayerTreeAgent):
(WebCore::InstrumentingAgents::setInspectorLayerTreeAgent):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers): Call the layerTreeDidChange method
on the LayerTreeAgent via the InspectorInstrumentation to inform the front-end that the
RenderLayer hierarchy has changed.
(WebCore):
(WebCore::RenderLayerCompositor::layerBecameNonComposited): Call the renderLayerDestroyed
method on the LayerTreeAgent via the InspectorInstrumentation to unbind the layer that is
being destroyed.
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor):

LayoutTests:

Adding a LayoutTest that exercises the various APIs and event exposed by the LayerTreeAgent.
This test is skipped on EFL where ACCELERATED_COMPOSITING is not available.

* inspector-protocol/layer-tree-expected.txt: Added.
* inspector-protocol/layer-tree.html: Added.
* platform/efl/TestExpectations:

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