summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-22 15:40:17 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-22 15:40:17 +0200
commit43a42f108af6bcbd91f2672731c3047c26213af1 (patch)
tree7fa092e5f5d873c72f2486a70e26be26f7a38bec
parentd9cf437c840c6eb7417bdd97e6c40979255d3158 (diff)
downloadqtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
-rw-r--r--ChangeLog58
-rw-r--r--Source/JavaScriptCore/API/JSStringRef.cpp6
-rw-r--r--Source/JavaScriptCore/API/JSStringRefCF.cpp2
-rw-r--r--Source/JavaScriptCore/API/OpaqueJSString.h12
-rw-r--r--Source/JavaScriptCore/CMakeLists.txt24
-rw-r--r--Source/JavaScriptCore/ChangeLog859
-rw-r--r--Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig5
-rw-r--r--Source/JavaScriptCore/GNUmakefile.list.am3
-rwxr-xr-xSource/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def4
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj15
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssembler.h26
-rw-r--r--Source/JavaScriptCore/bytecode/ArrayProfile.cpp36
-rw-r--r--Source/JavaScriptCore/bytecode/ArrayProfile.h33
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.cpp248
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.h59
-rw-r--r--Source/JavaScriptCore/bytecode/DFGExitProfile.h1
-rw-r--r--Source/JavaScriptCore/bytecode/Opcode.h36
-rw-r--r--Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp44
-rw-r--r--Source/JavaScriptCore/bytecode/ResolveGlobalStatus.h3
-rw-r--r--Source/JavaScriptCore/bytecode/StructureSet.h11
-rw-r--r--Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp358
-rw-r--r--Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h226
-rw-r--r--Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp81
-rw-r--r--Source/JavaScriptCore/dfg/DFGAbstractState.cpp16
-rw-r--r--Source/JavaScriptCore/dfg/DFGAbstractValue.h161
-rw-r--r--Source/JavaScriptCore/dfg/DFGArrayMode.cpp20
-rw-r--r--Source/JavaScriptCore/dfg/DFGArrayMode.h45
-rw-r--r--Source/JavaScriptCore/dfg/DFGAssemblyHelpers.cpp12
-rw-r--r--Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h37
-rw-r--r--Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp488
-rw-r--r--Source/JavaScriptCore/dfg/DFGCCallHelpers.h14
-rw-r--r--Source/JavaScriptCore/dfg/DFGCapabilities.h89
-rw-r--r--Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp3
-rw-r--r--Source/JavaScriptCore/dfg/DFGGraph.h19
-rw-r--r--Source/JavaScriptCore/dfg/DFGNode.h9
-rw-r--r--Source/JavaScriptCore/dfg/DFGNodeType.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGOSRExit.cpp2
-rw-r--r--Source/JavaScriptCore/dfg/DFGOSRExit.h4
-rw-r--r--Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp9
-rw-r--r--Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp105
-rw-r--r--Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp153
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.cpp21
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.h14
-rw-r--r--Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp31
-rw-r--r--Source/JavaScriptCore/dfg/DFGRepatch.cpp24
-rw-r--r--Source/JavaScriptCore/dfg/DFGScratchRegisterAllocator.h22
-rw-r--r--Source/JavaScriptCore/dfg/DFGSilentRegisterSavePlan.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp95
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h105
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp33
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp439
-rw-r--r--Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp2
-rw-r--r--Source/JavaScriptCore/dfg/DFGThunks.cpp30
-rw-r--r--Source/JavaScriptCore/heap/CopiedSpace.cpp49
-rw-r--r--Source/JavaScriptCore/heap/CopiedSpaceInlineMethods.h1
-rw-r--r--Source/JavaScriptCore/heap/CopyVisitorInlineMethods.h4
-rw-r--r--Source/JavaScriptCore/heap/GCThread.cpp10
-rw-r--r--Source/JavaScriptCore/heap/GCThreadSharedData.cpp57
-rw-r--r--Source/JavaScriptCore/heap/GCThreadSharedData.h5
-rw-r--r--Source/JavaScriptCore/heap/Heap.cpp7
-rw-r--r--Source/JavaScriptCore/heap/SlotVisitor.cpp10
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.cpp26
-rw-r--r--Source/JavaScriptCore/jit/JIT.cpp55
-rw-r--r--Source/JavaScriptCore/jit/JIT.h38
-rw-r--r--Source/JavaScriptCore/jit/JITArithmetic.cpp84
-rw-r--r--Source/JavaScriptCore/jit/JITCall.cpp22
-rw-r--r--Source/JavaScriptCore/jit/JITInlineMethods.h195
-rw-r--r--Source/JavaScriptCore/jit/JITOpcodes.cpp650
-rw-r--r--Source/JavaScriptCore/jit/JITOpcodes32_64.cpp143
-rw-r--r--Source/JavaScriptCore/jit/JITPropertyAccess.cpp127
-rw-r--r--Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp75
-rw-r--r--Source/JavaScriptCore/jit/JITStubCall.h32
-rw-r--r--Source/JavaScriptCore/jit/JITStubs.cpp53
-rw-r--r--Source/JavaScriptCore/jit/JITStubs.h9
-rw-r--r--Source/JavaScriptCore/jit/JSInterfaceJIT.h20
-rw-r--r--Source/JavaScriptCore/jit/SpecializedThunkJIT.h8
-rw-r--r--Source/JavaScriptCore/llint/LLIntSlowPaths.cpp118
-rw-r--r--Source/JavaScriptCore/llint/LLIntSlowPaths.h7
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter.asm450
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm127
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter64.asm140
-rw-r--r--Source/JavaScriptCore/offlineasm/armv7.rb535
-rw-r--r--Source/JavaScriptCore/offlineasm/risc.rb555
-rw-r--r--Source/JavaScriptCore/parser/Lexer.cpp4
-rw-r--r--Source/JavaScriptCore/parser/Lexer.h29
-rw-r--r--Source/JavaScriptCore/parser/Parser.h2
-rw-r--r--Source/JavaScriptCore/runtime/JSScope.cpp597
-rw-r--r--Source/JavaScriptCore/runtime/JSScope.h36
-rw-r--r--Source/JavaScriptCore/runtime/JSValue.cpp2
-rw-r--r--Source/JavaScriptCore/runtime/JSValue.h8
-rw-r--r--Source/JavaScriptCore/runtime/JSValueInlineMethods.h33
-rw-r--r--Source/JavaScriptCore/runtime/JSVariableObject.cpp2
-rw-r--r--Source/JavaScriptCore/runtime/JSVariableObject.h2
-rw-r--r--Source/JavaScriptCore/runtime/RegExpKey.h19
-rw-r--r--Source/JavaScriptCore/runtime/StringRecursionChecker.h3
-rw-r--r--Source/JavaScriptCore/runtime/Structure.h2
-rw-r--r--Source/Platform/ChangeLog67
-rw-r--r--Source/Platform/chromium/public/WebLocalizedString.h3
-rw-r--r--Source/Platform/chromium/public/WebMediaStreamCenter.h4
-rw-r--r--Source/Platform/chromium/public/WebMediaStreamDescriptor.h3
-rw-r--r--Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj8
-rw-r--r--Source/ThirdParty/ANGLE/ChangeLog56
-rw-r--r--Source/ThirdParty/ANGLE/Target.pri2
-rw-r--r--Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h8
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.cpp88
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.h57
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp12
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp31
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ShHandle.h3
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp3
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp3
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp2
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/intermediate.h6
-rw-r--r--Source/WTF/ChangeLog180
-rw-r--r--Source/WTF/Configurations/CopyWTFHeaders.xcconfig26
-rw-r--r--Source/WTF/Configurations/WTF.xcconfig2
-rw-r--r--Source/WTF/GNUmakefile.list.am1
-rw-r--r--Source/WTF/WTF.xcodeproj/project.pbxproj95
-rw-r--r--Source/WTF/wtf/Deque.h99
-rw-r--r--Source/WTF/wtf/MemoryInstrumentation.h45
-rw-r--r--Source/WTF/wtf/StackBounds.h21
-rw-r--r--Source/WTF/wtf/StackStats.cpp309
-rw-r--r--Source/WTF/wtf/StackStats.h151
-rw-r--r--Source/WTF/wtf/ThreadingPthreads.cpp2
-rw-r--r--Source/WTF/wtf/WTFThreadData.cpp3
-rw-r--r--Source/WTF/wtf/WTFThreadData.h11
-rw-r--r--Source/WTF/wtf/unicode/UTF8.cpp20
-rw-r--r--Source/WTF/wtf/unicode/UTF8.h2
-rw-r--r--Source/WebCore/CMakeLists.txt7
-rw-r--r--Source/WebCore/ChangeLog3042
-rw-r--r--Source/WebCore/Configurations/FeatureDefines.xcconfig5
-rw-r--r--Source/WebCore/DerivedSources.make1
-rw-r--r--Source/WebCore/DerivedSources.pri1
-rw-r--r--Source/WebCore/English.lproj/localizedStrings.js148
-rw-r--r--Source/WebCore/GNUmakefile.am16
-rw-r--r--Source/WebCore/GNUmakefile.features.am7
-rw-r--r--Source/WebCore/GNUmakefile.list.am13
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBBackingStore.h7
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursor.h1
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h4
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp77
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h8
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp26
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp1
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h1
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBRequest.cpp3
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBRequest.h2
-rw-r--r--Source/WebCore/Modules/indexeddb/IDBTransaction.h4
-rw-r--r--Source/WebCore/Modules/mediastream/MediaStream.cpp4
-rw-r--r--Source/WebCore/Modules/mediastream/MediaStream.h6
-rw-r--r--Source/WebCore/Modules/mediastream/PeerConnection00.cpp4
-rw-r--r--Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp4
-rw-r--r--Source/WebCore/Modules/notifications/NotificationCenter.cpp5
-rw-r--r--Source/WebCore/Modules/notifications/NotificationCenter.h1
-rw-r--r--Source/WebCore/Resources/pagepopups/calendarPicker.css5
-rw-r--r--Source/WebCore/Resources/pagepopups/calendarPicker.js7
-rw-r--r--Source/WebCore/Target.pri4
-rw-r--r--[-rwxr-xr-x]Source/WebCore/UseV8.cmake0
-rw-r--r--Source/WebCore/WebCore.exp.in9
-rw-r--r--Source/WebCore/WebCore.gypi17
-rw-r--r--Source/WebCore/WebCore.order1
-rwxr-xr-xSource/WebCore/WebCore.vcproj/WebCore.vcproj8
-rw-r--r--Source/WebCore/WebCore.xcodeproj/project.pbxproj32
-rw-r--r--Source/WebCore/accessibility/AXObjectCache.cpp19
-rw-r--r--Source/WebCore/accessibility/AXObjectCache.h5
-rw-r--r--Source/WebCore/accessibility/AccessibilityARIAGrid.cpp6
-rw-r--r--Source/WebCore/accessibility/AccessibilityARIAGrid.h2
-rw-r--r--Source/WebCore/accessibility/AccessibilityImageMapLink.cpp15
-rw-r--r--Source/WebCore/accessibility/AccessibilityImageMapLink.h1
-rw-r--r--Source/WebCore/accessibility/AccessibilityMediaControls.cpp16
-rw-r--r--Source/WebCore/accessibility/AccessibilityMediaControls.h2
-rw-r--r--Source/WebCore/accessibility/AccessibilityNodeObject.cpp303
-rw-r--r--Source/WebCore/accessibility/AccessibilityNodeObject.h15
-rw-r--r--Source/WebCore/accessibility/AccessibilityObject.cpp13
-rw-r--r--Source/WebCore/accessibility/AccessibilityObject.h74
-rw-r--r--Source/WebCore/accessibility/AccessibilityRenderObject.cpp166
-rw-r--r--Source/WebCore/accessibility/AccessibilityRenderObject.h5
-rw-r--r--Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm116
-rw-r--r--Source/WebCore/bindings/ScriptControllerBase.cpp1
-rw-r--r--Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp4
-rw-r--r--Source/WebCore/bindings/gobject/DOMObjectCache.cpp11
-rw-r--r--Source/WebCore/bindings/gobject/GNUmakefile.am9
-rw-r--r--Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp4
-rw-r--r--[-rwxr-xr-x]Source/WebCore/bindings/js/PageScriptDebugServer.cpp0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/bindings/objc/DOMEvents.mm0
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm4
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorV8.pm41
-rw-r--r--Source/WebCore/bindings/scripts/IDLAttributes.txt4
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestException.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp9
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestNode.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp21
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestObj.h2
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp7
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h2
-rw-r--r--Source/WebCore/bindings/v8/IDBBindingUtilities.cpp3
-rw-r--r--[-rwxr-xr-x]Source/WebCore/bindings/v8/PageScriptDebugServer.cpp0
-rw-r--r--Source/WebCore/bindings/v8/V8DOMWindowShell.cpp5
-rw-r--r--Source/WebCore/bindings/v8/V8DOMWrapper.cpp10
-rw-r--r--Source/WebCore/bindings/v8/V8GCController.cpp128
-rw-r--r--Source/WebCore/bindings/v8/V8PerContextData.cpp8
-rw-r--r--Source/WebCore/bindings/v8/V8PerContextData.h12
-rw-r--r--Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp2
-rw-r--r--[-rwxr-xr-x]Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp0
-rw-r--r--Source/WebCore/bindings/v8/WrapperTypeInfo.h7
-rw-r--r--[-rwxr-xr-x]Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp0
-rw-r--r--Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp5
-rw-r--r--[-rwxr-xr-x]Source/WebCore/css/CSSCalculationValue.h0
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.cpp12
-rw-r--r--Source/WebCore/css/CSSGrammar.y.in94
-rw-r--r--Source/WebCore/css/CSSParser.cpp54
-rw-r--r--Source/WebCore/css/CSSParser.h7
-rw-r--r--Source/WebCore/css/CSSPrimitiveValueMappings.h4
-rw-r--r--Source/WebCore/css/CSSProperty.cpp8
-rw-r--r--Source/WebCore/css/CSSPropertyNames.in2
-rw-r--r--Source/WebCore/css/CSSValueKeywords.in2
-rw-r--r--Source/WebCore/css/SelectorChecker.cpp26
-rw-r--r--Source/WebCore/css/SelectorChecker.h18
-rw-r--r--Source/WebCore/css/StyleBuilder.cpp4
-rw-r--r--Source/WebCore/css/StyleInvalidationAnalysis.cpp136
-rw-r--r--Source/WebCore/css/StyleInvalidationAnalysis.h56
-rw-r--r--Source/WebCore/css/StyleResolver.cpp79
-rw-r--r--Source/WebCore/css/StyleResolver.h5
-rw-r--r--Source/WebCore/css/StyleSheetList.cpp4
-rw-r--r--Source/WebCore/css/StyleSheetList.idl5
-rw-r--r--Source/WebCore/dom/ContainerNode.cpp21
-rw-r--r--Source/WebCore/dom/ContainerNode.h12
-rw-r--r--Source/WebCore/dom/DOMImplementation.idl3
-rw-r--r--Source/WebCore/dom/Document.cpp6
-rw-r--r--Source/WebCore/dom/DocumentOrderedMap.cpp11
-rw-r--r--Source/WebCore/dom/DocumentOrderedMap.h2
-rw-r--r--Source/WebCore/dom/DocumentStyleSheetCollection.cpp90
-rw-r--r--Source/WebCore/dom/DocumentStyleSheetCollection.h10
-rw-r--r--Source/WebCore/dom/Element.cpp46
-rw-r--r--Source/WebCore/dom/Element.h1
-rw-r--r--Source/WebCore/dom/QualifiedName.cpp12
-rw-r--r--Source/WebCore/dom/QualifiedName.h15
-rw-r--r--Source/WebCore/dom/ShadowRoot.cpp2
-rw-r--r--Source/WebCore/dom/TreeScope.cpp33
-rw-r--r--Source/WebCore/dom/TreeScope.h10
-rw-r--r--[-rwxr-xr-x]Source/WebCore/dom/WheelEvent.cpp0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/dom/WheelEvent.h0
-rw-r--r--Source/WebCore/editing/ReplaceSelectionCommand.cpp7
-rw-r--r--Source/WebCore/html/BaseTextInputType.cpp5
-rw-r--r--Source/WebCore/html/BaseTextInputType.h1
-rw-r--r--Source/WebCore/html/DateTimeInputType.cpp8
-rw-r--r--Source/WebCore/html/DateTimeInputType.h1
-rw-r--r--Source/WebCore/html/EmailInputType.cpp5
-rw-r--r--Source/WebCore/html/EmailInputType.h1
-rw-r--r--Source/WebCore/html/HTMLAnchorElement.cpp7
-rw-r--r--Source/WebCore/html/HTMLInputElement.cpp20
-rw-r--r--Source/WebCore/html/HTMLInputElement.h3
-rw-r--r--Source/WebCore/html/HTMLInputElement.idl7
-rw-r--r--Source/WebCore/html/HTMLMediaElement.cpp29
-rw-r--r--Source/WebCore/html/HTMLPlugInImageElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLTextAreaElement.idl7
-rw-r--r--Source/WebCore/html/HTMLTextFormControlElement.cpp60
-rw-r--r--Source/WebCore/html/HTMLTextFormControlElement.h2
-rw-r--r--Source/WebCore/html/InputType.cpp5
-rw-r--r--Source/WebCore/html/InputType.h2
-rw-r--r--Source/WebCore/html/MonthInputType.cpp2
-rw-r--r--[-rwxr-xr-x]Source/WebCore/html/canvas/DataView.cpp0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/html/canvas/DataView.idl0
-rw-r--r--Source/WebCore/html/canvas/OESElementIndexUint.cpp55
-rw-r--r--Source/WebCore/html/canvas/OESElementIndexUint.h47
-rw-r--r--Source/WebCore/html/canvas/OESElementIndexUint.idl33
-rw-r--r--Source/WebCore/html/canvas/WebGLExtension.h1
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.cpp63
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.h8
-rw-r--r--Source/WebCore/html/shadow/ContentDistributor.cpp3
-rw-r--r--Source/WebCore/html/shadow/DateTimeEditElement.cpp19
-rw-r--r--Source/WebCore/html/shadow/DateTimeFieldElements.cpp44
-rw-r--r--Source/WebCore/html/shadow/DateTimeFieldElements.h15
-rw-r--r--Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h1
-rw-r--r--Source/WebCore/html/shadow/HTMLContentElement.h6
-rw-r--r--Source/WebCore/html/shadow/MediaControlElements.cpp11
-rw-r--r--Source/WebCore/html/shadow/MediaControlElements.h3
-rw-r--r--Source/WebCore/inspector/InspectorClient.h2
-rw-r--r--Source/WebCore/inspector/InspectorFrontendClient.h10
-rw-r--r--Source/WebCore/inspector/InspectorFrontendClientLocal.cpp21
-rw-r--r--Source/WebCore/inspector/InspectorFrontendClientLocal.h4
-rw-r--r--Source/WebCore/inspector/InspectorFrontendHost.cpp26
-rw-r--r--Source/WebCore/inspector/InspectorFrontendHost.h3
-rw-r--r--Source/WebCore/inspector/InspectorFrontendHost.idl3
-rw-r--r--Source/WebCore/inspector/InspectorMemoryAgent.cpp10
-rw-r--r--Source/WebCore/inspector/MemoryInstrumentationImpl.cpp12
-rw-r--r--Source/WebCore/inspector/MemoryInstrumentationImpl.h6
-rw-r--r--Source/WebCore/inspector/front-end/CSSCompletions.js7
-rw-r--r--Source/WebCore/inspector/front-end/CSSKeywordCompletions.js2
-rw-r--r--Source/WebCore/inspector/front-end/DockController.js69
-rw-r--r--Source/WebCore/inspector/front-end/FileManager.js16
-rw-r--r--Source/WebCore/inspector/front-end/FileUtils.js5
-rw-r--r--Source/WebCore/inspector/front-end/HandlerRegistry.js4
-rw-r--r--Source/WebCore/inspector/front-end/HeapSnapshotView.js2
-rw-r--r--Source/WebCore/inspector/front-end/InspectorFrontendAPI.js9
-rw-r--r--Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js54
-rw-r--r--Source/WebCore/inspector/front-end/ResourceScriptMapping.js1
-rw-r--r--Source/WebCore/inspector/front-end/SASSSourceMapping.js4
-rw-r--r--Source/WebCore/inspector/front-end/ScriptSnippetModel.js7
-rw-r--r--Source/WebCore/inspector/front-end/ScriptsNavigator.js4
-rw-r--r--Source/WebCore/inspector/front-end/ScriptsPanel.js2
-rw-r--r--Source/WebCore/inspector/front-end/SettingsScreen.js2
-rw-r--r--Source/WebCore/inspector/front-end/StylesSidebarPane.js6
-rw-r--r--Source/WebCore/inspector/front-end/StylesSourceMapping.js20
-rw-r--r--Source/WebCore/inspector/front-end/UISourceCode.js4
-rw-r--r--Source/WebCore/inspector/front-end/Workspace.js1
-rw-r--r--Source/WebCore/inspector/front-end/externs.js4
-rw-r--r--Source/WebCore/inspector/front-end/inspector.html1
-rw-r--r--Source/WebCore/loader/FrameLoader.cpp24
-rw-r--r--Source/WebCore/loader/HistoryController.cpp2
-rw-r--r--Source/WebCore/loader/SubresourceLoader.cpp36
-rw-r--r--[-rwxr-xr-x]Source/WebCore/loader/cache/CachedResource.cpp0
-rw-r--r--Source/WebCore/loader/cache/CachedResourceLoader.cpp2
-rw-r--r--Source/WebCore/page/DOMWindowPagePopup.cpp6
-rw-r--r--Source/WebCore/page/DOMWindowPagePopup.h1
-rw-r--r--Source/WebCore/page/DiagnosticLoggingKeys.cpp12
-rw-r--r--Source/WebCore/page/DiagnosticLoggingKeys.h4
-rw-r--r--Source/WebCore/page/Frame.cpp10
-rw-r--r--Source/WebCore/page/Frame.h5
-rw-r--r--Source/WebCore/page/FrameView.cpp10
-rw-r--r--Source/WebCore/page/Page.cpp31
-rw-r--r--Source/WebCore/page/Page.h11
-rw-r--r--Source/WebCore/page/PageGroup.cpp2
-rw-r--r--Source/WebCore/page/Performance.cpp25
-rw-r--r--Source/WebCore/page/Performance.h2
-rw-r--r--Source/WebCore/page/scrolling/ScrollingCoordinator.cpp11
-rw-r--r--Source/WebCore/page/scrolling/ScrollingCoordinator.h7
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateNode.h1
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp6
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h2
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateTree.cpp20
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateTree.h5
-rw-r--r--Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h2
-rw-r--r--Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm32
-rw-r--r--[-rwxr-xr-x]Source/WebCore/platform/CalculationValue.cpp0
-rw-r--r--Source/WebCore/platform/DateComponents.cpp4
-rw-r--r--Source/WebCore/platform/LinkHash.cpp12
-rw-r--r--Source/WebCore/platform/LinkHash.h3
-rw-r--r--Source/WebCore/platform/LocalizedStrings.cpp4
-rw-r--r--Source/WebCore/platform/LocalizedStrings.h7
-rw-r--r--[-rwxr-xr-x]Source/WebCore/platform/MIMETypeRegistry.cpp0
-rw-r--r--Source/WebCore/platform/Supplementable.h5
-rw-r--r--Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp51
-rw-r--r--Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp13
-rw-r--r--Source/WebCore/platform/chromium/LinkHashChromium.cpp5
-rw-r--r--Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp14
-rw-r--r--[-rwxr-xr-x]Source/WebCore/platform/chromium/support/WebThreadSafeData.cpp0
-rw-r--r--Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp41
-rw-r--r--Source/WebCore/platform/graphics/ANGLEWebKitBridge.h3
-rw-r--r--Source/WebCore/platform/graphics/Extensions3D.h1
-rw-r--r--Source/WebCore/platform/graphics/FloatRect.cpp10
-rw-r--r--Source/WebCore/platform/graphics/FloatRect.h1
-rw-r--r--Source/WebCore/platform/graphics/ImageSource.cpp6
-rw-r--r--Source/WebCore/platform/graphics/ImageSource.h18
-rw-r--r--Source/WebCore/platform/graphics/TiledBacking.h4
-rw-r--r--Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp202
-rw-r--r--Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h12
-rw-r--r--Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm3
-rw-r--r--Source/WebCore/platform/graphics/ca/mac/TileCache.h4
-rw-r--r--Source/WebCore/platform/graphics/ca/mac/TileCache.mm6
-rw-r--r--Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.cpp154
-rw-r--r--Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.h75
-rw-r--r--Source/WebCore/platform/graphics/chromium/ImageDecodingStore.cpp225
-rw-r--r--Source/WebCore/platform/graphics/chromium/ImageDecodingStore.h86
-rw-r--r--Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp68
-rw-r--r--Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.h67
-rw-r--r--Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp75
-rw-r--r--Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h65
-rw-r--r--Source/WebCore/platform/graphics/chromium/ScaledImageFragment.cpp54
-rw-r--r--Source/WebCore/platform/graphics/chromium/ScaledImageFragment.h67
-rw-r--r--Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp1
-rw-r--r--Source/WebCore/platform/graphics/filters/CustomFilterOperation.h2
-rw-r--r--Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp72
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp7
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h2
-rw-r--r--Source/WebCore/platform/graphics/mac/FontMac.mm3
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp4
-rw-r--r--Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp6
-rw-r--r--Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp10
-rw-r--r--Source/WebCore/platform/graphics/skia/PatternSkia.cpp1
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapper.h9
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp10
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h6
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp48
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperGL.h4
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp4
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h4
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp2
-rw-r--r--Source/WebCore/platform/image-decoders/ImageDecoder.h12
-rw-r--r--Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp1
-rw-r--r--Source/WebCore/platform/mediastream/MediaStreamCenter.cpp18
-rw-r--r--Source/WebCore/platform/mediastream/MediaStreamDescriptor.h12
-rw-r--r--Source/WebCore/platform/network/qt/ResourceHandleQt.cpp7
-rw-r--r--Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp10
-rw-r--r--Source/WebCore/platform/text/LocaleICU.cpp61
-rw-r--r--Source/WebCore/platform/text/LocaleICU.h6
-rw-r--r--Source/WebCore/platform/text/LocaleNone.cpp26
-rw-r--r--Source/WebCore/platform/text/LocaleWin.cpp20
-rw-r--r--Source/WebCore/platform/text/LocaleWin.h4
-rw-r--r--Source/WebCore/platform/text/Localizer.h11
-rw-r--r--Source/WebCore/platform/text/cf/StringCF.cpp8
-rw-r--r--Source/WebCore/platform/text/mac/LocaleMac.h6
-rw-r--r--Source/WebCore/platform/text/mac/LocaleMac.mm41
-rw-r--r--Source/WebCore/rendering/ExclusionPolygon.cpp28
-rw-r--r--Source/WebCore/rendering/ExclusionPolygon.h2
-rw-r--r--Source/WebCore/rendering/ExclusionRectangle.cpp6
-rw-r--r--Source/WebCore/rendering/ExclusionRectangle.h1
-rw-r--r--Source/WebCore/rendering/ExclusionShape.cpp27
-rw-r--r--Source/WebCore/rendering/ExclusionShape.h3
-rw-r--r--[-rwxr-xr-x]Source/WebCore/rendering/InlineIterator.h0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/rendering/RenderBlock.cpp9
-rw-r--r--[-rwxr-xr-x]Source/WebCore/rendering/RenderBlockLineLayout.cpp46
-rw-r--r--Source/WebCore/rendering/RenderBox.cpp25
-rw-r--r--Source/WebCore/rendering/RenderDialog.cpp1
-rw-r--r--Source/WebCore/rendering/RenderEmbeddedObject.cpp1
-rw-r--r--Source/WebCore/rendering/RenderFieldset.cpp7
-rw-r--r--Source/WebCore/rendering/RenderFieldset.h3
-rw-r--r--Source/WebCore/rendering/RenderFlexibleBox.cpp1
-rw-r--r--Source/WebCore/rendering/RenderFlowThread.cpp1
-rw-r--r--Source/WebCore/rendering/RenderFrameSet.cpp1
-rw-r--r--Source/WebCore/rendering/RenderIFrame.cpp1
-rw-r--r--Source/WebCore/rendering/RenderImage.cpp1
-rw-r--r--Source/WebCore/rendering/RenderLayer.cpp2
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.cpp12
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.h2
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp7
-rw-r--r--Source/WebCore/rendering/RenderListBox.cpp1
-rw-r--r--Source/WebCore/rendering/RenderListItem.cpp1
-rw-r--r--Source/WebCore/rendering/RenderListMarker.cpp1
-rw-r--r--Source/WebCore/rendering/RenderMedia.cpp1
-rw-r--r--[-rwxr-xr-x]Source/WebCore/rendering/RenderObject.cpp1
-rw-r--r--Source/WebCore/rendering/RenderObject.h1
-rw-r--r--Source/WebCore/rendering/RenderRegion.cpp1
-rw-r--r--Source/WebCore/rendering/RenderReplaced.cpp1
-rw-r--r--Source/WebCore/rendering/RenderReplica.cpp1
-rw-r--r--Source/WebCore/rendering/RenderRubyRun.cpp1
-rw-r--r--Source/WebCore/rendering/RenderScrollbarPart.cpp1
-rw-r--r--Source/WebCore/rendering/RenderSlider.cpp1
-rw-r--r--Source/WebCore/rendering/RenderTable.cpp1
-rw-r--r--Source/WebCore/rendering/RenderTableCell.cpp1
-rw-r--r--Source/WebCore/rendering/RenderTableRow.cpp1
-rw-r--r--Source/WebCore/rendering/RenderTableSection.cpp1
-rw-r--r--Source/WebCore/rendering/RenderTextControlSingleLine.cpp2
-rw-r--r--Source/WebCore/rendering/RenderTextTrackCue.cpp1
-rw-r--r--Source/WebCore/rendering/RenderVideo.cpp1
-rw-r--r--Source/WebCore/rendering/RenderView.cpp1
-rw-r--r--Source/WebCore/rendering/RenderWidget.cpp1
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.cpp4
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.h12
-rw-r--r--Source/WebCore/rendering/style/RenderStyleConstants.h4
-rw-r--r--Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp12
-rw-r--r--Source/WebCore/rendering/style/StyleRareNonInheritedData.h4
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGContainer.cpp1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGImage.cpp1
-rw-r--r--[-rwxr-xr-x]Source/WebCore/rendering/svg/RenderSVGPath.cpp0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/rendering/svg/RenderSVGRect.cpp0
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp3
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGRoot.cpp1
-rw-r--r--[-rwxr-xr-x]Source/WebCore/rendering/svg/RenderSVGShape.cpp1
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGText.cpp1
-rw-r--r--[-rwxr-xr-x]Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp0
-rw-r--r--Source/WebCore/svg/SVGElement.h6
-rw-r--r--[-rwxr-xr-x]Source/WebCore/svg/SVGURIReference.cpp0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/svg/SVGURIReference.h0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/svg/SVGUseElement.cpp0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/svg/SVGUseElement.h0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/testing/InternalSettings.cpp0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/testing/InternalSettings.h0
-rw-r--r--[-rwxr-xr-x]Source/WebCore/testing/InternalSettings.idl0
-rw-r--r--Source/WebKit/blackberry/Api/InRegionScroller.cpp3
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.cpp26
-rw-r--r--Source/WebKit/blackberry/Api/WebPageClient.h2
-rw-r--r--Source/WebKit/blackberry/ChangeLog207
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp11
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp14
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/DOMSupport.h3
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp36
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.h2
-rw-r--r--Source/WebKit/chromium/ChangeLog454
-rw-r--r--Source/WebKit/chromium/DEPS2
-rw-r--r--Source/WebKit/chromium/WebKit.gyp22
-rw-r--r--Source/WebKit/chromium/WebKit.gypi4
-rw-r--r--Source/WebKit/chromium/features.gypi3
-rw-r--r--Source/WebKit/chromium/public/WebDevToolsAgentClient.h8
-rw-r--r--Source/WebKit/chromium/public/WebInputEvent.h69
-rw-r--r--Source/WebKit/chromium/public/WebSettings.h2
-rw-r--r--Source/WebKit/chromium/src/InspectorClientImpl.cpp6
-rw-r--r--Source/WebKit/chromium/src/InspectorClientImpl.h1
-rw-r--r--Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp22
-rw-r--r--Source/WebKit/chromium/src/InspectorFrontendClientImpl.h4
-rw-r--r--Source/WebKit/chromium/src/LocalizedStrings.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp24
-rw-r--r--Source/WebKit/chromium/src/WebDevToolsAgentImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebKit.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebPagePopupImpl.cpp9
-rw-r--r--Source/WebKit/chromium/src/WebPagePopupImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebSettingsImpl.cpp17
-rw-r--r--Source/WebKit/chromium/src/WebSettingsImpl.h5
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp11
-rw-r--r--Source/WebKit/chromium/tests/DeferredImageDecoderTest.cpp102
-rw-r--r--Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp1
-rw-r--r--Source/WebKit/chromium/tests/IDBFakeBackingStore.h2
-rw-r--r--Source/WebKit/chromium/tests/LocaleMacTest.cpp52
-rw-r--r--Source/WebKit/chromium/tests/LocaleWinTest.cpp29
-rw-r--r--Source/WebKit/chromium/tests/LocalizedDateICUTest.cpp48
-rw-r--r--Source/WebKit/chromium/tests/MockImageDecoder.h61
-rw-r--r--Source/WebKit/efl/ChangeLog53
-rw-r--r--Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp46
-rw-r--r--Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h6
-rw-r--r--Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp6
-rw-r--r--Source/WebKit/efl/ewebkit.pc.in2
-rw-r--r--Source/WebKit/efl/ewk/ewk_frame.cpp2
-rw-r--r--Source/WebKit/gtk/ChangeLog10
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp2
-rw-r--r--Source/WebKit/mac/ChangeLog33
-rw-r--r--Source/WebKit/mac/Configurations/FeatureDefines.xcconfig5
-rw-r--r--Source/WebKit/mac/WebKit.order1
-rw-r--r--Source/WebKit/mac/WebView/WebView.mm5
-rw-r--r--Source/WebKit/mac/WebView/WebViewPrivate.h2
-rw-r--r--Source/WebKit/qt/Api/qwebpage.cpp38
-rw-r--r--Source/WebKit/qt/Api/qwebpage_p.h3
-rw-r--r--Source/WebKit/qt/ChangeLog45
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp9
-rw-r--r--Source/WebKit/qt/WebCoreSupport/WebEventConversion.cpp43
-rw-r--r--Source/WebKit/qt/WebCoreSupport/WebEventConversion.h8
-rw-r--r--Source/WebKit/qt/declarative/experimental/experimental.pri2
-rw-r--r--Source/WebKit/qt/declarative/public.pri2
-rw-r--r--Source/WebKit/win/ChangeLog29
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp2
-rw-r--r--Source/WebKit/win/WebKit.vcproj/WebKit.sln40
-rw-r--r--Source/WebKit/win/WebView.cpp5
-rw-r--r--Source/WebKit/wx/ChangeLog10
-rw-r--r--Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp2
-rw-r--r--Source/WebKit2/CMakeLists.txt4
-rw-r--r--Source/WebKit2/ChangeLog1747
-rw-r--r--Source/WebKit2/Configurations/FeatureDefines.xcconfig5
-rw-r--r--Source/WebKit2/DerivedSources.make3
-rw-r--r--Source/WebKit2/GNUmakefile.list.am4
-rw-r--r--Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp94
-rw-r--r--Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h64
-rw-r--r--Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in29
-rw-r--r--Source/WebKit2/NetworkProcess/NetworkProcess.cpp39
-rw-r--r--Source/WebKit2/NetworkProcess/NetworkProcess.h14
-rw-r--r--Source/WebKit2/NetworkProcess/NetworkProcess.messages.in3
-rw-r--r--Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp6
-rw-r--r--Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h6
-rw-r--r--Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp29
-rw-r--r--Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h62
-rw-r--r--Source/WebKit2/Platform/CoreIPC/Connection.cpp20
-rw-r--r--Source/WebKit2/Platform/CoreIPC/Connection.h16
-rw-r--r--Source/WebKit2/Platform/CoreIPC/HandleMessage.h91
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageID.h10
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageReceiver.h8
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp25
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h16
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageSender.h2
-rw-r--r--Source/WebKit2/Platform/CoreIPC/win/ConnectionWin.cpp2
-rw-r--r--Source/WebKit2/Platform/mac/SharedMemoryMac.cpp2
-rw-r--r--Source/WebKit2/Platform/win/SharedMemoryWin.cpp6
-rw-r--r--Source/WebKit2/PlatformEfl.cmake2
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.h4
-rw-r--r--Source/WebKit2/PluginProcess/PluginProcess.cpp4
-rw-r--r--Source/WebKit2/PluginProcess/PluginProcess.h8
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.cpp74
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.h8
-rw-r--r--Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp8
-rw-r--r--Source/WebKit2/Scripts/webkit2/messages.py41
-rw-r--r--Source/WebKit2/Scripts/webkit2/messages_unittest.py127
-rw-r--r--Source/WebKit2/Shared/ConnectionStack.cpp38
-rw-r--r--Source/WebKit2/Shared/ConnectionStack.h79
-rw-r--r--Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp538
-rw-r--r--Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h93
-rw-r--r--Source/WebKit2/Shared/CoordinatedGraphics/WebCustomFilterProgram.h73
-rw-r--r--Source/WebKit2/Shared/DictionaryPopupInfo.cpp2
-rw-r--r--Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp4
-rw-r--r--Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h2
-rw-r--r--Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp6
-rw-r--r--Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h2
-rw-r--r--Source/WebKit2/Shared/ShareableSurface.cpp5
-rw-r--r--Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.cpp4
-rw-r--r--Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.h4
-rw-r--r--Source/WebKit2/Shared/UserMessageCoders.h4
-rw-r--r--Source/WebKit2/Shared/WebConnection.cpp4
-rw-r--r--Source/WebKit2/Shared/WebConnection.h6
-rw-r--r--Source/WebKit2/Shared/WebCoreArgumentCoders.cpp188
-rw-r--r--Source/WebKit2/Shared/WebCoreArgumentCoders.h49
-rw-r--r--Source/WebKit2/Shared/WebPreferencesStore.cpp16
-rw-r--r--Source/WebKit2/Shared/WebPreferencesStore.h8
-rw-r--r--Source/WebKit2/Shared/WebProcessCreationParameters.cpp14
-rw-r--r--Source/WebKit2/Shared/WebProcessCreationParameters.h4
-rw-r--r--Source/WebKit2/Shared/WebString.h10
-rw-r--r--Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp10
-rw-r--r--Source/WebKit2/Shared/mac/ArgumentCodersMac.mm8
-rw-r--r--Source/WebKit2/Shared/mac/KeychainAttribute.cpp4
-rw-r--r--Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm4
-rw-r--r--Source/WebKit2/Shared/mac/SandboxExtensionMac.mm2
-rw-r--r--Source/WebKit2/Shared/mac/SecItemRequestData.cpp2
-rw-r--r--Source/WebKit2/Shared/mac/SecItemResponseData.cpp4
-rw-r--r--Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp6
-rw-r--r--Source/WebKit2/Shared/mac/SecKeychainItemResponseData.cpp10
-rw-r--r--Source/WebKit2/Shared/qt/ArgumentCodersQt.cpp2
-rw-r--r--Source/WebKit2/Shared/qt/QtNetworkReplyData.cpp2
-rw-r--r--Source/WebKit2/Shared/soup/PlatformCertificateInfo.cpp6
-rw-r--r--Source/WebKit2/Shared/win/LayerTreeContextWin.cpp2
-rw-r--r--Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp4
-rw-r--r--Source/WebKit2/Shared/win/WindowGeometry.cpp2
-rw-r--r--Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp8
-rw-r--r--Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.h8
-rw-r--r--Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.messages.in4
-rw-r--r--Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMac.mm4
-rw-r--r--Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm4
-rw-r--r--Source/WebKit2/Target.pri5
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContext.cpp10
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp13
-rw-r--r--Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.cpp (renamed from Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp)42
-rw-r--r--Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.h (renamed from Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h)29
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp145
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp52
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h18
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h26
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_context.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp30
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp154
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager_private.h22
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp156
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_download_job.h2
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_download_job_private.h66
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_error.cpp58
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_error_private.h15
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.cpp161
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.h8
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_favicon_database_private.h19
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp43
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request_private.h27
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp89
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h30
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp55
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_intent_service_private.h26
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_navigation_data.cpp27
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_navigation_data_private.h19
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp79
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h43
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp81
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item_private.h36
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_resource.cpp19
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h14
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp27
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_url_request_private.h18
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp34
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h19
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp54
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h2
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h30
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.cpp21
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.h2
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp3
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp8
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp21
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h10
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp1
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp1
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp1
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp43
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp1
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp28
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp32
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp41
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp27
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp15
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp16
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h1
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp411
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h3
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp12
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h10
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebInspectorPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp28
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp17
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h14
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h12
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp77
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h4
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am7
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestCookieManager.cpp15
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/mac/WKView.mm2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp3
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h5
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp2
-rw-r--r--Source/WebKit2/UIProcess/Downloads/DownloadProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxy.cpp2
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxy.h6
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp4
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h2
-rw-r--r--Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp10
-rw-r--r--Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h6
-rw-r--r--Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm21
-rw-r--r--Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp2
-rw-r--r--Source/WebKit2/UIProcess/Network/NetworkProcessManager.cpp70
-rw-r--r--Source/WebKit2/UIProcess/Network/NetworkProcessManager.h59
-rw-r--r--Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp67
-rw-r--r--Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h19
-rw-r--r--Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in29
-rw-r--r--Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/PageViewportController.cpp3
-rw-r--r--Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp6
-rw-r--r--Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h6
-rw-r--r--Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp4
-rw-r--r--Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h8
-rw-r--r--Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp5
-rw-r--r--Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h6
-rw-r--r--Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm12
-rw-r--r--Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp11
-rw-r--r--Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp2
-rw-r--r--Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.cpp4
-rw-r--r--Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.h4
-rw-r--r--Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.cpp8
-rw-r--r--Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.h8
-rw-r--r--Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.messages.in4
-rw-r--r--Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h5
-rw-r--r--Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebBatteryManagerProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp18
-rw-r--r--Source/WebKit2/UIProcess/WebConnectionToWebProcess.h8
-rw-r--r--Source/WebKit2/UIProcess/WebContext.cpp72
-rw-r--r--Source/WebKit2/UIProcess/WebContext.h35
-rw-r--r--Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebCookieManagerProxy.h5
-rw-r--r--Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp8
-rw-r--r--Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h8
-rw-r--r--Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/WebIconDatabase.cpp8
-rw-r--r--Source/WebKit2/UIProcess/WebIconDatabase.h8
-rw-r--r--Source/WebKit2/UIProcess/WebInspectorProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp10
-rw-r--r--Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.h8
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp140
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.h64
-rw-r--r--Source/WebKit2/UIProcess/WebPreferences.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebPreferences.h2
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.cpp51
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.h27
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.messages.in9
-rw-r--r--Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/WebVibrationProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/WebVibrationProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/cf/WebPreferencesCF.cpp9
-rw-r--r--Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp14
-rw-r--r--Source/WebKit2/UIProcess/efl/WebPreferencesEfl.cpp5
-rw-r--r--Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp5
-rw-r--r--Source/WebKit2/UIProcess/mac/WebPreferencesMac.mm8
-rw-r--r--Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp4
-rw-r--r--Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp6
-rw-r--r--Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.h4
-rw-r--r--Source/WebKit2/WebKit2.pri1
-rw-r--r--Source/WebKit2/WebKit2.xcodeproj/project.pbxproj50
-rw-r--r--Source/WebKit2/WebKit2Prefix.h8
-rw-r--r--Source/WebKit2/WebProcess.pro7
-rw-r--r--Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h10
-rw-r--r--Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp6
-rw-r--r--Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h4
-rw-r--r--Source/WebKit2/WebProcess/Battery/WebBatteryManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/Battery/WebBatteryManager.h6
-rw-r--r--Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/Cookies/WebCookieManager.h6
-rw-r--r--Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h6
-rw-r--r--Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp6
-rw-r--r--Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h4
-rw-r--r--Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp4
-rw-r--r--Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h6
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp6
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h2
-rw-r--r--Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h10
-rw-r--r--Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h10
-rw-r--r--Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp66
-rw-r--r--Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h65
-rw-r--r--Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.h6
-rw-r--r--Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h6
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp18
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h6
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginProxy.h4
-rw-r--r--Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h6
-rw-r--r--Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp19
-rw-r--r--Source/WebKit2/WebProcess/WebConnectionToUIProcess.h10
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h6
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp30
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp10
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h9
-rw-r--r--Source/WebKit2/WebProcess/WebKitMain.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp1
-rw-r--r--Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingArea.h6
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp18
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EventDispatcher.h4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebFrame.cpp9
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebFrame.h3
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebInspector.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp30
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.h12
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h6
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.cpp111
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.h35
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.messages.in9
-rw-r--r--Source/WebKit2/WebProcess/mac/WebProcessMac.mm2
-rw-r--r--Source/WebKit2/WebProcess/qt/WebProcessQt.cpp2
-rw-r--r--Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp2
-rw-r--r--Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp4
-rw-r--r--Source/WebKit2/WebProcess/soup/WebSoupRequestManager.h6
-rw-r--r--Source/WebKit2/WebProcess/win/WebProcessWin.cpp2
-rw-r--r--Source/WebKit2/efl/ewebkit2.pc.in2
-rw-r--r--Source/WebKit2/qt/MainQt.cpp10
-rw-r--r--Source/WebKit2/win/WebKit2.def4
-rw-r--r--Source/WebKit2/win/WebKit2CFLite.def3
-rw-r--r--Source/autotools/symbols.filter3
-rw-r--r--Source/cmake/OptionsEfl.cmake4
-rw-r--r--Source/cmake/WebKitFeatures.cmake3
-rw-r--r--Source/cmakeconfig.h.cmake3
-rw-r--r--Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js9
-rw-r--r--Tools/ChangeLog780
-rw-r--r--Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp23
-rw-r--r--Tools/DumpRenderTree/DumpRenderTree.gypi51
-rw-r--r--Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp51
-rw-r--r--Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h2
-rw-r--r--Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h2
-rw-r--r--Tools/DumpRenderTree/chromium/DRTDevToolsClient.h2
-rw-r--r--Tools/DumpRenderTree/chromium/DRTTestRunner.h2
-rw-r--r--Tools/DumpRenderTree/chromium/DumpRenderTree.cpp5
-rw-r--r--Tools/DumpRenderTree/chromium/MockSpellCheck.cpp12
-rw-r--r--Tools/DumpRenderTree/chromium/MockSpellCheck.h8
-rw-r--r--Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h2
-rw-r--r--Tools/DumpRenderTree/chromium/MockWebSpeechInputController.h2
-rw-r--r--Tools/DumpRenderTree/chromium/MockWebSpeechRecognizer.h2
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/public/WebAccessibilityController.h58
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h59
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h56
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h)28
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/AccessibilityControllerChromium.cpp)7
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/AccessibilityControllerChromium.h)4
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp)8
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.h)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/CppVariant.cpp)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/CppVariant.h)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp)49
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/EventSender.h)4
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/GamepadController.cpp)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/GamepadController.h)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/Task.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/Task.cpp)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/Task.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/Task.h)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/TestDelegate.h)4
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp)70
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h70
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/TestRunner.cpp)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/TestRunner.h)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp (renamed from Tools/DumpRenderTree/chromium/TestRunner/TextInputController.cpp)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.h (renamed from Tools/DumpRenderTree/chromium/TestRunner/TextInputController.h)0
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/WebAccessibilityController.cpp60
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/WebEventSender.cpp51
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp166
-rw-r--r--Tools/DumpRenderTree/chromium/TestShell.cpp5
-rw-r--r--Tools/DumpRenderTree/chromium/TestShell.h12
-rw-r--r--Tools/DumpRenderTree/chromium/WebPreferences.cpp2
-rw-r--r--Tools/DumpRenderTree/chromium/WebPreferences.h1
-rw-r--r--Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h2
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.cpp8
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.h8
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTree.cpp3
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp2
-rw-r--r--Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp27
-rw-r--r--Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm2
-rw-r--r--Tools/DumpRenderTree/qt/EventSenderQt.cpp10
-rw-r--r--Tools/DumpRenderTree/qt/EventSenderQt.h2
-rw-r--r--Tools/MiniBrowser/efl/main.c3
-rwxr-xr-xTools/Scripts/export-w3c-performance-wg-tests80
-rwxr-xr-xTools/Scripts/prepare-ChangeLog6
-rwxr-xr-xTools/Scripts/run-gtk-tests1
-rwxr-xr-xTools/Scripts/run-javascriptcore-tests1
-rw-r--r--Tools/Scripts/webkitperl/FeatureList.pm10
-rw-r--r--Tools/Scripts/webkitpy/common/config/committers.py2
-rwxr-xr-xTools/Scripts/webkitpy/common/config/watchlist10
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/builders.py27
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/port/chromium.py3
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py4
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py13
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/rebaseline.py18
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py67
-rw-r--r--Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py9
-rw-r--r--Tools/TestResultServer/static-dashboards/aggregate_results.html1
-rw-r--r--Tools/TestResultServer/static-dashboards/builders.js27
-rw-r--r--Tools/TestResultServer/static-dashboards/dashboard_base.js244
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard.html1
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard.js4
-rw-r--r--Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js25
-rw-r--r--Tools/TestResultServer/static-dashboards/loader.js247
-rw-r--r--Tools/TestResultServer/static-dashboards/loader_unittests.js106
-rw-r--r--Tools/TestResultServer/static-dashboards/run-unittests.html7
-rw-r--r--Tools/TestResultServer/static-dashboards/timeline_explorer.html1
-rw-r--r--Tools/TestResultServer/static-dashboards/treemap.html34
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj14
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp25
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp67
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp78
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/link-with-title.html5
-rw-r--r--Tools/Tools.pro14
-rw-r--r--Tools/WebKitTestRunner/GNUmakefile.am2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp16
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp13
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/TestRunner.h2
-rw-r--r--Tools/WebKitTestRunner/TestInvocation.cpp14
-rw-r--r--Tools/WebKitTestRunner/WorkQueueManager.cpp64
-rw-r--r--Tools/WebKitTestRunner/WorkQueueManager.h13
-rw-r--r--Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp32
-rw-r--r--Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp7
-rw-r--r--Tools/qmake/mkspecs/features/configure.prf17
-rw-r--r--Tools/qmake/mkspecs/features/default_post.prf5
-rw-r--r--Tools/qmake/mkspecs/features/default_pre.prf5
-rw-r--r--Tools/qmake/mkspecs/features/features.pri3
-rw-r--r--WebKitLibraries/ChangeLog24
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops9
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops9
-rw-r--r--configure.ac10
1003 files changed, 24018 insertions, 7632 deletions
diff --git a/ChangeLog b/ChangeLog
index 9db07099c..12a41fb61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,61 @@
+2012-10-22 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: merge "docked" state into the "dock side" enum.
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Reviewed by Vsevolod Vlasov.
+
+ Otherwise, it is hard to manage these inter-dependent flags.
+
+ * Source/autotools/symbols.filter:
+
+2012-10-19 Tony Chang <tony@chromium.org>
+
+ Unreviewed, rolling out r131936.
+ http://trac.webkit.org/changeset/131936
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Broke the clang build
+
+ * Source/autotools/symbols.filter:
+
+2012-10-19 Dongwoo Joshua Im <dw.im@samsung.com>
+
+ Rename ENABLE_CSS3_TEXT_DECORATION to ENABLE_CSS3_TEXT
+ https://bugs.webkit.org/show_bug.cgi?id=99804
+
+ Reviewed by Julien Chaffraix.
+
+ CSS3 text related properties will be implemented under this flag,
+ including text decoration, text-align-last, and text-justify.
+
+ * Source/cmake/OptionsEfl.cmake:
+ * Source/cmake/WebKitFeatures.cmake:
+ * Source/cmakeconfig.h.cmake:
+
+2012-10-18 Laszlo Gombos <l.gombos@samsung.com>
+
+ [EFL] Buildfix if Netscape plugin support is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=99757
+
+ Reviewed by Gyuyoung Kim.
+
+ Set ENABLE_PLUGIN_PROCESS only if ENABLE_NETSCAPE_PLUGIN_API is set.
+
+ * Source/cmake/OptionsEfl.cmake:
+
+2012-10-18 Pablo Flouret <pablof@motorola.com>
+
+ Implement css3-conditional's @supports rule
+ https://bugs.webkit.org/show_bug.cgi?id=86146
+
+ Reviewed by Antti Koivisto.
+
+ * Source/cmake/WebKitFeatures.cmake:
+ * Source/cmakeconfig.h.cmake:
+ * configure.ac:
+ Add an ENABLE_CSS3_CONDITIONAL_RULES flag.
+
2012-10-18 Simon Hausmann <simon.hausmann@digia.com>
[Qt] Clean up variables controlling Qt module creation/handling
diff --git a/Source/JavaScriptCore/API/JSStringRef.cpp b/Source/JavaScriptCore/API/JSStringRef.cpp
index ea31da66b..da1a3057a 100644
--- a/Source/JavaScriptCore/API/JSStringRef.cpp
+++ b/Source/JavaScriptCore/API/JSStringRef.cpp
@@ -46,8 +46,12 @@ JSStringRef JSStringCreateWithUTF8CString(const char* string)
size_t length = strlen(string);
Vector<UChar, 1024> buffer(length);
UChar* p = buffer.data();
- if (conversionOK == convertUTF8ToUTF16(&string, string + length, &p, p + length))
+ bool sourceIsAllASCII;
+ if (conversionOK == convertUTF8ToUTF16(&string, string + length, &p, p + length, &sourceIsAllASCII)) {
+ if (sourceIsAllASCII)
+ return OpaqueJSString::create(reinterpret_cast<const LChar*>(string), length).leakRef();
return OpaqueJSString::create(buffer.data(), p - buffer.data()).leakRef();
+ }
}
// Null string.
diff --git a/Source/JavaScriptCore/API/JSStringRefCF.cpp b/Source/JavaScriptCore/API/JSStringRefCF.cpp
index e87fd838d..69cf3f8c4 100644
--- a/Source/JavaScriptCore/API/JSStringRefCF.cpp
+++ b/Source/JavaScriptCore/API/JSStringRefCF.cpp
@@ -46,7 +46,7 @@ JSStringRef JSStringCreateWithCFString(CFStringRef string)
COMPILE_ASSERT(sizeof(UniChar) == sizeof(UChar), unichar_and_uchar_must_be_same_size);
return OpaqueJSString::create(reinterpret_cast<UChar*>(buffer.get()), length).leakRef();
} else {
- return OpaqueJSString::create(0, 0).leakRef();
+ return OpaqueJSString::create(static_cast<const LChar*>(0), 0).leakRef();
}
}
diff --git a/Source/JavaScriptCore/API/OpaqueJSString.h b/Source/JavaScriptCore/API/OpaqueJSString.h
index 36680388d..0464e8813 100644
--- a/Source/JavaScriptCore/API/OpaqueJSString.h
+++ b/Source/JavaScriptCore/API/OpaqueJSString.h
@@ -41,6 +41,11 @@ struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
return adoptRef(new OpaqueJSString);
}
+ static PassRefPtr<OpaqueJSString> create(const LChar* characters, unsigned length)
+ {
+ return adoptRef(new OpaqueJSString(characters, length));
+ }
+
static PassRefPtr<OpaqueJSString> create(const UChar* characters, unsigned length)
{
return adoptRef(new OpaqueJSString(characters, length));
@@ -51,7 +56,7 @@ struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
const UChar* characters() { return !!this ? m_string.characters() : 0; }
unsigned length() { return !!this ? m_string.length() : 0; }
- String string() const;
+ JS_EXPORT_PRIVATE String string() const;
JSC::Identifier identifier(JSC::JSGlobalData*) const;
private:
@@ -70,6 +75,11 @@ private:
m_string = String(string.characters16(), string.length());
}
+ OpaqueJSString(const LChar* characters, unsigned length)
+ {
+ m_string = String(characters, length);
+ }
+
OpaqueJSString(const UChar* characters, unsigned length)
{
m_string = String(characters, length);
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index 4656c5aab..c706f65e9 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -324,6 +324,7 @@ IF (ENABLE_LLINT)
offlineasm/opt.rb
offlineasm/parser.rb
offlineasm/registers.rb
+ offlineasm/risc.rb
offlineasm/self_hash.rb
offlineasm/settings.rb
offlineasm/transform.rb
@@ -337,8 +338,19 @@ IF (ENABLE_LLINT)
COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
VERBATIM)
- ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h)
- ADD_EXECUTABLE(LLIntOffsetsExtractor ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp)
+ # We add the header file directly to the ADD_EXECUTABLE call instead of setting the
+ # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb may
+ # not regenerate it in case the hash it calculates does not change.
+ # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMAND above have
+ # changed the command will always be called because the mtime of LLIntDesiredOffsets.h will
+ # always be older than that of its dependencies.
+ # Additionally, setting the OBJECT_DEPENDS property will make LLIntDesiredOffsets.h a Makefile
+ # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
+ # actually be run twice!
+ ADD_EXECUTABLE(LLIntOffsetsExtractor
+ ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
+ ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
+ )
TARGET_LINK_LIBRARIES(LLIntOffsetsExtractor ${WTF_LIBRARY_NAME})
ADD_CUSTOM_COMMAND(
@@ -348,7 +360,13 @@ IF (ENABLE_LLINT)
COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
VERBATIM)
- ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h)
+ # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
+ # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
+ # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
+ # since it is used in the ADD_LIBRARY() call at the end of this file.
+ LIST(APPEND JavaScriptCore_HEADERS
+ ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
+ )
LIST(APPEND JavaScriptCore_SOURCES
llint/LLIntCLoop.cpp
llint/LLIntData.cpp
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 3574aa0d8..c6b5ce758 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,63 +1,631 @@
-2012-10-17 Zoltan Horvath <zoltan@webkit.org>
+2012-10-20 Martin Robinson <mrobinson@igalia.com>
- Remove the JSHeap memory measurement of the PageLoad performacetests since it creates bogus JSGlobalDatas
- https://bugs.webkit.org/show_bug.cgi?id=99609
+ Fix 'make dist' for the GTK+ port
- Reviewed by Ryosuke Niwa.
+ * GNUmakefile.list.am: Add missing files to the source list.
- Remove the implementation since it creates bogus JSGlobalDatas in the layout tests.
+2012-10-21 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
- * heap/HeapStatistics.cpp:
+ [CMake][JSC] Depend on risc.rb to decide when to run the LLInt scripts.
+ https://bugs.webkit.org/show_bug.cgi?id=99917
+
+ Reviewed by Geoffrey Garen.
+
+ Depend on the newly-added risc.rb to make sure we always run the
+ LLInt scripts when one of them changes.
+
+ * CMakeLists.txt:
+
+2012-10-20 Filip Pizlo <fpizlo@apple.com>
+
+ LLInt backends of non-ARM RISC platforms should be able to share code with the existing ARMv7 backend
+ https://bugs.webkit.org/show_bug.cgi?id=99745
+
+ Reviewed by Geoffrey Garen.
+
+ This moves all of the things in armv7.rb that I thought are generally useful out
+ into risc.rb. It also separates some phases (branch ops is separated into one
+ phase that does sensible things, and another that does things that are painfully
+ ARM-specific), and removes ARM assumptions from others by using a callback to
+ drive exactly what lowering must happen. The goal here is to minimize the future
+ maintenance burden of LLInt by ensuring that the various platforms share as much
+ lowering code as possible.
+
+ * offlineasm/armv7.rb:
+ * offlineasm/risc.rb: Added.
+
+2012-10-19 Filip Pizlo <fpizlo@apple.com>
+
+ DFG should have some facility for recognizing redundant CheckArrays and Arrayifies
+ https://bugs.webkit.org/show_bug.cgi?id=99287
+
+ Reviewed by Mark Hahnenberg.
+
+ Adds reasoning about indexing type sets (i.e. ArrayModes) to AbstractValue, which
+ then enables us to fold away CheckArray's and Arrayify's that are redundant.
+
+ * bytecode/ArrayProfile.cpp:
+ (JSC::arrayModesToString):
(JSC):
- * heap/HeapStatistics.h:
- (HeapStatistics):
+ * bytecode/ArrayProfile.h:
+ (JSC):
+ (JSC::mergeArrayModes):
+ (JSC::arrayModesAlreadyChecked):
+ * bytecode/StructureSet.h:
+ (JSC::StructureSet::arrayModesFromStructures):
+ (StructureSet):
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGAbstractValue.h:
+ (JSC::DFG::AbstractValue::AbstractValue):
+ (JSC::DFG::AbstractValue::clear):
+ (JSC::DFG::AbstractValue::isClear):
+ (JSC::DFG::AbstractValue::makeTop):
+ (JSC::DFG::AbstractValue::clobberStructures):
+ (AbstractValue):
+ (JSC::DFG::AbstractValue::setMostSpecific):
+ (JSC::DFG::AbstractValue::set):
+ (JSC::DFG::AbstractValue::operator==):
+ (JSC::DFG::AbstractValue::merge):
+ (JSC::DFG::AbstractValue::filter):
+ (JSC::DFG::AbstractValue::filterArrayModes):
+ (JSC::DFG::AbstractValue::validate):
+ (JSC::DFG::AbstractValue::checkConsistency):
+ (JSC::DFG::AbstractValue::dump):
+ (JSC::DFG::AbstractValue::clobberArrayModes):
+ (JSC::DFG::AbstractValue::clobberArrayModesSlow):
+ (JSC::DFG::AbstractValue::setFuturePossibleStructure):
+ (JSC::DFG::AbstractValue::filterFuturePossibleStructure):
+ * dfg/DFGArrayMode.cpp:
+ (JSC::DFG::modeAlreadyChecked):
+ * dfg/DFGArrayMode.h:
+ (JSC::DFG::arrayModesFor):
+ (DFG):
+ * dfg/DFGConstantFoldingPhase.cpp:
+ (JSC::DFG::ConstantFoldingPhase::foldConstants):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::arrayify):
-2012-10-17 Sam Weinig <sam@webkit.org>
+2012-10-19 Filip Pizlo <fpizlo@apple.com>
- Attempt to fix the build.
+ Baseline JIT should not inline array allocations, to make them easier to instrument
+ https://bugs.webkit.org/show_bug.cgi?id=99905
- * bytecode/GlobalResolveInfo.h: Copied from bytecode/GlobalResolveInfo.h.
+ Reviewed by Mark Hahnenberg.
-2012-10-17 Oliver Hunt <oliver@apple.com>
+ This will make it easier to instrument array allocations for the purposes of profiling.
+ It also allows us to kill off a bunch of code. And, this doesn't appear to hurt
+ performance at all. That's expected because these days any hot allocation will end up
+ in the DFG JIT, which does inline these allocations.
+
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileSlowCases):
+ * jit/JIT.h:
+ (JIT):
+ * jit/JITInlineMethods.h:
+ (JSC):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_new_array):
+
+2012-10-19 Oliver Hunt <oliver@apple.com>
+
+ Fix some of the regression cause by the non-local variable reworking
+ https://bugs.webkit.org/show_bug.cgi?id=99896
+
+ Reviewed by Filip Pizlo.
+
+ The non0local variable reworking led to some of the optimisations performed by
+ the bytecode generator being dropped. This in turn put more pressure on the DFG
+ optimisations. This exposed a short coming in our double speculation propogation.
+ Now we try to distinguish between places where we should SpecDoubleReal vs generic
+ SpecDouble.
+
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ (PredictionPropagationPhase):
+ (JSC::DFG::PredictionPropagationPhase::speculatedDoubleTypeForPrediction):
+ (JSC::DFG::PredictionPropagationPhase::speculatedDoubleTypeForPredictions):
+ (JSC::DFG::PredictionPropagationPhase::propagate):
+
+2012-10-19 Michael Saboff <msaboff@apple.com>
+
+ Lexer should create 8 bit Identifiers for RegularExpressions and ASCII identifiers
+ https://bugs.webkit.org/show_bug.cgi?id=99855
+
+ Reviewed by Filip Pizlo.
+
+ Added makeIdentifier helpers that will always make an 8 bit Identifier or make an
+ Identifier that is the same size as the template parameter. Used the first in the fast
+ path when looking for a JS identifier and the second when scanning regular expressions.
+
+ * parser/Lexer.cpp:
+ (JSC::::scanRegExp):
+ * parser/Lexer.h:
+ (Lexer):
+ (JSC::::makeIdentifierSameType):
+ (JSC::::makeLCharIdentifier):
+ (JSC::::lexExpectIdentifier):
+
+2012-10-19 Mark Lam <mark.lam@apple.com>
+
+ Added WTF::StackStats mechanism.
+ https://bugs.webkit.org/show_bug.cgi?id=99805.
+
+ Reviewed by Geoffrey Garen.
+
+ Added StackStats checkpoints and probes.
+
+ * bytecompiler/BytecodeGenerator.h:
+ (JSC::BytecodeGenerator::emitNode):
+ (JSC::BytecodeGenerator::emitNodeInConditionContext):
+ * heap/SlotVisitor.cpp:
+ (JSC::SlotVisitor::append):
+ (JSC::visitChildren):
+ (JSC::SlotVisitor::donateKnownParallel):
+ (JSC::SlotVisitor::drain):
+ (JSC::SlotVisitor::drainFromShared):
+ (JSC::SlotVisitor::mergeOpaqueRoots):
+ (JSC::SlotVisitor::internalAppend):
+ (JSC::SlotVisitor::harvestWeakReferences):
+ (JSC::SlotVisitor::finalizeUnconditionalFinalizers):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::execute):
+ (JSC::Interpreter::executeCall):
+ (JSC::Interpreter::executeConstruct):
+ (JSC::Interpreter::prepareForRepeatCall):
+ * parser/Parser.h:
+ (JSC::Parser::canRecurse):
+ * runtime/StringRecursionChecker.h:
+ (StringRecursionChecker):
+
+2012-10-19 Oliver Hunt <oliver@apple.com>
+
+ REGRESSION(r131822): It made 500+ tests crash on 32 bit platforms
+ https://bugs.webkit.org/show_bug.cgi?id=99814
+
+ Reviewed by Filip Pizlo.
+
+ Call the correct macro in 32bit.
- Roll out r131645 as it causes random site crashes.
+ * llint/LowLevelInterpreter.asm:
+
+2012-10-19 Dongwoo Joshua Im <dw.im@samsung.com>
+
+ Rename ENABLE_CSS3_TEXT_DECORATION to ENABLE_CSS3_TEXT
+ https://bugs.webkit.org/show_bug.cgi?id=99804
+
+ Reviewed by Julien Chaffraix.
+
+ CSS3 text related properties will be implemented under this flag,
+ including text decoration, text-align-last, and text-justify.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-10-18 Anders Carlsson <andersca@apple.com>
+
+ Clean up RegExpKey
+ https://bugs.webkit.org/show_bug.cgi?id=99798
+
+ Reviewed by Darin Adler.
+
+ RegExpHash doesn't need to be a class template specialization when the class template is specialized
+ for JSC::RegExpKey only. Make it a nested class of RegExp instead. Also, make operator== a friend function
+ so Hash::equal can see it.
+
+ * runtime/RegExpKey.h:
+ (JSC::RegExpKey::RegExpKey):
+ (JSC::RegExpKey::operator==):
+ (RegExpKey):
+ (JSC::RegExpKey::Hash::hash):
+ (JSC::RegExpKey::Hash::equal):
+ (Hash):
+
+2012-10-19 Mark Lam <mark.lam@apple.com>
+
+ Bot greening: Follow up to r131877 to fix the Windows build.
+ https://bugs.webkit.org/show_bug.cgi?id=99739.
+
+ Not reviewed.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2012-10-19 Mark Lam <mark.lam@apple.com>
+
+ Bot greening: Attempt to fix broken Window build after r131836.
+ https://bugs.webkit.org/show_bug.cgi?id=99739.
+
+ Not reviewed.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2012-10-19 Yuqiang Xian <yuqiang.xian@intel.com>
+
+ Unreviewed fix after r131868.
+
+ On JSVALUE64 platforms, JSValue constants can be Imm64 instead of ImmPtr for JIT compilers.
+
+ * dfg/DFGOSRExitCompiler64.cpp:
+ (JSC::DFG::OSRExitCompiler::compileExit):
+
+2012-10-18 Filip Pizlo <fpizlo@apple.com>
+
+ Baseline array profiling should be less accurate, and DFG OSR exit should update array profiles on CheckArray and CheckStructure failure
+ https://bugs.webkit.org/show_bug.cgi?id=99261
+
+ Reviewed by Oliver Hunt.
+
+ This makes array profiling stochastic, like value profiling. The point is to avoid
+ noticing one-off indexing types that we'll never see again, but instead to:
+
+ Notice the big ones: We want the DFG to compile based on the things that happen with
+ high probability. So, this change makes array profiling do like value profiling and
+ only notice a random subsampling of indexing types that flowed through an array
+ access. Prior to this patch array profiles noticed all indexing types and weighted
+ them identically.
+
+ Bias the recent: Often an array access will see awkward indexing types during the
+ first handful of executions because of artifacts of program startup. So, we want to
+ bias towards the indexing types that we saw most recently. With this change, array
+ profiling does like value profiling and usually tells use a random sampling that
+ is biased to what happened recently.
+
+ Have a backup plan: The above two things don't work by themselves because our
+ randomness is not that random (nor do we care enough to make it more random), and
+ because some procedures will have a <1/10 probability event that we must handle
+ without bailing because it dominates a hot loop. So, like value profiling, this
+ patch makes array profiling use OSR exits to tell us why we are bailing out, so
+ that we don't make the same mistake again in the future.
+ This change also makes the way that the 32-bit OSR exit compiler snatches scratch
+ registers more uniform. We don't need a scratch buffer when we can push and pop.
+
+ * bytecode/DFGExitProfile.h:
+ * dfg/DFGOSRExitCompiler32_64.cpp:
+ (JSC::DFG::OSRExitCompiler::compileExit):
+ * dfg/DFGOSRExitCompiler64.cpp:
+ (JSC::DFG::OSRExitCompiler::compileExit):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::checkArray):
+ (JSC::DFG::SpeculativeJIT::arrayify):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * jit/JITInlineMethods.h:
+ (JSC::JIT::emitArrayProfilingSite):
+ * llint/LowLevelInterpreter.asm:
+
+2012-10-18 Yuqiang Xian <yuqiang.xian@intel.com>
+
+ [Qt] REGRESSION(r131858): It broke the ARM build
+ https://bugs.webkit.org/show_bug.cgi?id=99809
+
+ Reviewed by Csaba Osztrogonác.
+
+ * dfg/DFGCCallHelpers.h:
+ (CCallHelpers):
+ (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
+
+2012-10-18 Yuqiang Xian <yuqiang.xian@intel.com>
+
+ Refactor MacroAssembler interfaces to differentiate the pointer operands from the 64-bit integer operands
+ https://bugs.webkit.org/show_bug.cgi?id=99154
+
+ Reviewed by Gavin Barraclough.
+
+ In current JavaScriptCore implementation for JSVALUE64 platform (i.e.,
+ the X64 platform), we assume that the JSValue size is same to the
+ pointer size, and thus EncodedJSValue is simply type defined as a
+ "void*". In the JIT compiler, we also take this assumption and invoke
+ the same macro assembler interfaces for both JSValue and pointer
+ operands. We need to differentiate the operations on pointers from the
+ operations on JSValues, and let them invoking different macro
+ assembler interfaces. For example, we now use the interface of
+ "loadPtr" to load either a pointer or a JSValue, and we need to switch
+ to using "loadPtr" to load a pointer and some new "load64" interface
+ to load a JSValue. This would help us supporting other JSVALUE64
+ platforms where pointer size is not necessarily 64-bits, for example
+ x32 (bug #99153).
+
+ The major modification I made is to introduce the "*64" interfaces in
+ the MacroAssembler for those operations on JSValues, keep the "*Ptr"
+ interfaces for those operations on real pointers, and go through all
+ the JIT compiler code to correct the usage.
+
+ This is the second part of the work, i.e, to correct the usage of the
+ new MacroAssembler interfaces in the JIT compilers, which also means
+ that now EncodedJSValue is defined as a 64-bit integer, and the "*64"
+ interfaces are used for it.
+
+ * assembler/MacroAssembler.h: JSValue immediates should be in Imm64 instead of ImmPtr.
+ (MacroAssembler):
+ (JSC::MacroAssembler::shouldBlind):
+ * dfg/DFGAssemblyHelpers.cpp: Correct the JIT compilers usage of the new interfaces.
+ (JSC::DFG::AssemblyHelpers::jitAssertIsInt32):
+ (JSC::DFG::AssemblyHelpers::jitAssertIsJSInt32):
+ (JSC::DFG::AssemblyHelpers::jitAssertIsJSNumber):
+ (JSC::DFG::AssemblyHelpers::jitAssertIsJSDouble):
+ (JSC::DFG::AssemblyHelpers::jitAssertIsCell):
+ * dfg/DFGAssemblyHelpers.h:
+ (JSC::DFG::AssemblyHelpers::emitPutToCallFrameHeader):
+ (JSC::DFG::AssemblyHelpers::branchIfNotCell):
+ (JSC::DFG::AssemblyHelpers::debugCall):
+ (JSC::DFG::AssemblyHelpers::boxDouble):
+ (JSC::DFG::AssemblyHelpers::unboxDouble):
+ (JSC::DFG::AssemblyHelpers::emitExceptionCheck):
+ * dfg/DFGCCallHelpers.h:
+ (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
+ (CCallHelpers):
+ * dfg/DFGOSRExitCompiler64.cpp:
+ (JSC::DFG::OSRExitCompiler::compileExit):
+ * dfg/DFGRepatch.cpp:
+ (JSC::DFG::generateProtoChainAccessStub):
+ (JSC::DFG::tryCacheGetByID):
+ (JSC::DFG::tryBuildGetByIDList):
+ (JSC::DFG::emitPutReplaceStub):
+ (JSC::DFG::emitPutTransitionStub):
+ * dfg/DFGScratchRegisterAllocator.h:
+ (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
+ (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
+ * dfg/DFGSilentRegisterSavePlan.h:
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
+ (JSC::DFG::SpeculativeJIT::compileValueToInt32):
+ (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
+ (JSC::DFG::SpeculativeJIT::compileInstanceOfForObject):
+ (JSC::DFG::SpeculativeJIT::compileInstanceOf):
+ (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant):
+ (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
+ * dfg/DFGSpeculativeJIT.h:
+ (SpeculativeJIT):
+ (JSC::DFG::SpeculativeJIT::silentSavePlanForGPR):
+ (JSC::DFG::SpeculativeJIT::silentSpill):
+ (JSC::DFG::SpeculativeJIT::silentFill):
+ (JSC::DFG::SpeculativeJIT::spill):
+ (JSC::DFG::SpeculativeJIT::valueOfJSConstantAsImm64):
+ (JSC::DFG::SpeculativeJIT::callOperation):
+ (JSC::DFG::SpeculativeJIT::branch64):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::fillInteger):
+ (JSC::DFG::SpeculativeJIT::fillDouble):
+ (JSC::DFG::SpeculativeJIT::fillJSValue):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToNumber):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToInt32):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeUInt32ToNumber):
+ (JSC::DFG::SpeculativeJIT::cachedGetById):
+ (JSC::DFG::SpeculativeJIT::cachedPutById):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
+ (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq):
+ (JSC::DFG::SpeculativeJIT::emitCall):
+ (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
+ (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
+ (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
+ (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
+ (JSC::DFG::SpeculativeJIT::convertToDouble):
+ (JSC::DFG::SpeculativeJIT::compileObjectEquality):
+ (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
+ (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
+ (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
+ (JSC::DFG::SpeculativeJIT::compileNonStringCellOrOtherLogicalNot):
+ (JSC::DFG::SpeculativeJIT::compileLogicalNot):
+ (JSC::DFG::SpeculativeJIT::emitNonStringCellOrOtherBranch):
+ (JSC::DFG::SpeculativeJIT::emitBranch):
+ (JSC::DFG::SpeculativeJIT::compileContiguousGetByVal):
+ (JSC::DFG::SpeculativeJIT::compileArrayStorageGetByVal):
+ (JSC::DFG::SpeculativeJIT::compileContiguousPutByVal):
+ (JSC::DFG::SpeculativeJIT::compileArrayStoragePutByVal):
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGThunks.cpp:
+ (JSC::DFG::osrExitGenerationThunkGenerator):
+ (JSC::DFG::throwExceptionFromCallSlowPathGenerator):
+ (JSC::DFG::slowPathFor):
+ (JSC::DFG::virtualForThunkGenerator):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::dumpRegisters):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompile):
+ * jit/JIT.h:
+ (JIT):
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::emit_op_negate):
+ (JSC::JIT::emitSlow_op_negate):
+ (JSC::JIT::emit_op_rshift):
+ (JSC::JIT::emitSlow_op_urshift):
+ (JSC::JIT::emit_compareAndJumpSlow):
+ (JSC::JIT::emit_op_bitand):
+ (JSC::JIT::compileBinaryArithOpSlowCase):
+ (JSC::JIT::emit_op_div):
+ * jit/JITCall.cpp:
+ (JSC::JIT::compileLoadVarargs):
+ (JSC::JIT::compileCallEval):
+ (JSC::JIT::compileCallEvalSlowCase):
+ (JSC::JIT::compileOpCall):
+ * jit/JITInlineMethods.h: Have some clean-up work as well.
+ (JSC):
+ (JSC::JIT::emitPutCellToCallFrameHeader):
+ (JSC::JIT::emitPutIntToCallFrameHeader):
+ (JSC::JIT::emitPutToCallFrameHeader):
+ (JSC::JIT::emitGetFromCallFrameHeader32):
+ (JSC::JIT::emitGetFromCallFrameHeader64):
+ (JSC::JIT::emitAllocateJSArray):
+ (JSC::JIT::emitValueProfilingSite):
+ (JSC::JIT::emitGetJITStubArg):
+ (JSC::JIT::emitGetVirtualRegister):
+ (JSC::JIT::emitPutVirtualRegister):
+ (JSC::JIT::emitInitRegister):
+ (JSC::JIT::emitJumpIfJSCell):
+ (JSC::JIT::emitJumpIfBothJSCells):
+ (JSC::JIT::emitJumpIfNotJSCell):
+ (JSC::JIT::emitLoadInt32ToDouble):
+ (JSC::JIT::emitJumpIfImmediateInteger):
+ (JSC::JIT::emitJumpIfNotImmediateInteger):
+ (JSC::JIT::emitJumpIfNotImmediateIntegers):
+ (JSC::JIT::emitFastArithReTagImmediate):
+ (JSC::JIT::emitFastArithIntToImmNoCheck):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::privateCompileCTINativeCall):
+ (JSC::JIT::emit_op_mov):
+ (JSC::JIT::emit_op_instanceof):
+ (JSC::JIT::emit_op_is_undefined):
+ (JSC::JIT::emit_op_is_boolean):
+ (JSC::JIT::emit_op_is_number):
+ (JSC::JIT::emit_op_tear_off_activation):
+ (JSC::JIT::emit_op_not):
+ (JSC::JIT::emit_op_jfalse):
+ (JSC::JIT::emit_op_jeq_null):
+ (JSC::JIT::emit_op_jneq_null):
+ (JSC::JIT::emit_op_jtrue):
+ (JSC::JIT::emit_op_bitxor):
+ (JSC::JIT::emit_op_bitor):
+ (JSC::JIT::emit_op_get_pnames):
+ (JSC::JIT::emit_op_next_pname):
+ (JSC::JIT::compileOpStrictEq):
+ (JSC::JIT::emit_op_catch):
+ (JSC::JIT::emit_op_throw_reference_error):
+ (JSC::JIT::emit_op_eq_null):
+ (JSC::JIT::emit_op_neq_null):
+ (JSC::JIT::emit_op_create_activation):
+ (JSC::JIT::emit_op_create_arguments):
+ (JSC::JIT::emit_op_init_lazy_reg):
+ (JSC::JIT::emitSlow_op_convert_this):
+ (JSC::JIT::emitSlow_op_not):
+ (JSC::JIT::emit_op_get_argument_by_val):
+ (JSC::JIT::emit_op_put_to_base):
+ (JSC::JIT::emit_resolve_operations):
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emitContiguousGetByVal):
+ (JSC::JIT::emitArrayStorageGetByVal):
+ (JSC::JIT::emitSlow_op_get_by_val):
+ (JSC::JIT::compileGetDirectOffset):
+ (JSC::JIT::emit_op_get_by_pname):
+ (JSC::JIT::emitContiguousPutByVal):
+ (JSC::JIT::emitArrayStoragePutByVal):
+ (JSC::JIT::compileGetByIdHotPath):
+ (JSC::JIT::emit_op_put_by_id):
+ (JSC::JIT::compilePutDirectOffset):
+ (JSC::JIT::emit_op_init_global_const):
+ (JSC::JIT::emit_op_init_global_const_check):
+ (JSC::JIT::emitIntTypedArrayGetByVal):
+ (JSC::JIT::emitFloatTypedArrayGetByVal):
+ (JSC::JIT::emitFloatTypedArrayPutByVal):
+ * jit/JITStubCall.h:
+ (JITStubCall):
+ (JSC::JITStubCall::JITStubCall):
+ (JSC::JITStubCall::addArgument):
+ (JSC::JITStubCall::call):
+ (JSC::JITStubCall::callWithValueProfiling):
+ * jit/JSInterfaceJIT.h:
+ (JSC::JSInterfaceJIT::emitJumpIfImmediateNumber):
+ (JSC::JSInterfaceJIT::emitJumpIfNotImmediateNumber):
+ (JSC::JSInterfaceJIT::emitLoadJSCell):
+ (JSC::JSInterfaceJIT::emitLoadInt32):
+ (JSC::JSInterfaceJIT::emitLoadDouble):
+ * jit/SpecializedThunkJIT.h:
+ (JSC::SpecializedThunkJIT::returnDouble):
+ (JSC::SpecializedThunkJIT::tagReturnAsInt32):
+ * runtime/JSValue.cpp:
+ (JSC::JSValue::description):
+ * runtime/JSValue.h: Define JSVALUE64 EncodedJSValue as int64_t, which is also unified with JSVALUE32_64.
+ (JSC):
+ * runtime/JSValueInlineMethods.h: New implementation of some JSValue methods to make them more conformant
+ with the new rule that "JSValue is a 64-bit integer rather than a pointer" for JSVALUE64 platforms.
+ (JSC):
+ (JSC::JSValue::JSValue):
+ (JSC::JSValue::operator bool):
+ (JSC::JSValue::operator==):
+ (JSC::JSValue::operator!=):
+ (JSC::reinterpretDoubleToInt64):
+ (JSC::reinterpretInt64ToDouble):
+ (JSC::JSValue::asDouble):
+
+2012-10-18 Michael Saboff <msaboff@apple.com>
+
+ convertUTF8ToUTF16() Should Check for ASCII Input
+ ihttps://bugs.webkit.org/show_bug.cgi?id=99739
+
+ Reviewed by Geoffrey Garen.
+
+ Using the updated convertUTF8ToUTF16() , we can determine if is makes more sense to
+ create a string using the 8 bit source. Added a new OpaqueJSString::create(LChar*, unsigned).
+ Had to add a cast n JSStringCreateWithCFString to differentiate which create() to call.
+
+ * API/JSStringRef.cpp:
+ (JSStringCreateWithUTF8CString):
+ * API/JSStringRefCF.cpp:
+ (JSStringCreateWithCFString):
+ * API/OpaqueJSString.h:
+ (OpaqueJSString::create):
+ (OpaqueJSString):
+ (OpaqueJSString::OpaqueJSString):
+
+2012-10-18 Oliver Hunt <oliver@apple.com>
+
+ Unbreak jsc tests. Last minute "clever"-ness is clearly just not
+ a good plan.
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+
+2012-10-18 Oliver Hunt <oliver@apple.com>
+
+ Bytecode should not have responsibility for determining how to perform non-local resolves
+ https://bugs.webkit.org/show_bug.cgi?id=99349
+
+ Reviewed by Gavin Barraclough.
+
+ This patch removes lexical analysis from the bytecode generation. This allows
+ us to delay lookup of a non-local variables until the lookup is actually necessary,
+ and simplifies a lot of the resolve logic in BytecodeGenerator.
+
+ Once a lookup is performed we cache the lookup information in a set of out-of-line
+ buffers in CodeBlock. This allows subsequent lookups to avoid unnecessary hashing,
+ etc, and allows the respective JITs to recreated optimal lookup code.
+
+ This is currently still a performance regression in LLInt, but most of the remaining
+ regression is caused by a lot of indirection that I'll remove in future work, as well
+ as some work necessary to allow LLInt to perform in line instruction repatching.
+ We will also want to improve the behaviour of the baseline JIT for some of the lookup
+ operations, however this patch was getting quite large already so I'm landing it now
+ that we've reached the bar of "performance-neutral".
+
+ Basic browsing seems to work.
+
* GNUmakefile.list.am:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
- (JSC):
- (JSC::isGlobalResolve):
- (JSC::instructionOffsetForNth):
- (JSC::printGlobalResolveInfo):
(JSC::CodeBlock::printStructures):
(JSC::CodeBlock::dump):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::visitStructures):
+ (JSC):
(JSC::CodeBlock::finalizeUnconditionally):
- (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
- (JSC::CodeBlock::globalResolveInfoForBytecodeOffset):
(JSC::CodeBlock::shrinkToFit):
* bytecode/CodeBlock.h:
+ (JSC::CodeBlock::addResolve):
+ (JSC::CodeBlock::addPutToBase):
(CodeBlock):
- (JSC::CodeBlock::addGlobalResolveInstruction):
- (JSC::CodeBlock::addGlobalResolveInfo):
- (JSC::CodeBlock::globalResolveInfo):
- (JSC::CodeBlock::numberOfGlobalResolveInfos):
- (JSC::CodeBlock::globalResolveInfoCount):
+ (JSC::CodeBlock::resolveOperations):
+ (JSC::CodeBlock::putToBaseOperation):
+ (JSC::CodeBlock::numberOfResolveOperations):
+ (JSC::CodeBlock::numberOfPutToBaseOperations):
+ (JSC::CodeBlock::addPropertyAccessInstruction):
+ (JSC::CodeBlock::globalObjectConstant):
+ (JSC::CodeBlock::setGlobalObjectConstant):
* bytecode/Opcode.h:
(JSC):
(JSC::padOpcodeName):
* bytecode/ResolveGlobalStatus.cpp:
- (JSC):
(JSC::computeForStructure):
- (JSC::computeForLLInt):
(JSC::ResolveGlobalStatus::computeFor):
* bytecode/ResolveGlobalStatus.h:
(JSC):
(ResolveGlobalStatus):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::ResolveResult::checkValidity):
- (JSC::ResolveResult::registerPointer):
(JSC):
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::resolve):
@@ -66,30 +634,29 @@
(JSC::BytecodeGenerator::emitResolve):
(JSC::BytecodeGenerator::emitResolveBase):
(JSC::BytecodeGenerator::emitResolveBaseForPut):
- (JSC::BytecodeGenerator::emitResolveWithBase):
+ (JSC::BytecodeGenerator::emitResolveWithBaseForPut):
(JSC::BytecodeGenerator::emitResolveWithThis):
- (JSC::BytecodeGenerator::emitGetStaticVar):
+ (JSC::BytecodeGenerator::emitGetLocalVar):
(JSC::BytecodeGenerator::emitInitGlobalConst):
- (JSC::BytecodeGenerator::emitPutStaticVar):
+ (JSC::BytecodeGenerator::emitPutToBase):
* bytecompiler/BytecodeGenerator.h:
(JSC::ResolveResult::registerResolve):
(JSC::ResolveResult::dynamicResolve):
- (JSC::ResolveResult::lexicalResolve):
- (JSC::ResolveResult::indexedGlobalResolve):
- (JSC::ResolveResult::dynamicIndexedGlobalResolve):
- (JSC::ResolveResult::globalResolve):
- (JSC::ResolveResult::dynamicGlobalResolve):
- (JSC::ResolveResult::type):
- (JSC::ResolveResult::index):
- (JSC::ResolveResult::depth):
- (JSC::ResolveResult::globalObject):
(ResolveResult):
- (JSC::ResolveResult::isStatic):
- (JSC::ResolveResult::isIndexed):
- (JSC::ResolveResult::isScoped):
- (JSC::ResolveResult::isGlobal):
(JSC::ResolveResult::ResolveResult):
+ (JSC):
+ (NonlocalResolveInfo):
+ (JSC::NonlocalResolveInfo::NonlocalResolveInfo):
+ (JSC::NonlocalResolveInfo::~NonlocalResolveInfo):
+ (JSC::NonlocalResolveInfo::resolved):
+ (JSC::NonlocalResolveInfo::put):
(BytecodeGenerator):
+ (JSC::BytecodeGenerator::getResolveOperations):
+ (JSC::BytecodeGenerator::getResolveWithThisOperations):
+ (JSC::BytecodeGenerator::getResolveBaseOperations):
+ (JSC::BytecodeGenerator::getResolveBaseForPutOperations):
+ (JSC::BytecodeGenerator::getResolveWithBaseForPutOperations):
+ (JSC::BytecodeGenerator::getPutToBaseOperation):
* bytecompiler/NodesCodegen.cpp:
(JSC::ResolveNode::isPure):
(JSC::FunctionCallResolveNode::emitBytecode):
@@ -105,18 +672,25 @@
(ByteCodeParser):
(InlineStackEntry):
(JSC::DFG::ByteCodeParser::handleGetByOffset):
+ (DFG):
+ (JSC::DFG::ByteCodeParser::parseResolveOperations):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
* dfg/DFGCapabilities.h:
+ (JSC::DFG::canInlineResolveOperations):
(DFG):
(JSC::DFG::canCompileOpcode):
(JSC::DFG::canInlineOpcode):
* dfg/DFGGraph.h:
(ResolveGlobalData):
+ (ResolveOperationData):
(DFG):
+ (PutToBaseOperationData):
(Graph):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasIdentifier):
+ (JSC::DFG::Node::resolveOperationsDataIndex):
+ (Node):
* dfg/DFGNodeType.h:
(DFG):
* dfg/DFGOSRExit.cpp:
@@ -130,7 +704,6 @@
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
- (JSC):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGRepatch.cpp:
@@ -138,6 +711,9 @@
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward):
* dfg/DFGSpeculativeJIT.h:
+ (JSC::DFG::SpeculativeJIT::resolveOperations):
+ (SpeculativeJIT):
+ (JSC::DFG::SpeculativeJIT::putToBaseOperation):
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
@@ -150,43 +726,31 @@
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
(JIT):
- (JSC::JIT::emit_op_get_global_var_watchable):
* jit/JITOpcodes.cpp:
- (JSC::JIT::emit_op_resolve):
+ (JSC::JIT::emit_op_put_to_base):
(JSC):
+ (JSC::JIT::emit_resolve_operations):
+ (JSC::JIT::emitSlow_link_resolve_operations):
+ (JSC::JIT::emit_op_resolve):
+ (JSC::JIT::emitSlow_op_resolve):
(JSC::JIT::emit_op_resolve_base):
- (JSC::JIT::emit_op_resolve_skip):
- (JSC::JIT::emit_op_resolve_global):
- (JSC::JIT::emitSlow_op_resolve_global):
+ (JSC::JIT::emitSlow_op_resolve_base):
(JSC::JIT::emit_op_resolve_with_base):
+ (JSC::JIT::emitSlow_op_resolve_with_base):
(JSC::JIT::emit_op_resolve_with_this):
- (JSC::JIT::emit_op_resolve_global_dynamic):
- (JSC::JIT::emitSlow_op_resolve_global_dynamic):
+ (JSC::JIT::emitSlow_op_resolve_with_this):
+ (JSC::JIT::emitSlow_op_put_to_base):
* jit/JITOpcodes32_64.cpp:
- (JSC::JIT::emit_op_resolve):
+ (JSC::JIT::emit_op_put_to_base):
(JSC):
- (JSC::JIT::emit_op_resolve_base):
- (JSC::JIT::emit_op_resolve_skip):
- (JSC::JIT::emit_op_resolve_global):
- (JSC::JIT::emitSlow_op_resolve_global):
- (JSC::JIT::emit_op_resolve_with_base):
- (JSC::JIT::emit_op_resolve_with_this):
* jit/JITPropertyAccess.cpp:
- (JSC::JIT::emit_op_get_scoped_var):
- (JSC):
- (JSC::JIT::emit_op_put_scoped_var):
- (JSC::JIT::emit_op_get_global_var):
- (JSC::JIT::emit_op_put_global_var):
- (JSC::JIT::emit_op_put_global_var_check):
- (JSC::JIT::emitSlow_op_put_global_var_check):
+ (JSC::JIT::emit_op_init_global_const):
+ (JSC::JIT::emit_op_init_global_const_check):
+ (JSC::JIT::emitSlow_op_init_global_const_check):
* jit/JITPropertyAccess32_64.cpp:
- (JSC::JIT::emit_op_get_scoped_var):
- (JSC):
- (JSC::JIT::emit_op_put_scoped_var):
- (JSC::JIT::emit_op_get_global_var):
- (JSC::JIT::emit_op_put_global_var):
- (JSC::JIT::emit_op_put_global_var_check):
- (JSC::JIT::emitSlow_op_put_global_var_check):
+ (JSC::JIT::emit_op_init_global_const):
+ (JSC::JIT::emit_op_init_global_const_check):
+ (JSC::JIT::emitSlow_op_init_global_const_check):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
(JSC):
@@ -200,18 +764,163 @@
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSScope.cpp:
+ (JSC::LookupResult::base):
+ (JSC::LookupResult::value):
+ (JSC::LookupResult::setBase):
+ (JSC::LookupResult::setValue):
+ (LookupResult):
+ (JSC):
+ (JSC::setPutPropertyAccessOffset):
+ (JSC::executeResolveOperations):
+ (JSC::JSScope::resolveContainingScopeInternal):
+ (JSC::JSScope::resolveContainingScope):
(JSC::JSScope::resolve):
- (JSC::JSScope::resolveSkip):
- (JSC::JSScope::resolveGlobal):
- (JSC::JSScope::resolveGlobalDynamic):
(JSC::JSScope::resolveBase):
(JSC::JSScope::resolveWithBase):
(JSC::JSScope::resolveWithThis):
+ (JSC::JSScope::resolvePut):
+ (JSC::JSScope::resolveGlobal):
* runtime/JSScope.h:
(JSScope):
* runtime/JSVariableObject.cpp:
+ (JSC):
* runtime/JSVariableObject.h:
+ (JSVariableObject):
* runtime/Structure.h:
+ (JSC::Structure::propertyAccessesAreCacheable):
+ (Structure):
+
+2012-10-18 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Live oversize copied blocks should count toward overall heap fragmentation
+ https://bugs.webkit.org/show_bug.cgi?id=99548
+
+ Reviewed by Filip Pizlo.
+
+ The CopiedSpace uses overall heap fragmentation to determine whether or not it should do any copying.
+ Currently it doesn't include live oversize CopiedBlocks in the calculation, but it should. We should
+ treat them as 100% utilized, since running a copying phase won't be able to free/compact any of their
+ memory. We can also free any dead oversize CopiedBlocks while we're iterating over them, rather than
+ iterating over them again at the end of the copying phase.
+
+ * heap/CopiedSpace.cpp:
+ (JSC::CopiedSpace::doneFillingBlock):
+ (JSC::CopiedSpace::startedCopying):
+ (JSC::CopiedSpace::doneCopying): Also removed a branch when iterating over from-space at the end of
+ copying. Since we eagerly recycle blocks as soon as they're fully evacuated, we should see no
+ unpinned blocks in from-space at the end of copying.
+ * heap/CopiedSpaceInlineMethods.h:
+ (JSC::CopiedSpace::recycleBorrowedBlock):
+ * heap/CopyVisitorInlineMethods.h:
+ (JSC::CopyVisitor::checkIfShouldCopy):
+
+2012-10-18 Roger Fong <roger_fong@apple.com>
+
+ Unreviewed. Build fix after r131701 and r131777.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2012-10-18 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Race condition between GCThread and main thread during copying phase
+ https://bugs.webkit.org/show_bug.cgi?id=99641
+
+ Reviewed by Filip Pizlo.
+
+ When a GCThread returns from copyFromShared(), it then calls doneCopying(), which returns
+ its borrowed CopiedBlock to the CopiedSpace. This final block allows the CopiedSpace to
+ continue and finish the cleanup of the copying phase. However, the GCThread can loop back
+ around, see that m_currentPhase is still "Copy", and try to go through the copying phase again.
+ This can cause all sorts of issues. To fix this, we should add a cyclic barrier to GCThread::waitForNextPhase().
+
+ * heap/GCThread.cpp:
+ (JSC::GCThread::waitForNextPhase): All GCThreads will wait when they finish one iteration until the main thread
+ notifies them to move down to the second while loop, where they wait for the next GCPhase to start. They also
+ decrement the m_numberOfActiveGCThreads counter as they begin to wait for the next phase and increment it as
+ they enter the next phase. This allows the main thread to wait in endCurrentPhase() until all the threads have
+ finished the current phase and are waiting on the next phase to begin. Without the counter, there would be
+ no way to ensure that every thread was available for each GCPhase.
+ (JSC::GCThread::gcThreadMain): We now use the m_phaseLock to synchronize with the main thread when we're being created.
+ * heap/GCThreadSharedData.cpp:
+ (JSC::GCThreadSharedData::GCThreadSharedData): As we create each GCThread, we increment the m_numberOfActiveGCThreads
+ counter. When we are done creating the threads, we wait until they're all waiting for the next GCPhase. This prevents
+ us from leaving some GCThreads behind during the first GCPhase, which could hurt us on our very short-running
+ benchmarks (e.g. SunSpider).
+ (JSC::GCThreadSharedData::~GCThreadSharedData):
+ (JSC::GCThreadSharedData::startNextPhase): We atomically swap the two flags, m_gcThreadsShouldWait and m_currentPhase,
+ so that if the threads finish very quickly, they will wait until the main thread is ready to end the current phase.
+ (JSC::GCThreadSharedData::endCurrentPhase): Here atomically we swap the two flags again to allow the threads to
+ advance to waiting on the next GCPhase. We wait until all of the GCThreads have settled into the second wait loop
+ before allowing the main thread to continue. This prevents us from leaving one of the GCThreads stuck in the first
+ wait loop if we were to call startNextPhase() before it had time to wake up and move on to the second wait loop.
+ (JSC):
+ (JSC::GCThreadSharedData::didStartMarking): We now use startNextPhase() to properly swap the flags.
+ (JSC::GCThreadSharedData::didFinishMarking): Ditto for endCurrentPhase().
+ (JSC::GCThreadSharedData::didStartCopying): Ditto.
+ (JSC::GCThreadSharedData::didFinishCopying): Ditto.
+ * heap/GCThreadSharedData.h:
+ (GCThreadSharedData):
+ * heap/Heap.cpp:
+ (JSC::Heap::copyBackingStores): No reason to use the extra reference.
+
+2012-10-18 Pablo Flouret <pablof@motorola.com>
+
+ Implement css3-conditional's @supports rule
+ https://bugs.webkit.org/show_bug.cgi?id=86146
+
+ Reviewed by Antti Koivisto.
+
+ * Configurations/FeatureDefines.xcconfig:
+ Add an ENABLE_CSS3_CONDITIONAL_RULES flag.
+
+2012-10-18 Michael Saboff <msaboff@apple.com>
+
+ Make conversion between JSStringRef and WKStringRef work without character size conversions
+ https://bugs.webkit.org/show_bug.cgi?id=99727
+
+ Reviewed by Anders Carlsson.
+
+ Export the string() method for use in WebKit.
+
+ * API/OpaqueJSString.h:
+ (OpaqueJSString::string):
+
+2012-10-18 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+
+ [CMake] Avoid unnecessarily running the LLInt generation commands.
+ https://bugs.webkit.org/show_bug.cgi?id=99708
+
+ Reviewed by Rob Buis.
+
+ As described in the comments in the change itself, in some cases
+ the Ruby generation scripts used when LLInt is on would each be
+ run twice in every build even if nothing had changed.
+
+ Fix that by not setting the OBJECT_DEPENDS property of some source
+ files to depend on the generated headers; instead, they are now
+ just part of the final binaries/libraries which use them.
+
+ * CMakeLists.txt:
+
+2012-10-17 Zoltan Horvath <zoltan@webkit.org>
+
+ Remove the JSHeap memory measurement of the PageLoad performacetests since it creates bogus JSGlobalDatas
+ https://bugs.webkit.org/show_bug.cgi?id=99609
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove the implementation since it creates bogus JSGlobalDatas in the layout tests.
+
+ * heap/HeapStatistics.cpp:
+ (JSC):
+ * heap/HeapStatistics.h:
+ (HeapStatistics):
+
+2012-10-17 Sam Weinig <sam@webkit.org>
+
+ Attempt to fix the build.
+
+ * bytecode/GlobalResolveInfo.h: Copied from bytecode/GlobalResolveInfo.h.
2012-10-17 Filip Pizlo <fpizlo@apple.com>
diff --git a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
index 19d4b4037..79a458eca 100644
--- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
+++ b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
@@ -47,7 +47,8 @@ ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
ENABLE_CSS_COMPOSITING = ENABLE_CSS_COMPOSITING;
ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
ENABLE_CSS_VARIABLES = ;
-ENABLE_CSS3_TEXT_DECORATION = ;
+ENABLE_CSS3_CONDITIONAL_RULES = ;
+ENABLE_CSS3_TEXT = ;
ENABLE_CUSTOM_SCHEME_HANDLER = ;
ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
@@ -147,4 +148,4 @@ ENABLE_WEB_TIMING = ;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/JavaScriptCore/GNUmakefile.list.am b/Source/JavaScriptCore/GNUmakefile.list.am
index ae5854b91..243894d39 100644
--- a/Source/JavaScriptCore/GNUmakefile.list.am
+++ b/Source/JavaScriptCore/GNUmakefile.list.am
@@ -106,7 +106,6 @@ javascriptcore_sources += \
Source/JavaScriptCore/bytecode/ExpressionRangeInfo.h \
Source/JavaScriptCore/bytecode/GetByIdStatus.cpp \
Source/JavaScriptCore/bytecode/GetByIdStatus.h \
- Source/JavaScriptCore/bytecode/GlobalResolveInfo.h \
Source/JavaScriptCore/bytecode/HandlerInfo.h \
Source/JavaScriptCore/bytecode/Instruction.h \
Source/JavaScriptCore/bytecode/JumpTable.cpp \
@@ -133,6 +132,7 @@ javascriptcore_sources += \
Source/JavaScriptCore/bytecode/PutKind.h \
Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp \
Source/JavaScriptCore/bytecode/ResolveGlobalStatus.h \
+ Source/JavaScriptCore/bytecode/ResolveOperation.h \
Source/JavaScriptCore/bytecode/SamplingTool.cpp \
Source/JavaScriptCore/bytecode/SamplingTool.h \
Source/JavaScriptCore/bytecode/SpecialPointer.cpp \
@@ -732,6 +732,7 @@ offlineasm_nosources += \
Source/JavaScriptCore/offlineasm/opt.rb \
Source/JavaScriptCore/offlineasm/parser.rb \
Source/JavaScriptCore/offlineasm/registers.rb \
+ Source/JavaScriptCore/offlineasm/risc.rb \
Source/JavaScriptCore/offlineasm/self_hash.rb \
Source/JavaScriptCore/offlineasm/settings.rb \
Source/JavaScriptCore/offlineasm/transform.rb \
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index 0724ca1ca..a386b4c2b 100755
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -115,10 +115,11 @@ EXPORTS
?constructString@JSC@@YAPAVStringObject@1@PAVExecState@1@PAVJSGlobalObject@1@VJSValue@1@@Z
?convertLatin1ToUTF8@Unicode@WTF@@YA?AW4ConversionResult@12@PAPBEPBEPAPADPAD@Z
?convertUTF16ToUTF8@Unicode@WTF@@YA?AW4ConversionResult@12@PAPB_WPB_WPAPADPAD_N@Z
- ?convertUTF8ToUTF16@Unicode@WTF@@YA?AW4ConversionResult@12@PAPBDPBDPAPA_WPA_W_N@Z
+ ?convertUTF8ToUTF16@Unicode@WTF@@YA?AW4ConversionResult@12@PAPBDPBDPAPA_WPA_WPA_N_N@Z
?copyBackingStore@JSObject@JSC@@SAXPAVJSCell@2@AAVCopyVisitor@2@@Z
?create@JSFunction@JSC@@SAPAV12@PAVExecState@2@PAVJSGlobalObject@2@HABVString@WTF@@P6I_J0@ZW4Intrinsic@2@3@Z
?create@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@W4ThreadStackType@2@W4HeapType@2@@Z
+ ?create@OpaqueJSString@@SA?AV?$PassRefPtr@UOpaqueJSString@@@WTF@@ABVString@3@@Z
?create@RegExp@JSC@@SAPAV12@AAVJSGlobalData@2@ABVString@WTF@@W4RegExpFlags@2@@Z
?createEmptyString@SmallStrings@JSC@@AAEXPAVJSGlobalData@2@@Z
?createError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVString@WTF@@@Z
@@ -354,6 +355,7 @@ EXPORTS
?startSampling@JSGlobalData@JSC@@QAEXXZ
?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVString@4@@Z
?stopSampling@JSGlobalData@JSC@@QAEXXZ
+ ?string@OpaqueJSString@@QBE?AVString@WTF@@XZ
?StringToDouble@StringToDoubleConverter@double_conversion@WTF@@SANPBDIPAI@Z
?suggestedNewOutOfLineStorageCapacity@Structure@JSC@@QAEIXZ
?sweeper@Heap@JSC@@QAEPAVIncrementalSweeper@2@XZ
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 28c2746dd..1cf109a0b 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -71,7 +71,6 @@
0F0B83B114BCF71800885B4F /* CallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F0B83B414BCF86000885B4F /* MethodCallLinkInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B83B214BCF85E00885B4F /* MethodCallLinkInfo.cpp */; };
0F0B83B514BCF86200885B4F /* MethodCallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B314BCF85E00885B4F /* MethodCallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0F0B83B714BCF8E100885B4F /* GlobalResolveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B614BCF8DF00885B4F /* GlobalResolveInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F0B83B914BCF95F00885B4F /* CallReturnOffsetToBytecodeOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F0CD4C215F1A6070032F1C0 /* PutDirectIndexMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0CD4C015F1A6040032F1C0 /* PutDirectIndexMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F0CD4C415F6B6BB0032F1C0 /* SparseArrayValueMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0CD4C315F6B6B50032F1C0 /* SparseArrayValueMap.cpp */; };
@@ -588,6 +587,7 @@
A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */; };
A784A26111D16622005776AC /* ASTBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */; };
A784A26411D16622005776AC /* SyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */; };
+ A7AFC17915F7EFE30048F57B /* ResolveOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = A7AFC17715F7EFE30048F57B /* ResolveOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */; };
A7B4ACAF1484C9CE00B38A36 /* JSExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4ACAE1484C9CE00B38A36 /* JSExportMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */; };
@@ -855,7 +855,6 @@
0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallLinkInfo.h; sourceTree = "<group>"; };
0F0B83B214BCF85E00885B4F /* MethodCallLinkInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MethodCallLinkInfo.cpp; sourceTree = "<group>"; };
0F0B83B314BCF85E00885B4F /* MethodCallLinkInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodCallLinkInfo.h; sourceTree = "<group>"; };
- 0F0B83B614BCF8DF00885B4F /* GlobalResolveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlobalResolveInfo.h; sourceTree = "<group>"; };
0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallReturnOffsetToBytecodeOffset.h; sourceTree = "<group>"; };
0F0CD4C015F1A6040032F1C0 /* PutDirectIndexMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PutDirectIndexMode.h; sourceTree = "<group>"; };
0F0CD4C315F6B6B50032F1C0 /* SparseArrayValueMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SparseArrayValueMap.cpp; sourceTree = "<group>"; };
@@ -1390,6 +1389,7 @@
A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObjectRefPrivate.h; sourceTree = "<group>"; };
A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTBuilder.h; sourceTree = "<group>"; };
A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SyntaxChecker.h; sourceTree = "<group>"; };
+ A7AFC17715F7EFE30048F57B /* ResolveOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResolveOperation.h; sourceTree = "<group>"; };
A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableAllocator.h; sourceTree = "<group>"; };
A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocator.cpp; sourceTree = "<group>"; };
A7B4ACAE1484C9CE00B38A36 /* JSExportMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExportMacros.h; sourceTree = "<group>"; };
@@ -2520,6 +2520,14 @@
0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */,
0F93329314CA7DC10085F3C6 /* CallLinkStatus.cpp */,
0F93329414CA7DC10085F3C6 /* CallLinkStatus.h */,
+ 0F93329514CA7DC10085F3C6 /* GetByIdStatus.cpp */,
+ 0F93329614CA7DC10085F3C6 /* GetByIdStatus.h */,
+ 0F93329714CA7DC10085F3C6 /* MethodCallLinkStatus.cpp */,
+ 0F93329814CA7DC10085F3C6 /* MethodCallLinkStatus.h */,
+ 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */,
+ 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */,
+ A7AFC17715F7EFE30048F57B /* ResolveOperation.h */,
+ 0F93329B14CA7DC10085F3C6 /* StructureSet.h */,
0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */,
969A07900ED1D3AE00F1F681 /* CodeBlock.cpp */,
969A07910ED1D3AE00F1F681 /* CodeBlock.h */,
@@ -2535,7 +2543,6 @@
0F0B83AA14BCF5B900885B4F /* ExpressionRangeInfo.h */,
0F93329514CA7DC10085F3C6 /* GetByIdStatus.cpp */,
0F93329614CA7DC10085F3C6 /* GetByIdStatus.h */,
- 0F0B83B614BCF8DF00885B4F /* GlobalResolveInfo.h */,
0F0B83A814BCF55E00885B4F /* HandlerInfo.h */,
969A07930ED1D3AE00F1F681 /* Instruction.h */,
BCFD8C900EEB2EE700283848 /* JumpTable.cpp */,
@@ -2894,7 +2901,6 @@
0F0B83AD14BCF60400885B4F /* LineInfo.h in Headers */,
0F0B83B114BCF71800885B4F /* CallLinkInfo.h in Headers */,
0F0B83B514BCF86200885B4F /* MethodCallLinkInfo.h in Headers */,
- 0F0B83B714BCF8E100885B4F /* GlobalResolveInfo.h in Headers */,
0F0B83B914BCF95F00885B4F /* CallReturnOffsetToBytecodeOffset.h in Headers */,
0F0FC45A14BD15F500B81154 /* LLIntCallLinkInfo.h in Headers */,
0F21C26814BE5F6800ADC64B /* JITDriver.h in Headers */,
@@ -2987,6 +2993,7 @@
14874AE615EBDE4A002E3587 /* JSScope.h in Headers */,
FED287B215EC9A5700DA8161 /* LLIntOpcode.h in Headers */,
1442566215EDE98D0066A49B /* JSWithScope.h in Headers */,
+ A7AFC17915F7EFE30048F57B /* ResolveOperation.h in Headers */,
0FB7F39515ED8E4600F167B2 /* ArrayConventions.h in Headers */,
0FB7F39615ED8E4600F167B2 /* ArrayStorage.h in Headers */,
0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */,
diff --git a/Source/JavaScriptCore/assembler/MacroAssembler.h b/Source/JavaScriptCore/assembler/MacroAssembler.h
index 4d4a960d3..642b5ca6b 100644
--- a/Source/JavaScriptCore/assembler/MacroAssembler.h
+++ b/Source/JavaScriptCore/assembler/MacroAssembler.h
@@ -728,16 +728,6 @@ public:
return store64WithAddressOffsetPatch(src, address);
}
- void movePtrToDouble(RegisterID src, FPRegisterID dest)
- {
- move64ToDouble(src, dest);
- }
-
- void moveDoubleToPtr(FPRegisterID src, RegisterID dest)
- {
- moveDoubleTo64(src, dest);
- }
-
void comparePtr(RelationalCondition cond, RegisterID left, TrustedImm32 right, RegisterID dest)
{
compare64(cond, left, right, dest);
@@ -895,14 +885,6 @@ public:
default: {
if (value <= 0xff)
return false;
- JSValue jsValue = JSValue::decode(reinterpret_cast<void*>(value));
- if (jsValue.isInt32())
- return shouldBlind(Imm32(jsValue.asInt32()));
- if (jsValue.isDouble() && !shouldBlindDouble(jsValue.asDouble()))
- return false;
-
- if (!shouldBlindDouble(bitwise_cast<double>(value)))
- return false;
}
}
return shouldBlindForSpecificArch(value);
@@ -956,6 +938,14 @@ public:
default: {
if (value <= 0xff)
return false;
+ JSValue jsValue = JSValue::decode(value);
+ if (jsValue.isInt32())
+ return shouldBlind(Imm32(jsValue.asInt32()));
+ if (jsValue.isDouble() && !shouldBlindDouble(jsValue.asDouble()))
+ return false;
+
+ if (!shouldBlindDouble(bitwise_cast<double>(value)))
+ return false;
}
}
return shouldBlindForSpecificArch(value);
diff --git a/Source/JavaScriptCore/bytecode/ArrayProfile.cpp b/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
index 3ba974d74..de7f67887 100644
--- a/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
+++ b/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
@@ -26,8 +26,44 @@
#include "config.h"
#include "ArrayProfile.h"
+#include <wtf/StringExtras.h>
+
namespace JSC {
+const char* arrayModesToString(ArrayModes arrayModes)
+{
+ if (!arrayModes)
+ return "0:<empty>";
+
+ if (arrayModes == ALL_ARRAY_MODES)
+ return "TOP";
+
+ bool isNonArray = !!(arrayModes & NonArray);
+ bool isNonArrayWithContiguous = !!(arrayModes & NonArrayWithContiguous);
+ bool isNonArrayWithArrayStorage = !!(arrayModes & NonArrayWithArrayStorage);
+ bool isNonArrayWithSlowPutArrayStorage = !!(arrayModes & NonArrayWithSlowPutArrayStorage);
+ bool isArray = !!(arrayModes & ArrayClass);
+ bool isArrayWithContiguous = !!(arrayModes & ArrayWithContiguous);
+ bool isArrayWithArrayStorage = !!(arrayModes & ArrayWithArrayStorage);
+ bool isArrayWithSlowPutArrayStorage = !!(arrayModes & ArrayWithSlowPutArrayStorage);
+
+ static char result[256];
+ snprintf(
+ result, sizeof(result),
+ "%u:%s%s%s%s%s%s%s%s",
+ arrayModes,
+ isNonArray ? "NonArray" : "",
+ isNonArrayWithContiguous ? "NonArrayWithContiguous" : "",
+ isNonArrayWithArrayStorage ? " NonArrayWithArrayStorage" : "",
+ isNonArrayWithSlowPutArrayStorage ? "NonArrayWithSlowPutArrayStorage" : "",
+ isArray ? "ArrayClass" : "",
+ isArrayWithContiguous ? "ArrayWithContiguous" : "",
+ isArrayWithArrayStorage ? " ArrayWithArrayStorage" : "",
+ isArrayWithSlowPutArrayStorage ? "ArrayWithSlowPutArrayStorage" : "");
+
+ return result;
+}
+
void ArrayProfile::computeUpdatedPrediction(OperationInProgress operation)
{
if (m_lastSeenStructure) {
diff --git a/Source/JavaScriptCore/bytecode/ArrayProfile.h b/Source/JavaScriptCore/bytecode/ArrayProfile.h
index 3b462eaba..ffc136258 100644
--- a/Source/JavaScriptCore/bytecode/ArrayProfile.h
+++ b/Source/JavaScriptCore/bytecode/ArrayProfile.h
@@ -40,13 +40,44 @@ class LLIntOffsetsExtractor;
typedef unsigned ArrayModes;
#define asArrayModes(type) \
- (1 << static_cast<unsigned>(type))
+ (static_cast<unsigned>(1) << static_cast<unsigned>(type))
+
+#define ALL_NON_ARRAY_ARRAY_MODES \
+ (asArrayModes(NonArray) \
+ | asArrayModes(NonArrayWithContiguous) \
+ | asArrayModes(NonArrayWithArrayStorage) \
+ | asArrayModes(NonArrayWithSlowPutArrayStorage))
+
+#define ALL_ARRAY_ARRAY_MODES \
+ (asArrayModes(ArrayClass) \
+ | asArrayModes(ArrayWithContiguous) \
+ | asArrayModes(ArrayWithArrayStorage) \
+ | asArrayModes(ArrayWithSlowPutArrayStorage))
+
+#define ALL_ARRAY_MODES (ALL_NON_ARRAY_ARRAY_MODES | ALL_ARRAY_ARRAY_MODES)
inline ArrayModes arrayModeFromStructure(Structure* structure)
{
return asArrayModes(structure->indexingType());
}
+const char* arrayModesToString(ArrayModes);
+
+inline bool mergeArrayModes(ArrayModes& left, ArrayModes right)
+{
+ ArrayModes newModes = left | right;
+ if (newModes == left)
+ return false;
+ left = newModes;
+ return true;
+}
+
+// Checks if proven is a subset of expected.
+inline bool arrayModesAlreadyChecked(ArrayModes proven, ArrayModes expected)
+{
+ return (expected | proven) == expected;
+}
+
class ArrayProfile {
public:
ArrayProfile()
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index d1151482e..7f86186a0 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -439,34 +439,6 @@ void CodeBlock::printPutByIdOp(ExecState* exec, int location, Vector<Instruction
it += 5;
}
-#if ENABLE(JIT)
-static bool isGlobalResolve(OpcodeID opcodeID)
-{
- return opcodeID == op_resolve_global || opcodeID == op_resolve_global_dynamic;
-}
-
-static unsigned instructionOffsetForNth(ExecState* exec, const RefCountedArray<Instruction>& instructions, int nth, bool (*predicate)(OpcodeID))
-{
- size_t i = 0;
- while (i < instructions.size()) {
- OpcodeID currentOpcode = exec->interpreter()->getOpcodeID(instructions[i].u.opcode);
- if (predicate(currentOpcode)) {
- if (!--nth)
- return i;
- }
- i += opcodeLengths[currentOpcode];
- }
-
- ASSERT_NOT_REACHED();
- return 0;
-}
-
-static void printGlobalResolveInfo(const GlobalResolveInfo& resolveInfo, unsigned instructionOffset)
-{
- dataLog(" [%4d] %s: %s\n", instructionOffset, "resolve_global", pointerToSourceString(resolveInfo.structure).utf8().data());
-}
-#endif
-
void CodeBlock::printStructure(const char* name, const Instruction* vPC, int operand)
{
unsigned instructionOffset = vPC - instructions().begin();
@@ -506,14 +478,6 @@ void CodeBlock::printStructures(const Instruction* vPC)
printStructure("put_by_id_replace", vPC, 4);
return;
}
- if (vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global)) {
- printStructure("resolve_global", vPC, 4);
- return;
- }
- if (vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global_dynamic)) {
- printStructure("resolve_global_dynamic", vPC, 4);
- return;
- }
// These m_instructions doesn't ref Structures.
ASSERT(vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_call) || vPC[0].u.opcode == interpreter->getOpcode(op_call_eval) || vPC[0].u.opcode == interpreter->getOpcode(op_construct));
@@ -577,16 +541,8 @@ void CodeBlock::dump(ExecState* exec)
}
#if ENABLE(JIT)
- if (!m_globalResolveInfos.isEmpty() || !m_structureStubInfos.isEmpty())
+ if (!m_structureStubInfos.isEmpty())
dataLog("\nStructures:\n");
-
- if (!m_globalResolveInfos.isEmpty()) {
- size_t i = 0;
- do {
- printGlobalResolveInfo(m_globalResolveInfos[i], instructionOffsetForNth(exec, instructions(), i + 1, isGlobalResolve));
- ++i;
- } while (i < m_globalResolveInfos.size());
- }
#endif
if (m_rareData && !m_rareData->m_exceptionHandlers.isEmpty()) {
@@ -909,92 +865,30 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
printBinaryOp(exec, location, it, "in");
break;
}
- case op_resolve: {
- int r0 = (++it)->u.operand;
- int id0 = (++it)->u.operand;
- dataLog("[%4d] resolve\t\t %s, %s", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data());
- dumpBytecodeCommentAndNewLine(location);
- it++;
- break;
- }
- case op_resolve_skip: {
- int r0 = (++it)->u.operand;
- int id0 = (++it)->u.operand;
- int skipLevels = (++it)->u.operand;
- dataLog("[%4d] resolve_skip\t %s, %s, %d", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), skipLevels);
- dumpBytecodeCommentAndNewLine(location);
- it++;
- break;
- }
- case op_resolve_global: {
- int r0 = (++it)->u.operand;
+ case op_put_to_base_variable:
+ case op_put_to_base: {
+ int base = (++it)->u.operand;
int id0 = (++it)->u.operand;
- dataLog("[%4d] resolve_global\t %s, %s", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data());
+ int value = (++it)->u.operand;
+ int resolveInfo = (++it)->u.operand;
+ dataLog("[%4d] put_to_base\t %s, %s, %s, %d", location, registerName(exec, base).data(), idName(id0, m_identifiers[id0]).data(), registerName(exec, value).data(), resolveInfo);
dumpBytecodeCommentAndNewLine(location);
- it += 3;
break;
}
- case op_resolve_global_dynamic: {
+ case op_resolve:
+ case op_resolve_global_property:
+ case op_resolve_global_var:
+ case op_resolve_scoped_var:
+ case op_resolve_scoped_var_on_top_scope:
+ case op_resolve_scoped_var_with_top_scope_check: {
int r0 = (++it)->u.operand;
int id0 = (++it)->u.operand;
- JSValue scope = JSValue((++it)->u.jsCell.get());
- ++it;
- int depth = (++it)->u.operand;
- dataLog("[%4d] resolve_global_dynamic\t %s, %s, %s, %d", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), idName(id0, m_identifiers[id0]).data(), depth);
- dumpBytecodeCommentAndNewLine(location);
- ++it;
- break;
- }
- case op_get_scoped_var: {
- int r0 = (++it)->u.operand;
- int index = (++it)->u.operand;
- int skipLevels = (++it)->u.operand;
- dataLog("[%4d] get_scoped_var\t %s, %d, %d", location, registerName(exec, r0).data(), index, skipLevels);
- dumpBytecodeCommentAndNewLine(location);
- it++;
- break;
- }
- case op_put_scoped_var: {
- int index = (++it)->u.operand;
- int skipLevels = (++it)->u.operand;
- int r0 = (++it)->u.operand;
- dataLog("[%4d] put_scoped_var\t %d, %d, %s", location, index, skipLevels, registerName(exec, r0).data());
- dumpBytecodeCommentAndNewLine(location);
- break;
- }
- case op_get_global_var: {
- int r0 = (++it)->u.operand;
- WriteBarrier<Unknown>* registerPointer = (++it)->u.registerPointer;
- dataLog("[%4d] get_global_var\t %s, g%d(%p)", location, registerName(exec, r0).data(), m_globalObject->findRegisterIndex(registerPointer), registerPointer);
+ int resolveInfo = (++it)->u.operand;
+ dataLog("[%4d] resolve\t\t %s, %s, %d", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), resolveInfo);
dumpBytecodeCommentAndNewLine(location);
it++;
break;
}
- case op_get_global_var_watchable: {
- int r0 = (++it)->u.operand;
- WriteBarrier<Unknown>* registerPointer = (++it)->u.registerPointer;
- dataLog("[%4d] get_global_var_watchable\t %s, g%d(%p)", location, registerName(exec, r0).data(), m_globalObject->findRegisterIndex(registerPointer), registerPointer);
- dumpBytecodeCommentAndNewLine(location);
- it++;
- it++;
- break;
- }
- case op_put_global_var: {
- WriteBarrier<Unknown>* registerPointer = (++it)->u.registerPointer;
- int r0 = (++it)->u.operand;
- dataLog("[%4d] put_global_var\t g%d(%p), %s", location, m_globalObject->findRegisterIndex(registerPointer), registerPointer, registerName(exec, r0).data());
- dumpBytecodeCommentAndNewLine(location);
- break;
- }
- case op_put_global_var_check: {
- WriteBarrier<Unknown>* registerPointer = (++it)->u.registerPointer;
- int r0 = (++it)->u.operand;
- dataLog("[%4d] put_global_var_check\t g%d(%p), %s", location, m_globalObject->findRegisterIndex(registerPointer), registerPointer, registerName(exec, r0).data());
- dumpBytecodeCommentAndNewLine(location);
- it++;
- it++;
- break;
- }
case op_init_global_const: {
WriteBarrier<Unknown>* registerPointer = (++it)->u.registerPointer;
int r0 = (++it)->u.operand;
@@ -1011,11 +905,17 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
it++;
break;
}
+ case op_resolve_base_to_global:
+ case op_resolve_base_to_global_dynamic:
+ case op_resolve_base_to_scope:
+ case op_resolve_base_to_scope_with_top_scope_check:
case op_resolve_base: {
int r0 = (++it)->u.operand;
int id0 = (++it)->u.operand;
int isStrict = (++it)->u.operand;
- dataLog("[%4d] resolve_base%s\t %s, %s", location, isStrict ? "_strict" : "", registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data());
+ int resolveInfo = (++it)->u.operand;
+ int putToBaseInfo = (++it)->u.operand;
+ dataLog("[%4d] resolve_base%s\t %s, %s, %d, %d", location, isStrict ? "_strict" : "", registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), resolveInfo, putToBaseInfo);
dumpBytecodeCommentAndNewLine(location);
it++;
break;
@@ -1031,7 +931,9 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
int r0 = (++it)->u.operand;
int r1 = (++it)->u.operand;
int id0 = (++it)->u.operand;
- dataLog("[%4d] resolve_with_base %s, %s, %s", location, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data());
+ int resolveInfo = (++it)->u.operand;
+ int putToBaseInfo = (++it)->u.operand;
+ dataLog("[%4d] resolve_with_base %s, %s, %s, %d, %d", location, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data(), resolveInfo, putToBaseInfo);
dumpBytecodeCommentAndNewLine(location);
it++;
break;
@@ -1040,7 +942,8 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
int r0 = (++it)->u.operand;
int r1 = (++it)->u.operand;
int id0 = (++it)->u.operand;
- dataLog("[%4d] resolve_with_this %s, %s, %s", location, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data());
+ int resolveInfo = (++it)->u.operand;
+ dataLog("[%4d] resolve_with_this %s, %s, %s, %d", location, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data(), resolveInfo);
dumpBytecodeCommentAndNewLine(location);
it++;
break;
@@ -1704,6 +1607,7 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, CodeBlock& other)
, m_thisRegister(other.m_thisRegister)
, m_argumentsRegister(other.m_argumentsRegister)
, m_activationRegister(other.m_activationRegister)
+ , m_globalObjectConstant(other.m_globalObjectConstant)
, m_needsFullScopeChain(other.m_needsFullScopeChain)
, m_usesEval(other.m_usesEval)
, m_isNumericCompareFunction(other.m_isNumericCompareFunction)
@@ -1711,9 +1615,6 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, CodeBlock& other)
, m_codeType(other.m_codeType)
, m_source(other.m_source)
, m_sourceOffset(other.m_sourceOffset)
-#if ENABLE(JIT)
- , m_globalResolveInfos(other.m_globalResolveInfos.size())
-#endif
#if ENABLE(VALUE_PROFILER)
, m_executionEntryCount(0)
#endif
@@ -1728,6 +1629,8 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, CodeBlock& other)
, m_optimizationDelayCounter(0)
, m_reoptimizationRetryCounter(0)
, m_lineInfo(other.m_lineInfo)
+ , m_resolveOperations(other.m_resolveOperations)
+ , m_putToBaseOperations(other.m_putToBaseOperations)
#if ENABLE(BYTECODE_COMMENTS)
, m_bytecodeCommentIterator(0)
#endif
@@ -1739,11 +1642,6 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, CodeBlock& other)
optimizeAfterWarmUp();
jitAfterWarmUp();
-#if ENABLE(JIT)
- for (unsigned i = m_globalResolveInfos.size(); i--;)
- m_globalResolveInfos[i] = GlobalResolveInfo(other.m_globalResolveInfos[i].bytecodeOffset);
-#endif
-
if (other.m_rareData) {
createRareDataIfNecessary();
@@ -1787,13 +1685,16 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, CodeType codeType, JSGlo
#endif
{
ASSERT(m_source);
-
+
optimizeAfterWarmUp();
jitAfterWarmUp();
#if DUMP_CODE_BLOCK_STATISTICS
liveCodeBlockSet.add(this);
#endif
+ // We have a stub putToBase operation to allow resolve_base to
+ // remain branchless
+ m_putToBaseOperations.append(PutToBaseOperation(isStrictMode()));
}
CodeBlock::~CodeBlock()
@@ -1892,11 +1793,6 @@ void CodeBlock::visitStructures(SlotVisitor& visitor, Instruction* vPC)
visitor.append(&vPC[4].u.structure);
return;
}
- if (vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global) || vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global_dynamic)) {
- if (vPC[3].u.structure)
- visitor.append(&vPC[3].u.structure);
- return;
- }
// These instructions don't ref their Structures.
ASSERT(vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_get_array_length) || vPC[0].u.opcode == interpreter->getOpcode(op_get_string_length));
@@ -2048,7 +1944,7 @@ static const bool verboseUnlinking = true;
#else
static const bool verboseUnlinking = false;
#endif
-
+
void CodeBlock::finalizeUnconditionally()
{
#if ENABLE(LLINT)
@@ -2093,17 +1989,7 @@ void CodeBlock::finalizeUnconditionally()
ASSERT_NOT_REACHED();
}
}
- for (size_t size = m_globalResolveInstructions.size(), i = 0; i < size; ++i) {
- Instruction* curInstruction = &instructions()[m_globalResolveInstructions[i]];
- ASSERT(interpreter->getOpcodeID(curInstruction[0].u.opcode) == op_resolve_global
- || interpreter->getOpcodeID(curInstruction[0].u.opcode) == op_resolve_global_dynamic);
- if (!curInstruction[3].u.structure || Heap::isMarked(curInstruction[3].u.structure.get()))
- continue;
- if (verboseUnlinking)
- dataLog("Clearing LLInt global resolve cache with structure %p.\n", curInstruction[3].u.structure.get());
- curInstruction[3].u.structure.clear();
- curInstruction[4].u.operand = 0;
- }
+
for (unsigned i = 0; i < m_llintCallLinkInfos.size(); ++i) {
if (m_llintCallLinkInfos[i].isLinked() && !Heap::isMarked(m_llintCallLinkInfos[i].callee.get())) {
if (verboseUnlinking)
@@ -2130,7 +2016,29 @@ void CodeBlock::finalizeUnconditionally()
return;
}
#endif // ENABLE(DFG_JIT)
-
+
+ for (size_t size = m_putToBaseOperations.size(), i = 0; i < size; ++i) {
+ if (m_putToBaseOperations[i].m_structure && !Heap::isMarked(m_putToBaseOperations[i].m_structure.get())) {
+ if (verboseUnlinking)
+ dataLog("Clearing putToBase info in %p.\n", this);
+ m_putToBaseOperations[i].m_structure.clear();
+ }
+ }
+ for (size_t size = m_resolveOperations.size(), i = 0; i < size; ++i) {
+ if (m_resolveOperations[i].isEmpty())
+ continue;
+#ifndef NDEBUG
+ for (size_t insnSize = m_resolveOperations[i].size() - 1, k = 0; k < insnSize; ++k)
+ ASSERT(!m_resolveOperations[i][k].m_structure);
+#endif
+ m_resolveOperations[i].last().m_structure.clear();
+ if (m_resolveOperations[i].last().m_structure && !Heap::isMarked(m_resolveOperations[i].last().m_structure.get())) {
+ if (verboseUnlinking)
+ dataLog("Clearing resolve info in %p.\n", this);
+ m_resolveOperations[i].last().m_structure.clear();
+ }
+ }
+
#if ENABLE(JIT)
// Handle inline caches.
if (!!getJITCode()) {
@@ -2145,14 +2053,6 @@ void CodeBlock::finalizeUnconditionally()
&& !Heap::isMarked(callLinkInfo(i).lastSeenCallee.get()))
callLinkInfo(i).lastSeenCallee.clear();
}
- for (size_t size = m_globalResolveInfos.size(), i = 0; i < size; ++i) {
- if (m_globalResolveInfos[i].structure && !Heap::isMarked(m_globalResolveInfos[i].structure.get())) {
- if (verboseUnlinking)
- dataLog("Clearing resolve info in %p.\n", this);
- m_globalResolveInfos[i].structure.clear();
- }
- }
-
for (size_t size = m_structureStubInfos.size(), i = 0; i < size; ++i) {
StructureStubInfo& stubInfo = m_structureStubInfos[i];
@@ -2422,43 +2322,14 @@ void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& d
return;
}
-#if ENABLE(JIT)
-bool CodeBlock::hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset)
-{
- if (m_globalResolveInfos.isEmpty())
- return false;
-
- int low = 0;
- int high = m_globalResolveInfos.size();
- while (low < high) {
- int mid = low + (high - low) / 2;
- if (m_globalResolveInfos[mid].bytecodeOffset <= bytecodeOffset)
- low = mid + 1;
- else
- high = mid;
- }
-
- if (!low || m_globalResolveInfos[low - 1].bytecodeOffset != bytecodeOffset)
- return false;
- return true;
-}
-GlobalResolveInfo& CodeBlock::globalResolveInfoForBytecodeOffset(unsigned bytecodeOffset)
-{
- return *(binarySearch<GlobalResolveInfo, unsigned, getGlobalResolveInfoBytecodeOffset>(m_globalResolveInfos.begin(), m_globalResolveInfos.size(), bytecodeOffset));
-}
-#endif
-
void CodeBlock::shrinkToFit(ShrinkMode shrinkMode)
{
m_propertyAccessInstructions.shrinkToFit();
- m_globalResolveInstructions.shrinkToFit();
#if ENABLE(LLINT)
m_llintCallLinkInfos.shrinkToFit();
#endif
#if ENABLE(JIT)
m_structureStubInfos.shrinkToFit();
- if (shrinkMode == EarlyShrink)
- m_globalResolveInfos.shrinkToFit();
m_callLinkInfos.shrinkToFit();
m_methodCallLinkInfos.shrinkToFit();
#endif
@@ -2477,6 +2348,7 @@ void CodeBlock::shrinkToFit(ShrinkMode shrinkMode)
m_constantRegisters.shrinkToFit();
} // else don't shrink these, because we would have already pointed pointers into these tables.
+ m_resolveOperations.shrinkToFit();
m_lineInfo.shrinkToFit();
if (m_rareData) {
m_rareData->m_exceptionHandlers.shrinkToFit();
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h
index 01a8ef4a1..fe588c787 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.h
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h
@@ -49,7 +49,6 @@
#include "EvalCodeCache.h"
#include "ExecutionCounter.h"
#include "ExpressionRangeInfo.h"
-#include "GlobalResolveInfo.h"
#include "HandlerInfo.h"
#include "MethodCallLinkInfo.h"
#include "Options.h"
@@ -64,6 +63,7 @@
#include "LineInfo.h"
#include "Nodes.h"
#include "RegExpObject.h"
+#include "ResolveOperation.h"
#include "StructureStubInfo.h"
#include "UnconditionalFinalizer.h"
#include "ValueProfile.h"
@@ -197,6 +197,30 @@ namespace JSC {
int lineNumberForBytecodeOffset(unsigned bytecodeOffset);
void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset);
+ uint32_t addResolve()
+ {
+ m_resolveOperations.grow(m_resolveOperations.size() + 1);
+ return m_resolveOperations.size() - 1;
+ }
+ uint32_t addPutToBase()
+ {
+ m_putToBaseOperations.append(PutToBaseOperation(isStrictMode()));
+ return m_putToBaseOperations.size() - 1;
+ }
+
+ ResolveOperations* resolveOperations(uint32_t i)
+ {
+ return &m_resolveOperations[i];
+ }
+
+ PutToBaseOperation* putToBaseOperation(uint32_t i)
+ {
+ return &m_putToBaseOperations[i];
+ }
+
+ size_t numberOfResolveOperations() const { return m_resolveOperations.size(); }
+ size_t numberOfPutToBaseOperations() const { return m_putToBaseOperations.size(); }
+
#if ENABLE(JIT)
StructureStubInfo& getStubInfo(ReturnAddressPtr returnAddress)
@@ -600,11 +624,6 @@ namespace JSC {
{
m_propertyAccessInstructions.append(propertyAccessInstruction);
}
- void addGlobalResolveInstruction(unsigned globalResolveInstruction)
- {
- m_globalResolveInstructions.append(globalResolveInstruction);
- }
- bool hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset);
#if ENABLE(LLINT)
LLIntCallLinkInfo* addLLIntCallLinkInfo()
{
@@ -621,15 +640,6 @@ namespace JSC {
size_t numberOfByValInfos() const { return m_byValInfos.size(); }
ByValInfo& byValInfo(size_t index) { return m_byValInfos[index]; }
- void addGlobalResolveInfo(unsigned globalResolveInstruction)
- {
- m_globalResolveInfos.append(GlobalResolveInfo(globalResolveInstruction));
- }
- GlobalResolveInfo& globalResolveInfo(int index) { return m_globalResolveInfos[index]; }
- bool hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset);
- GlobalResolveInfo& globalResolveInfoForBytecodeOffset(unsigned bytecodeOffset);
- unsigned numberOfGlobalResolveInfos() { return m_globalResolveInfos.size(); }
-
void setNumberOfCallLinkInfos(size_t size) { m_callLinkInfos.grow(size); }
size_t numberOfCallLinkInfos() const { return m_callLinkInfos.size(); }
CallLinkInfo& callLinkInfo(int index) { return m_callLinkInfos[index]; }
@@ -781,15 +791,6 @@ namespace JSC {
ArrayProfile* getArrayProfile(unsigned bytecodeOffset);
ArrayProfile* getOrAddArrayProfile(unsigned bytecodeOffset);
#endif
-
- unsigned globalResolveInfoCount() const
- {
-#if ENABLE(JIT)
- if (m_globalData->canUseJIT())
- return m_globalResolveInfos.size();
-#endif
- return 0;
- }
// Exception handling support
@@ -1215,13 +1216,16 @@ namespace JSC {
int m_numVars;
bool m_isConstructor;
+ int globalObjectConstant() const { return m_globalObjectConstant; }
+ void setGlobalObjectConstant(int globalRegister) { m_globalObjectConstant = globalRegister; }
+
protected:
#if ENABLE(JIT)
virtual bool jitCompileImpl(ExecState*) = 0;
#endif
virtual void visitWeakReferences(SlotVisitor&);
virtual void finalizeUnconditionally();
-
+
private:
friend class DFGCodeBlocks;
@@ -1294,6 +1298,7 @@ namespace JSC {
int m_thisRegister;
int m_argumentsRegister;
int m_activationRegister;
+ int m_globalObjectConstant;
bool m_needsFullScopeChain;
bool m_usesEval;
@@ -1306,7 +1311,6 @@ namespace JSC {
unsigned m_sourceOffset;
Vector<unsigned> m_propertyAccessInstructions;
- Vector<unsigned> m_globalResolveInstructions;
#if ENABLE(LLINT)
SegmentedVector<LLIntCallLinkInfo, 8> m_llintCallLinkInfos;
SentinelLinkedList<LLIntCallLinkInfo, BasicRawSentinelNode<LLIntCallLinkInfo> > m_incomingLLIntCalls;
@@ -1314,7 +1318,6 @@ namespace JSC {
#if ENABLE(JIT)
Vector<StructureStubInfo> m_structureStubInfos;
Vector<ByValInfo> m_byValInfos;
- Vector<GlobalResolveInfo> m_globalResolveInfos;
Vector<CallLinkInfo> m_callLinkInfos;
Vector<MethodCallLinkInfo> m_methodCallLinkInfos;
JITCode m_jitCode;
@@ -1406,6 +1409,8 @@ namespace JSC {
Vector<Comment> m_bytecodeComments;
size_t m_bytecodeCommentIterator;
#endif
+ Vector<ResolveOperations> m_resolveOperations;
+ Vector<PutToBaseOperation> m_putToBaseOperations;
struct RareData {
WTF_MAKE_FAST_ALLOCATED;
diff --git a/Source/JavaScriptCore/bytecode/DFGExitProfile.h b/Source/JavaScriptCore/bytecode/DFGExitProfile.h
index 45947c8af..57fb06bda 100644
--- a/Source/JavaScriptCore/bytecode/DFGExitProfile.h
+++ b/Source/JavaScriptCore/bytecode/DFGExitProfile.h
@@ -36,6 +36,7 @@ enum ExitKind {
ExitKindUnset,
BadType, // We exited because a type prediction was wrong.
BadCache, // We exited because an inline cache was wrong.
+ BadIndexingType, // We exited because an indexing type was wrong.
Overflow, // We exited because of overflow.
NegativeZero, // We exited because we encountered negative zero.
OutOfBounds, // We had an out-of-bounds access to an array.
diff --git a/Source/JavaScriptCore/bytecode/Opcode.h b/Source/JavaScriptCore/bytecode/Opcode.h
index dd62df700..3ce56c80e 100644
--- a/Source/JavaScriptCore/bytecode/Opcode.h
+++ b/Source/JavaScriptCore/bytecode/Opcode.h
@@ -96,22 +96,30 @@ namespace JSC {
macro(op_is_function, 3) \
macro(op_in, 4) \
\
- macro(op_resolve, 4) /* has value profiling */ \
- macro(op_resolve_skip, 5) /* has value profiling */ \
- macro(op_resolve_global, 6) /* has value profiling */ \
- macro(op_resolve_global_dynamic, 7) /* has value profiling */ \
- macro(op_get_scoped_var, 5) /* has value profiling */ \
- macro(op_put_scoped_var, 4) \
- macro(op_get_global_var, 4) /* has value profiling */ \
- macro(op_get_global_var_watchable, 5) /* has value profiling */ \
- macro(op_put_global_var, 3) \
- macro(op_put_global_var_check, 5) \
+ macro(op_resolve, 5) /* has value profiling */ \
+ macro(op_resolve_global_property, 5) /* has value profiling */ \
+ macro(op_resolve_global_var, 5) /* has value profiling */ \
+ macro(op_resolve_scoped_var, 5) /* has value profiling */ \
+ macro(op_resolve_scoped_var_on_top_scope, 5) /* has value profiling */ \
+ macro(op_resolve_scoped_var_with_top_scope_check, 5) /* has value profiling */ \
+ \
+ macro(op_resolve_base_to_global, 7) /* has value profiling */ \
+ macro(op_resolve_base_to_global_dynamic, 7) /* has value profiling */ \
+ macro(op_resolve_base_to_scope, 7) /* has value profiling */ \
+ macro(op_resolve_base_to_scope_with_top_scope_check, 7) /* has value profiling */ \
+ macro(op_resolve_base, 7) /* has value profiling */ \
+ \
+ macro(op_ensure_property_exists, 3) \
+ \
+ macro(op_resolve_with_base, 7) /* has value profiling */ \
+ \
+ macro(op_resolve_with_this, 6) /* has value profiling */ \
+ \
+ macro(op_put_to_base, 5) \
+ macro(op_put_to_base_variable, 5) \
+ \
macro(op_init_global_const, 3) \
macro(op_init_global_const_check, 5) \
- macro(op_resolve_base, 5) /* has value profiling */ \
- macro(op_ensure_property_exists, 3) \
- macro(op_resolve_with_base, 5) /* has value profiling */ \
- macro(op_resolve_with_this, 5) /* has value profiling */ \
macro(op_get_by_id, 9) /* has value profiling */ \
macro(op_get_by_id_out_of_line, 9) /* has value profiling */ \
macro(op_get_by_id_self, 9) /* has value profiling */ \
diff --git a/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp b/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp
index c9fd7dca2..7814f8c99 100644
--- a/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp
+++ b/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp
@@ -32,13 +32,11 @@
namespace JSC {
-#if ENABLE(LLINT) || (ENABLE(JIT) && ENABLE(VALUE_PROFILER))
static ResolveGlobalStatus computeForStructure(CodeBlock* codeBlock, Structure* structure, Identifier& identifier)
{
unsigned attributesIgnored;
JSCell* specificValue;
- PropertyOffset offset = structure->get(
- *codeBlock->globalData(), identifier, attributesIgnored, specificValue);
+ PropertyOffset offset = structure->get(*codeBlock->globalData(), identifier, attributesIgnored, specificValue);
if (structure->isDictionary())
specificValue = 0;
if (!isValidOffset(offset))
@@ -46,46 +44,14 @@ static ResolveGlobalStatus computeForStructure(CodeBlock* codeBlock, Structure*
return ResolveGlobalStatus(ResolveGlobalStatus::Simple, structure, offset, specificValue);
}
-#endif // ENABLE(LLINT) || ENABLE(JIT)
-static ResolveGlobalStatus computeForLLInt(CodeBlock* codeBlock, unsigned bytecodeIndex, Identifier& identifier)
+ResolveGlobalStatus ResolveGlobalStatus::computeFor(CodeBlock* codeBlock, int, ResolveOperation* operation, Identifier& identifier)
{
-#if ENABLE(LLINT)
- Instruction* instruction = codeBlock->instructions().begin() + bytecodeIndex;
-
- ASSERT(instruction[0].u.opcode == LLInt::getOpcode(op_resolve_global));
-
- Structure* structure = instruction[3].u.structure.get();
- if (!structure)
+ ASSERT(operation->m_operation == ResolveOperation::GetAndReturnGlobalProperty);
+ if (!operation->m_structure)
return ResolveGlobalStatus();
- return computeForStructure(codeBlock, structure, identifier);
-#else
- UNUSED_PARAM(codeBlock);
- UNUSED_PARAM(bytecodeIndex);
- UNUSED_PARAM(identifier);
- return ResolveGlobalStatus();
-#endif
-}
-
-ResolveGlobalStatus ResolveGlobalStatus::computeFor(CodeBlock* codeBlock, unsigned bytecodeIndex, Identifier& identifier)
-{
-#if ENABLE(JIT) && ENABLE(VALUE_PROFILER)
- if (!codeBlock->numberOfGlobalResolveInfos())
- return computeForLLInt(codeBlock, bytecodeIndex, identifier);
-
- if (codeBlock->likelyToTakeSlowCase(bytecodeIndex))
- return ResolveGlobalStatus(TakesSlowPath);
-
- GlobalResolveInfo& globalResolveInfo = codeBlock->globalResolveInfoForBytecodeOffset(bytecodeIndex);
-
- if (!globalResolveInfo.structure)
- return computeForLLInt(codeBlock, bytecodeIndex, identifier);
-
- return computeForStructure(codeBlock, globalResolveInfo.structure.get(), identifier);
-#else
- return computeForLLInt(codeBlock, bytecodeIndex, identifier);
-#endif
+ return computeForStructure(codeBlock, operation->m_structure.get(), identifier);
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.h b/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.h
index cbe4d3b5f..46a9254e7 100644
--- a/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.h
+++ b/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.h
@@ -34,6 +34,7 @@ namespace JSC {
class CodeBlock;
class Identifier;
+struct ResolveOperation;
class Structure;
class ResolveGlobalStatus {
@@ -61,7 +62,7 @@ public:
{
}
- static ResolveGlobalStatus computeFor(CodeBlock*, unsigned bytecodeIndex, Identifier&);
+ static ResolveGlobalStatus computeFor(CodeBlock*, int bytecodeIndex, ResolveOperation*, Identifier&);
State state() const { return m_state; }
diff --git a/Source/JavaScriptCore/bytecode/StructureSet.h b/Source/JavaScriptCore/bytecode/StructureSet.h
index ebde9779f..c95d3047b 100644
--- a/Source/JavaScriptCore/bytecode/StructureSet.h
+++ b/Source/JavaScriptCore/bytecode/StructureSet.h
@@ -26,6 +26,7 @@
#ifndef StructureSet_h
#define StructureSet_h
+#include "ArrayProfile.h"
#include "SpeculatedType.h"
#include "Structure.h"
#include <stdio.h>
@@ -137,6 +138,16 @@ public:
return result;
}
+ ArrayModes arrayModesFromStructures() const
+ {
+ ArrayModes result = 0;
+
+ for (size_t i = 0; i < m_structures.size(); ++i)
+ mergeArrayModes(result, asArrayModes(m_structures[i]->indexingType()));
+
+ return result;
+ }
+
bool operator==(const StructureSet& other) const
{
if (m_structures.size() != other.m_structures.size())
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index 1160a1888..228277328 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -137,25 +137,8 @@ void ResolveResult::checkValidity()
case ReadOnlyRegister:
ASSERT(m_local);
return;
- case Lexical:
- case ReadOnlyLexical:
- case DynamicLexical:
- case DynamicReadOnlyLexical:
- ASSERT(m_index != missingSymbolMarker());
- return;
- case Global:
- case DynamicGlobal:
- ASSERT(m_globalObject);
- return;
- case IndexedGlobal:
- case ReadOnlyIndexedGlobal:
- case WatchedIndexedGlobal:
- case DynamicIndexedGlobal:
- case DynamicReadOnlyIndexedGlobal:
- ASSERT(m_index != missingSymbolMarker());
- ASSERT(m_globalObject);
- return;
case Dynamic:
+ ASSERT(!m_local);
return;
default:
ASSERT_NOT_REACHED();
@@ -163,11 +146,6 @@ void ResolveResult::checkValidity()
}
#endif
-WriteBarrier<Unknown>* ResolveResult::registerPointer() const
-{
- return &jsCast<JSGlobalObject*>(globalObject())->registerAt(index());
-}
-
static bool s_dumpsGeneratedCode = false;
void BytecodeGenerator::setDumpsGeneratedCode(bool dumpsGeneratedCode)
@@ -292,6 +270,8 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, JSScope* scope, S
, m_expressionTooDeep(false)
{
m_globalData->startedCompiling(m_codeBlock);
+ m_codeBlock->setGlobalObjectConstant(emitLoad(0, JSValue(m_codeBlock->globalObject()))->index());
+
if (m_shouldEmitDebugHooks)
m_codeBlock->setNeedsFullScopeChain(true);
@@ -324,7 +304,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, JSScope* scope, S
FunctionBodyNode* function = functionStack[i];
bool propertyDidExist =
globalObject->removeDirect(*m_globalData, function->ident()); // Newly declared functions overwrite existing properties.
-
+
JSValue value = JSFunction::create(exec, FunctionExecutable::create(*m_globalData, function), scope);
int index = addGlobalVar(
function->ident(), IsVariable,
@@ -374,6 +354,8 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, JSScope* sc
, m_expressionTooDeep(false)
{
m_globalData->startedCompiling(m_codeBlock);
+ m_codeBlock->setGlobalObjectConstant(emitLoad(0, JSValue(m_codeBlock->globalObject()))->index());
+
if (m_shouldEmitDebugHooks)
m_codeBlock->setNeedsFullScopeChain(true);
@@ -588,6 +570,8 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, JSScope* scope, SharedS
, m_expressionTooDeep(false)
{
m_globalData->startedCompiling(m_codeBlock);
+ m_codeBlock->setGlobalObjectConstant(emitLoad(0, JSValue(m_codeBlock->globalObject()))->index());
+
if (m_shouldEmitDebugHooks || m_baseScopeDepth)
m_codeBlock->setNeedsFullScopeChain(true);
@@ -1365,67 +1349,7 @@ ResolveResult BytecodeGenerator::resolve(const Identifier& property)
return ResolveResult::registerResolve(local, flags);
}
}
-
- // Cases where we cannot statically optimize the lookup.
- if (property == propertyNames().arguments || !canOptimizeNonLocals())
- return ResolveResult::dynamicResolve(0);
-
- ScopeChainIterator iter = m_scope->begin();
- ScopeChainIterator end = m_scope->end();
- size_t depth = 0;
- size_t depthOfFirstScopeWithDynamicChecks = 0;
- unsigned flags = 0;
- for (; iter != end; ++iter, ++depth) {
- JSObject* currentScope = iter.get();
- if (!currentScope->isVariableObject()) {
- flags |= ResolveResult::DynamicFlag;
- break;
- }
- JSSymbolTableObject* currentVariableObject = jsCast<JSSymbolTableObject*>(currentScope);
- SymbolTableEntry entry = currentVariableObject->symbolTable()->get(property.impl());
-
- // Found the property
- if (!entry.isNull()) {
- if (entry.isReadOnly())
- flags |= ResolveResult::ReadOnlyFlag;
- depth += m_codeBlock->needsFullScopeChain();
- if (++iter == end) {
- if (flags & ResolveResult::DynamicFlag)
- return ResolveResult::dynamicIndexedGlobalResolve(entry.getIndex(), depth, currentScope, flags);
- return ResolveResult::indexedGlobalResolve(
- entry.getIndex(), currentScope,
- flags | (entry.couldBeWatched() ? ResolveResult::WatchedFlag : 0));
- }
-#if !ASSERT_DISABLED
- if (JSActivation* activation = jsDynamicCast<JSActivation*>(currentVariableObject))
- ASSERT(activation->isValid(entry));
-#endif
- return ResolveResult::lexicalResolve(entry.getIndex(), depth, flags);
- }
- bool scopeRequiresDynamicChecks = false;
- if (currentVariableObject->isDynamicScope(scopeRequiresDynamicChecks))
- break;
- if (!(flags & ResolveResult::DynamicFlag)) {
- if (scopeRequiresDynamicChecks)
- flags |= ResolveResult::DynamicFlag;
- else
- ++depthOfFirstScopeWithDynamicChecks;
- }
- }
-
- // Can't locate the property but we're able to avoid a few lookups.
- JSObject* scope = iter.get();
- // Step over the function's activation, if it needs one. At this point we
- // know there is no dynamic scope in the function itself, so this is safe to
- // do.
- depth += m_codeBlock->needsFullScopeChain();
- depthOfFirstScopeWithDynamicChecks += m_codeBlock->needsFullScopeChain();
- if (++iter == end) {
- if ((flags & ResolveResult::DynamicFlag) && depth)
- return ResolveResult::dynamicGlobalResolve(depth, scope);
- return ResolveResult::globalResolve(scope);
- }
- return ResolveResult::dynamicResolve(depthOfFirstScopeWithDynamicChecks);
+ return ResolveResult::dynamicResolve();
}
ResolveResult BytecodeGenerator::resolveConstDecl(const Identifier& property)
@@ -1440,26 +1364,7 @@ ResolveResult BytecodeGenerator::resolveConstDecl(const Identifier& property)
}
}
- // Const declarations in eval code or global code.
- ScopeChainIterator iter = scope()->begin();
- ScopeChainIterator end = scope()->end();
- size_t depth = 0;
- for (; iter != end; ++iter, ++depth) {
- JSObject* currentScope = iter.get();
- if (!currentScope->isVariableObject())
- continue;
- JSSymbolTableObject* currentVariableObject = jsCast<JSSymbolTableObject*>(currentScope);
- SymbolTableEntry entry = currentVariableObject->symbolTable()->get(property.impl());
- if (entry.isNull())
- continue;
- if (++iter == end)
- return ResolveResult::indexedGlobalResolve(entry.getIndex(), currentVariableObject, 0);
- return ResolveResult::lexicalResolve(entry.getIndex(), depth + scopeDepth(), 0);
- }
-
- // FIXME: While this code should only be hit in an eval block, it will assign
- // to the wrong base if property exists in an intervening with scope.
- return ResolveResult::dynamicResolve(scopeDepth());
+ return ResolveResult::dynamicResolve();
}
void BytecodeGenerator::emitCheckHasInstance(RegisterID* dst, RegisterID* value, RegisterID* base, Label* target)
@@ -1481,158 +1386,89 @@ RegisterID* BytecodeGenerator::emitInstanceOf(RegisterID* dst, RegisterID* value
return dst;
}
-static const unsigned maxGlobalResolves = 128;
-
bool BytecodeGenerator::shouldAvoidResolveGlobal()
{
- return m_codeBlock->globalResolveInfoCount() > maxGlobalResolves && !m_labelScopes.size();
+ return !m_labelScopes.size();
}
RegisterID* BytecodeGenerator::emitResolve(RegisterID* dst, const ResolveResult& resolveResult, const Identifier& property)
{
- if (resolveResult.isStatic())
- return emitGetStaticVar(dst, resolveResult, property);
-
- if (resolveResult.isGlobal() && !shouldAvoidResolveGlobal()) {
-#if ENABLE(JIT)
- m_codeBlock->addGlobalResolveInfo(instructions().size());
-#endif
- m_codeBlock->addGlobalResolveInstruction(instructions().size());
- bool dynamic = resolveResult.isDynamic() && resolveResult.depth();
- ValueProfile* profile = emitProfiledOpcode(dynamic ? op_resolve_global_dynamic : op_resolve_global);
- instructions().append(dst->index());
- instructions().append(addConstant(property));
- instructions().append(0);
- instructions().append(0);
- if (dynamic)
- instructions().append(resolveResult.depth());
- instructions().append(profile);
- return dst;
- }
-
- if (resolveResult.type() == ResolveResult::Dynamic && resolveResult.depth()) {
- // In this case we are at least able to drop a few scope chains from the
- // lookup chain, although we still need to hash from then on.
- ValueProfile* profile = emitProfiledOpcode(op_resolve_skip);
- instructions().append(dst->index());
- instructions().append(addConstant(property));
- instructions().append(resolveResult.depth());
- instructions().append(profile);
- return dst;
- }
+
+ if (resolveResult.isRegister())
+ return emitGetLocalVar(dst, resolveResult, property);
ValueProfile* profile = emitProfiledOpcode(op_resolve);
instructions().append(dst->index());
instructions().append(addConstant(property));
+ instructions().append(getResolveOperations(property));
instructions().append(profile);
return dst;
}
RegisterID* BytecodeGenerator::emitResolveBase(RegisterID* dst, const ResolveResult& resolveResult, const Identifier& property)
{
- if (resolveResult.isGlobal() && !resolveResult.isDynamic())
- // Global object is the base
- return emitLoad(dst, JSValue(resolveResult.globalObject()));
-
+ ASSERT_UNUSED(resolveResult, !resolveResult.isRegister());
// We can't optimise at all :-(
ValueProfile* profile = emitProfiledOpcode(op_resolve_base);
instructions().append(dst->index());
instructions().append(addConstant(property));
instructions().append(false);
+ instructions().append(getResolveBaseOperations(property));
+ instructions().append(0);
instructions().append(profile);
return dst;
}
-RegisterID* BytecodeGenerator::emitResolveBaseForPut(RegisterID* dst, const ResolveResult& resolveResult, const Identifier& property)
+RegisterID* BytecodeGenerator::emitResolveBaseForPut(RegisterID* dst, const ResolveResult& resolveResult, const Identifier& property, NonlocalResolveInfo& verifier)
{
- if (!m_codeBlock->isStrictMode())
- return emitResolveBase(dst, resolveResult, property);
-
- if (resolveResult.isGlobal() && !resolveResult.isDynamic()) {
- // Global object is the base
- RefPtr<RegisterID> result = emitLoad(dst, JSValue(resolveResult.globalObject()));
- emitOpcode(op_ensure_property_exists);
- instructions().append(dst->index());
- instructions().append(addConstant(property));
- return result.get();
- }
-
+ ASSERT_UNUSED(resolveResult, !resolveResult.isRegister());
// We can't optimise at all :-(
ValueProfile* profile = emitProfiledOpcode(op_resolve_base);
instructions().append(dst->index());
instructions().append(addConstant(property));
- instructions().append(true);
+ instructions().append(m_codeBlock->isStrictMode());
+ uint32_t putToBaseIndex = 0;
+ instructions().append(getResolveBaseForPutOperations(property, putToBaseIndex));
+ verifier.resolved(putToBaseIndex);
+ instructions().append(putToBaseIndex);
instructions().append(profile);
return dst;
}
-RegisterID* BytecodeGenerator::emitResolveWithBase(RegisterID* baseDst, RegisterID* propDst, const ResolveResult& resolveResult, const Identifier& property)
+RegisterID* BytecodeGenerator::emitResolveWithBaseForPut(RegisterID* baseDst, RegisterID* propDst, const ResolveResult& resolveResult, const Identifier& property, NonlocalResolveInfo& verifier)
{
- if (resolveResult.isGlobal() && !resolveResult.isDynamic()) {
- // Global object is the base
- emitLoad(baseDst, JSValue(resolveResult.globalObject()));
-
- if (resolveResult.isStatic()) {
- // Directly index the property lookup across multiple scopes.
- emitGetStaticVar(propDst, resolveResult, property);
- return baseDst;
- }
-
- if (shouldAvoidResolveGlobal()) {
- ValueProfile* profile = emitProfiledOpcode(op_resolve);
- instructions().append(propDst->index());
- instructions().append(addConstant(property));
- instructions().append(profile);
- return baseDst;
- }
-
-#if ENABLE(JIT)
- m_codeBlock->addGlobalResolveInfo(instructions().size());
-#endif
- m_codeBlock->addGlobalResolveInstruction(instructions().size());
- ValueProfile* profile = emitProfiledOpcode(op_resolve_global);
- instructions().append(propDst->index());
- instructions().append(addConstant(property));
- instructions().append(0);
- instructions().append(0);
- instructions().append(profile);
- return baseDst;
- }
-
+ ASSERT_UNUSED(resolveResult, !resolveResult.isRegister());
ValueProfile* profile = emitProfiledOpcode(op_resolve_with_base);
instructions().append(baseDst->index());
instructions().append(propDst->index());
instructions().append(addConstant(property));
+ uint32_t putToBaseIndex = 0;
+ instructions().append(getResolveWithBaseForPutOperations(property, putToBaseIndex));
+ verifier.resolved(putToBaseIndex);
+ instructions().append(putToBaseIndex);
instructions().append(profile);
return baseDst;
}
RegisterID* BytecodeGenerator::emitResolveWithThis(RegisterID* baseDst, RegisterID* propDst, const ResolveResult& resolveResult, const Identifier& property)
{
- if (resolveResult.isStatic()) {
+ if (resolveResult.isRegister()) {
emitLoad(baseDst, jsUndefined());
- emitGetStaticVar(propDst, resolveResult, property);
+ emitGetLocalVar(propDst, resolveResult, property);
return baseDst;
}
- if (resolveResult.type() == ResolveResult::Dynamic) {
- // We can't optimise at all :-(
- ValueProfile* profile = emitProfiledOpcode(op_resolve_with_this);
- instructions().append(baseDst->index());
- instructions().append(propDst->index());
- instructions().append(addConstant(property));
- instructions().append(profile);
- return baseDst;
- }
-
- emitLoad(baseDst, jsUndefined());
- return emitResolve(propDst, resolveResult, property);
+ ValueProfile* profile = emitProfiledOpcode(op_resolve_with_this);
+ instructions().append(baseDst->index());
+ instructions().append(propDst->index());
+ instructions().append(addConstant(property));
+ instructions().append(getResolveWithThisOperations(property));
+ instructions().append(profile);
+ return baseDst;
}
-RegisterID* BytecodeGenerator::emitGetStaticVar(RegisterID* dst, const ResolveResult& resolveResult, const Identifier& identifier)
+RegisterID* BytecodeGenerator::emitGetLocalVar(RegisterID* dst, const ResolveResult& resolveResult, const Identifier&)
{
- ValueProfile* profile = 0;
-
switch (resolveResult.type()) {
case ResolveResult::Register:
case ResolveResult::ReadOnlyRegister:
@@ -1640,107 +1476,33 @@ RegisterID* BytecodeGenerator::emitGetStaticVar(RegisterID* dst, const ResolveRe
return 0;
return moveToDestinationIfNeeded(dst, resolveResult.local());
- case ResolveResult::Lexical:
- case ResolveResult::ReadOnlyLexical:
- profile = emitProfiledOpcode(op_get_scoped_var);
- instructions().append(dst->index());
- instructions().append(resolveResult.index());
- instructions().append(resolveResult.depth());
- instructions().append(profile);
- return dst;
-
- case ResolveResult::IndexedGlobal:
- case ResolveResult::ReadOnlyIndexedGlobal:
- if (m_lastOpcodeID == op_put_global_var) {
- WriteBarrier<Unknown>* dstPointer;
- int srcIndex;
- retrieveLastUnaryOp(dstPointer, srcIndex);
- if (dstPointer == resolveResult.registerPointer() && srcIndex == dst->index())
- return dst;
- }
-
- profile = emitProfiledOpcode(op_get_global_var);
- instructions().append(dst->index());
- instructions().append(resolveResult.registerPointer());
- instructions().append(profile);
- return dst;
-
- case ResolveResult::WatchedIndexedGlobal:
- // Skip the peephole for now. It's not clear that it's profitable given
- // the DFG's capabilities, and the fact that if it's watchable then we
- // don't expect to see any put_global_var's anyway.
- profile = emitProfiledOpcode(op_get_global_var_watchable);
- instructions().append(dst->index());
- instructions().append(resolveResult.registerPointer());
- instructions().append(addConstant(identifier)); // For the benefit of the DFG.
- instructions().append(profile);
- return dst;
-
default:
ASSERT_NOT_REACHED();
return 0;
}
}
-RegisterID* BytecodeGenerator::emitInitGlobalConst(const ResolveResult& resolveResult, const Identifier& identifier, RegisterID* value)
+RegisterID* BytecodeGenerator::emitInitGlobalConst(const Identifier& identifier, RegisterID* value)
{
ASSERT(m_codeType == GlobalCode);
- switch (resolveResult.type()) {
- case ResolveResult::IndexedGlobal:
- case ResolveResult::ReadOnlyIndexedGlobal:
- emitOpcode(op_init_global_const);
- instructions().append(resolveResult.registerPointer());
- instructions().append(value->index());
- return value;
-
- case ResolveResult::WatchedIndexedGlobal:
- emitOpcode(op_init_global_const_check);
- instructions().append(resolveResult.registerPointer());
- instructions().append(value->index());
- instructions().append(jsCast<JSGlobalObject*>(resolveResult.globalObject())->symbolTable()->get(identifier.impl()).addressOfIsWatched());
- instructions().append(addConstant(identifier));
- return value;
-
- default:
- ASSERT_NOT_REACHED();
+ JSGlobalObject* globalObject = m_codeBlock->globalObject();
+ SymbolTableEntry entry = globalObject->symbolTable()->get(identifier.impl());
+ if (entry.isNull())
return 0;
- }
-}
-
-RegisterID* BytecodeGenerator::emitPutStaticVar(const ResolveResult& resolveResult, const Identifier& identifier, RegisterID* value)
-{
- switch (resolveResult.type()) {
- case ResolveResult::Register:
- case ResolveResult::ReadOnlyRegister:
- return moveToDestinationIfNeeded(resolveResult.local(), value);
-
- case ResolveResult::Lexical:
- case ResolveResult::ReadOnlyLexical:
- emitOpcode(op_put_scoped_var);
- instructions().append(resolveResult.index());
- instructions().append(resolveResult.depth());
- instructions().append(value->index());
- return value;
-
- case ResolveResult::IndexedGlobal:
- case ResolveResult::ReadOnlyIndexedGlobal:
- emitOpcode(op_put_global_var);
- instructions().append(resolveResult.registerPointer());
- instructions().append(value->index());
- return value;
-
- case ResolveResult::WatchedIndexedGlobal:
- emitOpcode(op_put_global_var_check);
- instructions().append(resolveResult.registerPointer());
+
+ if (entry.couldBeWatched()) {
+ emitOpcode(op_init_global_const_check);
+ instructions().append(&globalObject->registerAt(entry.getIndex()));
instructions().append(value->index());
- instructions().append(jsCast<JSGlobalObject*>(resolveResult.globalObject())->symbolTable()->get(identifier.impl()).addressOfIsWatched());
+ instructions().append(entry.addressOfIsWatched());
instructions().append(addConstant(identifier));
return value;
-
- default:
- ASSERT_NOT_REACHED();
- return 0;
}
+
+ emitOpcode(op_init_global_const);
+ instructions().append(&globalObject->registerAt(entry.getIndex()));
+ instructions().append(value->index());
+ return value;
}
void BytecodeGenerator::emitMethodCheck()
@@ -1790,6 +1552,16 @@ RegisterID* BytecodeGenerator::emitPutById(RegisterID* base, const Identifier& p
return value;
}
+RegisterID* BytecodeGenerator::emitPutToBase(RegisterID* base, const Identifier& property, RegisterID* value, NonlocalResolveInfo& resolveInfo)
+{
+ emitOpcode(op_put_to_base);
+ instructions().append(base->index());
+ instructions().append(addConstant(property));
+ instructions().append(value->index());
+ instructions().append(resolveInfo.put());
+ return value;
+}
+
RegisterID* BytecodeGenerator::emitDirectPutById(RegisterID* base, const Identifier& property, RegisterID* value)
{
m_codeBlock->addPropertyAccessInstruction(instructions().size());
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index ae79a13ae..246530ab2 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -123,124 +123,42 @@ namespace JSC {
// We need to traverse the scope chain at runtime, checking for
// non-strict eval and/or `with' nodes.
DynamicFlag = 0x2,
- // The property was resolved to a definite location, and the
- // identifier is not needed any more.
- StaticFlag = 0x4,
- // Once we have the base object, the property will be located at a
- // known index.
- IndexedFlag = 0x8,
- // Skip some number of objects in the scope chain, given by "depth".
- ScopedFlag = 0x10,
// The resolved binding is immutable.
- ReadOnlyFlag = 0x20,
- // The base object is the global object.
- GlobalFlag = 0x40,
- // The property is being watched, so writes should be special.
- WatchedFlag = 0x80
+ ReadOnlyFlag = 0x4,
};
+
enum Type {
// The property is local, and stored in a register.
- Register = RegisterFlag | StaticFlag,
+ Register = RegisterFlag,
// A read-only local, created by "const".
- ReadOnlyRegister = RegisterFlag | ReadOnlyFlag | StaticFlag,
- // The property is statically scoped free variable. Its coordinates
- // are in "index" and "depth".
- Lexical = IndexedFlag | ScopedFlag | StaticFlag,
- // A read-only Lexical, created by "const".
- ReadOnlyLexical = IndexedFlag | ScopedFlag | ReadOnlyFlag | StaticFlag,
- // The property was not bound lexically, so at runtime we should
- // look directly in the global object.
- Global = GlobalFlag,
- // Like Global, but we could actually resolve the property to a
- // DontDelete property in the global object, for instance, any
- // binding created with "var" at the top level. At runtime we'll
- // just index into the global object.
- IndexedGlobal = IndexedFlag | GlobalFlag | StaticFlag,
- // Like IndexedGlobal, but the property is being watched.
- WatchedIndexedGlobal = IndexedFlag | GlobalFlag | StaticFlag | WatchedFlag,
- // Like IndexedGlobal, but the property is also read-only, like NaN,
- // Infinity, or undefined.
- ReadOnlyIndexedGlobal = IndexedFlag | ReadOnlyFlag | GlobalFlag | StaticFlag,
- // The property could not be resolved statically, due to the
- // presence of `with' blocks. At runtime we'll have to walk the
- // scope chain. ScopedFlag is set to indicate that "depth" will
- // hold some number of nodes to skip in the scope chain, before
- // beginning the search.
- Dynamic = DynamicFlag | ScopedFlag,
- // The property was located as a statically scoped free variable,
- // but while traversing the scope chain, there was an intermediate
- // activation that used non-strict `eval'. At runtime we'll have to
- // check for the absence of this property in those intervening
- // scopes.
- DynamicLexical = DynamicFlag | IndexedFlag | ScopedFlag,
- // Like ReadOnlyLexical, but with intervening non-strict `eval'.
- DynamicReadOnlyLexical = DynamicFlag | IndexedFlag | ScopedFlag | ReadOnlyFlag,
- // Like Global, but with intervening non-strict `eval'. As with
- // Dynamic, ScopeFlag is set to indicate that "depth" does indeed
- // store a number of frames to skip before doing the dynamic checks.
- DynamicGlobal = DynamicFlag | GlobalFlag | ScopedFlag,
- // Like IndexedGlobal, but with intervening non-strict `eval'.
- DynamicIndexedGlobal = DynamicFlag | IndexedFlag | GlobalFlag | ScopedFlag,
- // Like ReadOnlyIndexedGlobal, but with intervening non-strict
- // `eval'.
- DynamicReadOnlyIndexedGlobal = DynamicFlag | IndexedFlag | ReadOnlyFlag | GlobalFlag | ScopedFlag,
+ ReadOnlyRegister = RegisterFlag | ReadOnlyFlag,
+ // Any form of non-local lookup
+ Dynamic = DynamicFlag,
};
static ResolveResult registerResolve(RegisterID *local, unsigned flags)
{
- return ResolveResult(Register | flags, local, missingSymbolMarker(), 0, 0);
- }
- static ResolveResult dynamicResolve(size_t depth)
- {
- return ResolveResult(Dynamic, 0, missingSymbolMarker(), depth, 0);
- }
- static ResolveResult lexicalResolve(int index, size_t depth, unsigned flags)
- {
- unsigned type = (flags & DynamicFlag) ? DynamicLexical : Lexical;
- return ResolveResult(type | flags, 0, index, depth, 0);
- }
- static ResolveResult indexedGlobalResolve(int index, JSObject *globalObject, unsigned flags)
- {
- return ResolveResult(IndexedGlobal | flags, 0, index, 0, globalObject);
+ return ResolveResult(Register | flags, local);
}
- static ResolveResult dynamicIndexedGlobalResolve(int index, size_t depth, JSObject *globalObject, unsigned flags)
+ static ResolveResult dynamicResolve()
{
- return ResolveResult(DynamicIndexedGlobal | flags, 0, index, depth, globalObject);
+ return ResolveResult(Dynamic, 0);
}
- static ResolveResult globalResolve(JSObject *globalObject)
- {
- return ResolveResult(Global, 0, missingSymbolMarker(), 0, globalObject);
- }
- static ResolveResult dynamicGlobalResolve(size_t dynamicDepth, JSObject *globalObject)
- {
- return ResolveResult(DynamicGlobal, 0, missingSymbolMarker(), dynamicDepth, globalObject);
- }
-
unsigned type() const { return m_type; }
+
// Returns the register corresponding to a local variable, or 0 if no
// such register exists. Registers returned by ResolveResult::local() do
// not require explicit reference counting.
RegisterID* local() const { return m_local; }
- int index() const { ASSERT (isIndexed() || isRegister()); return m_index; }
- size_t depth() const { ASSERT(isScoped()); return m_depth; }
- JSObject* globalObject() const { ASSERT(isGlobal()); ASSERT(m_globalObject); return m_globalObject; }
- WriteBarrier<Unknown>* registerPointer() const;
bool isRegister() const { return m_type & RegisterFlag; }
bool isDynamic() const { return m_type & DynamicFlag; }
- bool isStatic() const { return m_type & StaticFlag; }
- bool isIndexed() const { return m_type & IndexedFlag; }
- bool isScoped() const { return m_type & ScopedFlag; }
bool isReadOnly() const { return (m_type & ReadOnlyFlag) && !isDynamic(); }
- bool isGlobal() const { return m_type & GlobalFlag; }
private:
- ResolveResult(unsigned type, RegisterID* local, int index, size_t depth, JSObject* globalObject)
+ ResolveResult(unsigned type, RegisterID* local)
: m_type(type)
- , m_index(index)
, m_local(local)
- , m_depth(depth)
- , m_globalObject(globalObject)
{
#ifndef NDEBUG
checkValidity();
@@ -252,10 +170,36 @@ namespace JSC {
#endif
unsigned m_type;
- int m_index; // Index in scope, if IndexedFlag is set
RegisterID* m_local; // Local register, if RegisterFlag is set
- size_t m_depth; // Depth in scope chain, if ScopedFlag is set
- JSObject* m_globalObject; // If GlobalFlag is set.
+ };
+
+ struct NonlocalResolveInfo {
+ friend class BytecodeGenerator;
+ NonlocalResolveInfo()
+ : m_state(Unused)
+ {
+ }
+ ~NonlocalResolveInfo()
+ {
+ ASSERT(m_state == Put);
+ }
+ private:
+ void resolved(uint32_t putToBaseIndex)
+ {
+ ASSERT(putToBaseIndex);
+ ASSERT(m_state == Unused);
+ m_state = Resolved;
+ m_putToBaseIndex = putToBaseIndex;
+ }
+ uint32_t put()
+ {
+ ASSERT(m_state == Resolved);
+ m_state = Put;
+ return m_putToBaseIndex;
+ }
+ enum State { Unused, Resolved, Put };
+ State m_state;
+ uint32_t m_putToBaseIndex;
};
class BytecodeGenerator {
@@ -367,7 +311,7 @@ namespace JSC {
// Node::emitCode assumes that dst, if provided, is either a local or a referenced temporary.
ASSERT(!dst || dst == ignoredResult() || !dst->isTemporary() || dst->refCount());
addLineInfo(n->lineNo());
- return m_stack.recursionCheck()
+ return m_stack.isSafeToRecurse()
? n->emitBytecode(*this, dst)
: emitThrowExpressionTooDeepException();
}
@@ -380,7 +324,7 @@ namespace JSC {
void emitNodeInConditionContext(ExpressionNode* n, Label* trueTarget, Label* falseTarget, bool fallThroughMeansTrue)
{
addLineInfo(n->lineNo());
- if (m_stack.recursionCheck())
+ if (m_stack.isSafeToRecurse())
n->emitBytecodeInConditionContext(*this, trueTarget, falseTarget, fallThroughMeansTrue);
else
emitThrowExpressionTooDeepException();
@@ -466,16 +410,17 @@ namespace JSC {
RegisterID* emitTypeOf(RegisterID* dst, RegisterID* src) { return emitUnaryOp(op_typeof, dst, src); }
RegisterID* emitIn(RegisterID* dst, RegisterID* property, RegisterID* base) { return emitBinaryOp(op_in, dst, property, base, OperandTypes()); }
- RegisterID* emitGetStaticVar(RegisterID* dst, const ResolveResult&, const Identifier&);
- RegisterID* emitPutStaticVar(const ResolveResult&, const Identifier&, RegisterID* value);
- RegisterID* emitInitGlobalConst(const ResolveResult&, const Identifier&, RegisterID* value);
+ RegisterID* emitGetLocalVar(RegisterID* dst, const ResolveResult&, const Identifier&);
+ RegisterID* emitInitGlobalConst(const Identifier&, RegisterID* value);
RegisterID* emitResolve(RegisterID* dst, const ResolveResult&, const Identifier& property);
RegisterID* emitResolveBase(RegisterID* dst, const ResolveResult&, const Identifier& property);
- RegisterID* emitResolveBaseForPut(RegisterID* dst, const ResolveResult&, const Identifier& property);
- RegisterID* emitResolveWithBase(RegisterID* baseDst, RegisterID* propDst, const ResolveResult&, const Identifier& property);
+ RegisterID* emitResolveBaseForPut(RegisterID* dst, const ResolveResult&, const Identifier& property, NonlocalResolveInfo&);
+ RegisterID* emitResolveWithBaseForPut(RegisterID* baseDst, RegisterID* propDst, const ResolveResult&, const Identifier& property, NonlocalResolveInfo&);
RegisterID* emitResolveWithThis(RegisterID* baseDst, RegisterID* propDst, const ResolveResult&, const Identifier& property);
+ RegisterID* emitPutToBase(RegisterID* base, const Identifier&, RegisterID* value, NonlocalResolveInfo&);
+
void emitMethodCheck();
RegisterID* emitGetById(RegisterID* dst, RegisterID* base, const Identifier& property);
@@ -596,6 +541,12 @@ namespace JSC {
typedef HashMap<double, JSValue> NumberMap;
typedef HashMap<StringImpl*, JSString*, IdentifierRepHash> IdentifierStringMap;
+ typedef struct {
+ int resolveOperations;
+ int putOperations;
+ } ResolveCacheEntry;
+ typedef HashMap<StringImpl*, ResolveCacheEntry, IdentifierRepHash> IdentifierResolvePutMap;
+ typedef HashMap<StringImpl*, uint32_t, IdentifierRepHash> IdentifierResolveMap;
// Helper for emitCall() and emitConstruct(). This works because the set of
// expected functions have identical behavior for both call and construct
@@ -766,6 +717,75 @@ namespace JSC {
NumberMap m_numberMap;
IdentifierStringMap m_stringMap;
+ uint32_t getResolveOperations(const Identifier& property)
+ {
+ if (m_dynamicScopeDepth)
+ return m_codeBlock->addResolve();
+ IdentifierResolveMap::AddResult result = m_resolveCacheMap.add(property.impl(), 0);
+ if (result.isNewEntry)
+ result.iterator->value = m_codeBlock->addResolve();
+ return result.iterator->value;
+ }
+
+ uint32_t getResolveWithThisOperations(const Identifier& property)
+ {
+ if (m_dynamicScopeDepth)
+ return m_codeBlock->addResolve();
+ IdentifierResolveMap::AddResult result = m_resolveWithThisCacheMap.add(property.impl(), 0);
+ if (result.isNewEntry)
+ result.iterator->value = m_codeBlock->addResolve();
+ return result.iterator->value;
+ }
+
+ uint32_t getResolveBaseOperations(IdentifierResolvePutMap& map, const Identifier& property, uint32_t& putToBaseOperation)
+ {
+ if (m_dynamicScopeDepth) {
+ putToBaseOperation = m_codeBlock->addPutToBase();
+ return m_codeBlock->addResolve();
+ }
+ ResolveCacheEntry entry = {-1, -1};
+ IdentifierResolvePutMap::AddResult result = map.add(property.impl(), entry);
+ if (result.isNewEntry)
+ result.iterator->value.resolveOperations = m_codeBlock->addResolve();
+ if (result.iterator->value.putOperations == -1)
+ result.iterator->value.putOperations = getPutToBaseOperation(property);
+ putToBaseOperation = result.iterator->value.putOperations;
+ return result.iterator->value.resolveOperations;
+ }
+
+ uint32_t getResolveBaseOperations(const Identifier& property)
+ {
+ uint32_t scratch;
+ return getResolveBaseOperations(m_resolveBaseMap, property, scratch);
+ }
+
+ uint32_t getResolveBaseForPutOperations(const Identifier& property, uint32_t& putToBaseOperation)
+ {
+ return getResolveBaseOperations(m_resolveBaseForPutMap, property, putToBaseOperation);
+ }
+
+ uint32_t getResolveWithBaseForPutOperations(const Identifier& property, uint32_t& putToBaseOperation)
+ {
+ return getResolveBaseOperations(m_resolveWithBaseForPutMap, property, putToBaseOperation);
+ }
+
+ uint32_t getPutToBaseOperation(const Identifier& property)
+ {
+ if (m_dynamicScopeDepth)
+ return m_codeBlock->addPutToBase();
+ IdentifierResolveMap::AddResult result = m_putToBaseMap.add(property.impl(), 0);
+ if (result.isNewEntry)
+ result.iterator->value = m_codeBlock->addPutToBase();
+ return result.iterator->value;
+ }
+
+ IdentifierResolveMap m_putToBaseMap;
+ IdentifierResolveMap m_resolveCacheMap;
+ IdentifierResolveMap m_resolveWithThisCacheMap;
+ IdentifierResolvePutMap m_resolveBaseMap;
+ IdentifierResolvePutMap m_resolveBaseForPutMap;
+ IdentifierResolvePutMap m_resolveWithBaseForPutMap;
+
JSGlobalData* m_globalData;
OpcodeID m_lastOpcodeID;
diff --git a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index 10a873d1c..68811955f 100644
--- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -141,7 +141,7 @@ RegisterID* ThisNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst
bool ResolveNode::isPure(BytecodeGenerator& generator) const
{
- return generator.resolve(m_ident).isStatic();
+ return generator.resolve(m_ident).isRegister();
}
RegisterID* ResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
@@ -439,14 +439,6 @@ RegisterID* FunctionCallResolveNode::emitBytecode(BytecodeGenerator& generator,
return generator.emitCall(generator.finalDestinationOrIgnored(dst, callArguments.thisRegister()), func.get(), NoExpectedFunction, callArguments, divot(), startOffset(), endOffset());
}
- if (resolveResult.isStatic()) {
- RefPtr<RegisterID> func = generator.newTemporary();
- CallArguments callArguments(generator, m_args);
- generator.emitGetStaticVar(func.get(), resolveResult, m_ident);
- generator.emitLoad(callArguments.thisRegister(), jsUndefined());
- return generator.emitCall(generator.finalDestinationOrIgnored(dst, func.get()), func.get(), expectedFunction, callArguments, divot(), startOffset(), endOffset());
- }
-
RefPtr<RegisterID> func = generator.newTemporary();
CallArguments callArguments(generator, m_args);
int identifierStart = divot() - startOffset();
@@ -631,29 +623,18 @@ RegisterID* PostfixNode::emitResolve(BytecodeGenerator& generator, RegisterID* d
return emitPreIncOrDec(generator, local, m_operator);
return emitPostIncOrDec(generator, generator.finalDestination(dst), local, m_operator);
}
-
- if (resolveResult.isStatic() && !resolveResult.isReadOnly()) {
- RefPtr<RegisterID> value = generator.emitGetStaticVar(generator.newTemporary(), resolveResult, ident);
- RegisterID* oldValue;
- if (dst == generator.ignoredResult()) {
- oldValue = 0;
- emitPreIncOrDec(generator, value.get(), m_operator);
- } else
- oldValue = emitPostIncOrDec(generator, generator.finalDestination(dst), value.get(), m_operator);
- generator.emitPutStaticVar(resolveResult, ident, value.get());
- return oldValue;
- }
generator.emitExpressionInfo(divot(), startOffset(), endOffset());
RefPtr<RegisterID> value = generator.newTemporary();
- RefPtr<RegisterID> base = generator.emitResolveWithBase(generator.newTemporary(), value.get(), resolveResult, ident);
+ NonlocalResolveInfo resolveInfo;
+ RefPtr<RegisterID> base = generator.emitResolveWithBaseForPut(generator.newTemporary(), value.get(), resolveResult, ident, resolveInfo);
RegisterID* oldValue;
if (dst == generator.ignoredResult()) {
oldValue = 0;
emitPreIncOrDec(generator, value.get(), m_operator);
} else
oldValue = emitPostIncOrDec(generator, generator.finalDestination(dst), value.get(), m_operator);
- generator.emitPutById(base.get(), ident, value.get());
+ generator.emitPutToBase(base.get(), ident, value.get(), resolveInfo);
return oldValue;
}
@@ -828,18 +809,12 @@ RegisterID* PrefixNode::emitResolve(BytecodeGenerator& generator, RegisterID* ds
return generator.moveToDestinationIfNeeded(dst, local);
}
- if (resolveResult.isStatic() && !resolveResult.isReadOnly()) {
- RefPtr<RegisterID> propDst = generator.emitGetStaticVar(generator.tempDestination(dst), resolveResult, ident);
- emitPreIncOrDec(generator, propDst.get(), m_operator);
- generator.emitPutStaticVar(resolveResult, ident, propDst.get());
- return generator.moveToDestinationIfNeeded(dst, propDst.get());
- }
-
generator.emitExpressionInfo(divot(), startOffset(), endOffset());
RefPtr<RegisterID> propDst = generator.tempDestination(dst);
- RefPtr<RegisterID> base = generator.emitResolveWithBase(generator.newTemporary(), propDst.get(), resolveResult, ident);
+ NonlocalResolveInfo resolveVerifier;
+ RefPtr<RegisterID> base = generator.emitResolveWithBaseForPut(generator.newTemporary(), propDst.get(), resolveResult, ident, resolveVerifier);
emitPreIncOrDec(generator, propDst.get(), m_operator);
- generator.emitPutById(base.get(), ident, propDst.get());
+ generator.emitPutToBase(base.get(), ident, propDst.get(), resolveVerifier);
return generator.moveToDestinationIfNeeded(dst, propDst.get());
}
@@ -1265,18 +1240,12 @@ RegisterID* ReadModifyResolveNode::emitBytecode(BytecodeGenerator& generator, Re
return generator.moveToDestinationIfNeeded(dst, result);
}
- if (resolveResult.isStatic() && !resolveResult.isReadOnly()) {
- RefPtr<RegisterID> src1 = generator.emitGetStaticVar(generator.tempDestination(dst), resolveResult, m_ident);
- RegisterID* result = emitReadModifyAssignment(generator, generator.finalDestination(dst, src1.get()), src1.get(), m_right, m_operator, OperandTypes(ResultType::unknownType(), m_right->resultDescriptor()));
- generator.emitPutStaticVar(resolveResult, m_ident, result);
- return result;
- }
-
RefPtr<RegisterID> src1 = generator.tempDestination(dst);
generator.emitExpressionInfo(divot() - startOffset() + m_ident.length(), m_ident.length(), 0);
- RefPtr<RegisterID> base = generator.emitResolveWithBase(generator.newTemporary(), src1.get(), resolveResult, m_ident);
+ NonlocalResolveInfo resolveVerifier;
+ RefPtr<RegisterID> base = generator.emitResolveWithBaseForPut(generator.newTemporary(), src1.get(), resolveResult, m_ident, resolveVerifier);
RegisterID* result = emitReadModifyAssignment(generator, generator.finalDestination(dst, src1.get()), src1.get(), m_right, m_operator, OperandTypes(ResultType::unknownType(), m_right->resultDescriptor()), this);
- return generator.emitPutById(base.get(), m_ident, result);
+ return generator.emitPutToBase(base.get(), m_ident, result, resolveVerifier);
}
// ------------------------------ AssignResolveNode -----------------------------------
@@ -1285,7 +1254,7 @@ RegisterID* AssignResolveNode::emitBytecode(BytecodeGenerator& generator, Regist
{
ResolveResult resolveResult = generator.resolve(m_ident);
- if (RegisterID *local = resolveResult.local()) {
+ if (RegisterID* local = resolveResult.local()) {
if (resolveResult.isReadOnly()) {
generator.emitReadOnlyExceptionIfNeeded();
return generator.emitNode(dst, m_right);
@@ -1294,20 +1263,13 @@ RegisterID* AssignResolveNode::emitBytecode(BytecodeGenerator& generator, Regist
return generator.moveToDestinationIfNeeded(dst, result);
}
- if (resolveResult.isStatic() && !resolveResult.isReadOnly()) {
- if (dst == generator.ignoredResult())
- dst = 0;
- RegisterID* value = generator.emitNode(dst, m_right);
- generator.emitPutStaticVar(resolveResult, m_ident, value);
- return value;
- }
-
- RefPtr<RegisterID> base = generator.emitResolveBaseForPut(generator.newTemporary(), resolveResult, m_ident);
+ NonlocalResolveInfo resolveVerifier;
+ RefPtr<RegisterID> base = generator.emitResolveBaseForPut(generator.newTemporary(), resolveResult, m_ident, resolveVerifier);
if (dst == generator.ignoredResult())
dst = 0;
RegisterID* value = generator.emitNode(dst, m_right);
generator.emitExpressionInfo(divot(), startOffset(), endOffset());
- return generator.emitPutById(base.get(), m_ident, value);
+ return generator.emitPutToBase(base.get(), m_ident, value, resolveVerifier);
}
// ------------------------------ AssignDotNode -----------------------------------
@@ -1402,16 +1364,14 @@ RegisterID* ConstDeclNode::emitCodeSingle(BytecodeGenerator& generator)
RefPtr<RegisterID> value = m_init ? generator.emitNode(m_init) : generator.emitLoad(0, jsUndefined());
- if (resolveResult.isStatic()) {
- if (generator.codeType() == GlobalCode)
- return generator.emitInitGlobalConst(resolveResult, m_ident, value.get());
- return generator.emitPutStaticVar(resolveResult, m_ident, value.get());
+ if (generator.codeType() == GlobalCode) {
+ if (RegisterID* result = generator.emitInitGlobalConst(m_ident, value.get()))
+ return result;
}
if (generator.codeType() != EvalCode)
return value.get();
- // FIXME: While this code should only be hit in an eval block, it will assign
- // to the wrong base if m_ident exists in an intervening with scope.
+ // FIXME: This will result in incorrect assignment if m_ident exists in an intervening with scope.
RefPtr<RegisterID> base = generator.emitResolveBase(generator.newTemporary(), resolveResult, m_ident);
return generator.emitPutById(base.get(), m_ident, value.get());
}
@@ -1699,10 +1659,11 @@ RegisterID* ForInNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds
if (!propertyName) {
propertyName = generator.newTemporary();
RefPtr<RegisterID> protect = propertyName;
- RegisterID* base = generator.emitResolveBaseForPut(generator.newTemporary(), resolveResult, ident);
+ NonlocalResolveInfo resolveVerifier;
+ RegisterID* base = generator.emitResolveBaseForPut(generator.newTemporary(), resolveResult, ident, resolveVerifier);
generator.emitExpressionInfo(divot(), startOffset(), endOffset());
- generator.emitPutById(base, ident, propertyName);
+ generator.emitPutToBase(base, ident, propertyName, resolveVerifier);
} else {
expectedSubscript = generator.emitMove(generator.newTemporary(), propertyName);
generator.pushOptimisedForIn(expectedSubscript.get(), iter.get(), i.get(), propertyName);
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
index da5682f55..928788bf3 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
+++ b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
@@ -1420,9 +1420,15 @@ bool AbstractState::execute(unsigned indexInBlock)
ASSERT_NOT_REACHED();
break;
}
+ forNode(node.child1()).filterArrayModes(arrayModesFor(node.arrayMode()));
break;
}
case Arrayify: {
+ if (modeAlreadyChecked(forNode(node.child1()), node.arrayMode())) {
+ m_foundConstants = true;
+ node.setCanExit(false);
+ break;
+ }
switch (node.arrayMode()) {
case ALL_EFFECTFUL_MODES:
node.setCanExit(true);
@@ -1431,9 +1437,10 @@ bool AbstractState::execute(unsigned indexInBlock)
forNode(node.child2()).filter(SpecInt32);
forNode(nodeIndex).clear();
clobberStructures(indexInBlock);
+ forNode(node.child1()).filterArrayModes(arrayModesFor(node.arrayMode()));
break;
default:
- ASSERT_NOT_REACHED();
+ CRASH();
break;
}
break;
@@ -1524,7 +1531,12 @@ bool AbstractState::execute(unsigned indexInBlock)
clobberWorld(node.codeOrigin, indexInBlock);
forNode(nodeIndex).makeTop();
break;
-
+
+ case GarbageValue:
+ clobberWorld(node.codeOrigin, indexInBlock);
+ forNode(nodeIndex).makeTop();
+ break;
+
case ForceOSRExit:
node.setCanExit(true);
m_isValid = false;
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractValue.h b/Source/JavaScriptCore/dfg/DFGAbstractValue.h
index ff1c6d205..5382cd3ad 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractValue.h
+++ b/Source/JavaScriptCore/dfg/DFGAbstractValue.h
@@ -30,6 +30,7 @@
#if ENABLE(DFG_JIT)
+#include "ArrayProfile.h"
#include "DFGStructureAbstractValue.h"
#include "JSCell.h"
#include "SpeculatedType.h"
@@ -40,12 +41,14 @@ namespace JSC { namespace DFG {
struct AbstractValue {
AbstractValue()
: m_type(SpecNone)
+ , m_arrayModes(0)
{
}
void clear()
{
m_type = SpecNone;
+ m_arrayModes = 0;
m_currentKnownStructure.clear();
m_futurePossibleStructure.clear();
m_value = JSValue();
@@ -54,7 +57,7 @@ struct AbstractValue {
bool isClear() const
{
- bool result = m_type == SpecNone && m_currentKnownStructure.isClear() && m_futurePossibleStructure.isClear();
+ bool result = m_type == SpecNone && !m_arrayModes && m_currentKnownStructure.isClear() && m_futurePossibleStructure.isClear();
if (result)
ASSERT(!m_value);
return result;
@@ -63,6 +66,7 @@ struct AbstractValue {
void makeTop()
{
m_type = SpecTop;
+ m_arrayModes = ALL_ARRAY_MODES;
m_currentKnownStructure.makeTop();
m_futurePossibleStructure.makeTop();
m_value = JSValue();
@@ -71,13 +75,16 @@ struct AbstractValue {
void clobberStructures()
{
- if (m_type & SpecCell)
+ if (m_type & SpecCell) {
m_currentKnownStructure.makeTop();
- else
+ clobberArrayModes();
+ } else {
ASSERT(m_currentKnownStructure.isClear());
+ ASSERT(!m_arrayModes);
+ }
checkConsistency();
}
-
+
void clobberValue()
{
m_value = JSValue();
@@ -105,29 +112,17 @@ struct AbstractValue {
return result;
}
- void setFuturePossibleStructure(Structure* structure)
- {
- if (structure->transitionWatchpointSetIsStillValid())
- m_futurePossibleStructure = structure;
- else
- m_futurePossibleStructure.makeTop();
- }
-
- void filterFuturePossibleStructure(Structure* structure)
- {
- if (structure->transitionWatchpointSetIsStillValid())
- m_futurePossibleStructure.filter(StructureAbstractValue(structure));
- }
-
void setMostSpecific(JSValue value)
{
if (!!value && value.isCell()) {
Structure* structure = value.asCell()->structure();
m_currentKnownStructure = structure;
setFuturePossibleStructure(structure);
+ m_arrayModes = asArrayModes(structure->indexingType());
} else {
m_currentKnownStructure.clear();
m_futurePossibleStructure.clear();
+ m_arrayModes = 0;
}
m_type = speculationFromValue(value);
@@ -140,10 +135,14 @@ struct AbstractValue {
{
if (!!value && value.isCell()) {
m_currentKnownStructure.makeTop();
- setFuturePossibleStructure(value.asCell()->structure());
+ Structure* structure = value.asCell()->structure();
+ setFuturePossibleStructure(structure);
+ m_arrayModes = asArrayModes(structure->indexingType());
+ clobberArrayModes();
} else {
m_currentKnownStructure.clear();
m_futurePossibleStructure.clear();
+ m_arrayModes = 0;
}
m_type = speculationFromValue(value);
@@ -156,6 +155,7 @@ struct AbstractValue {
{
m_currentKnownStructure = structure;
setFuturePossibleStructure(structure);
+ m_arrayModes = asArrayModes(structure->indexingType());
m_type = speculationFromStructure(structure);
m_value = JSValue();
@@ -167,9 +167,11 @@ struct AbstractValue {
if (type & SpecCell) {
m_currentKnownStructure.makeTop();
m_futurePossibleStructure.makeTop();
+ m_arrayModes = ALL_ARRAY_MODES;
} else {
m_currentKnownStructure.clear();
m_futurePossibleStructure.clear();
+ m_arrayModes = 0;
}
m_type = type;
m_value = JSValue();
@@ -179,6 +181,7 @@ struct AbstractValue {
bool operator==(const AbstractValue& other) const
{
return m_type == other.m_type
+ && m_arrayModes == other.m_arrayModes
&& m_currentKnownStructure == other.m_currentKnownStructure
&& m_futurePossibleStructure == other.m_futurePossibleStructure
&& m_value == other.m_value;
@@ -199,6 +202,7 @@ struct AbstractValue {
result = !other.isClear();
} else {
result |= mergeSpeculation(m_type, other.m_type);
+ result |= mergeArrayModes(m_arrayModes, other.m_arrayModes);
result |= m_currentKnownStructure.addAll(other.m_currentKnownStructure);
result |= m_futurePossibleStructure.addAll(other.m_futurePossibleStructure);
if (m_value != other.m_value) {
@@ -218,6 +222,7 @@ struct AbstractValue {
if (type & SpecCell) {
m_currentKnownStructure.makeTop();
m_futurePossibleStructure.makeTop();
+ m_arrayModes = ALL_ARRAY_MODES;
}
m_value = JSValue();
@@ -227,6 +232,7 @@ struct AbstractValue {
void filter(const StructureSet& other)
{
m_type &= other.speculationFromStructures();
+ m_arrayModes &= other.arrayModesFromStructures();
m_currentKnownStructure.filter(other);
if (m_currentKnownStructure.isClear())
m_futurePossibleStructure.clear();
@@ -241,11 +247,24 @@ struct AbstractValue {
m_currentKnownStructure.filter(m_type);
m_futurePossibleStructure.filter(m_type);
+ filterArrayModesByType();
filterValueByType();
checkConsistency();
}
+ void filterArrayModes(ArrayModes arrayModes)
+ {
+ ASSERT(arrayModes);
+
+ m_type &= SpecCell;
+ m_arrayModes &= arrayModes;
+
+ // I could do more fancy filtering here. But it probably won't make any difference.
+
+ checkConsistency();
+ }
+
void filter(SpeculatedType type)
{
if (type == SpecTop)
@@ -258,31 +277,13 @@ struct AbstractValue {
// the new type (None) rather than the one passed (Array).
m_currentKnownStructure.filter(m_type);
m_futurePossibleStructure.filter(m_type);
-
+
+ filterArrayModesByType();
filterValueByType();
checkConsistency();
}
- // We could go further, and ensure that if the futurePossibleStructure contravenes
- // the value, then we could clear both of those things. But that's unlikely to help
- // in any realistic scenario, so we don't do it. Simpler is better.
- void filterValueByType()
- {
- if (!!m_type) {
- // The type is still non-empty. This implies that regardless of what filtering
- // was done, we either didn't have a value to begin with, or that value is still
- // valid.
- ASSERT(!m_value || validateType(m_value));
- return;
- }
-
- // The type has been rendered empty. That means that the value must now be invalid,
- // as well.
- ASSERT(!m_value || !validateType(m_value));
- m_value = JSValue();
- }
-
bool validateType(JSValue value) const
{
if (isTop())
@@ -319,7 +320,8 @@ struct AbstractValue {
ASSERT(m_type & SpecCell);
Structure* structure = value.asCell()->structure();
return m_currentKnownStructure.contains(structure)
- && m_futurePossibleStructure.contains(structure);
+ && m_futurePossibleStructure.contains(structure)
+ && (m_arrayModes & asArrayModes(structure->indexingType()));
}
return true;
@@ -330,6 +332,7 @@ struct AbstractValue {
if (!(m_type & SpecCell)) {
ASSERT(m_currentKnownStructure.isClear());
ASSERT(m_futurePossibleStructure.isClear());
+ ASSERT(!m_arrayModes);
}
if (isClear())
@@ -346,7 +349,7 @@ struct AbstractValue {
void dump(FILE* out) const
{
- fprintf(out, "(%s, ", speculationToString(m_type));
+ fprintf(out, "(%s, %s, ", speculationToString(m_type), arrayModesToString(m_arrayModes));
m_currentKnownStructure.dump(out);
dataLog(", ");
m_futurePossibleStructure.dump(out);
@@ -437,6 +440,13 @@ struct AbstractValue {
// unified with the set of all objects with structure 0x12345.
SpeculatedType m_type;
+ // This is a proven constraint on the possible indexing types that this value
+ // can have right now. It also implicitly constraints the set of structures
+ // that the value may have right now, since a structure has an immutable
+ // indexing type. This is subject to change upon reassignment, or any side
+ // effect that makes non-obvious changes to the heap.
+ ArrayModes m_arrayModes;
+
// This is a proven constraint on the possible values that this value can
// have now or any time in the future, unless it is reassigned. Note that this
// implies nothing about the structure. Oddly, JSValue() (i.e. the empty value)
@@ -444,6 +454,75 @@ struct AbstractValue {
// BOTTOM then JSValue() means BOTTOM; if m_type is not BOTTOM then JSValue()
// means TOP.
JSValue m_value;
+
+private:
+ void clobberArrayModes()
+ {
+ if (m_arrayModes == ALL_ARRAY_MODES)
+ return;
+
+ if (LIKELY(m_arrayModes & asArrayModes(NonArray)))
+ m_arrayModes = ALL_ARRAY_MODES;
+ else
+ clobberArrayModesSlow();
+ }
+
+ void clobberArrayModesSlow()
+ {
+ if (m_arrayModes & asArrayModes(ArrayClass))
+ m_arrayModes = ALL_ARRAY_MODES;
+ else if (m_arrayModes & asArrayModes(NonArrayWithContiguous))
+ m_arrayModes |= asArrayModes(NonArrayWithArrayStorage) | asArrayModes(NonArrayWithSlowPutArrayStorage);
+ else if (m_arrayModes & asArrayModes(ArrayWithContiguous))
+ m_arrayModes |= asArrayModes(ArrayWithArrayStorage) | asArrayModes(ArrayWithSlowPutArrayStorage);
+ else if (m_arrayModes & asArrayModes(NonArrayWithArrayStorage))
+ m_arrayModes |= asArrayModes(NonArrayWithSlowPutArrayStorage);
+ else if (m_arrayModes & asArrayModes(ArrayWithArrayStorage))
+ m_arrayModes |= asArrayModes(ArrayWithArrayStorage);
+ }
+
+ void setFuturePossibleStructure(Structure* structure)
+ {
+ if (structure->transitionWatchpointSetIsStillValid())
+ m_futurePossibleStructure = structure;
+ else
+ m_futurePossibleStructure.makeTop();
+ }
+
+ void filterFuturePossibleStructure(Structure* structure)
+ {
+ if (structure->transitionWatchpointSetIsStillValid())
+ m_futurePossibleStructure.filter(StructureAbstractValue(structure));
+ }
+
+ // We could go further, and ensure that if the futurePossibleStructure contravenes
+ // the value, then we could clear both of those things. But that's unlikely to help
+ // in any realistic scenario, so we don't do it. Simpler is better.
+ void filterValueByType()
+ {
+ if (!!m_type) {
+ // The type is still non-empty. This implies that regardless of what filtering
+ // was done, we either didn't have a value to begin with, or that value is still
+ // valid.
+ ASSERT(!m_value || validateType(m_value));
+ return;
+ }
+
+ // The type has been rendered empty. That means that the value must now be invalid,
+ // as well.
+ ASSERT(!m_value || !validateType(m_value));
+ m_value = JSValue();
+ }
+
+ void filterArrayModesByType()
+ {
+ if (!(m_type & SpecCell))
+ m_arrayModes = 0;
+ else if (!(m_type & ~SpecArray))
+ m_arrayModes &= ALL_ARRAY_ARRAY_MODES;
+ else if (!(m_type & SpecArray))
+ m_arrayModes &= ALL_NON_ARRAY_ARRAY_MODES;
+ }
};
} } // namespace JSC::DFG
diff --git a/Source/JavaScriptCore/dfg/DFGArrayMode.cpp b/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
index 3985d769c..623e9d743 100644
--- a/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
+++ b/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
@@ -167,12 +167,17 @@ bool modeAlreadyChecked(AbstractValue& value, Array::Mode arrayMode)
case Array::PossiblyArrayWithContiguous:
case Array::PossiblyArrayWithContiguousToTail:
case Array::PossiblyArrayWithContiguousOutOfBounds:
+ case Array::ToContiguous:
+ if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModes(NonArrayWithContiguous) | asArrayModes(ArrayWithContiguous)))
+ return true;
return value.m_currentKnownStructure.hasSingleton()
&& hasContiguous(value.m_currentKnownStructure.singleton()->indexingType());
case Array::ArrayWithContiguous:
case Array::ArrayWithContiguousToTail:
case Array::ArrayWithContiguousOutOfBounds:
+ if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModes(ArrayWithContiguous)))
+ return true;
return value.m_currentKnownStructure.hasSingleton()
&& hasContiguous(value.m_currentKnownStructure.singleton()->indexingType())
&& (value.m_currentKnownStructure.singleton()->indexingType() & IsArray);
@@ -183,29 +188,38 @@ bool modeAlreadyChecked(AbstractValue& value, Array::Mode arrayMode)
case Array::PossiblyArrayWithArrayStorage:
case Array::PossiblyArrayWithArrayStorageToHole:
case Array::PossiblyArrayWithArrayStorageOutOfBounds:
+ case Array::ToArrayStorage:
+ case Array::PossiblyArrayToArrayStorage:
+ if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModes(NonArrayWithArrayStorage) | asArrayModes(ArrayWithArrayStorage)))
+ return true;
return value.m_currentKnownStructure.hasSingleton()
&& hasFastArrayStorage(value.m_currentKnownStructure.singleton()->indexingType());
case Array::SlowPutArrayStorage:
case Array::PossiblyArrayWithSlowPutArrayStorage:
+ case Array::ToSlowPutArrayStorage:
+ if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModes(NonArrayWithArrayStorage) | asArrayModes(ArrayWithArrayStorage) | asArrayModes(NonArrayWithSlowPutArrayStorage) | asArrayModes(ArrayWithSlowPutArrayStorage)))
+ return true;
return value.m_currentKnownStructure.hasSingleton()
&& hasArrayStorage(value.m_currentKnownStructure.singleton()->indexingType());
case Array::ArrayWithArrayStorage:
case Array::ArrayWithArrayStorageToHole:
case Array::ArrayWithArrayStorageOutOfBounds:
+ case Array::ArrayToArrayStorage:
+ if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModes(ArrayWithArrayStorage)))
+ return true;
return value.m_currentKnownStructure.hasSingleton()
&& hasFastArrayStorage(value.m_currentKnownStructure.singleton()->indexingType())
&& (value.m_currentKnownStructure.singleton()->indexingType() & IsArray);
case Array::ArrayWithSlowPutArrayStorage:
+ if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModes(ArrayWithArrayStorage) | asArrayModes(ArrayWithSlowPutArrayStorage)))
+ return true;
return value.m_currentKnownStructure.hasSingleton()
&& hasArrayStorage(value.m_currentKnownStructure.singleton()->indexingType())
&& (value.m_currentKnownStructure.singleton()->indexingType() & IsArray);
- case ALL_EFFECTFUL_MODES:
- return false;
-
case Array::Arguments:
return isArgumentsSpeculation(value.m_type);
diff --git a/Source/JavaScriptCore/dfg/DFGArrayMode.h b/Source/JavaScriptCore/dfg/DFGArrayMode.h
index a666bb83f..f7ac92733 100644
--- a/Source/JavaScriptCore/dfg/DFGArrayMode.h
+++ b/Source/JavaScriptCore/dfg/DFGArrayMode.h
@@ -349,6 +349,51 @@ inline bool isEffectful(Array::Mode mode)
}
}
+// This returns the set of array modes that will pass filtering of a CheckArray or
+// Arrayify with the given mode.
+inline ArrayModes arrayModesFor(Array::Mode arrayMode)
+{
+ switch (arrayMode) {
+ case Array::Generic:
+ return ALL_ARRAY_MODES;
+ case Array::Contiguous:
+ case Array::ContiguousToTail:
+ case Array::ContiguousOutOfBounds:
+ case Array::ToContiguous:
+ return asArrayModes(NonArrayWithContiguous);
+ case Array::PossiblyArrayWithContiguous:
+ case Array::PossiblyArrayWithContiguousToTail:
+ case Array::PossiblyArrayWithContiguousOutOfBounds:
+ return asArrayModes(NonArrayWithContiguous) | asArrayModes(ArrayWithContiguous);
+ case ARRAY_WITH_CONTIGUOUS_MODES:
+ return asArrayModes(ArrayWithContiguous);
+ case Array::ArrayStorage:
+ case Array::ArrayStorageToHole:
+ case Array::ArrayStorageOutOfBounds:
+ case Array::ToArrayStorage:
+ return asArrayModes(NonArrayWithArrayStorage);
+ case Array::ToSlowPutArrayStorage:
+ case Array::SlowPutArrayStorage:
+ return asArrayModes(NonArrayWithArrayStorage) | asArrayModes(NonArrayWithSlowPutArrayStorage);
+ case Array::PossiblyArrayWithArrayStorage:
+ case Array::PossiblyArrayWithArrayStorageToHole:
+ case Array::PossiblyArrayWithArrayStorageOutOfBounds:
+ case Array::PossiblyArrayToArrayStorage:
+ return asArrayModes(NonArrayWithArrayStorage) | asArrayModes(ArrayWithArrayStorage);
+ case Array::PossiblyArrayWithSlowPutArrayStorage:
+ return asArrayModes(NonArrayWithArrayStorage) | asArrayModes(ArrayWithArrayStorage) | asArrayModes(NonArrayWithSlowPutArrayStorage) | asArrayModes(ArrayWithSlowPutArrayStorage);
+ case Array::ArrayWithArrayStorage:
+ case Array::ArrayWithArrayStorageToHole:
+ case Array::ArrayWithArrayStorageOutOfBounds:
+ case Array::ArrayToArrayStorage:
+ return asArrayModes(ArrayWithArrayStorage);
+ case Array::ArrayWithSlowPutArrayStorage:
+ return asArrayModes(ArrayWithArrayStorage) | asArrayModes(ArrayWithSlowPutArrayStorage);
+ default:
+ return asArrayModes(NonArray);
+ }
+}
+
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)
diff --git a/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.cpp b/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.cpp
index a19b723d8..ca8683ead 100644
--- a/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.cpp
+++ b/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.cpp
@@ -73,7 +73,7 @@ void AssemblyHelpers::clearSamplingFlag(int32_t flag)
void AssemblyHelpers::jitAssertIsInt32(GPRReg gpr)
{
#if CPU(X86_64)
- Jump checkInt32 = branchPtr(BelowOrEqual, gpr, TrustedImmPtr(reinterpret_cast<void*>(static_cast<uintptr_t>(0xFFFFFFFFu))));
+ Jump checkInt32 = branch64(BelowOrEqual, gpr, TrustedImm64(static_cast<uintptr_t>(0xFFFFFFFFu)));
breakpoint();
checkInt32.link(this);
#else
@@ -83,22 +83,22 @@ void AssemblyHelpers::jitAssertIsInt32(GPRReg gpr)
void AssemblyHelpers::jitAssertIsJSInt32(GPRReg gpr)
{
- Jump checkJSInt32 = branchPtr(AboveOrEqual, gpr, GPRInfo::tagTypeNumberRegister);
+ Jump checkJSInt32 = branch64(AboveOrEqual, gpr, GPRInfo::tagTypeNumberRegister);
breakpoint();
checkJSInt32.link(this);
}
void AssemblyHelpers::jitAssertIsJSNumber(GPRReg gpr)
{
- Jump checkJSNumber = branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagTypeNumberRegister);
+ Jump checkJSNumber = branchTest64(MacroAssembler::NonZero, gpr, GPRInfo::tagTypeNumberRegister);
breakpoint();
checkJSNumber.link(this);
}
void AssemblyHelpers::jitAssertIsJSDouble(GPRReg gpr)
{
- Jump checkJSInt32 = branchPtr(AboveOrEqual, gpr, GPRInfo::tagTypeNumberRegister);
- Jump checkJSNumber = branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagTypeNumberRegister);
+ Jump checkJSInt32 = branch64(AboveOrEqual, gpr, GPRInfo::tagTypeNumberRegister);
+ Jump checkJSNumber = branchTest64(MacroAssembler::NonZero, gpr, GPRInfo::tagTypeNumberRegister);
checkJSInt32.link(this);
breakpoint();
checkJSNumber.link(this);
@@ -106,7 +106,7 @@ void AssemblyHelpers::jitAssertIsJSDouble(GPRReg gpr)
void AssemblyHelpers::jitAssertIsCell(GPRReg gpr)
{
- Jump checkCell = branchTestPtr(MacroAssembler::Zero, gpr, GPRInfo::tagMaskRegister);
+ Jump checkCell = branchTest64(MacroAssembler::Zero, gpr, GPRInfo::tagMaskRegister);
breakpoint();
checkCell.link(this);
}
diff --git a/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h b/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h
index 5d338fa57..953a743ff 100644
--- a/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h
+++ b/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h
@@ -99,7 +99,11 @@ public:
}
void emitPutToCallFrameHeader(GPRReg from, JSStack::CallFrameHeaderEntry entry)
{
- storePtr(from, Address(GPRInfo::callFrameRegister, entry * sizeof(Register)));
+#if USE(JSVALUE64)
+ store64(from, Address(GPRInfo::callFrameRegister, entry * sizeof(Register)));
+#else
+ store32(from, Address(GPRInfo::callFrameRegister, entry * sizeof(Register)));
+#endif
}
void emitPutImmediateToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry entry)
@@ -110,7 +114,7 @@ public:
Jump branchIfNotCell(GPRReg reg)
{
#if USE(JSVALUE64)
- return branchTestPtr(MacroAssembler::NonZero, reg, GPRInfo::tagMaskRegister);
+ return branchTest64(MacroAssembler::NonZero, reg, GPRInfo::tagMaskRegister);
#else
return branch32(MacroAssembler::NotEqual, reg, TrustedImm32(JSValue::CellTag));
#endif
@@ -172,8 +176,14 @@ public:
ScratchBuffer* scratchBuffer = m_globalData->scratchBufferForSize(scratchSize);
EncodedJSValue* buffer = static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer());
- for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i)
- storePtr(GPRInfo::toRegister(i), buffer + i);
+ for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i) {
+#if USE(JSVALUE64)
+ store64(GPRInfo::toRegister(i), buffer + i);
+#else
+ store32(GPRInfo::toRegister(i), buffer + i);
+#endif
+ }
+
for (unsigned i = 0; i < FPRInfo::numberOfRegisters; ++i) {
move(TrustedImmPtr(buffer + GPRInfo::numberOfRegisters + i), GPRInfo::regT0);
storeDouble(FPRInfo::toRegister(i), GPRInfo::regT0);
@@ -204,8 +214,13 @@ public:
move(TrustedImmPtr(buffer + GPRInfo::numberOfRegisters + i), GPRInfo::regT0);
loadDouble(GPRInfo::regT0, FPRInfo::toRegister(i));
}
- for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i)
- loadPtr(buffer + i, GPRInfo::toRegister(i));
+ for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i) {
+#if USE(JSVALUE64)
+ load64(buffer + i, GPRInfo::toRegister(i));
+#else
+ load32(buffer + i, GPRInfo::toRegister(i));
+#endif
+ }
}
// These methods JIT generate dynamic, debug-only checks - akin to ASSERTs.
@@ -229,16 +244,16 @@ public:
#if USE(JSVALUE64)
GPRReg boxDouble(FPRReg fpr, GPRReg gpr)
{
- moveDoubleToPtr(fpr, gpr);
- subPtr(GPRInfo::tagTypeNumberRegister, gpr);
+ moveDoubleTo64(fpr, gpr);
+ sub64(GPRInfo::tagTypeNumberRegister, gpr);
jitAssertIsJSDouble(gpr);
return gpr;
}
FPRReg unboxDouble(GPRReg gpr, FPRReg fpr)
{
jitAssertIsJSDouble(gpr);
- addPtr(GPRInfo::tagTypeNumberRegister, gpr);
- movePtrToDouble(gpr, fpr);
+ add64(GPRInfo::tagTypeNumberRegister, gpr);
+ move64ToDouble(gpr, fpr);
return fpr;
}
#endif
@@ -258,7 +273,7 @@ public:
Jump emitExceptionCheck(ExceptionCheckKind kind = NormalExceptionCheck)
{
#if USE(JSVALUE64)
- return branchTestPtr(kind == NormalExceptionCheck ? NonZero : Zero, AbsoluteAddress(&globalData()->exception));
+ return branchTest64(kind == NormalExceptionCheck ? NonZero : Zero, AbsoluteAddress(&globalData()->exception));
#elif USE(JSVALUE32_64)
return branch32(kind == NormalExceptionCheck ? NotEqual : Equal, AbsoluteAddress(reinterpret_cast<char*>(&globalData()->exception) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), TrustedImm32(JSValue::EmptyValueTag));
#endif
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index 4869cf8c1..36d18d7b3 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -169,12 +169,17 @@ private:
// Handle intrinsic functions. Return true if it succeeded, false if we need to plant a call.
bool handleIntrinsic(bool usesResult, int resultOperand, Intrinsic, int registerOffset, int argumentCountIncludingThis, SpeculatedType prediction);
bool handleConstantInternalFunction(bool usesResult, int resultOperand, InternalFunction*, int registerOffset, int argumentCountIncludingThis, SpeculatedType prediction, CodeSpecializationKind);
+ NodeIndex handleGetByOffset(SpeculatedType, NodeIndex base, unsigned identifierNumber, PropertyOffset);
void handleGetByOffset(
int destinationOperand, SpeculatedType, NodeIndex base, unsigned identifierNumber,
PropertyOffset);
void handleGetById(
int destinationOperand, SpeculatedType, NodeIndex base, unsigned identifierNumber,
const GetByIdStatus&);
+
+ // Convert a set of ResolveOperations into graph nodes
+ bool parseResolveOperations(SpeculatedType, unsigned identifierNumber, unsigned operations, unsigned putToBaseOperation, NodeIndex* base, NodeIndex* value);
+
// Prepare to parse a block.
void prepareToParseBlock();
// Parse a single basic block of bytecode instructions.
@@ -1143,6 +1148,8 @@ private:
Vector<unsigned> m_identifierRemap;
Vector<unsigned> m_constantRemap;
Vector<unsigned> m_constantBufferRemap;
+ Vector<unsigned> m_resolveOperationRemap;
+ Vector<unsigned> m_putToBaseOperationRemap;
// Blocks introduced by this code block, which need successor linking.
// May include up to one basic block that includes the continuation after
@@ -1779,24 +1786,28 @@ bool ByteCodeParser::handleConstantInternalFunction(
return false;
}
-void ByteCodeParser::handleGetByOffset(
- int destinationOperand, SpeculatedType prediction, NodeIndex base, unsigned identifierNumber,
- PropertyOffset offset)
+NodeIndex ByteCodeParser::handleGetByOffset(SpeculatedType prediction, NodeIndex base, unsigned identifierNumber, PropertyOffset offset)
{
NodeIndex propertyStorage;
if (isInlineOffset(offset))
propertyStorage = base;
else
propertyStorage = addToGraph(GetButterfly, base);
- set(destinationOperand,
- addToGraph(
- GetByOffset, OpInfo(m_graph.m_storageAccessData.size()), OpInfo(prediction),
- propertyStorage));
-
+ NodeIndex getByOffset = addToGraph(GetByOffset, OpInfo(m_graph.m_storageAccessData.size()), OpInfo(prediction), propertyStorage);
+
StorageAccessData storageAccessData;
storageAccessData.offset = indexRelativeToBase(offset);
storageAccessData.identifierNumber = identifierNumber;
m_graph.m_storageAccessData.append(storageAccessData);
+
+ return getByOffset;
+}
+
+void ByteCodeParser::handleGetByOffset(
+ int destinationOperand, SpeculatedType prediction, NodeIndex base, unsigned identifierNumber,
+ PropertyOffset offset)
+{
+ set(destinationOperand, handleGetByOffset(prediction, base, identifierNumber, offset));
}
void ByteCodeParser::handleGetById(
@@ -1860,10 +1871,174 @@ void ByteCodeParser::prepareToParseBlock()
m_cellConstantNodes.clear();
}
+bool ByteCodeParser::parseResolveOperations(SpeculatedType prediction, unsigned identifier, unsigned operations, unsigned putToBaseOperation, NodeIndex* base, NodeIndex* value)
+{
+ ResolveOperations* resolveOperations = m_codeBlock->resolveOperations(operations);
+ if (resolveOperations->isEmpty()) {
+ addToGraph(ForceOSRExit);
+ return false;
+ }
+ JSGlobalObject* globalObject = m_inlineStackTop->m_codeBlock->globalObject();
+ int skipCount = 0;
+ bool skippedScopes = false;
+ bool setBase = false;
+ ResolveOperation* pc = resolveOperations->data();
+ NodeIndex localBase = 0;
+ bool resolvingBase = true;
+ while (resolvingBase) {
+ switch (pc->m_operation) {
+ case ResolveOperation::ReturnGlobalObjectAsBase:
+ *base = get(m_codeBlock->globalObjectConstant());
+ ASSERT(!value);
+ return true;
+
+ case ResolveOperation::SetBaseToGlobal:
+ *base = get(m_codeBlock->globalObjectConstant());
+ setBase = true;
+ resolvingBase = false;
+ ++pc;
+ break;
+
+ case ResolveOperation::SetBaseToUndefined:
+ *base = constantUndefined();
+ setBase = true;
+ resolvingBase = false;
+ ++pc;
+ break;
+
+ case ResolveOperation::SetBaseToScope:
+ localBase = addToGraph(GetScope, OpInfo(skipCount));
+ *base = localBase;
+ setBase = true;
+
+ resolvingBase = false;
+
+ // Reset the scope skipping as we've already loaded it
+ skippedScopes = false;
+ ++pc;
+ break;
+ case ResolveOperation::ReturnScopeAsBase:
+ *base = addToGraph(GetScope, OpInfo(skipCount));
+ ASSERT(!value);
+ return true;
+
+ case ResolveOperation::SkipTopScopeNode:
+ if (m_inlineStackTop->m_inlineCallFrame)
+ return false;
+ skipCount = 1;
+ skippedScopes = true;
+ ++pc;
+ break;
+
+ case ResolveOperation::SkipScopes:
+ if (m_inlineStackTop->m_inlineCallFrame)
+ return false;
+ skipCount += pc->m_scopesToSkip;
+ skippedScopes = true;
+ ++pc;
+ break;
+
+ case ResolveOperation::CheckForDynamicEntriesBeforeGlobalScope:
+ return false;
+
+ case ResolveOperation::Fail:
+ return false;
+
+ default:
+ resolvingBase = false;
+ }
+ }
+ if (skippedScopes)
+ localBase = addToGraph(GetScope, OpInfo(skipCount));
+
+ if (base && !setBase)
+ *base = localBase;
+
+ ASSERT(value);
+ ResolveOperation* resolveValueOperation = pc;
+ switch (resolveValueOperation->m_operation) {
+ case ResolveOperation::GetAndReturnGlobalProperty: {
+ ResolveGlobalStatus status = ResolveGlobalStatus::computeFor(m_inlineStackTop->m_profiledBlock, m_currentIndex, resolveValueOperation, m_codeBlock->identifier(identifier));
+ if (status.isSimple()) {
+ ASSERT(status.structure());
+
+ NodeIndex globalObjectNode = addStructureTransitionCheck(globalObject, status.structure());
+
+ if (status.specificValue()) {
+ ASSERT(status.specificValue().isCell());
+ *value = cellConstant(status.specificValue().asCell());
+ } else
+ *value = handleGetByOffset(prediction, globalObjectNode, identifier, status.offset());
+ return true;
+ }
+
+ NodeIndex resolve = addToGraph(ResolveGlobal, OpInfo(m_graph.m_resolveGlobalData.size()), OpInfo(prediction));
+ m_graph.m_resolveGlobalData.append(ResolveGlobalData());
+ ResolveGlobalData& data = m_graph.m_resolveGlobalData.last();
+ data.identifierNumber = identifier;
+ data.resolveOperationsIndex = operations;
+ data.putToBaseOperationIndex = putToBaseOperation;
+ data.resolvePropertyIndex = resolveValueOperation - resolveOperations->data();
+ *value = resolve;
+ return true;
+ }
+ case ResolveOperation::GetAndReturnGlobalVar: {
+ *value = addToGraph(GetGlobalVar,
+ OpInfo(globalObject->assertRegisterIsInThisObject(pc->m_registerAddress)),
+ OpInfo(prediction));
+ return true;
+ }
+ case ResolveOperation::GetAndReturnGlobalVarWatchable: {
+ SpeculatedType prediction = getPrediction();
+
+ JSGlobalObject* globalObject = m_inlineStackTop->m_codeBlock->globalObject();
+
+ Identifier ident = m_codeBlock->identifier(identifier);
+ SymbolTableEntry entry = globalObject->symbolTable()->get(ident.impl());
+ if (!entry.couldBeWatched()) {
+ *value = addToGraph(GetGlobalVar, OpInfo(globalObject->assertRegisterIsInThisObject(pc->m_registerAddress)), OpInfo(prediction));
+ return true;
+ }
+
+ // The watchpoint is still intact! This means that we will get notified if the
+ // current value in the global variable changes. So, we can inline that value.
+ // Moreover, currently we can assume that this value is a JSFunction*, which
+ // implies that it's a cell. This simplifies things, since in general we'd have
+ // to use a JSConstant for non-cells and a WeakJSConstant for cells. So instead
+ // of having both cases we just assert that the value is a cell.
+
+ // NB. If it wasn't for CSE, GlobalVarWatchpoint would have no need for the
+ // register pointer. But CSE tracks effects on global variables by comparing
+ // register pointers. Because CSE executes multiple times while the backend
+ // executes once, we use the following performance trade-off:
+ // - The node refers directly to the register pointer to make CSE super cheap.
+ // - To perform backend code generation, the node only contains the identifier
+ // number, from which it is possible to get (via a few average-time O(1)
+ // lookups) to the WatchpointSet.
+
+ addToGraph(GlobalVarWatchpoint, OpInfo(globalObject->assertRegisterIsInThisObject(pc->m_registerAddress)), OpInfo(identifier));
+
+ JSValue specificValue = globalObject->registerAt(entry.getIndex()).get();
+ ASSERT(specificValue.isCell());
+ *value = cellConstant(specificValue.asCell());
+ return true;
+ }
+ case ResolveOperation::GetAndReturnScopedVar: {
+ NodeIndex getScopeRegisters = addToGraph(GetScopeRegisters, localBase);
+ *value = addToGraph(GetScopedVar, OpInfo(resolveValueOperation->m_offset), OpInfo(prediction), getScopeRegisters);
+ return true;
+ }
+ default:
+ CRASH();
+ return false;
+ }
+
+}
+
bool ByteCodeParser::parseBlock(unsigned limit)
{
bool shouldContinueParsing = true;
-
+
Interpreter* interpreter = m_globalData->interpreter;
Instruction* instructionsBegin = m_inlineStackTop->m_codeBlock->instructions().begin();
unsigned blockBegin = m_currentIndex;
@@ -2364,26 +2539,6 @@ bool ByteCodeParser::parseBlock(unsigned limit)
m_currentIndex += OPCODE_LENGTH(op_method_check) + OPCODE_LENGTH(op_get_by_id);
continue;
}
- case op_get_scoped_var: {
- SpeculatedType prediction = getPrediction();
- int dst = currentInstruction[1].u.operand;
- int slot = currentInstruction[2].u.operand;
- int depth = currentInstruction[3].u.operand;
- NodeIndex getScope = addToGraph(GetScope, OpInfo(depth));
- NodeIndex getScopeRegisters = addToGraph(GetScopeRegisters, getScope);
- NodeIndex getScopedVar = addToGraph(GetScopedVar, OpInfo(slot), OpInfo(prediction), getScopeRegisters);
- set(dst, getScopedVar);
- NEXT_OPCODE(op_get_scoped_var);
- }
- case op_put_scoped_var: {
- int slot = currentInstruction[1].u.operand;
- int depth = currentInstruction[2].u.operand;
- int source = currentInstruction[3].u.operand;
- NodeIndex getScope = addToGraph(GetScope, OpInfo(depth));
- NodeIndex getScopeRegisters = addToGraph(GetScopeRegisters, getScope);
- addToGraph(PutScopedVar, OpInfo(slot), getScope, getScopeRegisters, get(source));
- NEXT_OPCODE(op_put_scoped_var);
- }
case op_get_by_id:
case op_get_by_id_out_of_line:
case op_get_array_length: {
@@ -2510,75 +2665,15 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NEXT_OPCODE(op_put_by_id);
}
- case op_get_global_var: {
- SpeculatedType prediction = getPrediction();
-
- JSGlobalObject* globalObject = m_inlineStackTop->m_codeBlock->globalObject();
-
- NodeIndex getGlobalVar = addToGraph(
- GetGlobalVar,
- OpInfo(globalObject->assertRegisterIsInThisObject(currentInstruction[2].u.registerPointer)),
- OpInfo(prediction));
- set(currentInstruction[1].u.operand, getGlobalVar);
- NEXT_OPCODE(op_get_global_var);
- }
-
- case op_get_global_var_watchable: {
- SpeculatedType prediction = getPrediction();
-
- JSGlobalObject* globalObject = m_inlineStackTop->m_codeBlock->globalObject();
-
- unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[currentInstruction[3].u.operand];
- Identifier identifier = m_codeBlock->identifier(identifierNumber);
- SymbolTableEntry entry = globalObject->symbolTable()->get(identifier.impl());
- if (!entry.couldBeWatched()) {
- NodeIndex getGlobalVar = addToGraph(
- GetGlobalVar,
- OpInfo(globalObject->assertRegisterIsInThisObject(currentInstruction[2].u.registerPointer)),
- OpInfo(prediction));
- set(currentInstruction[1].u.operand, getGlobalVar);
- NEXT_OPCODE(op_get_global_var_watchable);
- }
-
- // The watchpoint is still intact! This means that we will get notified if the
- // current value in the global variable changes. So, we can inline that value.
- // Moreover, currently we can assume that this value is a JSFunction*, which
- // implies that it's a cell. This simplifies things, since in general we'd have
- // to use a JSConstant for non-cells and a WeakJSConstant for cells. So instead
- // of having both cases we just assert that the value is a cell.
-
- // NB. If it wasn't for CSE, GlobalVarWatchpoint would have no need for the
- // register pointer. But CSE tracks effects on global variables by comparing
- // register pointers. Because CSE executes multiple times while the backend
- // executes once, we use the following performance trade-off:
- // - The node refers directly to the register pointer to make CSE super cheap.
- // - To perform backend code generation, the node only contains the identifier
- // number, from which it is possible to get (via a few average-time O(1)
- // lookups) to the WatchpointSet.
-
- addToGraph(
- GlobalVarWatchpoint,
- OpInfo(globalObject->assertRegisterIsInThisObject(currentInstruction[2].u.registerPointer)),
- OpInfo(identifierNumber));
-
- JSValue specificValue = globalObject->registerAt(entry.getIndex()).get();
- ASSERT(specificValue.isCell());
- set(currentInstruction[1].u.operand, cellConstant(specificValue.asCell()));
-
- NEXT_OPCODE(op_get_global_var_watchable);
- }
-
- case op_put_global_var:
case op_init_global_const: {
NodeIndex value = get(currentInstruction[2].u.operand);
addToGraph(
PutGlobalVar,
OpInfo(m_inlineStackTop->m_codeBlock->globalObject()->assertRegisterIsInThisObject(currentInstruction[1].u.registerPointer)),
value);
- NEXT_OPCODE(op_put_global_var);
+ NEXT_OPCODE(op_init_global_const);
}
- case op_put_global_var_check:
case op_init_global_const_check: {
NodeIndex value = get(currentInstruction[2].u.operand);
CodeBlock* codeBlock = m_inlineStackTop->m_codeBlock;
@@ -2591,16 +2686,17 @@ bool ByteCodeParser::parseBlock(unsigned limit)
PutGlobalVar,
OpInfo(globalObject->assertRegisterIsInThisObject(currentInstruction[1].u.registerPointer)),
value);
- NEXT_OPCODE(op_put_global_var_check);
+ NEXT_OPCODE(op_init_global_const_check);
}
addToGraph(
PutGlobalVarCheck,
OpInfo(codeBlock->globalObject()->assertRegisterIsInThisObject(currentInstruction[1].u.registerPointer)),
OpInfo(identifierNumber),
value);
- NEXT_OPCODE(op_put_global_var_check);
+ NEXT_OPCODE(op_init_global_const_check);
}
+
// === Block terminators. ===
case op_jmp: {
@@ -2869,69 +2965,175 @@ bool ByteCodeParser::parseBlock(unsigned limit)
addToGraph(Jump, OpInfo(m_currentIndex + OPCODE_LENGTH(op_jneq_ptr)));
LAST_OPCODE(op_jneq_ptr);
- case op_resolve: {
+ case op_resolve:
+ case op_resolve_global_property:
+ case op_resolve_global_var:
+ case op_resolve_scoped_var:
+ case op_resolve_scoped_var_on_top_scope:
+ case op_resolve_scoped_var_with_top_scope_check: {
SpeculatedType prediction = getPrediction();
unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[2].u.operand];
+ unsigned operations = m_inlineStackTop->m_resolveOperationRemap[currentInstruction[3].u.operand];
+ NodeIndex value = 0;
+ if (parseResolveOperations(prediction, identifier, operations, 0, 0, &value)) {
+ set(currentInstruction[1].u.operand, value);
+ NEXT_OPCODE(op_resolve);
+ }
+
+ NodeIndex resolve = addToGraph(Resolve, OpInfo(m_graph.m_resolveOperationsData.size()), OpInfo(prediction));
+ m_graph.m_resolveOperationsData.append(ResolveOperationData());
+ ResolveOperationData& data = m_graph.m_resolveOperationsData.last();
+ data.identifierNumber = identifier;
+ data.resolveOperationsIndex = operations;
- NodeIndex resolve = addToGraph(Resolve, OpInfo(identifier), OpInfo(prediction));
set(currentInstruction[1].u.operand, resolve);
NEXT_OPCODE(op_resolve);
}
+ case op_put_to_base_variable:
+ case op_put_to_base: {
+ unsigned base = currentInstruction[1].u.operand;
+ unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[2].u.operand];
+ unsigned value = currentInstruction[3].u.operand;
+ unsigned operation = m_inlineStackTop->m_putToBaseOperationRemap[currentInstruction[4].u.operand];
+ PutToBaseOperation* putToBase = m_codeBlock->putToBaseOperation(operation);
+
+ if (putToBase->m_isDynamic) {
+ addToGraph(Phantom, get(base));
+ addToGraph(PutById, OpInfo(identifier), get(base), get(value));
+ NEXT_OPCODE(op_put_to_base);
+ }
+
+ switch (putToBase->m_kind) {
+ case PutToBaseOperation::Uninitialised:
+ addToGraph(Phantom, get(base));
+ addToGraph(ForceOSRExit);
+ break;
+
+ case PutToBaseOperation::GlobalVariablePutChecked: {
+ CodeBlock* codeBlock = m_inlineStackTop->m_codeBlock;
+ JSGlobalObject* globalObject = codeBlock->globalObject();
+ SymbolTableEntry entry = globalObject->symbolTable()->get(m_codeBlock->identifier(identifier).impl());
+ if (entry.couldBeWatched()) {
+ addToGraph(PutGlobalVarCheck,
+ OpInfo(codeBlock->globalObject()->assertRegisterIsInThisObject(putToBase->m_registerAddress)),
+ OpInfo(identifier),
+ get(value));
+ break;
+ }
+ }
+ case PutToBaseOperation::GlobalVariablePut:
+ addToGraph(PutGlobalVar,
+ OpInfo(m_inlineStackTop->m_codeBlock->globalObject()->assertRegisterIsInThisObject(putToBase->m_registerAddress)),
+ get(value));
+ break;
+ case PutToBaseOperation::VariablePut: {
+ addToGraph(Phantom, get(base));
+ NodeIndex getScope = addToGraph(GetScope, OpInfo(putToBase->m_scopeDepth));
+ NodeIndex getScopeRegisters = addToGraph(GetScopeRegisters, getScope);
+ addToGraph(PutScopedVar, OpInfo(putToBase->m_offset), getScope, getScopeRegisters, get(value));
+ break;
+ }
+ case PutToBaseOperation::GlobalPropertyPut: {
+ if (!putToBase->m_structure) {
+ addToGraph(Phantom, get(base));
+ addToGraph(ForceOSRExit);
+ NEXT_OPCODE(op_put_to_base);
+ }
+ NodeIndex baseNode = get(base);
+ addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(putToBase->m_structure.get())), baseNode);
+ NodeIndex propertyStorage;
+ if (isInlineOffset(putToBase->m_offset))
+ propertyStorage = baseNode;
+ else
+ propertyStorage = addToGraph(GetButterfly, baseNode);
+ addToGraph(PutByOffset, OpInfo(m_graph.m_storageAccessData.size()), propertyStorage, baseNode, get(value));
+
+ StorageAccessData storageAccessData;
+ storageAccessData.offset = indexRelativeToBase(putToBase->m_offset);
+ storageAccessData.identifierNumber = identifier;
+ m_graph.m_storageAccessData.append(storageAccessData);
+ break;
+ }
+ case PutToBaseOperation::Readonly:
+ case PutToBaseOperation::Generic:
+ addToGraph(Phantom, get(base));
+ addToGraph(PutById, OpInfo(identifier), get(base), get(value));
+ }
+ NEXT_OPCODE(op_put_to_base);
+ }
+
+ case op_resolve_base_to_global:
+ case op_resolve_base_to_global_dynamic:
+ case op_resolve_base_to_scope:
+ case op_resolve_base_to_scope_with_top_scope_check:
case op_resolve_base: {
SpeculatedType prediction = getPrediction();
unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[2].u.operand];
+ unsigned operations = m_inlineStackTop->m_resolveOperationRemap[currentInstruction[4].u.operand];
+ unsigned putToBaseOperation = m_inlineStackTop->m_putToBaseOperationRemap[currentInstruction[5].u.operand];
- NodeIndex resolve = addToGraph(currentInstruction[3].u.operand ? ResolveBaseStrictPut : ResolveBase, OpInfo(identifier), OpInfo(prediction));
+ NodeIndex base = 0;
+ if (parseResolveOperations(prediction, identifier, operations, 0, &base, 0)) {
+ set(currentInstruction[1].u.operand, base);
+ NEXT_OPCODE(op_resolve_base);
+ }
+
+ NodeIndex resolve = addToGraph(currentInstruction[3].u.operand ? ResolveBaseStrictPut : ResolveBase, OpInfo(m_graph.m_resolveOperationsData.size()), OpInfo(prediction));
+ m_graph.m_resolveOperationsData.append(ResolveOperationData());
+ ResolveOperationData& data = m_graph.m_resolveOperationsData.last();
+ data.identifierNumber = identifier;
+ data.resolveOperationsIndex = operations;
+ data.putToBaseOperationIndex = putToBaseOperation;
+
set(currentInstruction[1].u.operand, resolve);
NEXT_OPCODE(op_resolve_base);
}
-
- case op_resolve_global: {
+ case op_resolve_with_base: {
SpeculatedType prediction = getPrediction();
-
- unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[
- currentInstruction[2].u.operand];
-
- ResolveGlobalStatus status = ResolveGlobalStatus::computeFor(
- m_inlineStackTop->m_profiledBlock, m_currentIndex,
- m_codeBlock->identifier(identifierNumber));
- if (status.isSimple()) {
- ASSERT(status.structure());
-
- NodeIndex globalObject = addStructureTransitionCheck(
- m_inlineStackTop->m_codeBlock->globalObject(), status.structure());
-
- if (status.specificValue()) {
- ASSERT(status.specificValue().isCell());
-
- set(currentInstruction[1].u.operand,
- cellConstant(status.specificValue().asCell()));
- } else {
- handleGetByOffset(
- currentInstruction[1].u.operand, prediction, globalObject,
- identifierNumber, status.offset());
- }
-
- m_globalResolveNumber++; // Skip over the unused global resolve info.
-
- NEXT_OPCODE(op_resolve_global);
+ unsigned baseDst = currentInstruction[1].u.operand;
+ unsigned valueDst = currentInstruction[2].u.operand;
+ unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[3].u.operand];
+ unsigned operations = m_inlineStackTop->m_resolveOperationRemap[currentInstruction[4].u.operand];
+ unsigned putToBaseOperation = m_inlineStackTop->m_putToBaseOperationRemap[currentInstruction[5].u.operand];
+
+ NodeIndex base = 0;
+ NodeIndex value = 0;
+ if (parseResolveOperations(prediction, identifier, operations, putToBaseOperation, &base, &value)) {
+ set(baseDst, base);
+ set(valueDst, value);
+ } else {
+ addToGraph(ForceOSRExit);
+ set(baseDst, addToGraph(GarbageValue));
+ set(valueDst, addToGraph(GarbageValue));
}
-
- NodeIndex resolve = addToGraph(ResolveGlobal, OpInfo(m_graph.m_resolveGlobalData.size()), OpInfo(prediction));
- m_graph.m_resolveGlobalData.append(ResolveGlobalData());
- ResolveGlobalData& data = m_graph.m_resolveGlobalData.last();
- data.identifierNumber = identifierNumber;
- data.resolveInfoIndex = m_globalResolveNumber++;
- set(currentInstruction[1].u.operand, resolve);
- NEXT_OPCODE(op_resolve_global);
+ NEXT_OPCODE(op_resolve_with_base);
}
+ case op_resolve_with_this: {
+ SpeculatedType prediction = getPrediction();
+ unsigned baseDst = currentInstruction[1].u.operand;
+ unsigned valueDst = currentInstruction[2].u.operand;
+ unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[3].u.operand];
+ unsigned operations = m_inlineStackTop->m_resolveOperationRemap[currentInstruction[4].u.operand];
+
+ NodeIndex base = 0;
+ NodeIndex value = 0;
+ if (parseResolveOperations(prediction, identifier, operations, 0, &base, &value)) {
+ set(baseDst, base);
+ set(valueDst, value);
+ } else {
+ addToGraph(ForceOSRExit);
+ set(baseDst, addToGraph(GarbageValue));
+ set(valueDst, addToGraph(GarbageValue));
+ }
+ NEXT_OPCODE(op_resolve_with_this);
+ }
case op_loop_hint: {
// Baseline->DFG OSR jumps between loop hints. The DFG assumes that Baseline->DFG
// OSR can only happen at basic block boundaries. Assert that these two statements
@@ -2943,7 +3145,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
// block. Hence, machine code block = true code block = not inline code block.
if (!m_inlineStackTop->m_caller)
m_currentBlock->isOSRTarget = true;
-
+
// Emit a phantom node to ensure that there is a placeholder node for this bytecode
// op.
addToGraph(Phantom);
@@ -3331,6 +3533,8 @@ ByteCodeParser::InlineStackEntry::InlineStackEntry(
m_identifierRemap.resize(codeBlock->numberOfIdentifiers());
m_constantRemap.resize(codeBlock->numberOfConstantRegisters());
m_constantBufferRemap.resize(codeBlock->numberOfConstantBuffers());
+ m_resolveOperationRemap.resize(codeBlock->numberOfResolveOperations());
+ m_putToBaseOperationRemap.resize(codeBlock->numberOfPutToBaseOperations());
for (size_t i = 0; i < codeBlock->numberOfIdentifiers(); ++i) {
StringImpl* rep = codeBlock->identifier(i).impl();
@@ -3357,8 +3561,11 @@ ByteCodeParser::InlineStackEntry::InlineStackEntry(
}
m_constantRemap[i] = result.iterator->value;
}
- for (unsigned i = 0; i < codeBlock->numberOfGlobalResolveInfos(); ++i)
- byteCodeParser->m_codeBlock->addGlobalResolveInfo(std::numeric_limits<unsigned>::max());
+ for (size_t i = 0; i < codeBlock->numberOfResolveOperations(); i++) {
+ uint32_t newResolve = byteCodeParser->m_codeBlock->addResolve();
+ m_resolveOperationRemap[i] = newResolve;
+ byteCodeParser->m_codeBlock->resolveOperations(newResolve)->append(*codeBlock->resolveOperations(i));
+ }
for (unsigned i = 0; i < codeBlock->numberOfConstantBuffers(); ++i) {
// If we inline the same code block multiple times, we don't want to needlessly
// duplicate its constant buffers.
@@ -3373,6 +3580,11 @@ ByteCodeParser::InlineStackEntry::InlineStackEntry(
m_constantBufferRemap[i] = newIndex;
byteCodeParser->m_constantBufferCache.add(ConstantBufferKey(codeBlock, i), newIndex);
}
+ for (size_t i = 0; i < codeBlock->numberOfPutToBaseOperations(); i++) {
+ uint32_t putToBaseResolve = byteCodeParser->m_codeBlock->addPutToBase();
+ m_putToBaseOperationRemap[i] = putToBaseResolve;
+ *byteCodeParser->m_codeBlock->putToBaseOperation(putToBaseResolve) = *codeBlock->putToBaseOperation(i);
+ }
m_callsiteBlockHeadNeedsLinking = true;
} else {
@@ -3389,6 +3601,8 @@ ByteCodeParser::InlineStackEntry::InlineStackEntry(
m_identifierRemap.resize(codeBlock->numberOfIdentifiers());
m_constantRemap.resize(codeBlock->numberOfConstantRegisters());
m_constantBufferRemap.resize(codeBlock->numberOfConstantBuffers());
+ m_resolveOperationRemap.resize(codeBlock->numberOfResolveOperations());
+ m_putToBaseOperationRemap.resize(codeBlock->numberOfPutToBaseOperations());
for (size_t i = 0; i < codeBlock->numberOfIdentifiers(); ++i)
m_identifierRemap[i] = i;
@@ -3396,6 +3610,10 @@ ByteCodeParser::InlineStackEntry::InlineStackEntry(
m_constantRemap[i] = i + FirstConstantRegisterIndex;
for (size_t i = 0; i < codeBlock->numberOfConstantBuffers(); ++i)
m_constantBufferRemap[i] = i;
+ for (size_t i = 0; i < codeBlock->numberOfResolveOperations(); ++i)
+ m_resolveOperationRemap[i] = i;
+ for (size_t i = 0; i < codeBlock->numberOfPutToBaseOperations(); ++i)
+ m_putToBaseOperationRemap[i] = i;
m_callsiteBlockHeadNeedsLinking = false;
}
diff --git a/Source/JavaScriptCore/dfg/DFGCCallHelpers.h b/Source/JavaScriptCore/dfg/DFGCCallHelpers.h
index 4a6024305..a2570b7ea 100644
--- a/Source/JavaScriptCore/dfg/DFGCCallHelpers.h
+++ b/Source/JavaScriptCore/dfg/DFGCCallHelpers.h
@@ -551,7 +551,21 @@ public:
move(arg2, GPRInfo::argumentGPR2);
move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
}
+#if CPU(X86_64)
+ ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImm64 arg2)
+ {
+ move(arg1, GPRInfo::argumentGPR1);
+ move(arg2, GPRInfo::argumentGPR2);
+ move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
+ }
+ ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm64 arg1, GPRReg arg2)
+ {
+ move(arg2, GPRInfo::argumentGPR2); // Move this first, so setting arg1 does not trample!
+ move(arg1, GPRInfo::argumentGPR1);
+ move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
+ }
+#endif
ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImm32 arg2)
{
move(arg1, GPRInfo::argumentGPR1);
diff --git a/Source/JavaScriptCore/dfg/DFGCapabilities.h b/Source/JavaScriptCore/dfg/DFGCapabilities.h
index dc6f7aa1c..e80cc28ae 100644
--- a/Source/JavaScriptCore/dfg/DFGCapabilities.h
+++ b/Source/JavaScriptCore/dfg/DFGCapabilities.h
@@ -68,6 +68,48 @@ inline bool mightInlineFunctionForConstruct(CodeBlock* codeBlock)
}
// Opcode checking.
+inline bool canInlineResolveOperations(OpcodeID opcode, ResolveOperations* operations)
+{
+ // Don't try to inline a resolve for which we have no information
+ if (operations->isEmpty())
+ return false;
+
+ for (unsigned i = 0; i < operations->size(); i++) {
+ switch (operations->data()[i].m_operation) {
+ case ResolveOperation::ReturnGlobalObjectAsBase:
+ case ResolveOperation::SetBaseToGlobal:
+ case ResolveOperation::SetBaseToUndefined:
+ case ResolveOperation::GetAndReturnGlobalProperty:
+ case ResolveOperation::GetAndReturnGlobalVar:
+ case ResolveOperation::GetAndReturnGlobalVarWatchable:
+ continue;
+
+ case ResolveOperation::Fail:
+ // The DFG can handle generic cases of failed resolves
+ ASSERT(opcode != op_resolve_base_to_global_dynamic);
+ ASSERT(opcode != op_resolve_base_to_scope_with_top_scope_check);
+ ASSERT(opcode != op_resolve_base_to_global);
+ ASSERT(opcode != op_resolve_base_to_scope);
+ if (opcode != op_resolve && opcode != op_resolve_base)
+ return false;
+
+ case ResolveOperation::SkipTopScopeNode:
+ case ResolveOperation::SkipScopes:
+ case ResolveOperation::SetBaseToScope:
+ case ResolveOperation::ReturnScopeAsBase:
+ case ResolveOperation::GetAndReturnScopedVar:
+ // These opcodes would be easy to support with inlining, but we currently don't do it.
+ // The issue is that the scope chain will not be set correctly.
+ return false;
+
+ case ResolveOperation::CheckForDynamicEntriesBeforeGlobalScope:
+ // This would be easy to support in all cases.
+ return false;
+ }
+ }
+ return true;
+}
+
inline CapabilityLevel canCompileOpcode(OpcodeID opcodeID, CodeBlock*, Instruction*)
{
switch (opcodeID) {
@@ -116,8 +158,6 @@ inline CapabilityLevel canCompileOpcode(OpcodeID opcodeID, CodeBlock*, Instructi
case op_get_by_val:
case op_put_by_val:
case op_method_check:
- case op_get_scoped_var:
- case op_put_scoped_var:
case op_get_by_id:
case op_get_by_id_out_of_line:
case op_get_array_length:
@@ -127,10 +167,6 @@ inline CapabilityLevel canCompileOpcode(OpcodeID opcodeID, CodeBlock*, Instructi
case op_put_by_id_transition_direct_out_of_line:
case op_put_by_id_transition_normal:
case op_put_by_id_transition_normal_out_of_line:
- case op_get_global_var:
- case op_get_global_var_watchable:
- case op_put_global_var:
- case op_put_global_var_check:
case op_init_global_const:
case op_init_global_const_check:
case op_jmp:
@@ -157,9 +193,6 @@ inline CapabilityLevel canCompileOpcode(OpcodeID opcodeID, CodeBlock*, Instructi
case op_ret:
case op_end:
case op_call_put_result:
- case op_resolve:
- case op_resolve_base:
- case op_resolve_global:
case op_new_object:
case op_new_array:
case op_new_array_with_size:
@@ -181,11 +214,30 @@ inline CapabilityLevel canCompileOpcode(OpcodeID opcodeID, CodeBlock*, Instructi
case op_get_argument_by_val:
case op_get_arguments_length:
case op_jneq_ptr:
+ case op_put_to_base_variable:
+ case op_put_to_base:
return CanCompile;
case op_call_varargs:
return ShouldProfile;
+ case op_resolve:
+ case op_resolve_global_property:
+ case op_resolve_global_var:
+ case op_resolve_scoped_var:
+ case op_resolve_scoped_var_on_top_scope:
+ case op_resolve_scoped_var_with_top_scope_check:
+ return CanCompile;
+
+ case op_resolve_base_to_global:
+ case op_resolve_base_to_global_dynamic:
+ case op_resolve_base_to_scope:
+ case op_resolve_base_to_scope_with_top_scope_check:
+ case op_resolve_base:
+ case op_resolve_with_base:
+ case op_resolve_with_this:
+ return CanCompile;
+
default:
return CannotCompile;
}
@@ -194,13 +246,22 @@ inline CapabilityLevel canCompileOpcode(OpcodeID opcodeID, CodeBlock*, Instructi
inline bool canInlineOpcode(OpcodeID opcodeID, CodeBlock* codeBlock, Instruction* pc)
{
switch (opcodeID) {
-
- // These opcodes would be easy to support with inlining, but we currently don't do it.
- // The issue is that the scope chain will not be set correctly.
- case op_get_scoped_var:
- case op_put_scoped_var:
case op_resolve:
+ case op_resolve_global_property:
+ case op_resolve_global_var:
+ case op_resolve_scoped_var:
+ case op_resolve_scoped_var_on_top_scope:
+ case op_resolve_scoped_var_with_top_scope_check:
+ return canInlineResolveOperations(opcodeID, codeBlock->resolveOperations(pc[3].u.operand));
+
+ case op_resolve_base_to_global:
+ case op_resolve_base_to_global_dynamic:
+ case op_resolve_base_to_scope:
+ case op_resolve_base_to_scope_with_top_scope_check:
case op_resolve_base:
+ case op_resolve_with_base:
+ case op_resolve_with_this:
+ return canInlineResolveOperations(opcodeID, codeBlock->resolveOperations(pc[4].u.operand));
// Inlining doesn't correctly remap regular expression operands.
case op_new_regexp:
diff --git a/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp b/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
index 8a261ad2b..25915cfd4 100644
--- a/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
@@ -102,7 +102,8 @@ private:
break;
}
- case CheckArray: {
+ case CheckArray:
+ case Arrayify: {
if (!modeAlreadyChecked(m_state.forNode(node.child1()), node.arrayMode()))
break;
ASSERT(node.refCount() == 1);
diff --git a/Source/JavaScriptCore/dfg/DFGGraph.h b/Source/JavaScriptCore/dfg/DFGGraph.h
index 212c8bbd2..b2c754f85 100644
--- a/Source/JavaScriptCore/dfg/DFGGraph.h
+++ b/Source/JavaScriptCore/dfg/DFGGraph.h
@@ -57,10 +57,23 @@ struct StorageAccessData {
struct ResolveGlobalData {
unsigned identifierNumber;
- unsigned resolveInfoIndex;
+ unsigned resolveOperationsIndex;
+ unsigned putToBaseOperationIndex;
+ unsigned resolvePropertyIndex;
};
-//
+struct ResolveOperationData {
+ unsigned identifierNumber;
+ unsigned resolveOperationsIndex;
+ unsigned putToBaseOperationIndex;
+};
+
+struct PutToBaseOperationData {
+ unsigned putToBaseOperationIndex;
+};
+
+
+//
// === Graph ===
//
// The dataflow graph is an ordered vector of nodes.
@@ -669,6 +682,8 @@ public:
Vector<Edge, 16> m_varArgChildren;
Vector<StorageAccessData> m_storageAccessData;
Vector<ResolveGlobalData> m_resolveGlobalData;
+ Vector<ResolveOperationData> m_resolveOperationsData;
+ Vector<PutToBaseOperationData> m_putToBaseOperationData;
Vector<NodeIndex, 8> m_arguments;
SegmentedVector<VariableAccessData, 16> m_variableAccessData;
SegmentedVector<ArgumentPosition, 8> m_argumentPositions;
diff --git a/Source/JavaScriptCore/dfg/DFGNode.h b/Source/JavaScriptCore/dfg/DFGNode.h
index df6191eab..40b3ed7ec 100644
--- a/Source/JavaScriptCore/dfg/DFGNode.h
+++ b/Source/JavaScriptCore/dfg/DFGNode.h
@@ -352,9 +352,6 @@ struct Node {
case GetByIdFlush:
case PutById:
case PutByIdDirect:
- case Resolve:
- case ResolveBase:
- case ResolveBaseStrictPut:
return true;
default:
return false;
@@ -373,6 +370,12 @@ struct Node {
return m_opInfo;
}
+ unsigned resolveOperationsDataIndex()
+ {
+ ASSERT(op() == Resolve || op() == ResolveBase || op() == ResolveBaseStrictPut);
+ return m_opInfo;
+ }
+
bool hasArithNodeFlags()
{
switch (op()) {
diff --git a/Source/JavaScriptCore/dfg/DFGNodeType.h b/Source/JavaScriptCore/dfg/DFGNodeType.h
index 9c93a8ba3..1d2460659 100644
--- a/Source/JavaScriptCore/dfg/DFGNodeType.h
+++ b/Source/JavaScriptCore/dfg/DFGNodeType.h
@@ -234,6 +234,8 @@ namespace JSC { namespace DFG {
macro(Throw, NodeMustGenerate) \
macro(ThrowReferenceError, NodeMustGenerate) \
\
+ macro(GarbageValue, NodeResultJS | NodeClobbersWorld) \
+ \
/* This is a pseudo-terminal. It means that execution should fall out of DFG at */\
/* this point, but execution does continue in the basic block - just in a */\
/* different compiler. */\
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExit.cpp b/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
index b3701722e..6560088fd 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
@@ -45,9 +45,9 @@ OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, MethodOfGettingAVal
, m_kind(kind)
, m_count(0)
, m_streamIndex(streamIndex)
- , m_lastSetOperand(jit->m_lastSetOperand)
{
ASSERT(m_codeOrigin.isSet());
+ m_setOperands.append(jit->m_lastSetOperand);
}
bool OSRExit::considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock)
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExit.h b/Source/JavaScriptCore/dfg/DFGOSRExit.h
index cd2434c11..0ecefe386 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExit.h
+++ b/Source/JavaScriptCore/dfg/DFGOSRExit.h
@@ -110,9 +110,9 @@ struct OSRExit {
}
unsigned m_streamIndex;
- int m_lastSetOperand;
+ Vector<int, 1> m_setOperands;
- RefPtr<ValueRecoveryOverride> m_valueRecoveryOverride;
+ Vector<RefPtr<ValueRecoveryOverride>, 1> m_valueRecoveryOverrides;
private:
bool considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock);
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
index 2ce1c887b..55a903c7a 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
@@ -70,11 +70,10 @@ void compileOSRExit(ExecState* exec)
Operands<ValueRecovery> operands;
codeBlock->variableEventStream().reconstruct(codeBlock, exit.m_codeOrigin, codeBlock->minifiedDFG(), exit.m_streamIndex, operands);
- // There may be an override, for forward speculations.
- if (!!exit.m_valueRecoveryOverride) {
- operands.setOperand(
- exit.m_valueRecoveryOverride->operand, exit.m_valueRecoveryOverride->recovery);
- }
+ // There may be overrides, for forward speculations.
+ for (size_t i = 0; i < exit.m_valueRecoveryOverrides.size(); i++)
+ operands.setOperand(exit.m_valueRecoveryOverrides[i]->operand, exit.m_valueRecoveryOverrides[i]->recovery);
+
SpeculationRecovery* recovery = 0;
if (exit.m_recoveryIndex)
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
index cb13dcc50..b64ce3fa1 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
@@ -83,28 +83,85 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
// 3) Refine some value profile, if appropriate.
- if (!!exit.m_jsValueSource && !!exit.m_valueProfile) {
- EncodedJSValue* bucket = exit.m_valueProfile.getSpecFailBucket(0);
+ if (!!exit.m_jsValueSource) {
+ if (exit.m_kind == BadCache || exit.m_kind == BadIndexingType) {
+ // If the instruction that this originated from has an array profile, then
+ // refine it. If it doesn't, then do nothing. The latter could happen for
+ // hoisted checks, or checks emitted for operations that didn't have array
+ // profiling - either ops that aren't array accesses at all, or weren't
+ // known to be array acceses in the bytecode. The latter case is a FIXME
+ // while the former case is an outcome of a CheckStructure not knowing why
+ // it was emitted (could be either due to an inline cache of a property
+ // property access, or due to an array profile).
+
+ // Note: We are free to assume that the jsValueSource is already known to
+ // be a cell since both BadCache and BadIndexingType exits occur after
+ // the cell check would have already happened.
+
+ CodeOrigin codeOrigin = exit.m_codeOriginForExitProfile;
+ if (ArrayProfile* arrayProfile = m_jit.baselineCodeBlockFor(codeOrigin)->getArrayProfile(codeOrigin.bytecodeIndex)) {
+ GPRReg usedRegister1;
+ GPRReg usedRegister2;
+ if (exit.m_jsValueSource.isAddress()) {
+ usedRegister1 = exit.m_jsValueSource.base();
+ usedRegister2 = InvalidGPRReg;
+ } else {
+ usedRegister1 = exit.m_jsValueSource.payloadGPR();
+ if (exit.m_jsValueSource.hasKnownTag())
+ usedRegister2 = InvalidGPRReg;
+ else
+ usedRegister2 = exit.m_jsValueSource.tagGPR();
+ }
+
+ GPRReg scratch1;
+ GPRReg scratch2;
+ scratch1 = AssemblyHelpers::selectScratchGPR(usedRegister1, usedRegister2);
+ scratch2 = AssemblyHelpers::selectScratchGPR(usedRegister1, usedRegister2, scratch1);
+
+ m_jit.push(scratch1);
+ m_jit.push(scratch2);
+
+ GPRReg value;
+ if (exit.m_jsValueSource.isAddress()) {
+ value = scratch1;
+ m_jit.loadPtr(AssemblyHelpers::Address(exit.m_jsValueSource.asAddress()), value);
+ } else
+ value = exit.m_jsValueSource.payloadGPR();
+
+ m_jit.loadPtr(AssemblyHelpers::Address(value, JSCell::structureOffset()), scratch1);
+ m_jit.storePtr(scratch1, arrayProfile->addressOfLastSeenStructure());
+ m_jit.load8(AssemblyHelpers::Address(scratch1, Structure::indexingTypeOffset()), scratch1);
+ m_jit.move(AssemblyHelpers::TrustedImm32(1), scratch2);
+ m_jit.lshift32(scratch1, scratch2);
+ m_jit.or32(scratch2, AssemblyHelpers::AbsoluteAddress(arrayProfile->addressOfArrayModes()));
+
+ m_jit.pop(scratch2);
+ m_jit.pop(scratch1);
+ }
+ }
- if (exit.m_jsValueSource.isAddress()) {
- // Save a register so we can use it.
- GPRReg scratch = GPRInfo::regT0;
- if (scratch == exit.m_jsValueSource.base())
- scratch = GPRInfo::regT1;
- ScratchBuffer* scratchBuffer = m_jit.globalData()->scratchBufferForSize(sizeof(uint32_t));
- EncodedJSValue* scratchDataBuffer = static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer());
- m_jit.store32(scratch, scratchDataBuffer);
- m_jit.load32(exit.m_jsValueSource.asAddress(OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), scratch);
- m_jit.store32(scratch, &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.tag);
- m_jit.load32(exit.m_jsValueSource.asAddress(OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), scratch);
- m_jit.store32(scratch, &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.payload);
- m_jit.load32(scratchDataBuffer, scratch);
- } else if (exit.m_jsValueSource.hasKnownTag()) {
- m_jit.store32(AssemblyHelpers::TrustedImm32(exit.m_jsValueSource.tag()), &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.tag);
- m_jit.store32(exit.m_jsValueSource.payloadGPR(), &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.payload);
- } else {
- m_jit.store32(exit.m_jsValueSource.tagGPR(), &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.tag);
- m_jit.store32(exit.m_jsValueSource.payloadGPR(), &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.payload);
+ if (!!exit.m_valueProfile) {
+ EncodedJSValue* bucket = exit.m_valueProfile.getSpecFailBucket(0);
+
+ if (exit.m_jsValueSource.isAddress()) {
+ // Save a register so we can use it.
+ GPRReg scratch = AssemblyHelpers::selectScratchGPR(exit.m_jsValueSource.base());
+
+ m_jit.push(scratch);
+
+ m_jit.load32(exit.m_jsValueSource.asAddress(OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), scratch);
+ m_jit.store32(scratch, &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.tag);
+ m_jit.load32(exit.m_jsValueSource.asAddress(OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), scratch);
+ m_jit.store32(scratch, &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.payload);
+
+ m_jit.pop(scratch);
+ } else if (exit.m_jsValueSource.hasKnownTag()) {
+ m_jit.store32(AssemblyHelpers::TrustedImm32(exit.m_jsValueSource.tag()), &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.tag);
+ m_jit.store32(exit.m_jsValueSource.payloadGPR(), &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.payload);
+ } else {
+ m_jit.store32(exit.m_jsValueSource.tagGPR(), &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.tag);
+ m_jit.store32(exit.m_jsValueSource.payloadGPR(), &bitwise_cast<EncodedValueDescriptor*>(bucket)->asBits.payload);
+ }
}
}
@@ -675,9 +732,9 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
// 15) Load the result of the last bytecode operation into regT0.
- if (exit.m_lastSetOperand != std::numeric_limits<int>::max()) {
- m_jit.load32(AssemblyHelpers::payloadFor((VirtualRegister)exit.m_lastSetOperand), GPRInfo::cachedResultRegister);
- m_jit.load32(AssemblyHelpers::tagFor((VirtualRegister)exit.m_lastSetOperand), GPRInfo::cachedResultRegister2);
+ for (size_t i = 0; i < exit.m_setOperands.size(); i++) {
+ m_jit.load32(AssemblyHelpers::payloadFor((VirtualRegister)exit.m_setOperands[i]), GPRInfo::cachedResultRegister);
+ m_jit.load32(AssemblyHelpers::tagFor((VirtualRegister)exit.m_setOperands[i]), GPRInfo::cachedResultRegister2);
}
// 16) Adjust the call frame pointer.
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
index 968e56f1a..65b89a550 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
@@ -73,12 +73,12 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
switch (recovery->type()) {
case SpeculativeAdd:
m_jit.sub32(recovery->src(), recovery->dest());
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, recovery->dest());
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, recovery->dest());
alreadyBoxed = recovery->dest();
break;
case BooleanSpeculationCheck:
- m_jit.xorPtr(AssemblyHelpers::TrustedImm32(static_cast<int32_t>(ValueFalse)), recovery->dest());
+ m_jit.xor64(AssemblyHelpers::TrustedImm32(static_cast<int32_t>(ValueFalse)), recovery->dest());
break;
default:
@@ -86,23 +86,70 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
}
}
- // 3) Refine some value profile, if appropriate.
-
- if (!!exit.m_jsValueSource && !!exit.m_valueProfile) {
- EncodedJSValue* bucket = exit.m_valueProfile.getSpecFailBucket(0);
+ // 3) Refine some array and/or value profile, if appropriate.
+
+ if (!!exit.m_jsValueSource) {
+ if (exit.m_kind == BadCache || exit.m_kind == BadIndexingType) {
+ // If the instruction that this originated from has an array profile, then
+ // refine it. If it doesn't, then do nothing. The latter could happen for
+ // hoisted checks, or checks emitted for operations that didn't have array
+ // profiling - either ops that aren't array accesses at all, or weren't
+ // known to be array acceses in the bytecode. The latter case is a FIXME
+ // while the former case is an outcome of a CheckStructure not knowing why
+ // it was emitted (could be either due to an inline cache of a property
+ // property access, or due to an array profile).
+
+ CodeOrigin codeOrigin = exit.m_codeOriginForExitProfile;
+ if (ArrayProfile* arrayProfile = m_jit.baselineCodeBlockFor(codeOrigin)->getArrayProfile(codeOrigin.bytecodeIndex)) {
+ GPRReg usedRegister;
+ if (exit.m_jsValueSource.isAddress())
+ usedRegister = exit.m_jsValueSource.base();
+ else
+ usedRegister = exit.m_jsValueSource.gpr();
+
+ GPRReg scratch1;
+ GPRReg scratch2;
+ scratch1 = AssemblyHelpers::selectScratchGPR(usedRegister);
+ scratch2 = AssemblyHelpers::selectScratchGPR(usedRegister, scratch1);
+
+ m_jit.push(scratch1);
+ m_jit.push(scratch2);
+
+ GPRReg value;
+ if (exit.m_jsValueSource.isAddress()) {
+ value = scratch1;
+ m_jit.loadPtr(AssemblyHelpers::Address(exit.m_jsValueSource.asAddress()), value);
+ } else
+ value = exit.m_jsValueSource.gpr();
+
+ m_jit.loadPtr(AssemblyHelpers::Address(value, JSCell::structureOffset()), scratch1);
+ m_jit.storePtr(scratch1, arrayProfile->addressOfLastSeenStructure());
+ m_jit.load8(AssemblyHelpers::Address(scratch1, Structure::indexingTypeOffset()), scratch1);
+ m_jit.move(AssemblyHelpers::TrustedImm32(1), scratch2);
+ m_jit.lshift32(scratch1, scratch2);
+ m_jit.or32(scratch2, AssemblyHelpers::AbsoluteAddress(arrayProfile->addressOfArrayModes()));
+
+ m_jit.pop(scratch2);
+ m_jit.pop(scratch1);
+ }
+ }
+ if (!!exit.m_valueProfile) {
+ EncodedJSValue* bucket = exit.m_valueProfile.getSpecFailBucket(0);
+
#if DFG_ENABLE(VERBOSE_SPECULATION_FAILURE)
- dataLog(" (have exit profile, bucket %p) ", bucket);
+ dataLog(" (have exit profile, bucket %p) ", bucket);
#endif
- if (exit.m_jsValueSource.isAddress()) {
- // We can't be sure that we have a spare register. So use the tagTypeNumberRegister,
- // since we know how to restore it.
- m_jit.loadPtr(AssemblyHelpers::Address(exit.m_jsValueSource.asAddress()), GPRInfo::tagTypeNumberRegister);
- m_jit.storePtr(GPRInfo::tagTypeNumberRegister, bucket);
- m_jit.move(AssemblyHelpers::TrustedImmPtr(bitwise_cast<void*>(TagTypeNumber)), GPRInfo::tagTypeNumberRegister);
- } else
- m_jit.storePtr(exit.m_jsValueSource.gpr(), bucket);
+ if (exit.m_jsValueSource.isAddress()) {
+ // We can't be sure that we have a spare register. So use the tagTypeNumberRegister,
+ // since we know how to restore it.
+ m_jit.load64(AssemblyHelpers::Address(exit.m_jsValueSource.asAddress()), GPRInfo::tagTypeNumberRegister);
+ m_jit.store64(GPRInfo::tagTypeNumberRegister, bucket);
+ m_jit.move(AssemblyHelpers::TrustedImm64(TagTypeNumber), GPRInfo::tagTypeNumberRegister);
+ } else
+ m_jit.store64(exit.m_jsValueSource.gpr(), bucket);
+ }
}
// 4) Figure out how many scratch slots we'll need. We need one for every GPR/FPR
@@ -230,7 +277,7 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
switch (recovery.technique()) {
case UnboxedInt32InGPR:
if (recovery.gpr() != alreadyBoxed)
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, recovery.gpr());
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, recovery.gpr());
break;
case AlreadyInJSStackAsUnboxedInt32:
@@ -252,7 +299,7 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
if (addressGPR == recovery.gpr())
addressGPR = GPRInfo::regT1;
- m_jit.storePtr(addressGPR, scratchDataBuffer);
+ m_jit.store64(addressGPR, scratchDataBuffer);
m_jit.move(AssemblyHelpers::TrustedImmPtr(scratchDataBuffer + 1), addressGPR);
m_jit.storeDouble(FPRInfo::fpRegT0, addressGPR);
@@ -266,12 +313,12 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
positive.link(&m_jit);
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, recovery.gpr());
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, recovery.gpr());
done.link(&m_jit);
m_jit.loadDouble(addressGPR, FPRInfo::fpRegT0);
- m_jit.loadPtr(scratchDataBuffer, addressGPR);
+ m_jit.load64(scratchDataBuffer, addressGPR);
break;
}
@@ -296,11 +343,11 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
case UnboxedInt32InGPR:
case UInt32InGPR:
if (operands.isVariable(index) && poisonedVirtualRegisters[operands.variableForIndex(index)]) {
- m_jit.storePtr(recovery.gpr(), scratchDataBuffer + currentPoisonIndex);
+ m_jit.store64(recovery.gpr(), scratchDataBuffer + currentPoisonIndex);
m_poisonScratchIndices[operands.variableForIndex(index)] = currentPoisonIndex;
currentPoisonIndex++;
} else
- m_jit.storePtr(recovery.gpr(), AssemblyHelpers::addressFor((VirtualRegister)operand));
+ m_jit.store64(recovery.gpr(), AssemblyHelpers::addressFor((VirtualRegister)operand));
break;
default:
break;
@@ -330,11 +377,11 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
continue;
GPRReg gpr = GPRInfo::toRegister(FPRInfo::toIndex(recovery.fpr()));
if (operands.isVariable(index) && poisonedVirtualRegisters[operands.variableForIndex(index)]) {
- m_jit.storePtr(gpr, scratchDataBuffer + currentPoisonIndex);
+ m_jit.store64(gpr, scratchDataBuffer + currentPoisonIndex);
m_poisonScratchIndices[operands.variableForIndex(index)] = currentPoisonIndex;
currentPoisonIndex++;
} else
- m_jit.storePtr(gpr, AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
+ m_jit.store64(gpr, AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
}
}
@@ -348,7 +395,7 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
continue;
m_jit.loadDouble(AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)), FPRInfo::fpRegT0);
m_jit.boxDouble(FPRInfo::fpRegT0, GPRInfo::regT0);
- m_jit.storePtr(GPRInfo::regT0, AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
+ m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
}
}
@@ -368,20 +415,20 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
const ValueRecovery& recovery = operands[index];
switch (recovery.technique()) {
case DisplacedInJSStack:
- m_jit.loadPtr(AssemblyHelpers::addressFor(recovery.virtualRegister()), GPRInfo::toRegister(displacementIndex++));
+ m_jit.load64(AssemblyHelpers::addressFor(recovery.virtualRegister()), GPRInfo::toRegister(displacementIndex++));
break;
case Int32DisplacedInJSStack: {
GPRReg gpr = GPRInfo::toRegister(displacementIndex++);
m_jit.load32(AssemblyHelpers::addressFor(recovery.virtualRegister()), gpr);
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, gpr);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr);
break;
}
case DoubleDisplacedInJSStack: {
GPRReg gpr = GPRInfo::toRegister(displacementIndex++);
- m_jit.loadPtr(AssemblyHelpers::addressFor(recovery.virtualRegister()), gpr);
- m_jit.subPtr(GPRInfo::tagTypeNumberRegister, gpr);
+ m_jit.load64(AssemblyHelpers::addressFor(recovery.virtualRegister()), gpr);
+ m_jit.sub64(GPRInfo::tagTypeNumberRegister, gpr);
break;
}
@@ -397,7 +444,7 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
case DisplacedInJSStack:
case Int32DisplacedInJSStack:
case DoubleDisplacedInJSStack:
- m_jit.storePtr(GPRInfo::toRegister(displacementIndex++), AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
+ m_jit.store64(GPRInfo::toRegister(displacementIndex++), AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
break;
default:
@@ -428,21 +475,21 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
switch (recovery.technique()) {
case DisplacedInJSStack:
- m_jit.loadPtr(AssemblyHelpers::addressFor(recovery.virtualRegister()), GPRInfo::regT0);
- m_jit.storePtr(GPRInfo::regT0, scratchDataBuffer + scratchIndex++);
+ m_jit.load64(AssemblyHelpers::addressFor(recovery.virtualRegister()), GPRInfo::regT0);
+ m_jit.store64(GPRInfo::regT0, scratchDataBuffer + scratchIndex++);
break;
case Int32DisplacedInJSStack: {
m_jit.load32(AssemblyHelpers::addressFor(recovery.virtualRegister()), GPRInfo::regT0);
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
- m_jit.storePtr(GPRInfo::regT0, scratchDataBuffer + scratchIndex++);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
+ m_jit.store64(GPRInfo::regT0, scratchDataBuffer + scratchIndex++);
break;
}
case DoubleDisplacedInJSStack: {
- m_jit.loadPtr(AssemblyHelpers::addressFor(recovery.virtualRegister()), GPRInfo::regT0);
- m_jit.subPtr(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
- m_jit.storePtr(GPRInfo::regT0, scratchDataBuffer + scratchIndex++);
+ m_jit.load64(AssemblyHelpers::addressFor(recovery.virtualRegister()), GPRInfo::regT0);
+ m_jit.sub64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
+ m_jit.store64(GPRInfo::regT0, scratchDataBuffer + scratchIndex++);
break;
}
@@ -458,8 +505,8 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
case DisplacedInJSStack:
case Int32DisplacedInJSStack:
case DoubleDisplacedInJSStack:
- m_jit.loadPtr(scratchDataBuffer + scratchIndex++, GPRInfo::regT0);
- m_jit.storePtr(GPRInfo::regT0, AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
+ m_jit.load64(scratchDataBuffer + scratchIndex++, GPRInfo::regT0);
+ m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
break;
default:
@@ -484,8 +531,8 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
case UnboxedInt32InGPR:
case UInt32InGPR:
case InFPR:
- m_jit.loadPtr(scratchDataBuffer + poisonIndex(virtualRegister), GPRInfo::regT0);
- m_jit.storePtr(GPRInfo::regT0, AssemblyHelpers::addressFor((VirtualRegister)virtualRegister));
+ m_jit.load64(scratchDataBuffer + poisonIndex(virtualRegister), GPRInfo::regT0);
+ m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor((VirtualRegister)virtualRegister));
break;
default:
@@ -499,16 +546,16 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
if (haveConstants) {
if (haveUndefined)
- m_jit.move(AssemblyHelpers::TrustedImmPtr(JSValue::encode(jsUndefined())), GPRInfo::regT0);
+ m_jit.move(AssemblyHelpers::TrustedImm64(JSValue::encode(jsUndefined())), GPRInfo::regT0);
for (size_t index = 0; index < operands.size(); ++index) {
const ValueRecovery& recovery = operands[index];
if (recovery.technique() != Constant)
continue;
if (recovery.constant().isUndefined())
- m_jit.storePtr(GPRInfo::regT0, AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
+ m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
else
- m_jit.storePtr(AssemblyHelpers::TrustedImmPtr(JSValue::encode(recovery.constant())), AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
+ m_jit.store64(AssemblyHelpers::TrustedImm64(JSValue::encode(recovery.constant())), AssemblyHelpers::addressFor((VirtualRegister)operands.operandForIndex(index)));
}
}
@@ -576,11 +623,11 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
callerFrameGPR = GPRInfo::callFrameRegister;
m_jit.storePtr(AssemblyHelpers::TrustedImmPtr(baselineCodeBlock), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::CodeBlock)));
- m_jit.storePtr(AssemblyHelpers::TrustedImmPtr(inlineCallFrame->callee->scope()), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ScopeChain)));
- m_jit.storePtr(callerFrameGPR, AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::CallerFrame)));
+ m_jit.store64(AssemblyHelpers::TrustedImm64(JSValue::encode(JSValue(inlineCallFrame->callee->scope()))), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ScopeChain)));
+ m_jit.store64(callerFrameGPR, AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::CallerFrame)));
m_jit.storePtr(AssemblyHelpers::TrustedImmPtr(jumpTarget), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ReturnPC)));
m_jit.store32(AssemblyHelpers::TrustedImm32(inlineCallFrame->arguments.size()), AssemblyHelpers::payloadFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ArgumentCount)));
- m_jit.storePtr(AssemblyHelpers::TrustedImmPtr(inlineCallFrame->callee.get()), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::Callee)));
+ m_jit.store64(AssemblyHelpers::TrustedImm64(JSValue::encode(JSValue(inlineCallFrame->callee.get()))), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::Callee)));
}
// 15) Create arguments if necessary and place them into the appropriate aliased
@@ -620,23 +667,23 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, const Operands<ValueRecov
bitwise_cast<void*>(operationCreateArguments)),
GPRInfo::nonArgGPR0);
m_jit.call(GPRInfo::nonArgGPR0);
- m_jit.storePtr(GPRInfo::returnValueGPR, AssemblyHelpers::addressFor(argumentsRegister));
- m_jit.storePtr(
+ m_jit.store64(GPRInfo::returnValueGPR, AssemblyHelpers::addressFor(argumentsRegister));
+ m_jit.store64(
GPRInfo::returnValueGPR,
AssemblyHelpers::addressFor(unmodifiedArgumentsRegister(argumentsRegister)));
m_jit.move(GPRInfo::returnValueGPR, GPRInfo::regT0); // no-op move on almost all platforms.
}
- m_jit.loadPtr(AssemblyHelpers::addressFor(argumentsRegister), GPRInfo::regT0);
- m_jit.storePtr(GPRInfo::regT0, AssemblyHelpers::addressFor(operand));
+ m_jit.load64(AssemblyHelpers::addressFor(argumentsRegister), GPRInfo::regT0);
+ m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand));
}
}
// 16) Load the result of the last bytecode operation into regT0.
- if (exit.m_lastSetOperand != std::numeric_limits<int>::max())
- m_jit.loadPtr(AssemblyHelpers::addressFor((VirtualRegister)exit.m_lastSetOperand), GPRInfo::cachedResultRegister);
-
+ for (size_t i = 0; i < exit.m_setOperands.size(); i++)
+ m_jit.load64(AssemblyHelpers::addressFor((VirtualRegister)exit.m_setOperands[i]), GPRInfo::cachedResultRegister);
+
// 17) Adjust the call frame pointer.
if (exit.m_codeOrigin.inlineCallFrame)
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp
index db736feeb..11c2c1cef 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp
@@ -1059,35 +1059,38 @@ void DFG_OPERATION operationNotifyGlobalVarWrite(WatchpointSet* watchpointSet)
watchpointSet->notifyWrite();
}
-EncodedJSValue DFG_OPERATION operationResolve(ExecState* exec, Identifier* propertyName)
+EncodedJSValue DFG_OPERATION operationResolve(ExecState* exec, Identifier* propertyName, ResolveOperations* operations)
{
JSGlobalData* globalData = &exec->globalData();
NativeCallFrameTracer tracer(globalData, exec);
- return JSValue::encode(JSScope::resolve(exec, *propertyName));
+ return JSValue::encode(JSScope::resolve(exec, *propertyName, operations));
}
-EncodedJSValue DFG_OPERATION operationResolveBase(ExecState* exec, Identifier* propertyName)
+EncodedJSValue DFG_OPERATION operationResolveBase(ExecState* exec, Identifier* propertyName, ResolveOperations* operations, PutToBaseOperation* putToBaseOperations)
{
JSGlobalData* globalData = &exec->globalData();
NativeCallFrameTracer tracer(globalData, exec);
- return JSValue::encode(JSScope::resolveBase(exec, *propertyName, false));
+ return JSValue::encode(JSScope::resolveBase(exec, *propertyName, false, operations, putToBaseOperations));
}
-EncodedJSValue DFG_OPERATION operationResolveBaseStrictPut(ExecState* exec, Identifier* propertyName)
+EncodedJSValue DFG_OPERATION operationResolveBaseStrictPut(ExecState* exec, Identifier* propertyName, ResolveOperations* operations, PutToBaseOperation* putToBaseOperations)
{
JSGlobalData* globalData = &exec->globalData();
NativeCallFrameTracer tracer(globalData, exec);
- return JSValue::encode(JSScope::resolveBase(exec, *propertyName, true));
+ return JSValue::encode(JSScope::resolveBase(exec, *propertyName, true, operations, putToBaseOperations));
}
-EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState* exec, GlobalResolveInfo* resolveInfo, JSGlobalObject* globalObject, Identifier* propertyName)
+EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState* exec, ResolveOperation* resolveOperation, JSGlobalObject* globalObject, Identifier* propertyName)
{
JSGlobalData* globalData = &exec->globalData();
NativeCallFrameTracer tracer(globalData, exec);
-
- return JSValue::encode(JSScope::resolveGlobal(exec, *propertyName, globalObject, &resolveInfo->structure, &resolveInfo->offset));
+ ASSERT(globalObject);
+ UNUSED_PARAM(resolveOperation);
+ UNUSED_PARAM(globalObject);
+ ASSERT(resolveOperation->m_operation == ResolveOperation::GetAndReturnGlobalProperty);
+ return JSValue::encode(JSScope::resolveGlobal(exec, *propertyName, globalObject, resolveOperation));
}
EncodedJSValue DFG_OPERATION operationToPrimitive(ExecState* exec, EncodedJSValue value)
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.h b/Source/JavaScriptCore/dfg/DFGOperations.h
index b6530b755..8d2beacec 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.h
+++ b/Source/JavaScriptCore/dfg/DFGOperations.h
@@ -33,8 +33,6 @@
namespace JSC {
-struct GlobalResolveInfo;
-
namespace DFG {
extern "C" {
@@ -66,8 +64,10 @@ typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EAZ)(ExecState*, JSArray*,
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_ECC)(ExecState*, JSCell*, JSCell*);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_ECI)(ExecState*, JSCell*, Identifier*);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_ECJ)(ExecState*, JSCell*, EncodedJSValue);
-typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EGriJsgI)(ExecState*, GlobalResolveInfo*, JSGlobalObject*, Identifier*);
+typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EGriJsgI)(ExecState*, ResolveOperation*, JSGlobalObject*, Identifier*);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EI)(ExecState*, Identifier*);
+typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EIRo)(ExecState*, Identifier*, ResolveOperations*);
+typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EIRoPtbo)(ExecState*, Identifier*, ResolveOperations*, PutToBaseOperation*);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EJ)(ExecState*, EncodedJSValue);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EJA)(ExecState*, EncodedJSValue, JSArray*);
typedef EncodedJSValue DFG_OPERATION (*J_DFGOperation_EJI)(ExecState*, EncodedJSValue, Identifier*);
@@ -131,10 +131,10 @@ EncodedJSValue DFG_OPERATION operationGetByIdOptimize(ExecState*, EncodedJSValue
EncodedJSValue DFG_OPERATION operationCallCustomGetter(ExecState*, JSCell*, PropertySlot::GetValueFunc, Identifier*) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationCallGetter(ExecState*, JSCell*, JSCell*) WTF_INTERNAL;
void DFG_OPERATION operationNotifyGlobalVarWrite(WatchpointSet* watchpointSet) WTF_INTERNAL;
-EncodedJSValue DFG_OPERATION operationResolve(ExecState*, Identifier*) WTF_INTERNAL;
-EncodedJSValue DFG_OPERATION operationResolveBase(ExecState*, Identifier*) WTF_INTERNAL;
-EncodedJSValue DFG_OPERATION operationResolveBaseStrictPut(ExecState*, Identifier*) WTF_INTERNAL;
-EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState*, GlobalResolveInfo*, JSGlobalObject*, Identifier*) WTF_INTERNAL;
+EncodedJSValue DFG_OPERATION operationResolve(ExecState*, Identifier*, ResolveOperations*) WTF_INTERNAL;
+EncodedJSValue DFG_OPERATION operationResolveBase(ExecState*, Identifier*, ResolveOperations*, PutToBaseOperation*) WTF_INTERNAL;
+EncodedJSValue DFG_OPERATION operationResolveBaseStrictPut(ExecState*, Identifier*, ResolveOperations*, PutToBaseOperation*) WTF_INTERNAL;
+EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState*, ResolveOperation*, JSGlobalObject*, Identifier*) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationToPrimitive(ExecState*, EncodedJSValue) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationStrCat(ExecState*, void*, size_t) WTF_INTERNAL;
char* DFG_OPERATION operationNewArray(ExecState*, Structure*, void*, size_t) WTF_INTERNAL;
diff --git a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
index d76fd8018..fee7a3ca2 100644
--- a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
@@ -116,7 +116,21 @@ private:
return false;
return !!m_graph.valueOfNumberConstant(nodeIndex);
}
-
+
+ SpeculatedType speculatedDoubleTypeForPrediction(SpeculatedType value)
+ {
+ if (!isNumberSpeculation(value))
+ return SpecDouble;
+ if (value & SpecDoubleNaN)
+ return SpecDouble;
+ return SpecDoubleReal;
+ }
+
+ SpeculatedType speculatedDoubleTypeForPredictions(SpeculatedType left, SpeculatedType right)
+ {
+ return speculatedDoubleTypeForPrediction(mergeSpeculations(left, right));
+ }
+
void propagate(Node& node)
{
if (!node.shouldGenerate())
@@ -248,7 +262,7 @@ private:
if (m_graph.addShouldSpeculateInteger(node))
changed |= mergePrediction(SpecInt32);
else
- changed |= mergePrediction(SpecDouble);
+ changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right));
} else if (!(left & SpecNumber) || !(right & SpecNumber)) {
// left or right is definitely something other than a number.
changed |= mergePrediction(SpecString);
@@ -272,7 +286,7 @@ private:
if (m_graph.addShouldSpeculateInteger(node))
changed |= mergePrediction(SpecInt32);
else
- changed |= mergePrediction(SpecDouble);
+ changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right));
}
if (isNotNegZero(node.child1().index()) || isNotNegZero(node.child2().index()))
@@ -291,7 +305,7 @@ private:
if (m_graph.addShouldSpeculateInteger(node))
changed |= mergePrediction(SpecInt32);
else
- changed |= mergePrediction(SpecDouble);
+ changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right));
}
if (isNotZero(node.child1().index()) || isNotZero(node.child2().index()))
@@ -307,7 +321,7 @@ private:
if (m_graph.negateShouldSpeculateInteger(node))
changed |= mergePrediction(SpecInt32);
else
- changed |= mergePrediction(SpecDouble);
+ changed |= mergePrediction(speculatedDoubleTypeForPrediction(m_graph[node.child1()].prediction()));
}
changed |= m_graph[node.child1()].mergeFlags(flags);
@@ -323,7 +337,7 @@ private:
&& nodeCanSpeculateInteger(node.arithNodeFlags()))
changed |= mergePrediction(SpecInt32);
else
- changed |= mergePrediction(SpecDouble);
+ changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right));
}
flags |= NodeUsedAsNumber;
@@ -340,7 +354,7 @@ private:
if (m_graph.mulShouldSpeculateInteger(node))
changed |= mergePrediction(SpecInt32);
else
- changed |= mergePrediction(SpecDouble);
+ changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right));
}
// As soon as a multiply happens, we can easily end up in the part
@@ -388,7 +402,7 @@ private:
if (nodeCanSpeculateInteger(node.arithNodeFlags()))
changed |= mergePrediction(child);
else
- changed |= setPrediction(SpecDouble);
+ changed |= setPrediction(speculatedDoubleTypeForPrediction(child));
flags &= ~NodeNeedsNegZero;
changed |= m_graph[node.child1()].mergeFlags(flags);
@@ -674,6 +688,7 @@ private:
case CheckNumber:
case CheckArgumentsNotCreated:
case GlobalVarWatchpoint:
+ case GarbageValue:
changed |= mergeDefaultFlags(node);
break;
diff --git a/Source/JavaScriptCore/dfg/DFGRepatch.cpp b/Source/JavaScriptCore/dfg/DFGRepatch.cpp
index 6fb185c12..531a525d5 100644
--- a/Source/JavaScriptCore/dfg/DFGRepatch.cpp
+++ b/Source/JavaScriptCore/dfg/DFGRepatch.cpp
@@ -192,7 +192,7 @@ static void generateProtoChainAccessStub(ExecState* exec, StructureStubInfo& stu
if (isInlineOffset(offset)) {
#if USE(JSVALUE64)
- stubJit.loadPtr(protoObject->locationForOffset(offset), resultGPR);
+ stubJit.load64(protoObject->locationForOffset(offset), resultGPR);
#elif USE(JSVALUE32_64)
stubJit.move(MacroAssembler::TrustedImmPtr(protoObject->locationForOffset(offset)), resultGPR);
stubJit.load32(MacroAssembler::Address(resultGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR);
@@ -201,7 +201,7 @@ static void generateProtoChainAccessStub(ExecState* exec, StructureStubInfo& stu
} else {
stubJit.loadPtr(protoObject->butterflyAddress(), resultGPR);
#if USE(JSVALUE64)
- stubJit.loadPtr(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier<Unknown>)), resultGPR);
+ stubJit.load64(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier<Unknown>)), resultGPR);
#elif USE(JSVALUE32_64)
stubJit.load32(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR);
stubJit.load32(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR);
@@ -263,7 +263,7 @@ static bool tryCacheGetByID(ExecState* exec, JSValue baseValue, const Identifier
failureCases.append(stubJit.branch32(MacroAssembler::LessThan, scratchGPR, MacroAssembler::TrustedImm32(0)));
#if USE(JSVALUE64)
- stubJit.orPtr(GPRInfo::tagTypeNumberRegister, scratchGPR, resultGPR);
+ stubJit.or64(GPRInfo::tagTypeNumberRegister, scratchGPR, resultGPR);
#elif USE(JSVALUE32_64)
stubJit.move(scratchGPR, resultGPR);
stubJit.move(JITCompiler::TrustedImm32(0xffffffff), resultTagGPR); // JSValue::Int32Tag
@@ -299,7 +299,7 @@ static bool tryCacheGetByID(ExecState* exec, JSValue baseValue, const Identifier
Structure* structure = baseCell->structure();
if (!slot.isCacheable())
return false;
- if (structure->isUncacheableDictionary() || structure->typeInfo().prohibitsPropertyCaching())
+ if (!structure->propertyAccessesAreCacheable())
return false;
// Optimize self access.
@@ -421,14 +421,14 @@ static bool tryBuildGetByIDList(ExecState* exec, JSValue baseValue, const Identi
ASSERT(baseGPR != scratchGPR);
if (isInlineOffset(slot.cachedOffset())) {
#if USE(JSVALUE64)
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, offsetRelativeToBase(slot.cachedOffset())), scratchGPR);
+ stubJit.load64(MacroAssembler::Address(baseGPR, offsetRelativeToBase(slot.cachedOffset())), scratchGPR);
#else
stubJit.load32(MacroAssembler::Address(baseGPR, offsetRelativeToBase(slot.cachedOffset())), scratchGPR);
#endif
} else {
stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR);
#if USE(JSVALUE64)
- stubJit.loadPtr(MacroAssembler::Address(scratchGPR, offsetRelativeToBase(slot.cachedOffset())), scratchGPR);
+ stubJit.load64(MacroAssembler::Address(scratchGPR, offsetRelativeToBase(slot.cachedOffset())), scratchGPR);
#else
stubJit.load32(MacroAssembler::Address(scratchGPR, offsetRelativeToBase(slot.cachedOffset())), scratchGPR);
#endif
@@ -465,7 +465,7 @@ static bool tryBuildGetByIDList(ExecState* exec, JSValue baseValue, const Identi
} else {
if (isInlineOffset(slot.cachedOffset())) {
#if USE(JSVALUE64)
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, offsetRelativeToBase(slot.cachedOffset())), resultGPR);
+ stubJit.load64(MacroAssembler::Address(baseGPR, offsetRelativeToBase(slot.cachedOffset())), resultGPR);
#else
if (baseGPR == resultTagGPR) {
stubJit.load32(MacroAssembler::Address(baseGPR, offsetRelativeToBase(slot.cachedOffset()) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR);
@@ -478,7 +478,7 @@ static bool tryBuildGetByIDList(ExecState* exec, JSValue baseValue, const Identi
} else {
stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), resultGPR);
#if USE(JSVALUE64)
- stubJit.loadPtr(MacroAssembler::Address(resultGPR, offsetRelativeToBase(slot.cachedOffset())), resultGPR);
+ stubJit.load64(MacroAssembler::Address(resultGPR, offsetRelativeToBase(slot.cachedOffset())), resultGPR);
#else
stubJit.load32(MacroAssembler::Address(resultGPR, offsetRelativeToBase(slot.cachedOffset()) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR);
stubJit.load32(MacroAssembler::Address(resultGPR, offsetRelativeToBase(slot.cachedOffset()) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR);
@@ -682,10 +682,10 @@ static void emitPutReplaceStub(
#if USE(JSVALUE64)
if (isInlineOffset(slot.cachedOffset()))
- stubJit.storePtr(valueGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue)));
+ stubJit.store64(valueGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue)));
else {
stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR);
- stubJit.storePtr(valueGPR, MacroAssembler::Address(scratchGPR, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue)));
+ stubJit.store64(valueGPR, MacroAssembler::Address(scratchGPR, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue)));
}
#elif USE(JSVALUE32_64)
if (isInlineOffset(slot.cachedOffset())) {
@@ -854,11 +854,11 @@ static void emitPutTransitionStub(
stubJit.storePtr(MacroAssembler::TrustedImmPtr(structure), MacroAssembler::Address(baseGPR, JSCell::structureOffset()));
#if USE(JSVALUE64)
if (isInlineOffset(slot.cachedOffset()))
- stubJit.storePtr(valueGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue)));
+ stubJit.store64(valueGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue)));
else {
if (!scratchGPR1HasStorage)
stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR1);
- stubJit.storePtr(valueGPR, MacroAssembler::Address(scratchGPR1, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue)));
+ stubJit.store64(valueGPR, MacroAssembler::Address(scratchGPR1, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue)));
}
#elif USE(JSVALUE32_64)
if (isInlineOffset(slot.cachedOffset())) {
diff --git a/Source/JavaScriptCore/dfg/DFGScratchRegisterAllocator.h b/Source/JavaScriptCore/dfg/DFGScratchRegisterAllocator.h
index 9a65e8b7d..706bcd61d 100644
--- a/Source/JavaScriptCore/dfg/DFGScratchRegisterAllocator.h
+++ b/Source/JavaScriptCore/dfg/DFGScratchRegisterAllocator.h
@@ -127,15 +127,20 @@ public:
{
unsigned count = 0;
for (unsigned i = GPRInfo::numberOfRegisters; i--;) {
- if (m_usedRegisters.getGPRByIndex(i))
- jit.storePtr(GPRInfo::toRegister(i), scratchBuffer->m_buffer + (count++));
+ if (m_usedRegisters.getGPRByIndex(i)) {
+#if USE(JSVALUE64)
+ jit.store64(GPRInfo::toRegister(i), static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) + (count++));
+#else
+ jit.store32(GPRInfo::toRegister(i), static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) + (count++));
+#endif
+ }
if (scratchGPR == InvalidGPRReg && !m_lockedRegisters.getGPRByIndex(i) && !m_scratchRegisters.getGPRByIndex(i))
scratchGPR = GPRInfo::toRegister(i);
}
ASSERT(scratchGPR != InvalidGPRReg);
for (unsigned i = FPRInfo::numberOfRegisters; i--;) {
if (m_usedRegisters.getFPRByIndex(i)) {
- jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->m_buffer + (count++)), scratchGPR);
+ jit.move(MacroAssembler::TrustedImmPtr(static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) + (count++)), scratchGPR);
jit.storeDouble(FPRInfo::toRegister(i), scratchGPR);
}
}
@@ -165,15 +170,20 @@ public:
unsigned count = m_usedRegisters.numberOfSetGPRs();
for (unsigned i = FPRInfo::numberOfRegisters; i--;) {
if (m_usedRegisters.getFPRByIndex(i)) {
- jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->m_buffer + (count++)), scratchGPR);
+ jit.move(MacroAssembler::TrustedImmPtr(static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) + (count++)), scratchGPR);
jit.loadDouble(scratchGPR, FPRInfo::toRegister(i));
}
}
count = 0;
for (unsigned i = GPRInfo::numberOfRegisters; i--;) {
- if (m_usedRegisters.getGPRByIndex(i))
- jit.loadPtr(scratchBuffer->m_buffer + (count++), GPRInfo::toRegister(i));
+ if (m_usedRegisters.getGPRByIndex(i)) {
+#if USE(JSVALUE64)
+ jit.load64(static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) + (count++), GPRInfo::toRegister(i));
+#else
+ jit.load32(static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()) + (count++), GPRInfo::toRegister(i));
+#endif
+ }
}
}
diff --git a/Source/JavaScriptCore/dfg/DFGSilentRegisterSavePlan.h b/Source/JavaScriptCore/dfg/DFGSilentRegisterSavePlan.h
index ab99b014d..bb04646bf 100644
--- a/Source/JavaScriptCore/dfg/DFGSilentRegisterSavePlan.h
+++ b/Source/JavaScriptCore/dfg/DFGSilentRegisterSavePlan.h
@@ -41,6 +41,7 @@ enum SilentSpillAction {
Store32Tag,
Store32Payload,
StorePtr,
+ Store64,
StoreDouble
};
@@ -61,6 +62,7 @@ enum SilentFillAction {
Load32Payload,
Load32PayloadBoxInt,
LoadPtr,
+ Load64,
LoadDouble,
LoadDoubleBoxDouble,
LoadJSUnboxDouble
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index 850d5aa74..a9b91d046 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -163,7 +163,9 @@ void SpeculativeJIT::convertLastOSRExitToForward(const ValueRecovery& valueRecov
#endif
unsigned setLocalIndexInBlock = m_indexInBlock + 1;
-
+
+ OSRExit& exit = m_jit.codeBlock()->lastOSRExit();
+
Node* setLocal = &at(m_jit.graph().m_blocks[m_block]->at(setLocalIndexInBlock));
bool hadInt32ToDouble = false;
@@ -173,7 +175,7 @@ void SpeculativeJIT::convertLastOSRExitToForward(const ValueRecovery& valueRecov
}
if (setLocal->op() == Flush || setLocal->op() == Phantom)
setLocal = &at(m_jit.graph().m_blocks[m_block]->at(++setLocalIndexInBlock));
-
+
if (!!valueRecovery) {
if (hadInt32ToDouble)
ASSERT(at(setLocal->child1()).child1() == m_compileIndex);
@@ -188,16 +190,34 @@ void SpeculativeJIT::convertLastOSRExitToForward(const ValueRecovery& valueRecov
// We're at an inlined return. Use a backward speculation instead.
return;
}
+
+ exit.m_setOperands[0] = setLocal->local();
+ while (nextNode->codeOrigin == at(m_compileIndex).codeOrigin) {
+ ++setLocalIndexInBlock;
+ Node* nextSetLocal = nextNode;
+ if (nextSetLocal->op() == Int32ToDouble)
+ nextSetLocal = &at(m_jit.graph().m_blocks[m_block]->at(++setLocalIndexInBlock));
+
+ if (nextSetLocal->op() == Flush || nextSetLocal->op() == Phantom)
+ nextSetLocal = &at(m_jit.graph().m_blocks[m_block]->at(++setLocalIndexInBlock));
+
+ nextNode = &at(m_jit.graph().m_blocks[m_block]->at(setLocalIndexInBlock + 1));
+ ASSERT(nextNode->op() != Jump || nextNode->codeOrigin != at(m_compileIndex).codeOrigin);
+ ASSERT(nextSetLocal->op() == SetLocal);
+ exit.m_setOperands.append(nextSetLocal->local());
+ }
+
ASSERT(nextNode->codeOrigin != at(m_compileIndex).codeOrigin);
-
- OSRExit& exit = m_jit.codeBlock()->lastOSRExit();
+
exit.m_codeOrigin = nextNode->codeOrigin;
if (!valueRecovery)
return;
- exit.m_lastSetOperand = setLocal->local();
- exit.m_valueRecoveryOverride = adoptRef(
- new ValueRecoveryOverride(setLocal->local(), valueRecovery));
+
+ ASSERT(exit.m_setOperands.size() == 1);
+ for (size_t i = 0; i < exit.m_setOperands.size(); i++)
+ exit.m_valueRecoveryOverrides.append(adoptRef(new ValueRecoveryOverride(exit.m_setOperands[i], valueRecovery)));
+
}
JumpReplacementWatchpoint* SpeculativeJIT::forwardSpeculationWatchpoint(ExitKind kind)
@@ -417,7 +437,7 @@ void SpeculativeJIT::checkArray(Node& node)
MacroAssembler::Address(baseReg, JSCell::structureOffset()), tempGPR);
m_jit.load8(MacroAssembler::Address(tempGPR, Structure::indexingTypeOffset()), tempGPR);
speculationCheck(
- Uncountable, JSValueRegs(), NoNode,
+ BadIndexingType, JSValueSource::unboxedCell(baseReg), NoNode,
jumpSlowForUnwantedArrayMode(tempGPR, node.arrayMode()));
noResult(m_compileIndex);
@@ -515,7 +535,7 @@ void SpeculativeJIT::arrayify(Node& node, GPRReg baseReg, GPRReg propertyReg)
// Next check that the object does not intercept indexed accesses. If it does,
// then this mode won't work.
speculationCheck(
- Uncountable, JSValueRegs(), NoNode,
+ BadIndexingType, JSValueSource::unboxedCell(baseReg), NoNode,
m_jit.branchTest8(
MacroAssembler::NonZero,
MacroAssembler::Address(structureGPR, Structure::typeInfoFlagsOffset()),
@@ -549,7 +569,7 @@ void SpeculativeJIT::arrayify(Node& node, GPRReg baseReg, GPRReg propertyReg)
m_jit.load8(
MacroAssembler::Address(structureGPR, Structure::indexingTypeOffset()), structureGPR);
speculationCheck(
- Uncountable, JSValueRegs(), NoNode,
+ BadIndexingType, JSValueSource::unboxedCell(baseReg), NoNode,
jumpSlowForUnwantedArrayMode(structureGPR, desiredArrayMode));
done.link(&m_jit);
@@ -559,10 +579,17 @@ void SpeculativeJIT::arrayify(Node& node, GPRReg baseReg, GPRReg propertyReg)
void SpeculativeJIT::arrayify(Node& node)
{
ASSERT(modeIsSpecific(node.arrayMode()));
- ASSERT(!modeAlreadyChecked(m_state.forNode(node.child1()), node.arrayMode()));
SpeculateCellOperand base(this, node.child1());
+ if (modeAlreadyChecked(m_state.forNode(node.child1()), node.arrayMode())) {
+ GPRTemporary temp(this);
+ m_jit.loadPtr(
+ MacroAssembler::Address(base.gpr(), JSObject::butterflyOffset()), temp.gpr());
+ storageResult(temp.gpr(), m_compileIndex);
+ return;
+ }
+
if (!node.child2()) {
arrayify(node, base.gpr(), InvalidGPRReg);
return;
@@ -1686,14 +1713,14 @@ void SpeculativeJIT::checkArgumentTypes()
#if USE(JSVALUE64)
if (isInt32Speculation(predictedType))
- speculationCheck(BadType, valueSource, nodeIndex, m_jit.branchPtr(MacroAssembler::Below, JITCompiler::addressFor(virtualRegister), GPRInfo::tagTypeNumberRegister));
+ speculationCheck(BadType, valueSource, nodeIndex, m_jit.branch64(MacroAssembler::Below, JITCompiler::addressFor(virtualRegister), GPRInfo::tagTypeNumberRegister));
else if (isBooleanSpeculation(predictedType)) {
GPRTemporary temp(this);
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr());
- m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), temp.gpr());
- speculationCheck(BadType, valueSource, nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), TrustedImm32(static_cast<int32_t>(~1))));
+ m_jit.load64(JITCompiler::addressFor(virtualRegister), temp.gpr());
+ m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), temp.gpr());
+ speculationCheck(BadType, valueSource, nodeIndex, m_jit.branchTest64(MacroAssembler::NonZero, temp.gpr(), TrustedImm32(static_cast<int32_t>(~1))));
} else if (isCellSpeculation(predictedType))
- speculationCheck(BadType, valueSource, nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, JITCompiler::addressFor(virtualRegister), GPRInfo::tagMaskRegister));
+ speculationCheck(BadType, valueSource, nodeIndex, m_jit.branchTest64(MacroAssembler::NonZero, JITCompiler::addressFor(virtualRegister), GPRInfo::tagMaskRegister));
#else
if (isInt32Speculation(predictedType))
speculationCheck(BadType, valueSource, nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::Int32Tag)));
@@ -1953,10 +1980,10 @@ void SpeculativeJIT::compileValueToInt32(Node& node)
FPRTemporary tempFpr(this);
FPRReg fpr = tempFpr.fpr();
- JITCompiler::Jump isInteger = m_jit.branchPtr(MacroAssembler::AboveOrEqual, gpr, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump isInteger = m_jit.branch64(MacroAssembler::AboveOrEqual, gpr, GPRInfo::tagTypeNumberRegister);
if (!isNumberSpeculation(m_state.forNode(node.child1()).m_type))
- speculationCheck(BadType, JSValueRegs(gpr), node.child1().index(), m_jit.branchTestPtr(MacroAssembler::Zero, gpr, GPRInfo::tagTypeNumberRegister));
+ speculationCheck(BadType, JSValueRegs(gpr), node.child1().index(), m_jit.branchTest64(MacroAssembler::Zero, gpr, GPRInfo::tagTypeNumberRegister));
// First, if we get here we have a double encoded as a JSValue
m_jit.move(gpr, resultGpr);
@@ -2099,8 +2126,8 @@ void SpeculativeJIT::compileInt32ToDouble(Node& node)
ASSERT(isInt32Constant(node.child1().index()));
FPRTemporary result(this);
GPRTemporary temp(this);
- m_jit.move(MacroAssembler::ImmPtr(reinterpret_cast<void*>(reinterpretDoubleToIntptr(valueOfNumberConstant(node.child1().index())))), temp.gpr());
- m_jit.movePtrToDouble(temp.gpr(), result.fpr());
+ m_jit.move(MacroAssembler::Imm64(reinterpretDoubleToInt64(valueOfNumberConstant(node.child1().index()))), temp.gpr());
+ m_jit.move64ToDouble(temp.gpr(), result.fpr());
doubleResult(result.fpr(), m_compileIndex);
return;
}
@@ -2124,13 +2151,13 @@ void SpeculativeJIT::compileInt32ToDouble(Node& node)
GPRReg tempGPR = temp.gpr();
FPRReg resultFPR = result.fpr();
- JITCompiler::Jump isInteger = m_jit.branchPtr(
+ JITCompiler::Jump isInteger = m_jit.branch64(
MacroAssembler::AboveOrEqual, op1GPR, GPRInfo::tagTypeNumberRegister);
if (!isNumberSpeculation(m_state.forNode(node.child1()).m_type)) {
speculationCheck(
BadType, JSValueRegs(op1GPR), node.child1(),
- m_jit.branchTestPtr(MacroAssembler::Zero, op1GPR, GPRInfo::tagTypeNumberRegister));
+ m_jit.branchTest64(MacroAssembler::Zero, op1GPR, GPRInfo::tagTypeNumberRegister));
}
m_jit.move(op1GPR, tempGPR);
@@ -2460,20 +2487,18 @@ void SpeculativeJIT::compileInstanceOfForObject(Node&, GPRReg valueReg, GPRReg p
MacroAssembler::Label loop(&m_jit);
m_jit.loadPtr(MacroAssembler::Address(scratchReg, JSCell::structureOffset()), scratchReg);
#if USE(JSVALUE64)
- m_jit.loadPtr(MacroAssembler::Address(scratchReg, Structure::prototypeOffset()), scratchReg);
+ m_jit.load64(MacroAssembler::Address(scratchReg, Structure::prototypeOffset()), scratchReg);
+ MacroAssembler::Jump isInstance = m_jit.branch64(MacroAssembler::Equal, scratchReg, prototypeReg);
+ m_jit.branchTest64(MacroAssembler::Zero, scratchReg, GPRInfo::tagMaskRegister).linkTo(loop, &m_jit);
#else
m_jit.load32(MacroAssembler::Address(scratchReg, Structure::prototypeOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), scratchReg);
-#endif
MacroAssembler::Jump isInstance = m_jit.branchPtr(MacroAssembler::Equal, scratchReg, prototypeReg);
-#if USE(JSVALUE64)
- m_jit.branchTestPtr(MacroAssembler::Zero, scratchReg, GPRInfo::tagMaskRegister).linkTo(loop, &m_jit);
-#else
m_jit.branchTest32(MacroAssembler::NonZero, scratchReg).linkTo(loop, &m_jit);
#endif
// No match - result is false.
#if USE(JSVALUE64)
- m_jit.move(MacroAssembler::TrustedImmPtr(JSValue::encode(jsBoolean(false))), scratchReg);
+ m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsBoolean(false))), scratchReg);
#else
m_jit.move(MacroAssembler::TrustedImm32(0), scratchReg);
#endif
@@ -2481,7 +2506,7 @@ void SpeculativeJIT::compileInstanceOfForObject(Node&, GPRReg valueReg, GPRReg p
isInstance.link(&m_jit);
#if USE(JSVALUE64)
- m_jit.move(MacroAssembler::TrustedImmPtr(JSValue::encode(jsBoolean(true))), scratchReg);
+ m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsBoolean(true))), scratchReg);
#else
m_jit.move(MacroAssembler::TrustedImm32(1), scratchReg);
#endif
@@ -2507,8 +2532,8 @@ void SpeculativeJIT::compileInstanceOf(Node& node)
#if USE(JSVALUE64)
GPRReg valueReg = value.gpr();
- MacroAssembler::Jump isCell = m_jit.branchTestPtr(MacroAssembler::Zero, valueReg, GPRInfo::tagMaskRegister);
- m_jit.move(MacroAssembler::TrustedImmPtr(JSValue::encode(jsBoolean(false))), scratchReg);
+ MacroAssembler::Jump isCell = m_jit.branchTest64(MacroAssembler::Zero, valueReg, GPRInfo::tagMaskRegister);
+ m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsBoolean(false))), scratchReg);
#else
GPRReg valueTagReg = value.tagGPR();
GPRReg valueReg = value.payloadGPR();
@@ -3071,7 +3096,7 @@ bool SpeculativeJIT::compileStrictEqForConstant(Node& node, Edge value, JSValue
}
#if USE(JSVALUE64)
- branchPtr(condition, op1.gpr(), MacroAssembler::TrustedImmPtr(bitwise_cast<void*>(JSValue::encode(constant))), taken);
+ branch64(condition, op1.gpr(), MacroAssembler::TrustedImm64(JSValue::encode(constant)), taken);
#else
GPRReg payloadGPR = op1.payloadGPR();
GPRReg tagGPR = op1.tagGPR();
@@ -3101,8 +3126,8 @@ bool SpeculativeJIT::compileStrictEqForConstant(Node& node, Edge value, JSValue
#if USE(JSVALUE64)
GPRReg op1GPR = op1.gpr();
GPRReg resultGPR = result.gpr();
- m_jit.move(MacroAssembler::TrustedImmPtr(bitwise_cast<void*>(ValueFalse)), resultGPR);
- MacroAssembler::Jump notEqual = m_jit.branchPtr(MacroAssembler::NotEqual, op1GPR, MacroAssembler::TrustedImmPtr(bitwise_cast<void*>(JSValue::encode(constant))));
+ m_jit.move(MacroAssembler::TrustedImm64(ValueFalse), resultGPR);
+ MacroAssembler::Jump notEqual = m_jit.branch64(MacroAssembler::NotEqual, op1GPR, MacroAssembler::TrustedImm64(JSValue::encode(constant)));
m_jit.or32(MacroAssembler::TrustedImm32(1), resultGPR);
notEqual.link(&m_jit);
jsValueResult(resultGPR, m_compileIndex, DataFormatJSBoolean);
@@ -3282,7 +3307,7 @@ void SpeculativeJIT::compileGetByValOnArguments(Node& node)
resultReg);
jsValueResult(resultTagReg, resultReg, m_compileIndex);
#else
- m_jit.loadPtr(
+ m_jit.load64(
MacroAssembler::BaseIndex(
scratchReg, resultReg, MacroAssembler::TimesEight,
CallFrame::thisArgumentOffset() * sizeof(Register) - sizeof(Register)),
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index 90b6d483a..3796cc704 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -71,6 +71,8 @@ private:
typedef JITCompiler::Imm32 Imm32;
typedef JITCompiler::TrustedImmPtr TrustedImmPtr;
typedef JITCompiler::ImmPtr ImmPtr;
+ typedef JITCompiler::TrustedImm64 TrustedImm64;
+ typedef JITCompiler::Imm64 Imm64;
// These constants are used to set priorities for spill order for
// the register allocator.
@@ -347,9 +349,11 @@ public:
ASSERT(info.gpr() == source);
if (registerFormat == DataFormatInteger)
spillAction = Store32Payload;
- else {
- ASSERT(registerFormat & DataFormatJS || registerFormat == DataFormatCell || registerFormat == DataFormatStorage);
+ else if (registerFormat == DataFormatCell || registerFormat == DataFormatStorage)
spillAction = StorePtr;
+ else {
+ ASSERT(registerFormat & DataFormatJS);
+ spillAction = Store64;
}
#elif USE(JSVALUE32_64)
if (registerFormat & DataFormatJS) {
@@ -414,7 +418,7 @@ public:
ASSERT(registerFormat == DataFormatJSDouble);
fillAction = LoadDoubleBoxDouble;
} else
- fillAction = LoadPtr;
+ fillAction = Load64;
#else
ASSERT(info.tagGPR() == source || info.payloadGPR() == source);
if (node.hasConstant())
@@ -501,6 +505,11 @@ public:
case StorePtr:
m_jit.storePtr(plan.gpr(), JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()));
break;
+#if USE(JSVALUE64)
+ case Store64:
+ m_jit.store64(plan.gpr(), JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()));
+ break;
+#endif
case StoreDouble:
m_jit.storeDouble(plan.fpr(), JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()));
break;
@@ -528,25 +537,25 @@ public:
break;
#if USE(JSVALUE64)
case SetTrustedJSConstant:
- m_jit.move(valueOfJSConstantAsImmPtr(plan.nodeIndex()).asTrustedImmPtr(), plan.gpr());
+ m_jit.move(valueOfJSConstantAsImm64(plan.nodeIndex()).asTrustedImm64(), plan.gpr());
break;
case SetJSConstant:
- m_jit.move(valueOfJSConstantAsImmPtr(plan.nodeIndex()), plan.gpr());
+ m_jit.move(valueOfJSConstantAsImm64(plan.nodeIndex()), plan.gpr());
break;
case SetDoubleConstant:
- m_jit.move(ImmPtr(bitwise_cast<void*>(valueOfNumberConstant(plan.nodeIndex()))), canTrample);
- m_jit.movePtrToDouble(canTrample, plan.fpr());
+ m_jit.move(Imm64(valueOfNumberConstant(plan.nodeIndex())), canTrample);
+ m_jit.move64ToDouble(canTrample, plan.fpr());
break;
case Load32PayloadBoxInt:
m_jit.load32(JITCompiler::payloadFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, plan.gpr());
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, plan.gpr());
break;
case LoadDoubleBoxDouble:
- m_jit.loadPtr(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
- m_jit.subPtr(GPRInfo::tagTypeNumberRegister, plan.gpr());
+ m_jit.load64(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
+ m_jit.sub64(GPRInfo::tagTypeNumberRegister, plan.gpr());
break;
case LoadJSUnboxDouble:
- m_jit.loadPtr(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), canTrample);
+ m_jit.load64(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), canTrample);
unboxDouble(canTrample, plan.fpr());
break;
#else
@@ -578,6 +587,11 @@ public:
case LoadPtr:
m_jit.loadPtr(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
break;
+#if USE(JSVALUE64)
+ case Load64:
+ m_jit.load64(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
+ break;
+#endif
case LoadDouble:
m_jit.loadDouble(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.fpr());
break;
@@ -752,10 +766,10 @@ public:
// We need to box int32 and cell values ...
// but on JSVALUE64 boxing a cell is a no-op!
if (spillFormat == DataFormatInteger)
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, reg);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, reg);
// Spill the value, and record it as spilled in its boxed form.
- m_jit.storePtr(reg, JITCompiler::addressFor(spillMe));
+ m_jit.store64(reg, JITCompiler::addressFor(spillMe));
info.spill(*m_stream, spillMe, (DataFormat)(spillFormat | DataFormatJS));
return;
#elif USE(JSVALUE32_64)
@@ -830,6 +844,16 @@ public:
return &m_jit.codeBlock()->identifier(index);
}
+ ResolveOperations* resolveOperations(unsigned index)
+ {
+ return m_jit.codeBlock()->resolveOperations(index);
+ }
+
+ PutToBaseOperation* putToBaseOperation(unsigned index)
+ {
+ return m_jit.codeBlock()->putToBaseOperation(index);
+ }
+
// Spill all VirtualRegisters back to the JSStack.
void flushRegisters()
{
@@ -865,9 +889,9 @@ public:
#endif
#if USE(JSVALUE64)
- MacroAssembler::ImmPtr valueOfJSConstantAsImmPtr(NodeIndex nodeIndex)
+ MacroAssembler::Imm64 valueOfJSConstantAsImm64(NodeIndex nodeIndex)
{
- return MacroAssembler::ImmPtr(JSValue::encode(valueOfJSConstant(nodeIndex)));
+ return MacroAssembler::Imm64(JSValue::encode(valueOfJSConstant(nodeIndex)));
}
#endif
@@ -1209,6 +1233,16 @@ public:
m_jit.setupArgumentsWithExecState(TrustedImmPtr(identifier));
return appendCallWithExceptionCheckSetResult(operation, result);
}
+ JITCompiler::Call callOperation(J_DFGOperation_EIRo operation, GPRReg result, Identifier* identifier, ResolveOperations* operations)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(identifier), TrustedImmPtr(operations));
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
+ JITCompiler::Call callOperation(J_DFGOperation_EIRoPtbo operation, GPRReg result, Identifier* identifier, ResolveOperations* operations, PutToBaseOperation* putToBaseOperations)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(identifier), TrustedImmPtr(operations), TrustedImmPtr(putToBaseOperations));
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
JITCompiler::Call callOperation(J_DFGOperation_EA operation, GPRReg result, GPRReg arg1)
{
m_jit.setupArgumentsWithExecState(arg1);
@@ -1339,6 +1373,11 @@ public:
m_jit.setupArgumentsWithExecState(arg1);
return appendCallWithExceptionCheckSetResult(operation, result);
}
+ JITCompiler::Call callOperation(J_DFGOperation_EJ operation, GPRReg result, GPRReg arg1)
+ {
+ m_jit.setupArgumentsWithExecState(arg1);
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
JITCompiler::Call callOperation(S_DFGOperation_EJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
{
m_jit.setupArgumentsWithExecState(arg1, arg2);
@@ -1354,14 +1393,19 @@ public:
m_jit.setupArgumentsWithExecState(arg1, arg2);
return appendCallWithExceptionCheckSetResult(operation, result);
}
+ JITCompiler::Call callOperation(J_DFGOperation_EJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
+ {
+ m_jit.setupArgumentsWithExecState(arg1, arg2);
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
JITCompiler::Call callOperation(J_DFGOperation_EJJ operation, GPRReg result, GPRReg arg1, MacroAssembler::TrustedImm32 imm)
{
- m_jit.setupArgumentsWithExecState(arg1, MacroAssembler::TrustedImmPtr(static_cast<const void*>(JSValue::encode(jsNumber(imm.m_value)))));
+ m_jit.setupArgumentsWithExecState(arg1, MacroAssembler::TrustedImm64(JSValue::encode(jsNumber(imm.m_value))));
return appendCallWithExceptionCheckSetResult(operation, result);
}
JITCompiler::Call callOperation(J_DFGOperation_EJJ operation, GPRReg result, MacroAssembler::TrustedImm32 imm, GPRReg arg2)
{
- m_jit.setupArgumentsWithExecState(MacroAssembler::TrustedImmPtr(static_cast<const void*>(JSValue::encode(jsNumber(imm.m_value)))), arg2);
+ m_jit.setupArgumentsWithExecState(MacroAssembler::TrustedImm64(JSValue::encode(jsNumber(imm.m_value))), arg2);
return appendCallWithExceptionCheckSetResult(operation, result);
}
JITCompiler::Call callOperation(J_DFGOperation_ECC operation, GPRReg result, GPRReg arg1, GPRReg arg2)
@@ -1707,6 +1751,19 @@ public:
m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG imm, TrustedImm32(JSValue::Int32Tag), arg2Payload, arg2Tag);
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
}
+
+ JITCompiler::Call callOperation(J_DFGOperation_EIRo operation, GPRReg resultTag, GPRReg resultPayload, Identifier* identifier, ResolveOperations* operations)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(identifier), TrustedImmPtr(operations));
+ return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
+ }
+
+ JITCompiler::Call callOperation(J_DFGOperation_EIRoPtbo operation, GPRReg resultTag, GPRReg resultPayload, Identifier* identifier, ResolveOperations* operations, PutToBaseOperation* putToBaseOperations)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(identifier), TrustedImmPtr(operations), TrustedImmPtr(putToBaseOperations));
+ return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
+ }
+
JITCompiler::Call callOperation(J_DFGOperation_ECJ operation, GPRReg resultTag, GPRReg resultPayload, GPRReg arg1, GPRReg arg2Tag, GPRReg arg2Payload)
{
m_jit.setupArgumentsWithExecState(arg1, arg2Payload, arg2Tag);
@@ -2030,6 +2087,20 @@ public:
notTaken.link(&m_jit);
}
+#if USE(JSVALUE64)
+ template<typename T, typename U>
+ void branch64(JITCompiler::RelationalCondition cond, T left, U right, BlockIndex destination)
+ {
+ if (!haveEdgeCodeToEmit(destination))
+ return addBranch(m_jit.branch64(cond, left, right), destination);
+
+ JITCompiler::Jump notTaken = m_jit.branch64(JITCompiler::invert(cond), left, right);
+ emitEdgeCode(destination);
+ addBranch(m_jit.jump(), destination);
+ notTaken.link(&m_jit);
+ }
+#endif
+
template<typename T, typename U>
void branchPtr(JITCompiler::RelationalCondition cond, T left, U right, BlockIndex destination)
{
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index 41fe8db0f..453851ba3 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -3879,7 +3879,7 @@ void SpeculativeJIT::compile(Node& node)
if (node.structureSet().size() == 1) {
speculationCheckWithConditionalDirection(
- BadCache, JSValueRegs(), NoNode,
+ BadCache, JSValueSource::unboxedCell(base.gpr()), NoNode,
m_jit.branchWeakPtr(
JITCompiler::NotEqual,
JITCompiler::Address(base.gpr(), JSCell::structureOffset()),
@@ -3896,7 +3896,7 @@ void SpeculativeJIT::compile(Node& node)
done.append(m_jit.branchWeakPtr(JITCompiler::Equal, structure.gpr(), node.structureSet()[i]));
speculationCheckWithConditionalDirection(
- BadCache, JSValueRegs(), NoNode,
+ BadCache, JSValueSource::unboxedCell(base.gpr()), NoNode,
m_jit.branchWeakPtr(
JITCompiler::NotEqual, structure.gpr(), node.structureSet().last()),
node.op() == ForwardCheckStructure);
@@ -3910,6 +3910,13 @@ void SpeculativeJIT::compile(Node& node)
case StructureTransitionWatchpoint:
case ForwardStructureTransitionWatchpoint: {
+ // There is a fascinating question here of what to do about array profiling.
+ // We *could* try to tell the OSR exit about where the base of the access is.
+ // The DFG will have kept it alive, though it may not be in a register, and
+ // we shouldn't really load it since that could be a waste. For now though,
+ // we'll just rely on the fact that when a watchpoint fires then that's
+ // quite a hint already.
+
m_jit.addWeakReference(node.structure());
node.structure()->addTransitionWatchpoint(
speculationWatchpointWithConditionalDirection(
@@ -4288,7 +4295,8 @@ void SpeculativeJIT::compile(Node& node)
flushRegisters();
GPRResult resultPayload(this);
GPRResult2 resultTag(this);
- callOperation(operationResolve, resultTag.gpr(), resultPayload.gpr(), identifier(node.identifierNumber()));
+ ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node.resolveOperationsDataIndex()];
+ callOperation(operationResolve, resultTag.gpr(), resultPayload.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex));
jsValueResult(resultTag.gpr(), resultPayload.gpr(), m_compileIndex);
break;
}
@@ -4297,7 +4305,8 @@ void SpeculativeJIT::compile(Node& node)
flushRegisters();
GPRResult resultPayload(this);
GPRResult2 resultTag(this);
- callOperation(operationResolveBase, resultTag.gpr(), resultPayload.gpr(), identifier(node.identifierNumber()));
+ ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node.resolveOperationsDataIndex()];
+ callOperation(operationResolveBase, resultTag.gpr(), resultPayload.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex), putToBaseOperation(data.putToBaseOperationIndex));
jsValueResult(resultTag.gpr(), resultPayload.gpr(), m_compileIndex);
break;
}
@@ -4306,7 +4315,8 @@ void SpeculativeJIT::compile(Node& node)
flushRegisters();
GPRResult resultPayload(this);
GPRResult2 resultTag(this);
- callOperation(operationResolveBaseStrictPut, resultTag.gpr(), resultPayload.gpr(), identifier(node.identifierNumber()));
+ ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node.resolveOperationsDataIndex()];
+ callOperation(operationResolveBaseStrictPut, resultTag.gpr(), resultPayload.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex), putToBaseOperation(data.putToBaseOperationIndex));
jsValueResult(resultTag.gpr(), resultPayload.gpr(), m_compileIndex);
break;
}
@@ -4323,18 +4333,18 @@ void SpeculativeJIT::compile(Node& node)
GPRReg resultPayloadGPR = resultPayload.gpr();
ResolveGlobalData& data = m_jit.graph().m_resolveGlobalData[node.resolveGlobalDataIndex()];
- GlobalResolveInfo* resolveInfoAddress = &(m_jit.codeBlock()->globalResolveInfo(data.resolveInfoIndex));
+ ResolveOperation* resolveOperationAddress = &(m_jit.codeBlock()->resolveOperations(data.resolveOperationsIndex)->data()[data.resolvePropertyIndex]);
// Check Structure of global object
m_jit.move(JITCompiler::TrustedImmPtr(m_jit.globalObjectFor(node.codeOrigin)), globalObjectGPR);
- m_jit.move(JITCompiler::TrustedImmPtr(resolveInfoAddress), resolveInfoGPR);
- m_jit.loadPtr(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(GlobalResolveInfo, structure)), resultPayloadGPR);
+ m_jit.move(JITCompiler::TrustedImmPtr(resolveOperationAddress), resolveInfoGPR);
+ m_jit.loadPtr(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(ResolveOperation, m_structure)), resultPayloadGPR);
JITCompiler::Jump structuresNotMatch = m_jit.branchPtr(JITCompiler::NotEqual, resultPayloadGPR, JITCompiler::Address(globalObjectGPR, JSCell::structureOffset()));
// Fast case
m_jit.loadPtr(JITCompiler::Address(globalObjectGPR, JSObject::butterflyOffset()), resultPayloadGPR);
- m_jit.load32(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), resolveInfoGPR);
+ m_jit.load32(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(ResolveOperation, m_offset)), resolveInfoGPR);
#if DFG_ENABLE(JIT_ASSERT)
JITCompiler::Jump isOutOfLine = m_jit.branch32(JITCompiler::GreaterThanOrEqual, resolveInfoGPR, TrustedImm32(firstOutOfLineOffset));
m_jit.breakpoint();
@@ -4739,6 +4749,11 @@ void SpeculativeJIT::compile(Node& node)
compileNewFunctionExpression(node);
break;
+ case GarbageValue:
+ // We should never get to the point of code emission for a GarbageValue
+ CRASH();
+ break;
+
case ForceOSRExit: {
terminateSpeculativeExecution(InadequateCoverage, JSValueRegs(), NoNode);
break;
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index daca71da7..42ab40341 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -55,21 +55,21 @@ GPRReg SpeculativeJIT::fillInteger(NodeIndex nodeIndex, DataFormat& returnFormat
}
if (isNumberConstant(nodeIndex)) {
JSValue jsValue = jsNumber(valueOfNumberConstant(nodeIndex));
- m_jit.move(MacroAssembler::ImmPtr(JSValue::encode(jsValue)), gpr);
+ m_jit.move(MacroAssembler::Imm64(JSValue::encode(jsValue)), gpr);
} else {
ASSERT(isJSConstant(nodeIndex));
JSValue jsValue = valueOfJSConstant(nodeIndex);
- m_jit.move(MacroAssembler::TrustedImmPtr(JSValue::encode(jsValue)), gpr);
+ m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr);
}
} else if (info.spillFormat() == DataFormatInteger) {
m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
m_jit.load32(JITCompiler::payloadFor(virtualRegister), gpr);
// Tag it, since fillInteger() is used when we want a boxed integer.
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, gpr);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr);
} else {
ASSERT(info.spillFormat() == DataFormatJS || info.spillFormat() == DataFormatJSInteger);
m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), gpr);
+ m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
}
// Since we statically know that we're filling an integer, and values
@@ -133,8 +133,8 @@ FPRReg SpeculativeJIT::fillDouble(NodeIndex nodeIndex)
unlock(gpr);
} else if (isNumberConstant(nodeIndex)) {
FPRReg fpr = fprAllocate();
- m_jit.move(MacroAssembler::ImmPtr(reinterpret_cast<void*>(reinterpretDoubleToIntptr(valueOfNumberConstant(nodeIndex)))), gpr);
- m_jit.movePtrToDouble(gpr, fpr);
+ m_jit.move(MacroAssembler::Imm64(reinterpretDoubleToInt64(valueOfNumberConstant(nodeIndex))), gpr);
+ m_jit.move64ToDouble(gpr, fpr);
unlock(gpr);
m_fprs.retain(fpr, virtualRegister, SpillOrderDouble);
@@ -144,7 +144,7 @@ FPRReg SpeculativeJIT::fillDouble(NodeIndex nodeIndex)
// FIXME: should not be reachable?
ASSERT(isJSConstant(nodeIndex));
JSValue jsValue = valueOfJSConstant(nodeIndex);
- m_jit.move(MacroAssembler::TrustedImmPtr(JSValue::encode(jsValue)), gpr);
+ m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr);
m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
info.fillJSValue(*m_stream, gpr, DataFormatJS);
unlock(gpr);
@@ -175,7 +175,7 @@ FPRReg SpeculativeJIT::fillDouble(NodeIndex nodeIndex)
ASSERT(spillFormat & DataFormatJS);
m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), gpr);
+ m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
info.fillJSValue(*m_stream, gpr, spillFormat);
unlock(gpr);
break;
@@ -200,7 +200,7 @@ FPRReg SpeculativeJIT::fillDouble(NodeIndex nodeIndex)
FPRReg fpr = fprAllocate();
GPRReg tempGpr = allocate(); // FIXME: can we skip this allocation on the last use of the virtual register?
- JITCompiler::Jump isInteger = m_jit.branchPtr(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump isInteger = m_jit.branch64(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister);
m_jit.jitAssertIsJSDouble(jsValueGpr);
@@ -279,15 +279,15 @@ GPRReg SpeculativeJIT::fillJSValue(NodeIndex nodeIndex)
if (isInt32Constant(nodeIndex)) {
info.fillJSValue(*m_stream, gpr, DataFormatJSInteger);
JSValue jsValue = jsNumber(valueOfInt32Constant(nodeIndex));
- m_jit.move(MacroAssembler::ImmPtr(JSValue::encode(jsValue)), gpr);
+ m_jit.move(MacroAssembler::Imm64(JSValue::encode(jsValue)), gpr);
} else if (isNumberConstant(nodeIndex)) {
info.fillJSValue(*m_stream, gpr, DataFormatJSDouble);
JSValue jsValue(JSValue::EncodeAsDouble, valueOfNumberConstant(nodeIndex));
- m_jit.move(MacroAssembler::ImmPtr(JSValue::encode(jsValue)), gpr);
+ m_jit.move(MacroAssembler::Imm64(JSValue::encode(jsValue)), gpr);
} else {
ASSERT(isJSConstant(nodeIndex));
JSValue jsValue = valueOfJSConstant(nodeIndex);
- m_jit.move(MacroAssembler::TrustedImmPtr(JSValue::encode(jsValue)), gpr);
+ m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr);
info.fillJSValue(*m_stream, gpr, DataFormatJS);
}
@@ -297,13 +297,13 @@ GPRReg SpeculativeJIT::fillJSValue(NodeIndex nodeIndex)
m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
if (spillFormat == DataFormatInteger) {
m_jit.load32(JITCompiler::addressFor(virtualRegister), gpr);
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, gpr);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr);
spillFormat = DataFormatJSInteger;
} else {
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), gpr);
+ m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
if (spillFormat == DataFormatDouble) {
// Need to box the double, since we want a JSValue.
- m_jit.subPtr(GPRInfo::tagTypeNumberRegister, gpr);
+ m_jit.sub64(GPRInfo::tagTypeNumberRegister, gpr);
spillFormat = DataFormatJSDouble;
} else
ASSERT(spillFormat & DataFormatJS);
@@ -319,11 +319,11 @@ GPRReg SpeculativeJIT::fillJSValue(NodeIndex nodeIndex)
// If not, we'll zero extend in place, so mark on the info that this is now type DataFormatInteger, not DataFormatJSInteger.
if (m_gprs.isLocked(gpr)) {
GPRReg result = allocate();
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, gpr, result);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr, result);
return result;
}
m_gprs.lock(gpr);
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, gpr);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr);
info.fillJSValue(*m_stream, gpr, DataFormatJSInteger);
return gpr;
}
@@ -408,8 +408,8 @@ void SpeculativeJIT::nonSpeculativeValueToNumber(Node& node)
GPRReg gpr = result.gpr();
op1.use();
- JITCompiler::Jump isInteger = m_jit.branchPtr(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister);
- JITCompiler::Jump nonNumeric = m_jit.branchTestPtr(MacroAssembler::Zero, jsValueGpr, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump isInteger = m_jit.branch64(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump nonNumeric = m_jit.branchTest64(MacroAssembler::Zero, jsValueGpr, GPRInfo::tagTypeNumberRegister);
// First, if we get here we have a double encoded as a JSValue
m_jit.move(jsValueGpr, gpr);
@@ -417,7 +417,7 @@ void SpeculativeJIT::nonSpeculativeValueToNumber(Node& node)
// Finally, handle integers.
isInteger.link(&m_jit);
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, jsValueGpr, gpr);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, jsValueGpr, gpr);
hasUnboxedDouble.link(&m_jit);
addSlowPathGenerator(adoptPtr(new ValueToNumberSlowPathGenerator(nonNumeric, this, gpr, jsValueGpr)));
@@ -459,7 +459,7 @@ void SpeculativeJIT::nonSpeculativeValueToInt32(Node& node)
GPRReg resultGPR = result.gpr();
op1.use();
- JITCompiler::Jump isNotInteger = m_jit.branchPtr(MacroAssembler::Below, jsValueGpr, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump isNotInteger = m_jit.branch64(MacroAssembler::Below, jsValueGpr, GPRInfo::tagTypeNumberRegister);
m_jit.zeroExtend32ToPtr(jsValueGpr, resultGPR);
@@ -486,7 +486,7 @@ void SpeculativeJIT::nonSpeculativeUInt32ToNumber(Node& node)
positive.link(&m_jit);
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, op1.gpr(), result.gpr());
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, op1.gpr(), result.gpr());
done.link(&m_jit);
@@ -500,7 +500,7 @@ void SpeculativeJIT::cachedGetById(CodeOrigin codeOrigin, GPRReg baseGPR, GPRReg
JITCompiler::ConvertibleLoadLabel propertyStorageLoad =
m_jit.convertibleLoadPtr(JITCompiler::Address(baseGPR, JSObject::butterflyOffset()), resultGPR);
- JITCompiler::DataLabelCompact loadWithPatch = m_jit.loadPtrWithCompactAddressOffsetPatch(JITCompiler::Address(resultGPR, 0), resultGPR);
+ JITCompiler::DataLabelCompact loadWithPatch = m_jit.load64WithCompactAddressOffsetPatch(JITCompiler::Address(resultGPR, 0), resultGPR);
JITCompiler::Label doneLabel = m_jit.label();
@@ -536,7 +536,7 @@ void SpeculativeJIT::cachedPutById(CodeOrigin codeOrigin, GPRReg baseGPR, GPRReg
JITCompiler::ConvertibleLoadLabel propertyStorageLoad =
m_jit.convertibleLoadPtr(JITCompiler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR);
- JITCompiler::DataLabel32 storeWithPatch = m_jit.storePtrWithAddressOffsetPatch(valueGPR, JITCompiler::Address(scratchGPR, 0));
+ JITCompiler::DataLabel32 storeWithPatch = m_jit.store64WithAddressOffsetPatch(valueGPR, JITCompiler::Address(scratchGPR, 0));
JITCompiler::Label doneLabel = m_jit.label();
@@ -588,7 +588,7 @@ void SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull(Edge operand, bool inv
JITCompiler::Jump notCell;
if (!isKnownCell(operand.index()))
- notCell = m_jit.branchTestPtr(MacroAssembler::NonZero, argGPR, GPRInfo::tagMaskRegister);
+ notCell = m_jit.branchTest64(MacroAssembler::NonZero, argGPR, GPRInfo::tagMaskRegister);
JITCompiler::Jump notMasqueradesAsUndefined;
if (m_jit.graph().globalObjectFor(m_jit.graph()[operand].codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()) {
@@ -618,8 +618,8 @@ void SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull(Edge operand, bool inv
notCell.link(&m_jit);
m_jit.move(argGPR, resultGPR);
- m_jit.andPtr(JITCompiler::TrustedImm32(~TagBitUndefined), resultGPR);
- m_jit.comparePtr(invert ? JITCompiler::NotEqual : JITCompiler::Equal, resultGPR, JITCompiler::TrustedImm32(ValueNull), resultGPR);
+ m_jit.and64(JITCompiler::TrustedImm32(~TagBitUndefined), resultGPR);
+ m_jit.compare64(invert ? JITCompiler::NotEqual : JITCompiler::Equal, resultGPR, JITCompiler::TrustedImm32(ValueNull), resultGPR);
done.link(&m_jit);
}
@@ -652,7 +652,7 @@ void SpeculativeJIT::nonSpeculativePeepholeBranchNull(Edge operand, NodeIndex br
JITCompiler::Jump notCell;
if (!isKnownCell(operand.index()))
- notCell = m_jit.branchTestPtr(MacroAssembler::NonZero, argGPR, GPRInfo::tagMaskRegister);
+ notCell = m_jit.branchTest64(MacroAssembler::NonZero, argGPR, GPRInfo::tagMaskRegister);
if (m_jit.graph().globalObjectFor(m_jit.graph()[operand].codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()) {
m_jit.graph().globalObjectFor(m_jit.graph()[operand].codeOrigin)->masqueradesAsUndefinedWatchpoint()->add(speculationWatchpoint());
@@ -676,8 +676,8 @@ void SpeculativeJIT::nonSpeculativePeepholeBranchNull(Edge operand, NodeIndex br
notCell.link(&m_jit);
m_jit.move(argGPR, resultGPR);
- m_jit.andPtr(JITCompiler::TrustedImm32(~TagBitUndefined), resultGPR);
- branchPtr(invert ? JITCompiler::NotEqual : JITCompiler::Equal, resultGPR, JITCompiler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull)), taken);
+ m_jit.and64(JITCompiler::TrustedImm32(~TagBitUndefined), resultGPR);
+ branch64(invert ? JITCompiler::NotEqual : JITCompiler::Equal, resultGPR, JITCompiler::TrustedImm64(ValueNull), taken);
}
jump(notTaken);
@@ -750,9 +750,9 @@ void SpeculativeJIT::nonSpeculativePeepholeBranch(Node& node, NodeIndex branchNo
arg2.use();
if (!isKnownInteger(node.child1().index()))
- slowPath.append(m_jit.branchPtr(MacroAssembler::Below, arg1GPR, GPRInfo::tagTypeNumberRegister));
+ slowPath.append(m_jit.branch64(MacroAssembler::Below, arg1GPR, GPRInfo::tagTypeNumberRegister));
if (!isKnownInteger(node.child2().index()))
- slowPath.append(m_jit.branchPtr(MacroAssembler::Below, arg2GPR, GPRInfo::tagTypeNumberRegister));
+ slowPath.append(m_jit.branch64(MacroAssembler::Below, arg2GPR, GPRInfo::tagTypeNumberRegister));
branch32(cond, arg1GPR, arg2GPR, taken);
@@ -833,9 +833,9 @@ void SpeculativeJIT::nonSpeculativeNonPeepholeCompare(Node& node, MacroAssembler
arg2.use();
if (!isKnownInteger(node.child1().index()))
- slowPath.append(m_jit.branchPtr(MacroAssembler::Below, arg1GPR, GPRInfo::tagTypeNumberRegister));
+ slowPath.append(m_jit.branch64(MacroAssembler::Below, arg1GPR, GPRInfo::tagTypeNumberRegister));
if (!isKnownInteger(node.child2().index()))
- slowPath.append(m_jit.branchPtr(MacroAssembler::Below, arg2GPR, GPRInfo::tagTypeNumberRegister));
+ slowPath.append(m_jit.branch64(MacroAssembler::Below, arg2GPR, GPRInfo::tagTypeNumberRegister));
m_jit.compare32(cond, arg1GPR, arg2GPR, resultGPR);
m_jit.or32(TrustedImm32(ValueFalse), resultGPR);
@@ -879,7 +879,7 @@ void SpeculativeJIT::nonSpeculativePeepholeStrictEq(Node& node, NodeIndex branch
if (isKnownCell(node.child1().index()) && isKnownCell(node.child2().index())) {
// see if we get lucky: if the arguments are cells and they reference the same
// cell, then they must be strictly equal.
- branchPtr(JITCompiler::Equal, arg1GPR, arg2GPR, invert ? notTaken : taken);
+ branch64(JITCompiler::Equal, arg1GPR, arg2GPR, invert ? notTaken : taken);
silentSpillAllRegisters(resultGPR);
callOperation(operationCompareStrictEqCell, resultGPR, arg1GPR, arg2GPR);
@@ -887,22 +887,22 @@ void SpeculativeJIT::nonSpeculativePeepholeStrictEq(Node& node, NodeIndex branch
branchTest32(invert ? JITCompiler::Zero : JITCompiler::NonZero, resultGPR, taken);
} else {
- m_jit.orPtr(arg1GPR, arg2GPR, resultGPR);
+ m_jit.or64(arg1GPR, arg2GPR, resultGPR);
- JITCompiler::Jump twoCellsCase = m_jit.branchTestPtr(JITCompiler::Zero, resultGPR, GPRInfo::tagMaskRegister);
+ JITCompiler::Jump twoCellsCase = m_jit.branchTest64(JITCompiler::Zero, resultGPR, GPRInfo::tagMaskRegister);
- JITCompiler::Jump leftOK = m_jit.branchPtr(JITCompiler::AboveOrEqual, arg1GPR, GPRInfo::tagTypeNumberRegister);
- JITCompiler::Jump leftDouble = m_jit.branchTestPtr(JITCompiler::NonZero, arg1GPR, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump leftOK = m_jit.branch64(JITCompiler::AboveOrEqual, arg1GPR, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump leftDouble = m_jit.branchTest64(JITCompiler::NonZero, arg1GPR, GPRInfo::tagTypeNumberRegister);
leftOK.link(&m_jit);
- JITCompiler::Jump rightOK = m_jit.branchPtr(JITCompiler::AboveOrEqual, arg2GPR, GPRInfo::tagTypeNumberRegister);
- JITCompiler::Jump rightDouble = m_jit.branchTestPtr(JITCompiler::NonZero, arg2GPR, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump rightOK = m_jit.branch64(JITCompiler::AboveOrEqual, arg2GPR, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump rightDouble = m_jit.branchTest64(JITCompiler::NonZero, arg2GPR, GPRInfo::tagTypeNumberRegister);
rightOK.link(&m_jit);
- branchPtr(invert ? JITCompiler::NotEqual : JITCompiler::Equal, arg1GPR, arg2GPR, taken);
+ branch64(invert ? JITCompiler::NotEqual : JITCompiler::Equal, arg1GPR, arg2GPR, taken);
jump(notTaken, ForceJump);
twoCellsCase.link(&m_jit);
- branchPtr(JITCompiler::Equal, arg1GPR, arg2GPR, invert ? notTaken : taken);
+ branch64(JITCompiler::Equal, arg1GPR, arg2GPR, invert ? notTaken : taken);
leftDouble.link(&m_jit);
rightDouble.link(&m_jit);
@@ -934,9 +934,9 @@ void SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq(Node& node, bool invert)
// see if we get lucky: if the arguments are cells and they reference the same
// cell, then they must be strictly equal.
// FIXME: this should flush registers instead of silent spill/fill.
- JITCompiler::Jump notEqualCase = m_jit.branchPtr(JITCompiler::NotEqual, arg1GPR, arg2GPR);
+ JITCompiler::Jump notEqualCase = m_jit.branch64(JITCompiler::NotEqual, arg1GPR, arg2GPR);
- m_jit.move(JITCompiler::TrustedImmPtr(JSValue::encode(jsBoolean(!invert))), resultGPR);
+ m_jit.move(JITCompiler::TrustedImm64(JSValue::encode(jsBoolean(!invert))), resultGPR);
JITCompiler::Jump done = m_jit.jump();
@@ -946,33 +946,33 @@ void SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq(Node& node, bool invert)
callOperation(operationCompareStrictEqCell, resultGPR, arg1GPR, arg2GPR);
silentFillAllRegisters(resultGPR);
- m_jit.andPtr(JITCompiler::TrustedImm32(1), resultGPR);
+ m_jit.and64(JITCompiler::TrustedImm32(1), resultGPR);
m_jit.or32(JITCompiler::TrustedImm32(ValueFalse), resultGPR);
done.link(&m_jit);
} else {
- m_jit.orPtr(arg1GPR, arg2GPR, resultGPR);
+ m_jit.or64(arg1GPR, arg2GPR, resultGPR);
JITCompiler::JumpList slowPathCases;
- JITCompiler::Jump twoCellsCase = m_jit.branchTestPtr(JITCompiler::Zero, resultGPR, GPRInfo::tagMaskRegister);
+ JITCompiler::Jump twoCellsCase = m_jit.branchTest64(JITCompiler::Zero, resultGPR, GPRInfo::tagMaskRegister);
- JITCompiler::Jump leftOK = m_jit.branchPtr(JITCompiler::AboveOrEqual, arg1GPR, GPRInfo::tagTypeNumberRegister);
- slowPathCases.append(m_jit.branchTestPtr(JITCompiler::NonZero, arg1GPR, GPRInfo::tagTypeNumberRegister));
+ JITCompiler::Jump leftOK = m_jit.branch64(JITCompiler::AboveOrEqual, arg1GPR, GPRInfo::tagTypeNumberRegister);
+ slowPathCases.append(m_jit.branchTest64(JITCompiler::NonZero, arg1GPR, GPRInfo::tagTypeNumberRegister));
leftOK.link(&m_jit);
- JITCompiler::Jump rightOK = m_jit.branchPtr(JITCompiler::AboveOrEqual, arg2GPR, GPRInfo::tagTypeNumberRegister);
- slowPathCases.append(m_jit.branchTestPtr(JITCompiler::NonZero, arg2GPR, GPRInfo::tagTypeNumberRegister));
+ JITCompiler::Jump rightOK = m_jit.branch64(JITCompiler::AboveOrEqual, arg2GPR, GPRInfo::tagTypeNumberRegister);
+ slowPathCases.append(m_jit.branchTest64(JITCompiler::NonZero, arg2GPR, GPRInfo::tagTypeNumberRegister));
rightOK.link(&m_jit);
- m_jit.comparePtr(invert ? JITCompiler::NotEqual : JITCompiler::Equal, arg1GPR, arg2GPR, resultGPR);
+ m_jit.compare64(invert ? JITCompiler::NotEqual : JITCompiler::Equal, arg1GPR, arg2GPR, resultGPR);
m_jit.or32(JITCompiler::TrustedImm32(ValueFalse), resultGPR);
JITCompiler::Jump done = m_jit.jump();
twoCellsCase.link(&m_jit);
- slowPathCases.append(m_jit.branchPtr(JITCompiler::NotEqual, arg1GPR, arg2GPR));
+ slowPathCases.append(m_jit.branch64(JITCompiler::NotEqual, arg1GPR, arg2GPR));
- m_jit.move(JITCompiler::TrustedImmPtr(JSValue::encode(jsBoolean(!invert))), resultGPR);
+ m_jit.move(JITCompiler::TrustedImm64(JSValue::encode(jsBoolean(!invert))), resultGPR);
addSlowPathGenerator(
adoptPtr(
@@ -1007,8 +1007,8 @@ void SpeculativeJIT::emitCall(Node& node)
int numPassedArgs = node.numChildren() - 1;
m_jit.store32(MacroAssembler::TrustedImm32(numPassedArgs + dummyThisArgument), callFramePayloadSlot(JSStack::ArgumentCount));
- m_jit.storePtr(GPRInfo::callFrameRegister, callFrameSlot(JSStack::CallerFrame));
- m_jit.storePtr(calleeGPR, callFrameSlot(JSStack::Callee));
+ m_jit.store64(GPRInfo::callFrameRegister, callFrameSlot(JSStack::CallerFrame));
+ m_jit.store64(calleeGPR, callFrameSlot(JSStack::Callee));
for (int i = 0; i < numPassedArgs; i++) {
Edge argEdge = m_jit.graph().m_varArgChildren[node.firstChild() + 1 + i];
@@ -1016,7 +1016,7 @@ void SpeculativeJIT::emitCall(Node& node)
GPRReg argGPR = arg.gpr();
use(argEdge);
- m_jit.storePtr(argGPR, argumentSlot(i + dummyThisArgument));
+ m_jit.store64(argGPR, argumentSlot(i + dummyThisArgument));
}
flushRegisters();
@@ -1025,16 +1025,17 @@ void SpeculativeJIT::emitCall(Node& node)
GPRReg resultGPR = result.gpr();
JITCompiler::DataLabelPtr targetToCheck;
- JITCompiler::Jump slowPath;
+ JITCompiler::JumpList slowPath;
CallBeginToken token;
m_jit.beginCall(node.codeOrigin, token);
m_jit.addPtr(TrustedImm32(m_jit.codeBlock()->m_numCalleeRegisters * sizeof(Register)), GPRInfo::callFrameRegister);
- slowPath = m_jit.branchPtrWithPatch(MacroAssembler::NotEqual, calleeGPR, targetToCheck, MacroAssembler::TrustedImmPtr(JSValue::encode(JSValue())));
+ slowPath.append(m_jit.branchPtrWithPatch(MacroAssembler::NotEqual, calleeGPR, targetToCheck, MacroAssembler::TrustedImmPtr(0)));
+
m_jit.loadPtr(MacroAssembler::Address(calleeGPR, OBJECT_OFFSETOF(JSFunction, m_scope)), resultGPR);
- m_jit.storePtr(resultGPR, MacroAssembler::Address(GPRInfo::callFrameRegister, static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::ScopeChain));
+ m_jit.store64(resultGPR, MacroAssembler::Address(GPRInfo::callFrameRegister, static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::ScopeChain));
CodeOrigin codeOrigin = at(m_compileIndex).codeOrigin;
JITCompiler::Call fastCall = m_jit.nearCall();
@@ -1104,14 +1105,14 @@ GPRReg SpeculativeJIT::fillSpeculateIntInternal(NodeIndex nodeIndex, DataFormat&
}
if (spillFormat == DataFormatInteger) {
m_jit.load32(JITCompiler::addressFor(virtualRegister), gpr);
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, gpr);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr);
} else
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), gpr);
+ m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
info.fillJSValue(*m_stream, gpr, DataFormatJSInteger);
returnFormat = DataFormatJSInteger;
return gpr;
}
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), gpr);
+ m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
// Fill as JSValue, and fall through.
info.fillJSValue(*m_stream, gpr, DataFormatJSInteger);
@@ -1123,7 +1124,7 @@ GPRReg SpeculativeJIT::fillSpeculateIntInternal(NodeIndex nodeIndex, DataFormat&
GPRReg gpr = info.gpr();
m_gprs.lock(gpr);
if (!isInt32Speculation(type))
- speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchPtr(MacroAssembler::Below, gpr, GPRInfo::tagTypeNumberRegister));
+ speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branch64(MacroAssembler::Below, gpr, GPRInfo::tagTypeNumberRegister));
info.fillJSValue(*m_stream, gpr, DataFormatJSInteger);
// If !strict we're done, return.
if (!strict) {
@@ -1223,8 +1224,8 @@ FPRReg SpeculativeJIT::fillSpeculateDouble(NodeIndex nodeIndex)
if (isInt32Constant(nodeIndex)) {
FPRReg fpr = fprAllocate();
- m_jit.move(MacroAssembler::ImmPtr(reinterpret_cast<void*>(reinterpretDoubleToIntptr(static_cast<double>(valueOfInt32Constant(nodeIndex))))), gpr);
- m_jit.movePtrToDouble(gpr, fpr);
+ m_jit.move(MacroAssembler::Imm64(reinterpretDoubleToInt64(static_cast<double>(valueOfInt32Constant(nodeIndex)))), gpr);
+ m_jit.move64ToDouble(gpr, fpr);
unlock(gpr);
m_fprs.retain(fpr, virtualRegister, SpillOrderDouble);
@@ -1233,8 +1234,8 @@ FPRReg SpeculativeJIT::fillSpeculateDouble(NodeIndex nodeIndex)
}
if (isNumberConstant(nodeIndex)) {
FPRReg fpr = fprAllocate();
- m_jit.move(MacroAssembler::ImmPtr(reinterpret_cast<void*>(reinterpretDoubleToIntptr(valueOfNumberConstant(nodeIndex)))), gpr);
- m_jit.movePtrToDouble(gpr, fpr);
+ m_jit.move(MacroAssembler::Imm64(reinterpretDoubleToInt64(valueOfNumberConstant(nodeIndex))), gpr);
+ m_jit.move64ToDouble(gpr, fpr);
unlock(gpr);
m_fprs.retain(fpr, virtualRegister, SpillOrderDouble);
@@ -1270,7 +1271,7 @@ FPRReg SpeculativeJIT::fillSpeculateDouble(NodeIndex nodeIndex)
ASSERT(spillFormat & DataFormatJS);
m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), gpr);
+ m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
info.fillJSValue(*m_stream, gpr, spillFormat);
unlock(gpr);
break;
@@ -1295,10 +1296,10 @@ FPRReg SpeculativeJIT::fillSpeculateDouble(NodeIndex nodeIndex)
FPRReg fpr = fprAllocate();
GPRReg tempGpr = allocate();
- JITCompiler::Jump isInteger = m_jit.branchPtr(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump isInteger = m_jit.branch64(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister);
if (!isNumberSpeculation(type))
- speculationCheck(BadType, JSValueRegs(jsValueGpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::Zero, jsValueGpr, GPRInfo::tagTypeNumberRegister));
+ speculationCheck(BadType, JSValueRegs(jsValueGpr), nodeIndex, m_jit.branchTest64(MacroAssembler::Zero, jsValueGpr, GPRInfo::tagTypeNumberRegister));
// First, if we get here we have a double encoded as a JSValue
m_jit.move(jsValueGpr, tempGpr);
@@ -1384,7 +1385,7 @@ GPRReg SpeculativeJIT::fillSpeculateCell(NodeIndex nodeIndex, bool isForwardSpec
JSValue jsValue = valueOfJSConstant(nodeIndex);
if (jsValue.isCell()) {
m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
- m_jit.move(MacroAssembler::TrustedImmPtr(jsValue.asCell()), gpr);
+ m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr);
info.fillJSValue(*m_stream, gpr, DataFormatJSCell);
return gpr;
}
@@ -1393,11 +1394,11 @@ GPRReg SpeculativeJIT::fillSpeculateCell(NodeIndex nodeIndex, bool isForwardSpec
}
ASSERT(info.spillFormat() & DataFormatJS);
m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), gpr);
+ m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
info.fillJSValue(*m_stream, gpr, DataFormatJS);
if (!isCellSpeculation(type))
- speculationCheckWithConditionalDirection(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister), isForwardSpeculation);
+ speculationCheckWithConditionalDirection(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTest64(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister), isForwardSpeculation);
info.fillJSValue(*m_stream, gpr, DataFormatJSCell);
return gpr;
}
@@ -1413,7 +1414,7 @@ GPRReg SpeculativeJIT::fillSpeculateCell(NodeIndex nodeIndex, bool isForwardSpec
GPRReg gpr = info.gpr();
m_gprs.lock(gpr);
if (!isCellSpeculation(type))
- speculationCheckWithConditionalDirection(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister), isForwardSpeculation);
+ speculationCheckWithConditionalDirection(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTest64(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister), isForwardSpeculation);
info.fillJSValue(*m_stream, gpr, DataFormatJSCell);
return gpr;
}
@@ -1460,7 +1461,7 @@ GPRReg SpeculativeJIT::fillSpeculateBoolean(NodeIndex nodeIndex)
JSValue jsValue = valueOfJSConstant(nodeIndex);
if (jsValue.isBoolean()) {
m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
- m_jit.move(MacroAssembler::TrustedImmPtr(JSValue::encode(jsValue)), gpr);
+ m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr);
info.fillJSValue(*m_stream, gpr, DataFormatJSBoolean);
return gpr;
}
@@ -1469,13 +1470,13 @@ GPRReg SpeculativeJIT::fillSpeculateBoolean(NodeIndex nodeIndex)
}
ASSERT(info.spillFormat() & DataFormatJS);
m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
- m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), gpr);
+ m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
info.fillJSValue(*m_stream, gpr, DataFormatJS);
if (!isBooleanSpeculation(type)) {
- m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
- speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg));
- m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
+ m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
+ speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTest64(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg));
+ m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
}
info.fillJSValue(*m_stream, gpr, DataFormatJSBoolean);
return gpr;
@@ -1492,9 +1493,9 @@ GPRReg SpeculativeJIT::fillSpeculateBoolean(NodeIndex nodeIndex)
GPRReg gpr = info.gpr();
m_gprs.lock(gpr);
if (!isBooleanSpeculation(type)) {
- m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
- speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg));
- m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
+ m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
+ speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTest64(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg));
+ m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
}
info.fillJSValue(*m_stream, gpr, DataFormatJSBoolean);
return gpr;
@@ -1521,9 +1522,9 @@ GPRReg SpeculativeJIT::fillSpeculateBoolean(NodeIndex nodeIndex)
JITCompiler::Jump SpeculativeJIT::convertToDouble(GPRReg value, FPRReg result, GPRReg tmp)
{
- JITCompiler::Jump isInteger = m_jit.branchPtr(MacroAssembler::AboveOrEqual, value, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump isInteger = m_jit.branch64(MacroAssembler::AboveOrEqual, value, GPRInfo::tagTypeNumberRegister);
- JITCompiler::Jump notNumber = m_jit.branchTestPtr(MacroAssembler::Zero, value, GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump notNumber = m_jit.branchTest64(MacroAssembler::Zero, value, GPRInfo::tagTypeNumberRegister);
m_jit.move(value, tmp);
unboxDouble(tmp, result);
@@ -1590,7 +1591,7 @@ void SpeculativeJIT::compileObjectEquality(Node& node)
MacroAssembler::TrustedImm32(MasqueradesAsUndefined)));
}
- MacroAssembler::Jump falseCase = m_jit.branchPtr(MacroAssembler::NotEqual, op1GPR, op2GPR);
+ MacroAssembler::Jump falseCase = m_jit.branch64(MacroAssembler::NotEqual, op1GPR, op2GPR);
m_jit.move(TrustedImm32(ValueTrue), resultGPR);
MacroAssembler::Jump done = m_jit.jump();
falseCase.link(&m_jit);
@@ -1638,7 +1639,7 @@ void SpeculativeJIT::compileObjectToObjectOrOtherEquality(Edge leftChild, Edge r
// It seems that most of the time when programs do a == b where b may be either null/undefined
// or an object, b is usually an object. Balance the branches to make that case fast.
MacroAssembler::Jump rightNotCell =
- m_jit.branchTestPtr(MacroAssembler::NonZero, op2GPR, GPRInfo::tagMaskRegister);
+ m_jit.branchTest64(MacroAssembler::NonZero, op2GPR, GPRInfo::tagMaskRegister);
// We know that within this branch, rightChild must be a cell.
if (m_jit.graph().globalObjectFor(leftNode.codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()) {
@@ -1668,7 +1669,7 @@ void SpeculativeJIT::compileObjectToObjectOrOtherEquality(Edge leftChild, Edge r
// At this point we know that we can perform a straight-forward equality comparison on pointer
// values because both left and right are pointers to objects that have no special equality
// protocols.
- MacroAssembler::Jump falseCase = m_jit.branchPtr(MacroAssembler::NotEqual, op1GPR, op2GPR);
+ MacroAssembler::Jump falseCase = m_jit.branch64(MacroAssembler::NotEqual, op1GPR, op2GPR);
MacroAssembler::Jump trueCase = m_jit.jump();
rightNotCell.link(&m_jit);
@@ -1677,13 +1678,13 @@ void SpeculativeJIT::compileObjectToObjectOrOtherEquality(Edge leftChild, Edge r
// prove that it is either null or undefined.
if (!isOtherOrEmptySpeculation(m_state.forNode(rightChild).m_type & ~SpecCell)) {
m_jit.move(op2GPR, resultGPR);
- m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR);
+ m_jit.and64(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR);
speculationCheck(
BadType, JSValueRegs(op2GPR), rightChild.index(),
- m_jit.branchPtr(
+ m_jit.branch64(
MacroAssembler::NotEqual, resultGPR,
- MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull))));
+ MacroAssembler::TrustedImm64(ValueNull)));
}
falseCase.link(&m_jit);
@@ -1737,7 +1738,7 @@ void SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality(Edge leftChild
// It seems that most of the time when programs do a == b where b may be either null/undefined
// or an object, b is usually an object. Balance the branches to make that case fast.
MacroAssembler::Jump rightNotCell =
- m_jit.branchTestPtr(MacroAssembler::NonZero, op2GPR, GPRInfo::tagMaskRegister);
+ m_jit.branchTest64(MacroAssembler::NonZero, op2GPR, GPRInfo::tagMaskRegister);
// We know that within this branch, rightChild must be a cell.
if (m_jit.graph().globalObjectFor(branchNode.codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()) {
@@ -1767,7 +1768,7 @@ void SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality(Edge leftChild
// At this point we know that we can perform a straight-forward equality comparison on pointer
// values because both left and right are pointers to objects that have no special equality
// protocols.
- branchPtr(MacroAssembler::Equal, op1GPR, op2GPR, taken);
+ branch64(MacroAssembler::Equal, op1GPR, op2GPR, taken);
// We know that within this branch, rightChild must not be a cell. Check if that is enough to
// prove that it is either null or undefined.
@@ -1778,13 +1779,13 @@ void SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality(Edge leftChild
rightNotCell.link(&m_jit);
m_jit.move(op2GPR, resultGPR);
- m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR);
+ m_jit.and64(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR);
speculationCheck(
BadType, JSValueRegs(op2GPR), rightChild.index(),
- m_jit.branchPtr(
+ m_jit.branch64(
MacroAssembler::NotEqual, resultGPR,
- MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull))));
+ MacroAssembler::TrustedImm64(ValueNull)));
}
jump(notTaken);
@@ -1811,7 +1812,7 @@ void SpeculativeJIT::compileDoubleCompare(Node& node, MacroAssembler::DoubleCond
m_jit.move(TrustedImm32(ValueTrue), result.gpr());
MacroAssembler::Jump trueCase = m_jit.branchDouble(condition, op1.fpr(), op2.fpr());
- m_jit.xorPtr(TrustedImm32(true), result.gpr());
+ m_jit.xor64(TrustedImm32(true), result.gpr());
trueCase.link(&m_jit);
jsValueResult(result.gpr(), m_compileIndex, DataFormatJSBoolean);
@@ -1843,7 +1844,7 @@ void SpeculativeJIT::compileNonStringCellOrOtherLogicalNot(Edge nodeUse, bool ne
GPRReg valueGPR = value.gpr();
GPRReg resultGPR = result.gpr();
- MacroAssembler::Jump notCell = m_jit.branchTestPtr(MacroAssembler::NonZero, valueGPR, GPRInfo::tagMaskRegister);
+ MacroAssembler::Jump notCell = m_jit.branchTest64(MacroAssembler::NonZero, valueGPR, GPRInfo::tagMaskRegister);
if (m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()) {
m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)->masqueradesAsUndefinedWatchpoint()->add(speculationWatchpoint());
@@ -1889,12 +1890,12 @@ void SpeculativeJIT::compileNonStringCellOrOtherLogicalNot(Edge nodeUse, bool ne
if (needSpeculationCheck) {
m_jit.move(valueGPR, resultGPR);
- m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR);
+ m_jit.and64(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR);
speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse,
- m_jit.branchPtr(
+ m_jit.branch64(
MacroAssembler::NotEqual,
resultGPR,
- MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull))));
+ MacroAssembler::TrustedImm64(ValueNull)));
}
m_jit.move(TrustedImm32(ValueTrue), resultGPR);
@@ -1937,7 +1938,7 @@ void SpeculativeJIT::compileLogicalNot(Node& node)
GPRTemporary result(this, value);
m_jit.move(value.gpr(), result.gpr());
- m_jit.xorPtr(TrustedImm32(true), result.gpr());
+ m_jit.xor64(TrustedImm32(true), result.gpr());
jsValueResult(result.gpr(), m_compileIndex, DataFormatJSBoolean);
return;
@@ -1947,9 +1948,9 @@ void SpeculativeJIT::compileLogicalNot(Node& node)
GPRTemporary result(this); // FIXME: We could reuse, but on speculation fail would need recovery to restore tag (akin to add).
m_jit.move(value.gpr(), result.gpr());
- m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), result.gpr());
- speculationCheck(BadType, JSValueRegs(value.gpr()), node.child1(), m_jit.branchTestPtr(JITCompiler::NonZero, result.gpr(), TrustedImm32(static_cast<int32_t>(~1))));
- m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueTrue)), result.gpr());
+ m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), result.gpr());
+ speculationCheck(BadType, JSValueRegs(value.gpr()), node.child1(), m_jit.branchTest64(JITCompiler::NonZero, result.gpr(), TrustedImm32(static_cast<int32_t>(~1))));
+ m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueTrue)), result.gpr());
// If we add a DataFormatBool, we should use it here.
jsValueResult(result.gpr(), m_compileIndex, DataFormatJSBoolean);
@@ -1965,13 +1966,13 @@ void SpeculativeJIT::compileLogicalNot(Node& node)
arg1.use();
m_jit.move(arg1GPR, resultGPR);
- m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), resultGPR);
- JITCompiler::Jump slowCase = m_jit.branchTestPtr(JITCompiler::NonZero, resultGPR, TrustedImm32(static_cast<int32_t>(~1)));
+ m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), resultGPR);
+ JITCompiler::Jump slowCase = m_jit.branchTest64(JITCompiler::NonZero, resultGPR, TrustedImm32(static_cast<int32_t>(~1)));
addSlowPathGenerator(
slowPathCall(slowCase, this, dfgConvertJSValueToBoolean, resultGPR, arg1GPR));
- m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueTrue)), resultGPR);
+ m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueTrue)), resultGPR);
jsValueResult(resultGPR, m_compileIndex, DataFormatJSBoolean, UseChildrenCalledExplicitly);
}
@@ -1982,7 +1983,7 @@ void SpeculativeJIT::emitNonStringCellOrOtherBranch(Edge nodeUse, BlockIndex tak
GPRReg valueGPR = value.gpr();
GPRReg scratchGPR = scratch.gpr();
- MacroAssembler::Jump notCell = m_jit.branchTestPtr(MacroAssembler::NonZero, valueGPR, GPRInfo::tagMaskRegister);
+ MacroAssembler::Jump notCell = m_jit.branchTest64(MacroAssembler::NonZero, valueGPR, GPRInfo::tagMaskRegister);
if (m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()) {
m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)->masqueradesAsUndefinedWatchpoint()->add(speculationWatchpoint());
@@ -2020,8 +2021,8 @@ void SpeculativeJIT::emitNonStringCellOrOtherBranch(Edge nodeUse, BlockIndex tak
if (needSpeculationCheck) {
m_jit.move(valueGPR, scratchGPR);
- m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), scratchGPR);
- speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse.index(), m_jit.branchPtr(MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull))));
+ m_jit.and64(MacroAssembler::TrustedImm32(~TagBitUndefined), scratchGPR);
+ speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse.index(), m_jit.branch64(MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImm64(ValueNull)));
}
jump(notTaken);
@@ -2078,8 +2079,8 @@ void SpeculativeJIT::emitBranch(Node& node)
branchTest32(condition, valueGPR, TrustedImm32(true), taken);
jump(notTaken);
} else {
- branchPtr(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImmPtr(JSValue::encode(jsBoolean(false))), notTaken);
- branchPtr(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImmPtr(JSValue::encode(jsBoolean(true))), taken);
+ branch64(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImm64(JSValue::encode(jsBoolean(false))), notTaken);
+ branch64(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImm64(JSValue::encode(jsBoolean(true))), taken);
speculationCheck(BadType, JSValueRegs(valueGPR), node.child1(), m_jit.jump());
}
@@ -2088,12 +2089,12 @@ void SpeculativeJIT::emitBranch(Node& node)
GPRTemporary result(this);
GPRReg resultGPR = result.gpr();
- branchPtr(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImmPtr(JSValue::encode(jsNumber(0))), notTaken);
- branchPtr(MacroAssembler::AboveOrEqual, valueGPR, GPRInfo::tagTypeNumberRegister, taken);
+ branch64(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImm64(JSValue::encode(jsNumber(0))), notTaken);
+ branch64(MacroAssembler::AboveOrEqual, valueGPR, GPRInfo::tagTypeNumberRegister, taken);
if (!predictBoolean) {
- branchPtr(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImmPtr(JSValue::encode(jsBoolean(false))), notTaken);
- branchPtr(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImmPtr(JSValue::encode(jsBoolean(true))), taken);
+ branch64(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImm64(JSValue::encode(jsBoolean(false))), notTaken);
+ branch64(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImm64(JSValue::encode(jsBoolean(true))), taken);
}
value.use();
@@ -2115,8 +2116,8 @@ MacroAssembler::JumpList SpeculativeJIT::compileContiguousGetByVal(Node&, GPRReg
MacroAssembler::JumpList slowCases;
slowCases.append(m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, Butterfly::offsetOfPublicLength())));
- m_jit.loadPtr(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr), resultReg);
- slowCases.append(m_jit.branchTestPtr(MacroAssembler::Zero, resultReg));
+ m_jit.load64(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight), resultReg);
+ slowCases.append(m_jit.branchTest64(MacroAssembler::Zero, resultReg));
return slowCases;
}
@@ -2125,8 +2126,8 @@ MacroAssembler::JumpList SpeculativeJIT::compileArrayStorageGetByVal(Node&, GPRR
{
MacroAssembler::Jump outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::vectorLengthOffset()));
- m_jit.loadPtr(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), resultReg);
- MacroAssembler::Jump hole = m_jit.branchTestPtr(MacroAssembler::Zero, resultReg);
+ m_jit.load64(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), resultReg);
+ MacroAssembler::Jump hole = m_jit.branchTest64(MacroAssembler::Zero, resultReg);
MacroAssembler::JumpList slowCases;
slowCases.append(outOfBounds);
@@ -2158,7 +2159,7 @@ MacroAssembler::JumpList SpeculativeJIT::compileContiguousPutByVal(Node& node, G
inBounds.link(&m_jit);
}
- m_jit.storePtr(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr));
+ m_jit.store64(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight));
if (isInBoundsAccess(arrayMode))
return MacroAssembler::JumpList();
@@ -2184,9 +2185,9 @@ MacroAssembler::JumpList SpeculativeJIT::compileArrayStoragePutByVal(Node& node,
// profiling.
speculationCheck(
Uncountable, JSValueRegs(), NoNode,
- m_jit.branchTestPtr(MacroAssembler::Zero, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]))));
+ m_jit.branchTest64(MacroAssembler::Zero, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]))));
} else {
- MacroAssembler::Jump notHoleValue = m_jit.branchTestPtr(MacroAssembler::NonZero, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
+ MacroAssembler::Jump notHoleValue = m_jit.branchTest64(MacroAssembler::NonZero, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
if (isSlowPutAccess(arrayMode)) {
// This is sort of strange. If we wanted to optimize this code path, we would invert
// the above branch. But it's simply not worth it since this only happens if we're
@@ -2206,7 +2207,7 @@ MacroAssembler::JumpList SpeculativeJIT::compileArrayStoragePutByVal(Node& node,
}
// Store the value to the array.
- m_jit.storePtr(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
+ m_jit.store64(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
return slowCases;
}
@@ -2270,7 +2271,7 @@ void SpeculativeJIT::compile(Node& node)
}
GPRTemporary result(this);
- m_jit.loadPtr(JITCompiler::addressFor(node.local()), result.gpr());
+ m_jit.load64(JITCompiler::addressFor(node.local()), result.gpr());
// Like jsValueResult, but don't useChildren - our children are phi nodes,
// and don't represent values within this dataflow with virtual registers.
@@ -2294,7 +2295,7 @@ void SpeculativeJIT::compile(Node& node)
case GetLocalUnlinked: {
GPRTemporary result(this);
- m_jit.loadPtr(JITCompiler::addressFor(node.unlinkedLocal()), result.gpr());
+ m_jit.load64(JITCompiler::addressFor(node.unlinkedLocal()), result.gpr());
jsValueResult(result.gpr(), m_compileIndex);
break;
@@ -2360,14 +2361,14 @@ void SpeculativeJIT::compile(Node& node)
if (isCellSpeculation(predictedType)) {
SpeculateCellOperand cell(this, node.child1());
GPRReg cellGPR = cell.gpr();
- m_jit.storePtr(cellGPR, JITCompiler::addressFor(node.local()));
+ m_jit.store64(cellGPR, JITCompiler::addressFor(node.local()));
noResult(m_compileIndex);
recordSetLocal(node.local(), ValueSource(CellInJSStack));
break;
}
if (isBooleanSpeculation(predictedType)) {
SpeculateBooleanOperand boolean(this, node.child1());
- m_jit.storePtr(boolean.gpr(), JITCompiler::addressFor(node.local()));
+ m_jit.store64(boolean.gpr(), JITCompiler::addressFor(node.local()));
noResult(m_compileIndex);
recordSetLocal(node.local(), ValueSource(BooleanInJSStack));
break;
@@ -2375,7 +2376,7 @@ void SpeculativeJIT::compile(Node& node)
}
JSValueOperand value(this, node.child1());
- m_jit.storePtr(value.gpr(), JITCompiler::addressFor(node.local()));
+ m_jit.store64(value.gpr(), JITCompiler::addressFor(node.local()));
noResult(m_compileIndex);
recordSetLocal(node.local(), ValueSource(ValueInJSStack));
@@ -2475,10 +2476,10 @@ void SpeculativeJIT::compile(Node& node)
case CheckNumber: {
if (!isNumberSpeculation(m_state.forNode(node.child1()).m_type)) {
JSValueOperand op1(this, node.child1());
- JITCompiler::Jump isInteger = m_jit.branchPtr(MacroAssembler::AboveOrEqual, op1.gpr(), GPRInfo::tagTypeNumberRegister);
+ JITCompiler::Jump isInteger = m_jit.branch64(MacroAssembler::AboveOrEqual, op1.gpr(), GPRInfo::tagTypeNumberRegister);
speculationCheck(
BadType, JSValueRegs(op1.gpr()), node.child1().index(),
- m_jit.branchTestPtr(MacroAssembler::Zero, op1.gpr(), GPRInfo::tagTypeNumberRegister));
+ m_jit.branchTest64(MacroAssembler::Zero, op1.gpr(), GPRInfo::tagTypeNumberRegister));
isInteger.link(&m_jit);
}
noResult(m_compileIndex);
@@ -2710,8 +2711,8 @@ void SpeculativeJIT::compile(Node& node)
speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, Butterfly::offsetOfPublicLength())));
GPRTemporary result(this);
- m_jit.loadPtr(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr), result.gpr());
- speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::Zero, result.gpr()));
+ m_jit.load64(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight), result.gpr());
+ speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branchTest64(MacroAssembler::Zero, result.gpr()));
jsValueResult(result.gpr(), m_compileIndex);
break;
}
@@ -2755,8 +2756,8 @@ void SpeculativeJIT::compile(Node& node)
speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::vectorLengthOffset())));
GPRTemporary result(this);
- m_jit.loadPtr(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), result.gpr());
- speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::Zero, result.gpr()));
+ m_jit.load64(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), result.gpr());
+ speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branchTest64(MacroAssembler::Zero, result.gpr()));
jsValueResult(result.gpr(), m_compileIndex);
break;
@@ -2900,7 +2901,7 @@ void SpeculativeJIT::compile(Node& node)
// Store the value to the array.
GPRReg propertyReg = property.gpr();
GPRReg valueReg = value.gpr();
- m_jit.storePtr(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr));
+ m_jit.store64(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight));
noResult(m_compileIndex);
break;
@@ -2951,7 +2952,7 @@ void SpeculativeJIT::compile(Node& node)
// Store the value to the array.
GPRReg propertyReg = property.gpr();
GPRReg valueReg = value.gpr();
- m_jit.storePtr(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
+ m_jit.store64(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
noResult(m_compileIndex);
break;
@@ -3013,7 +3014,7 @@ void SpeculativeJIT::compile(Node& node)
MacroAssembler::Address(baseReg, OBJECT_OFFSETOF(Arguments, m_registers)),
scratchReg);
- m_jit.storePtr(
+ m_jit.store64(
valueReg,
MacroAssembler::BaseIndex(
scratchReg, scratch2Reg, MacroAssembler::TimesEight,
@@ -3139,10 +3140,10 @@ void SpeculativeJIT::compile(Node& node)
case Array::ArrayWithContiguousOutOfBounds: {
m_jit.load32(MacroAssembler::Address(storageGPR, Butterfly::offsetOfPublicLength()), storageLengthGPR);
MacroAssembler::Jump slowPath = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(storageGPR, Butterfly::offsetOfVectorLength()));
- m_jit.storePtr(valueGPR, MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::ScalePtr));
+ m_jit.store64(valueGPR, MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight));
m_jit.add32(TrustedImm32(1), storageLengthGPR);
m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, Butterfly::offsetOfPublicLength()));
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, storageLengthGPR);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, storageLengthGPR);
addSlowPathGenerator(
slowPathCall(
@@ -3162,12 +3163,12 @@ void SpeculativeJIT::compile(Node& node)
MacroAssembler::Jump slowPath = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::vectorLengthOffset()));
- m_jit.storePtr(valueGPR, MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
+ m_jit.store64(valueGPR, MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
m_jit.add32(TrustedImm32(1), storageLengthGPR);
m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()));
m_jit.add32(TrustedImm32(1), MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, storageLengthGPR);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, storageLengthGPR);
addSlowPathGenerator(
slowPathCall(
@@ -3208,19 +3209,19 @@ void SpeculativeJIT::compile(Node& node)
m_jit.sub32(TrustedImm32(1), storageLengthGPR);
m_jit.store32(
storageLengthGPR, MacroAssembler::Address(storageGPR, Butterfly::offsetOfPublicLength()));
- m_jit.loadPtr(
- MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::ScalePtr),
+ m_jit.load64(
+ MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight),
valueGPR);
// FIXME: This would not have to be here if changing the publicLength also zeroed the values between the old
// length and the new length.
- m_jit.storePtr(
- MacroAssembler::TrustedImmPtr(0), MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::ScalePtr));
- MacroAssembler::Jump slowCase = m_jit.branchTestPtr(MacroAssembler::Zero, valueGPR);
+ m_jit.store64(
+ MacroAssembler::TrustedImm64((int64_t)0), MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight));
+ MacroAssembler::Jump slowCase = m_jit.branchTest64(MacroAssembler::Zero, valueGPR);
addSlowPathGenerator(
slowPathMove(
undefinedCase, this,
- MacroAssembler::TrustedImmPtr(JSValue::encode(jsUndefined())), valueGPR));
+ MacroAssembler::TrustedImm64(JSValue::encode(jsUndefined())), valueGPR));
addSlowPathGenerator(
slowPathCall(
slowCase, this, operationArrayPopAndRecoverLength, valueGPR, baseGPR));
@@ -3241,18 +3242,18 @@ void SpeculativeJIT::compile(Node& node)
JITCompiler::JumpList slowCases;
slowCases.append(m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::vectorLengthOffset())));
- m_jit.loadPtr(MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), valueGPR);
- slowCases.append(m_jit.branchTestPtr(MacroAssembler::Zero, valueGPR));
+ m_jit.load64(MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), valueGPR);
+ slowCases.append(m_jit.branchTest64(MacroAssembler::Zero, valueGPR));
m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()));
- m_jit.storePtr(MacroAssembler::TrustedImmPtr(0), MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
+ m_jit.store64(MacroAssembler::TrustedImm64((int64_t)0), MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
m_jit.sub32(MacroAssembler::TrustedImm32(1), MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
addSlowPathGenerator(
slowPathMove(
undefinedCase, this,
- MacroAssembler::TrustedImmPtr(JSValue::encode(jsUndefined())), valueGPR));
+ MacroAssembler::TrustedImm64(JSValue::encode(jsUndefined())), valueGPR));
addSlowPathGenerator(
slowPathCall(
@@ -3345,7 +3346,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.move(op1.gpr(), result.gpr());
if (op1.format() == DataFormatInteger)
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, result.gpr());
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, result.gpr());
jsValueResult(result.gpr(), m_compileIndex);
break;
@@ -3364,7 +3365,7 @@ void SpeculativeJIT::compile(Node& node)
if (!(m_state.forNode(node.child1()).m_type & ~(SpecNumber | SpecBoolean)))
m_jit.move(op1GPR, resultGPR);
else {
- MacroAssembler::Jump alreadyPrimitive = m_jit.branchTestPtr(MacroAssembler::NonZero, op1GPR, GPRInfo::tagMaskRegister);
+ MacroAssembler::Jump alreadyPrimitive = m_jit.branchTest64(MacroAssembler::NonZero, op1GPR, GPRInfo::tagMaskRegister);
MacroAssembler::Jump notPrimitive = m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op1GPR, JSCell::structureOffset()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->stringStructure.get()));
alreadyPrimitive.link(&m_jit);
@@ -3401,7 +3402,7 @@ void SpeculativeJIT::compile(Node& node)
for (unsigned operandIdx = 0; operandIdx < node.numChildren(); ++operandIdx) {
JSValueOperand operand(this, m_jit.graph().m_varArgChildren[node.firstChild() + operandIdx]);
GPRReg opGPR = operand.gpr();
- m_jit.storePtr(opGPR, MacroAssembler::Address(storageGPR, sizeof(JSValue) * operandIdx));
+ m_jit.store64(opGPR, MacroAssembler::Address(storageGPR, sizeof(JSValue) * operandIdx));
}
// Yuck, we should *really* have a way of also returning the storageGPR. But
@@ -3432,7 +3433,7 @@ void SpeculativeJIT::compile(Node& node)
GPRReg opGPR = operand.gpr();
operand.use();
- m_jit.storePtr(opGPR, buffer + operandIdx);
+ m_jit.store64(opGPR, buffer + operandIdx);
}
flushRegisters();
@@ -3532,7 +3533,7 @@ void SpeculativeJIT::compile(Node& node)
GPRReg opGPR = operand.gpr();
operand.use();
- m_jit.storePtr(opGPR, buffer + operandIdx);
+ m_jit.store64(opGPR, buffer + operandIdx);
}
flushRegisters();
@@ -3577,8 +3578,8 @@ void SpeculativeJIT::compile(Node& node)
JSValue* data = m_jit.codeBlock()->constantBuffer(node.startConstant());
for (unsigned index = 0; index < node.numConstants(); ++index) {
- m_jit.storePtr(
- ImmPtr(bitwise_cast<void*>(JSValue::encode(data[index]))),
+ m_jit.store64(
+ Imm64(JSValue::encode(data[index])),
MacroAssembler::Address(storageGPR, sizeof(JSValue) * index));
}
@@ -3622,8 +3623,8 @@ void SpeculativeJIT::compile(Node& node)
if (!isOtherSpeculation(m_state.forNode(node.child1()).m_type)) {
m_jit.move(thisValueGPR, scratchGPR);
- m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), scratchGPR);
- speculationCheck(BadType, JSValueRegs(thisValueGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull))));
+ m_jit.and64(MacroAssembler::TrustedImm32(~TagBitUndefined), scratchGPR);
+ speculationCheck(BadType, JSValueRegs(thisValueGPR), node.child1(), m_jit.branch64(MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImm64(ValueNull)));
}
m_jit.move(MacroAssembler::TrustedImmPtr(m_jit.globalThisObjectFor(node.codeOrigin)), scratchGPR);
@@ -3723,7 +3724,7 @@ void SpeculativeJIT::compile(Node& node)
if (checkTopLevel && skip--) {
JITCompiler::Jump activationNotCreated;
if (checkTopLevel)
- activationNotCreated = m_jit.branchTestPtr(JITCompiler::Zero, JITCompiler::addressFor(static_cast<VirtualRegister>(m_jit.codeBlock()->activationRegister())));
+ activationNotCreated = m_jit.branchTest64(JITCompiler::Zero, JITCompiler::addressFor(static_cast<VirtualRegister>(m_jit.codeBlock()->activationRegister())));
m_jit.loadPtr(JITCompiler::Address(resultGPR, JSScope::offsetOfNext()), resultGPR);
activationNotCreated.link(&m_jit);
}
@@ -3749,7 +3750,7 @@ void SpeculativeJIT::compile(Node& node)
GPRReg registersGPR = registers.gpr();
GPRReg resultGPR = result.gpr();
- m_jit.loadPtr(JITCompiler::Address(registersGPR, node.varNumber() * sizeof(Register)), resultGPR);
+ m_jit.load64(JITCompiler::Address(registersGPR, node.varNumber() * sizeof(Register)), resultGPR);
jsValueResult(resultGPR, m_compileIndex);
break;
}
@@ -3764,7 +3765,7 @@ void SpeculativeJIT::compile(Node& node)
GPRReg valueGPR = value.gpr();
GPRReg scratchGPR = scratchRegister.gpr();
- m_jit.storePtr(valueGPR, JITCompiler::Address(registersGPR, node.varNumber() * sizeof(Register)));
+ m_jit.store64(valueGPR, JITCompiler::Address(registersGPR, node.varNumber() * sizeof(Register)));
writeBarrier(scopeGPR, valueGPR, node.child3(), WriteBarrierForVariableAccess, scratchGPR);
noResult(m_compileIndex);
break;
@@ -3798,7 +3799,7 @@ void SpeculativeJIT::compile(Node& node)
base.use();
- JITCompiler::Jump notCell = m_jit.branchTestPtr(JITCompiler::NonZero, baseGPR, GPRInfo::tagMaskRegister);
+ JITCompiler::Jump notCell = m_jit.branchTest64(JITCompiler::NonZero, baseGPR, GPRInfo::tagMaskRegister);
cachedGetById(node.codeOrigin, baseGPR, resultGPR, node.identifierNumber(), notCell);
@@ -3840,7 +3841,7 @@ void SpeculativeJIT::compile(Node& node)
base.use();
flushRegisters();
- JITCompiler::Jump notCell = m_jit.branchTestPtr(JITCompiler::NonZero, baseGPR, GPRInfo::tagMaskRegister);
+ JITCompiler::Jump notCell = m_jit.branchTest64(JITCompiler::NonZero, baseGPR, GPRInfo::tagMaskRegister);
cachedGetById(node.codeOrigin, baseGPR, resultGPR, node.identifierNumber(), notCell, DontSpill);
@@ -3874,7 +3875,7 @@ void SpeculativeJIT::compile(Node& node)
if (node.structureSet().size() == 1) {
speculationCheckWithConditionalDirection(
- BadCache, JSValueRegs(), NoNode,
+ BadCache, JSValueRegs(base.gpr()), NoNode,
m_jit.branchWeakPtr(
JITCompiler::NotEqual,
JITCompiler::Address(base.gpr(), JSCell::structureOffset()),
@@ -3891,7 +3892,7 @@ void SpeculativeJIT::compile(Node& node)
done.append(m_jit.branchWeakPtr(JITCompiler::Equal, structure.gpr(), node.structureSet()[i]));
speculationCheckWithConditionalDirection(
- BadCache, JSValueRegs(), NoNode,
+ BadCache, JSValueRegs(base.gpr()), NoNode,
m_jit.branchWeakPtr(
JITCompiler::NotEqual, structure.gpr(), node.structureSet().last()),
node.op() == ForwardCheckStructure);
@@ -3905,6 +3906,13 @@ void SpeculativeJIT::compile(Node& node)
case StructureTransitionWatchpoint:
case ForwardStructureTransitionWatchpoint: {
+ // There is a fascinating question here of what to do about array profiling.
+ // We *could* try to tell the OSR exit about where the base of the access is.
+ // The DFG will have kept it alive, though it may not be in a register, and
+ // we shouldn't really load it since that could be a waste. For now though,
+ // we'll just rely on the fact that when a watchpoint fires then that's
+ // quite a hint already.
+
m_jit.addWeakReference(node.structure());
node.structure()->addTransitionWatchpoint(
speculationWatchpointWithConditionalDirection(
@@ -3988,7 +3996,7 @@ void SpeculativeJIT::compile(Node& node)
StorageAccessData& storageAccessData = m_jit.graph().m_storageAccessData[node.storageAccessDataIndex()];
- m_jit.loadPtr(JITCompiler::Address(storageGPR, storageAccessData.offset * sizeof(EncodedJSValue)), resultGPR);
+ m_jit.load64(JITCompiler::Address(storageGPR, storageAccessData.offset * sizeof(EncodedJSValue)), resultGPR);
jsValueResult(resultGPR, m_compileIndex);
break;
@@ -4010,7 +4018,7 @@ void SpeculativeJIT::compile(Node& node)
StorageAccessData& storageAccessData = m_jit.graph().m_storageAccessData[node.storageAccessDataIndex()];
- m_jit.storePtr(valueGPR, JITCompiler::Address(storageGPR, storageAccessData.offset * sizeof(EncodedJSValue)));
+ m_jit.store64(valueGPR, JITCompiler::Address(storageGPR, storageAccessData.offset * sizeof(EncodedJSValue)));
noResult(m_compileIndex);
break;
@@ -4055,7 +4063,7 @@ void SpeculativeJIT::compile(Node& node)
case GetGlobalVar: {
GPRTemporary result(this);
- m_jit.loadPtr(node.registerPointer(), result.gpr());
+ m_jit.load64(node.registerPointer(), result.gpr());
jsValueResult(result.gpr(), m_compileIndex);
break;
@@ -4071,7 +4079,7 @@ void SpeculativeJIT::compile(Node& node)
writeBarrier(m_jit.globalObjectFor(node.codeOrigin), value.gpr(), node.child1(), WriteBarrierForVariableAccess, scratchReg);
}
- m_jit.storePtr(value.gpr(), node.registerPointer());
+ m_jit.store64(value.gpr(), node.registerPointer());
noResult(m_compileIndex);
break;
@@ -4097,7 +4105,7 @@ void SpeculativeJIT::compile(Node& node)
writeBarrier(m_jit.globalObjectFor(node.codeOrigin), value.gpr(), node.child1(), WriteBarrierForVariableAccess, scratchReg);
}
- m_jit.storePtr(value.gpr(), node.registerPointer());
+ m_jit.store64(value.gpr(), node.registerPointer());
noResult(m_compileIndex);
break;
@@ -4111,10 +4119,10 @@ void SpeculativeJIT::compile(Node& node)
#if DFG_ENABLE(JIT_ASSERT)
GPRTemporary scratch(this);
GPRReg scratchGPR = scratch.gpr();
- m_jit.loadPtr(node.registerPointer(), scratchGPR);
- JITCompiler::Jump ok = m_jit.branchPtr(
+ m_jit.load64(node.registerPointer(), scratchGPR);
+ JITCompiler::Jump ok = m_jit.branch64(
JITCompiler::Equal, scratchGPR,
- TrustedImmPtr(bitwise_cast<void*>(JSValue::encode(node.registerPointer()->get()))));
+ TrustedImm64(JSValue::encode(node.registerPointer()->get())));
m_jit.breakpoint();
ok.link(&m_jit);
#endif
@@ -4144,9 +4152,9 @@ void SpeculativeJIT::compile(Node& node)
JSValueOperand value(this, node.child1());
GPRTemporary result(this);
- JITCompiler::Jump isCell = m_jit.branchTestPtr(JITCompiler::Zero, value.gpr(), GPRInfo::tagMaskRegister);
+ JITCompiler::Jump isCell = m_jit.branchTest64(JITCompiler::Zero, value.gpr(), GPRInfo::tagMaskRegister);
- m_jit.comparePtr(JITCompiler::Equal, value.gpr(), TrustedImm32(ValueUndefined), result.gpr());
+ m_jit.compare64(JITCompiler::Equal, value.gpr(), TrustedImm32(ValueUndefined), result.gpr());
JITCompiler::Jump done = m_jit.jump();
isCell.link(&m_jit);
@@ -4183,8 +4191,8 @@ void SpeculativeJIT::compile(Node& node)
GPRTemporary result(this, value);
m_jit.move(value.gpr(), result.gpr());
- m_jit.xorPtr(JITCompiler::TrustedImm32(ValueFalse), result.gpr());
- m_jit.testPtr(JITCompiler::Zero, result.gpr(), JITCompiler::TrustedImm32(static_cast<int32_t>(~1)), result.gpr());
+ m_jit.xor64(JITCompiler::TrustedImm32(ValueFalse), result.gpr());
+ m_jit.test64(JITCompiler::Zero, result.gpr(), JITCompiler::TrustedImm32(static_cast<int32_t>(~1)), result.gpr());
m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
jsValueResult(result.gpr(), m_compileIndex, DataFormatJSBoolean);
break;
@@ -4194,7 +4202,7 @@ void SpeculativeJIT::compile(Node& node)
JSValueOperand value(this, node.child1());
GPRTemporary result(this, value);
- m_jit.testPtr(JITCompiler::NonZero, value.gpr(), GPRInfo::tagTypeNumberRegister, result.gpr());
+ m_jit.test64(JITCompiler::NonZero, value.gpr(), GPRInfo::tagTypeNumberRegister, result.gpr());
m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
jsValueResult(result.gpr(), m_compileIndex, DataFormatJSBoolean);
break;
@@ -4204,7 +4212,7 @@ void SpeculativeJIT::compile(Node& node)
JSValueOperand value(this, node.child1());
GPRTemporary result(this, value);
- JITCompiler::Jump isNotCell = m_jit.branchTestPtr(JITCompiler::NonZero, value.gpr(), GPRInfo::tagMaskRegister);
+ JITCompiler::Jump isNotCell = m_jit.branchTest64(JITCompiler::NonZero, value.gpr(), GPRInfo::tagMaskRegister);
m_jit.loadPtr(JITCompiler::Address(value.gpr(), JSCell::structureOffset()), result.gpr());
m_jit.compare8(JITCompiler::Equal, JITCompiler::Address(result.gpr(), Structure::typeInfoTypeOffset()), TrustedImm32(StringType), result.gpr());
@@ -4263,7 +4271,8 @@ void SpeculativeJIT::compile(Node& node)
case Resolve: {
flushRegisters();
GPRResult result(this);
- callOperation(operationResolve, result.gpr(), identifier(node.identifierNumber()));
+ ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node.resolveOperationsDataIndex()];
+ callOperation(operationResolve, result.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex));
jsValueResult(result.gpr(), m_compileIndex);
break;
}
@@ -4271,7 +4280,8 @@ void SpeculativeJIT::compile(Node& node)
case ResolveBase: {
flushRegisters();
GPRResult result(this);
- callOperation(operationResolveBase, result.gpr(), identifier(node.identifierNumber()));
+ ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node.resolveOperationsDataIndex()];
+ callOperation(operationResolveBase, result.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex), putToBaseOperation(data.putToBaseOperationIndex));
jsValueResult(result.gpr(), m_compileIndex);
break;
}
@@ -4279,7 +4289,8 @@ void SpeculativeJIT::compile(Node& node)
case ResolveBaseStrictPut: {
flushRegisters();
GPRResult result(this);
- callOperation(operationResolveBaseStrictPut, result.gpr(), identifier(node.identifierNumber()));
+ ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node.resolveOperationsDataIndex()];
+ callOperation(operationResolveBaseStrictPut, result.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex), putToBaseOperation(data.putToBaseOperationIndex));
jsValueResult(result.gpr(), m_compileIndex);
break;
}
@@ -4294,16 +4305,16 @@ void SpeculativeJIT::compile(Node& node)
GPRReg resultGPR = result.gpr();
ResolveGlobalData& data = m_jit.graph().m_resolveGlobalData[node.resolveGlobalDataIndex()];
- GlobalResolveInfo* resolveInfoAddress = &(m_jit.codeBlock()->globalResolveInfo(data.resolveInfoIndex));
+ ResolveOperation* resolveOperationAddress = &(m_jit.codeBlock()->resolveOperations(data.resolveOperationsIndex)->data()[data.resolvePropertyIndex]);
// Check Structure of global object
m_jit.move(JITCompiler::TrustedImmPtr(m_jit.globalObjectFor(node.codeOrigin)), globalObjectGPR);
- m_jit.move(JITCompiler::TrustedImmPtr(resolveInfoAddress), resolveInfoGPR);
- m_jit.loadPtr(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(GlobalResolveInfo, structure)), resultGPR);
+ m_jit.move(JITCompiler::TrustedImmPtr(resolveOperationAddress), resolveInfoGPR);
+ m_jit.loadPtr(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(ResolveOperation, m_structure)), resultGPR);
JITCompiler::Jump structuresDontMatch = m_jit.branchPtr(JITCompiler::NotEqual, resultGPR, JITCompiler::Address(globalObjectGPR, JSCell::structureOffset()));
// Fast case
- m_jit.load32(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), resolveInfoGPR);
+ m_jit.load32(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(ResolveOperation, m_offset)), resolveInfoGPR);
#if DFG_ENABLE(JIT_ASSERT)
JITCompiler::Jump isOutOfLine = m_jit.branch32(JITCompiler::GreaterThanOrEqual, resolveInfoGPR, TrustedImm32(firstOutOfLineOffset));
m_jit.breakpoint();
@@ -4312,7 +4323,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.neg32(resolveInfoGPR);
m_jit.signExtend32ToPtr(resolveInfoGPR, resolveInfoGPR);
m_jit.loadPtr(JITCompiler::Address(globalObjectGPR, JSObject::butterflyOffset()), resultGPR);
- m_jit.loadPtr(JITCompiler::BaseIndex(resultGPR, resolveInfoGPR, JITCompiler::ScalePtr, (firstOutOfLineOffset - 2) * static_cast<ptrdiff_t>(sizeof(JSValue))), resultGPR);
+ m_jit.load64(JITCompiler::BaseIndex(resultGPR, resolveInfoGPR, JITCompiler::TimesEight, (firstOutOfLineOffset - 2) * static_cast<ptrdiff_t>(sizeof(JSValue))), resultGPR);
addSlowPathGenerator(
slowPathCall(
@@ -4335,7 +4346,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.move(valueGPR, resultGPR);
- JITCompiler::Jump notCreated = m_jit.branchTestPtr(JITCompiler::Zero, resultGPR);
+ JITCompiler::Jump notCreated = m_jit.branchTest64(JITCompiler::Zero, resultGPR);
addSlowPathGenerator(
slowPathCall(notCreated, this, operationCreateActivation, resultGPR));
@@ -4353,7 +4364,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.move(valueGPR, resultGPR);
- JITCompiler::Jump notCreated = m_jit.branchTestPtr(JITCompiler::Zero, resultGPR);
+ JITCompiler::Jump notCreated = m_jit.branchTest64(JITCompiler::Zero, resultGPR);
if (node.codeOrigin.inlineCallFrame) {
addSlowPathGenerator(
@@ -4377,17 +4388,17 @@ void SpeculativeJIT::compile(Node& node)
GPRReg activationValueGPR = activationValue.gpr();
GPRReg scratchGPR = scratch.gpr();
- JITCompiler::Jump notCreated = m_jit.branchTestPtr(JITCompiler::Zero, activationValueGPR);
+ JITCompiler::Jump notCreated = m_jit.branchTest64(JITCompiler::Zero, activationValueGPR);
SharedSymbolTable* symbolTable = m_jit.symbolTableFor(node.codeOrigin);
int registersOffset = JSActivation::registersOffset(symbolTable);
int captureEnd = symbolTable->captureEnd();
for (int i = symbolTable->captureStart(); i < captureEnd; ++i) {
- m_jit.loadPtr(
+ m_jit.load64(
JITCompiler::Address(
GPRInfo::callFrameRegister, i * sizeof(Register)), scratchGPR);
- m_jit.storePtr(
+ m_jit.store64(
scratchGPR, JITCompiler::Address(
activationValueGPR, registersOffset + i * sizeof(Register)));
}
@@ -4405,7 +4416,7 @@ void SpeculativeJIT::compile(Node& node)
GPRReg unmodifiedArgumentsValueGPR = unmodifiedArgumentsValue.gpr();
GPRReg activationValueGPR = activationValue.gpr();
- JITCompiler::Jump created = m_jit.branchTestPtr(JITCompiler::NonZero, unmodifiedArgumentsValueGPR);
+ JITCompiler::Jump created = m_jit.branchTest64(JITCompiler::NonZero, unmodifiedArgumentsValueGPR);
if (node.codeOrigin.inlineCallFrame) {
addSlowPathGenerator(
@@ -4431,7 +4442,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.graph().argumentsRegisterFor(node.codeOrigin)).m_type)) {
speculationCheck(
ArgumentsEscaped, JSValueRegs(), NoNode,
- m_jit.branchTestPtr(
+ m_jit.branchTest64(
JITCompiler::NonZero,
JITCompiler::addressFor(
m_jit.argumentsRegisterFor(node.codeOrigin))));
@@ -4448,22 +4459,19 @@ void SpeculativeJIT::compile(Node& node)
GPRTemporary result(this);
GPRReg resultGPR = result.gpr();
- JITCompiler::Jump created = m_jit.branchTestPtr(
+ JITCompiler::Jump created = m_jit.branchTest64(
JITCompiler::NonZero,
JITCompiler::addressFor(
m_jit.argumentsRegisterFor(node.codeOrigin)));
if (node.codeOrigin.inlineCallFrame) {
m_jit.move(
- ImmPtr(
- bitwise_cast<void*>(
- JSValue::encode(
- jsNumber(node.codeOrigin.inlineCallFrame->arguments.size() - 1)))),
+ Imm64(JSValue::encode(jsNumber(node.codeOrigin.inlineCallFrame->arguments.size() - 1))),
resultGPR);
} else {
m_jit.load32(JITCompiler::payloadFor(JSStack::ArgumentCount), resultGPR);
m_jit.sub32(TrustedImm32(1), resultGPR);
- m_jit.orPtr(GPRInfo::tagTypeNumberRegister, resultGPR);
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, resultGPR);
}
// FIXME: the slow path generator should perform a forward speculation that the
@@ -4490,7 +4498,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.graph().argumentsRegisterFor(node.codeOrigin)).m_type)) {
speculationCheck(
ArgumentsEscaped, JSValueRegs(), NoNode,
- m_jit.branchTestPtr(
+ m_jit.branchTest64(
JITCompiler::NonZero,
JITCompiler::addressFor(
m_jit.argumentsRegisterFor(node.codeOrigin))));
@@ -4529,7 +4537,7 @@ void SpeculativeJIT::compile(Node& node)
OBJECT_OFFSETOF(SlowArgument, index)),
resultGPR);
m_jit.signExtend32ToPtr(resultGPR, resultGPR);
- m_jit.loadPtr(
+ m_jit.load64(
JITCompiler::BaseIndex(
GPRInfo::callFrameRegister, resultGPR, JITCompiler::TimesEight, m_jit.offsetOfLocals(node.codeOrigin)),
resultGPR);
@@ -4540,7 +4548,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.neg32(resultGPR);
m_jit.signExtend32ToPtr(resultGPR, resultGPR);
- m_jit.loadPtr(
+ m_jit.load64(
JITCompiler::BaseIndex(
GPRInfo::callFrameRegister, resultGPR, JITCompiler::TimesEight, m_jit.offsetOfArgumentsIncludingThis(node.codeOrigin)),
resultGPR);
@@ -4558,7 +4566,7 @@ void SpeculativeJIT::compile(Node& node)
JITCompiler::JumpList slowPath;
slowPath.append(
- m_jit.branchTestPtr(
+ m_jit.branchTest64(
JITCompiler::NonZero,
JITCompiler::addressFor(
m_jit.argumentsRegisterFor(node.codeOrigin))));
@@ -4594,7 +4602,7 @@ void SpeculativeJIT::compile(Node& node)
OBJECT_OFFSETOF(SlowArgument, index)),
resultGPR);
m_jit.signExtend32ToPtr(resultGPR, resultGPR);
- m_jit.loadPtr(
+ m_jit.load64(
JITCompiler::BaseIndex(
GPRInfo::callFrameRegister, resultGPR, JITCompiler::TimesEight, m_jit.offsetOfLocals(node.codeOrigin)),
resultGPR);
@@ -4605,7 +4613,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.neg32(resultGPR);
m_jit.signExtend32ToPtr(resultGPR, resultGPR);
- m_jit.loadPtr(
+ m_jit.load64(
JITCompiler::BaseIndex(
GPRInfo::callFrameRegister, resultGPR, JITCompiler::TimesEight, m_jit.offsetOfArgumentsIncludingThis(node.codeOrigin)),
resultGPR);
@@ -4636,7 +4644,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.graph().argumentsRegisterFor(node.codeOrigin)).m_type));
speculationCheck(
ArgumentsEscaped, JSValueRegs(), NoNode,
- m_jit.branchTestPtr(
+ m_jit.branchTest64(
JITCompiler::NonZero,
JITCompiler::addressFor(
m_jit.argumentsRegisterFor(node.codeOrigin))));
@@ -4657,7 +4665,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.move(valueGPR, resultGPR);
- JITCompiler::Jump notCreated = m_jit.branchTestPtr(JITCompiler::Zero, resultGPR);
+ JITCompiler::Jump notCreated = m_jit.branchTest64(JITCompiler::Zero, resultGPR);
addSlowPathGenerator(
slowPathCall(
@@ -4672,6 +4680,11 @@ void SpeculativeJIT::compile(Node& node)
compileNewFunctionExpression(node);
break;
+ case GarbageValue:
+ // We should never get to the point of code emission for a GarbageValue
+ CRASH();
+ break;
+
case ForceOSRExit: {
terminateSpeculativeExecution(InadequateCoverage, JSValueRegs(), NoNode);
break;
diff --git a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
index 2e44af2d7..22b9395b5 100644
--- a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
@@ -144,6 +144,8 @@ public:
m_graph.vote(node, VoteOther);
break;
}
+ case GarbageValue:
+ break;
default:
m_graph.vote(node, VoteOther);
diff --git a/Source/JavaScriptCore/dfg/DFGThunks.cpp b/Source/JavaScriptCore/dfg/DFGThunks.cpp
index 25fcad10a..74d1967a8 100644
--- a/Source/JavaScriptCore/dfg/DFGThunks.cpp
+++ b/Source/JavaScriptCore/dfg/DFGThunks.cpp
@@ -44,8 +44,13 @@ MacroAssemblerCodeRef osrExitGenerationThunkGenerator(JSGlobalData* globalData)
ScratchBuffer* scratchBuffer = globalData->scratchBufferForSize(scratchSize);
EncodedJSValue* buffer = static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer());
- for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i)
- jit.storePtr(GPRInfo::toRegister(i), buffer + i);
+ for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i) {
+#if USE(JSVALUE64)
+ jit.store64(GPRInfo::toRegister(i), buffer + i);
+#else
+ jit.store32(GPRInfo::toRegister(i), buffer + i);
+#endif
+ }
for (unsigned i = 0; i < FPRInfo::numberOfRegisters; ++i) {
jit.move(MacroAssembler::TrustedImmPtr(buffer + GPRInfo::numberOfRegisters + i), GPRInfo::regT0);
jit.storeDouble(FPRInfo::toRegister(i), GPRInfo::regT0);
@@ -71,8 +76,13 @@ MacroAssemblerCodeRef osrExitGenerationThunkGenerator(JSGlobalData* globalData)
jit.move(MacroAssembler::TrustedImmPtr(buffer + GPRInfo::numberOfRegisters + i), GPRInfo::regT0);
jit.loadDouble(GPRInfo::regT0, FPRInfo::toRegister(i));
}
- for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i)
- jit.loadPtr(buffer + i, GPRInfo::toRegister(i));
+ for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i) {
+#if USE(JSVALUE64)
+ jit.load64(buffer + i, GPRInfo::toRegister(i));
+#else
+ jit.load32(buffer + i, GPRInfo::toRegister(i));
+#endif
+ }
jit.jump(MacroAssembler::AbsoluteAddress(&globalData->osrExitJumpDestination));
@@ -115,7 +125,11 @@ MacroAssemblerCodeRef throwExceptionFromCallSlowPathGenerator(JSGlobalData* glob
GPRInfo::callFrameRegister,
static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::CallerFrame),
GPRInfo::callFrameRegister);
+#if USE(JSVALUE64)
+ jit.peek64(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
+#else
jit.peek(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
+#endif
jit.setupArgumentsWithExecState(GPRInfo::nonPreservedNonReturnGPR);
jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(lookupExceptionHandler)), GPRInfo::nonArgGPR0);
emitPointerValidation(jit, GPRInfo::nonArgGPR0);
@@ -138,7 +152,11 @@ static void slowPathFor(
GPRInfo::callFrameRegister,
static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::ReturnPC));
jit.storePtr(GPRInfo::callFrameRegister, &globalData->topCallFrame);
+#if USE(JSVALUE64)
+ jit.poke64(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
+#else
jit.poke(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
+#endif
jit.setupArgumentsExecState();
jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(slowPathFunction)), GPRInfo::nonArgGPR0);
emitPointerValidation(jit, GPRInfo::nonArgGPR0);
@@ -211,7 +229,7 @@ static MacroAssemblerCodeRef virtualForThunkGenerator(
#if USE(JSVALUE64)
slowCase.append(
- jit.branchTestPtr(
+ jit.branchTest64(
CCallHelpers::NonZero, GPRInfo::nonArgGPR0, GPRInfo::tagMaskRegister));
#else
slowCase.append(
@@ -245,7 +263,7 @@ static MacroAssemblerCodeRef virtualForThunkGenerator(
CCallHelpers::Address(GPRInfo::nonArgGPR0, JSFunction::offsetOfScopeChain()),
GPRInfo::nonArgGPR1);
#if USE(JSVALUE64)
- jit.storePtr(
+ jit.store64(
GPRInfo::nonArgGPR1,
CCallHelpers::Address(
GPRInfo::callFrameRegister,
diff --git a/Source/JavaScriptCore/heap/CopiedSpace.cpp b/Source/JavaScriptCore/heap/CopiedSpace.cpp
index cedafee3a..c228f9460 100644
--- a/Source/JavaScriptCore/heap/CopiedSpace.cpp
+++ b/Source/JavaScriptCore/heap/CopiedSpace.cpp
@@ -173,6 +173,7 @@ void CopiedSpace::doneFillingBlock(CopiedBlock* block, CopiedBlock** exchange)
{
MutexLocker locker(m_loanedBlocksLock);
ASSERT(m_numberOfLoanedBlocks > 0);
+ ASSERT(m_inCopyingPhase);
m_numberOfLoanedBlocks--;
if (!m_numberOfLoanedBlocks)
m_loanedBlocksCondition.signal();
@@ -199,6 +200,22 @@ void CopiedSpace::startedCopying()
totalUsableBytes += block->payloadCapacity();
}
+ CopiedBlock* block = m_oversizeBlocks.head();
+ while (block) {
+ CopiedBlock* next = block->next();
+ if (block->isPinned()) {
+ m_blockFilter.add(reinterpret_cast<Bits>(block));
+ totalLiveBytes += block->payloadCapacity();
+ totalUsableBytes += block->payloadCapacity();
+ block->didSurviveGC();
+ } else {
+ m_oversizeBlocks.remove(block);
+ m_blockSet.remove(block);
+ m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(block));
+ }
+ block = next;
+ }
+
double markedSpaceBytes = m_heap->objectSpace().capacity();
double totalFragmentation = ((double)totalLiveBytes + markedSpaceBytes) / ((double)totalUsableBytes + markedSpaceBytes);
m_shouldDoCopyPhase = totalFragmentation <= Options::minHeapUtilization();
@@ -224,31 +241,13 @@ void CopiedSpace::doneCopying()
while (!m_fromSpace->isEmpty()) {
CopiedBlock* block = m_fromSpace->removeHead();
- if (block->isPinned() || !m_shouldDoCopyPhase) {
- block->didSurviveGC();
- // We don't add the block to the blockSet because it was never removed.
- ASSERT(m_blockSet.contains(block));
- m_blockFilter.add(reinterpret_cast<Bits>(block));
- m_toSpace->push(block);
- continue;
- }
-
- m_blockSet.remove(block);
- m_heap->blockAllocator().deallocate(CopiedBlock::destroy(block));
- }
-
- CopiedBlock* curr = m_oversizeBlocks.head();
- while (curr) {
- CopiedBlock* next = curr->next();
- if (!curr->isPinned()) {
- m_oversizeBlocks.remove(curr);
- m_blockSet.remove(curr);
- m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(curr));
- } else {
- m_blockFilter.add(reinterpret_cast<Bits>(curr));
- curr->didSurviveGC();
- }
- curr = next;
+ // All non-pinned blocks in from-space should have been reclaimed as they were evacuated.
+ ASSERT(block->isPinned() || !m_shouldDoCopyPhase);
+ block->didSurviveGC();
+ // We don't add the block to the blockSet because it was never removed.
+ ASSERT(m_blockSet.contains(block));
+ m_blockFilter.add(reinterpret_cast<Bits>(block));
+ m_toSpace->push(block);
}
if (!m_toSpace->head())
diff --git a/Source/JavaScriptCore/heap/CopiedSpaceInlineMethods.h b/Source/JavaScriptCore/heap/CopiedSpaceInlineMethods.h
index 01e816793..c244015e7 100644
--- a/Source/JavaScriptCore/heap/CopiedSpaceInlineMethods.h
+++ b/Source/JavaScriptCore/heap/CopiedSpaceInlineMethods.h
@@ -113,6 +113,7 @@ inline void CopiedSpace::recycleBorrowedBlock(CopiedBlock* block)
{
MutexLocker locker(m_loanedBlocksLock);
ASSERT(m_numberOfLoanedBlocks > 0);
+ ASSERT(m_inCopyingPhase);
m_numberOfLoanedBlocks--;
if (!m_numberOfLoanedBlocks)
m_loanedBlocksCondition.signal();
diff --git a/Source/JavaScriptCore/heap/CopyVisitorInlineMethods.h b/Source/JavaScriptCore/heap/CopyVisitorInlineMethods.h
index 73400750f..eb7bd2e82 100644
--- a/Source/JavaScriptCore/heap/CopyVisitorInlineMethods.h
+++ b/Source/JavaScriptCore/heap/CopyVisitorInlineMethods.h
@@ -56,10 +56,8 @@ private:
inline bool CopyVisitor::checkIfShouldCopy(void* oldPtr, size_t bytes)
{
- if (CopiedSpace::isOversize(bytes)) {
- ASSERT(CopiedSpace::oversizeBlockFor(oldPtr)->isPinned());
+ if (CopiedSpace::isOversize(bytes))
return false;
- }
if (CopiedSpace::blockFor(oldPtr)->isPinned())
return false;
diff --git a/Source/JavaScriptCore/heap/GCThread.cpp b/Source/JavaScriptCore/heap/GCThread.cpp
index ea43456bd..ce3bbedc9 100644
--- a/Source/JavaScriptCore/heap/GCThread.cpp
+++ b/Source/JavaScriptCore/heap/GCThread.cpp
@@ -70,8 +70,16 @@ CopyVisitor* GCThread::copyVisitor()
GCPhase GCThread::waitForNextPhase()
{
MutexLocker locker(m_shared.m_phaseLock);
+ while (m_shared.m_gcThreadsShouldWait)
+ m_shared.m_phaseCondition.wait(m_shared.m_phaseLock);
+
+ m_shared.m_numberOfActiveGCThreads--;
+ if (!m_shared.m_numberOfActiveGCThreads)
+ m_shared.m_activityCondition.signal();
+
while (m_shared.m_currentPhase == NoPhase)
m_shared.m_phaseCondition.wait(m_shared.m_phaseLock);
+ m_shared.m_numberOfActiveGCThreads++;
return m_shared.m_currentPhase;
}
@@ -84,7 +92,7 @@ void GCThread::gcThreadMain()
// Wait for the main thread to finish creating and initializing us. The main thread grabs this lock before
// creating this thread. We aren't guaranteed to have a valid threadID until the main thread releases this lock.
{
- MutexLocker locker(m_shared.m_markingLock);
+ MutexLocker locker(m_shared.m_phaseLock);
}
{
ParallelModeEnabler enabler(*m_slotVisitor);
diff --git a/Source/JavaScriptCore/heap/GCThreadSharedData.cpp b/Source/JavaScriptCore/heap/GCThreadSharedData.cpp
index d9946d589..446b41c2f 100644
--- a/Source/JavaScriptCore/heap/GCThreadSharedData.cpp
+++ b/Source/JavaScriptCore/heap/GCThreadSharedData.cpp
@@ -61,13 +61,16 @@ GCThreadSharedData::GCThreadSharedData(JSGlobalData* globalData)
, m_parallelMarkersShouldExit(false)
, m_blocksToCopy(globalData->heap.m_blockSnapshot)
, m_copyIndex(0)
+ , m_numberOfActiveGCThreads(0)
+ , m_gcThreadsShouldWait(false)
, m_currentPhase(NoPhase)
{
m_copyLock.Init();
#if ENABLE(PARALLEL_GC)
// Grab the lock so the new GC threads can be properly initialized before they start running.
- MutexLocker locker(m_markingLock);
+ MutexLocker locker(m_phaseLock);
for (unsigned i = 1; i < Options::numberOfGCMarkers(); ++i) {
+ m_numberOfActiveGCThreads++;
SlotVisitor* slotVisitor = new SlotVisitor(*this);
CopyVisitor* copyVisitor = new CopyVisitor(*this);
GCThread* newThread = new GCThread(*this, slotVisitor, copyVisitor);
@@ -75,6 +78,10 @@ GCThreadSharedData::GCThreadSharedData(JSGlobalData* globalData)
newThread->initializeThreadID(threadID);
m_gcThreads.append(newThread);
}
+
+ // Wait for all the GCThreads to get to the right place.
+ while (m_numberOfActiveGCThreads)
+ m_activityCondition.wait(m_phaseLock);
#endif
}
@@ -87,6 +94,7 @@ GCThreadSharedData::~GCThreadSharedData()
MutexLocker phaseLocker(m_phaseLock);
ASSERT(m_currentPhase == NoPhase);
m_parallelMarkersShouldExit = true;
+ m_gcThreadsShouldWait = false;
m_currentPhase = Exit;
m_phaseCondition.broadcast();
}
@@ -115,24 +123,44 @@ void GCThreadSharedData::reset()
}
}
-void GCThreadSharedData::didStartMarking()
+void GCThreadSharedData::startNextPhase(GCPhase phase)
{
- MutexLocker markingLocker(m_markingLock);
MutexLocker phaseLocker(m_phaseLock);
+ ASSERT(!m_gcThreadsShouldWait);
ASSERT(m_currentPhase == NoPhase);
- m_currentPhase = Mark;
- m_parallelMarkersShouldExit = false;
+ m_gcThreadsShouldWait = true;
+ m_currentPhase = phase;
m_phaseCondition.broadcast();
}
-void GCThreadSharedData::didFinishMarking()
+void GCThreadSharedData::endCurrentPhase()
+{
+ ASSERT(m_gcThreadsShouldWait);
+ MutexLocker locker(m_phaseLock);
+ m_currentPhase = NoPhase;
+ m_gcThreadsShouldWait = false;
+ m_phaseCondition.broadcast();
+ while (m_numberOfActiveGCThreads)
+ m_activityCondition.wait(m_phaseLock);
+}
+
+void GCThreadSharedData::didStartMarking()
{
MutexLocker markingLocker(m_markingLock);
- MutexLocker phaseLocker(m_phaseLock);
+ m_parallelMarkersShouldExit = false;
+ startNextPhase(Mark);
+}
+
+void GCThreadSharedData::didFinishMarking()
+{
+ {
+ MutexLocker markingLocker(m_markingLock);
+ m_parallelMarkersShouldExit = true;
+ m_markingCondition.broadcast();
+ }
+
ASSERT(m_currentPhase == Mark);
- m_currentPhase = NoPhase;
- m_parallelMarkersShouldExit = true;
- m_markingCondition.broadcast();
+ endCurrentPhase();
}
void GCThreadSharedData::didStartCopying()
@@ -150,18 +178,13 @@ void GCThreadSharedData::didStartCopying()
for (size_t i = 0; i < m_gcThreads.size(); i++)
m_gcThreads[i]->copyVisitor()->startCopying();
- MutexLocker locker(m_phaseLock);
- ASSERT(m_currentPhase == NoPhase);
- m_currentPhase = Copy;
- m_phaseCondition.broadcast();
+ startNextPhase(Copy);
}
void GCThreadSharedData::didFinishCopying()
{
- MutexLocker locker(m_phaseLock);
ASSERT(m_currentPhase == Copy);
- m_currentPhase = NoPhase;
- m_phaseCondition.broadcast();
+ endCurrentPhase();
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/GCThreadSharedData.h b/Source/JavaScriptCore/heap/GCThreadSharedData.h
index bd48d9263..f341afc04 100644
--- a/Source/JavaScriptCore/heap/GCThreadSharedData.h
+++ b/Source/JavaScriptCore/heap/GCThreadSharedData.h
@@ -74,6 +74,8 @@ private:
friend class CopyVisitor;
void getNextBlocksToCopy(size_t&, size_t&);
+ void startNextPhase(GCPhase);
+ void endCurrentPhase();
JSGlobalData* m_globalData;
CopiedSpace* m_copiedSpace;
@@ -100,6 +102,9 @@ private:
Mutex m_phaseLock;
ThreadCondition m_phaseCondition;
+ ThreadCondition m_activityCondition;
+ unsigned m_numberOfActiveGCThreads;
+ bool m_gcThreadsShouldWait;
GCPhase m_currentPhase;
ListableHandler<WeakReferenceHarvester>::List m_weakReferenceHarvesters;
diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp
index 772d85144..cd3393aa2 100644
--- a/Source/JavaScriptCore/heap/Heap.cpp
+++ b/Source/JavaScriptCore/heap/Heap.cpp
@@ -612,10 +612,9 @@ void Heap::copyBackingStores()
m_storageSpace.startedCopying();
if (m_storageSpace.shouldDoCopyPhase()) {
m_sharedData.didStartCopying();
- CopyVisitor& visitor = m_copyVisitor;
- visitor.startCopying();
- visitor.copyFromShared();
- visitor.doneCopying();
+ m_copyVisitor.startCopying();
+ m_copyVisitor.copyFromShared();
+ m_copyVisitor.doneCopying();
// We need to wait for everybody to finish and return their CopiedBlocks
// before signaling that the phase is complete.
m_storageSpace.doneCopying();
diff --git a/Source/JavaScriptCore/heap/SlotVisitor.cpp b/Source/JavaScriptCore/heap/SlotVisitor.cpp
index 26d056feb..7a30debda 100644
--- a/Source/JavaScriptCore/heap/SlotVisitor.cpp
+++ b/Source/JavaScriptCore/heap/SlotVisitor.cpp
@@ -10,6 +10,7 @@
#include "JSGlobalData.h"
#include "JSObject.h"
#include "JSString.h"
+#include <wtf/StackStats.h>
namespace JSC {
@@ -58,6 +59,7 @@ void SlotVisitor::reset()
void SlotVisitor::append(ConservativeRoots& conservativeRoots)
{
+ StackStats::probe();
JSCell** roots = conservativeRoots.roots();
size_t size = conservativeRoots.size();
for (size_t i = 0; i < size; ++i)
@@ -66,6 +68,7 @@ void SlotVisitor::append(ConservativeRoots& conservativeRoots)
ALWAYS_INLINE static void visitChildren(SlotVisitor& visitor, const JSCell* cell)
{
+ StackStats::probe();
#if ENABLE(SIMPLE_HEAP_PROFILING)
m_visitedTypeCounts.count(cell);
#endif
@@ -92,6 +95,7 @@ ALWAYS_INLINE static void visitChildren(SlotVisitor& visitor, const JSCell* cell
void SlotVisitor::donateKnownParallel()
{
+ StackStats::probe();
// NOTE: Because we re-try often, we can afford to be conservative, and
// assume that donating is not profitable.
@@ -119,6 +123,7 @@ void SlotVisitor::donateKnownParallel()
void SlotVisitor::drain()
{
+ StackStats::probe();
ASSERT(m_isInParallelMode);
#if ENABLE(PARALLEL_GC)
@@ -144,6 +149,7 @@ void SlotVisitor::drain()
void SlotVisitor::drainFromShared(SharedDrainMode sharedDrainMode)
{
+ StackStats::probe();
ASSERT(m_isInParallelMode);
ASSERT(Options::numberOfGCMarkers());
@@ -221,6 +227,7 @@ void SlotVisitor::drainFromShared(SharedDrainMode sharedDrainMode)
void SlotVisitor::mergeOpaqueRoots()
{
+ StackStats::probe();
ASSERT(!m_opaqueRoots.isEmpty()); // Should only be called when opaque roots are non-empty.
{
MutexLocker locker(m_shared.m_opaqueRootsLock);
@@ -276,6 +283,7 @@ ALWAYS_INLINE void SlotVisitor::internalAppend(JSValue* slot)
// as it can change the JSValue pointed to be the argument when the original JSValue
// is a string that contains the same contents as another string.
+ StackStats::probe();
ASSERT(slot);
JSValue value = *slot;
ASSERT(value);
@@ -309,12 +317,14 @@ ALWAYS_INLINE void SlotVisitor::internalAppend(JSValue* slot)
void SlotVisitor::harvestWeakReferences()
{
+ StackStats::probe();
for (WeakReferenceHarvester* current = m_shared.m_weakReferenceHarvesters.head(); current; current = current->next())
current->visitWeakReferences(*this);
}
void SlotVisitor::finalizeUnconditionalFinalizers()
{
+ StackStats::probe();
while (m_shared.m_unconditionalFinalizers.hasNext())
m_shared.m_unconditionalFinalizers.removeNext()->finalizeUnconditionally();
}
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 00b283393..8c09019da 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -65,6 +65,7 @@
#include "StrongInlines.h"
#include <limits.h>
#include <stdio.h>
+#include <wtf/StackStats.h>
#include <wtf/Threading.h>
#include <wtf/text/StringBuilder.h>
@@ -307,11 +308,7 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
JSValue v = it->jsValue();
int registerNumber = it - callFrame->registers();
String name = codeBlock->nameForRegister(registerNumber);
-#if USE(JSVALUE32_64)
- dataLog("[r% 3d %14s] | %10p | %-16s 0x%llx \n", registerNumber, name.ascii().data(), it, v.description(), JSValue::encode(v));
-#else
- dataLog("[r% 3d %14s] | %10p | %-16s %p \n", registerNumber, name.ascii().data(), it, v.description(), JSValue::encode(v));
-#endif
+ dataLog("[r% 3d %14s] | %10p | %-16s 0x%lld \n", registerNumber, name.ascii().data(), it, v.description(), (long long)JSValue::encode(v));
it++;
}
@@ -346,11 +343,7 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
JSValue v = it->jsValue();
int registerNumber = it - callFrame->registers();
String name = codeBlock->nameForRegister(registerNumber);
-#if USE(JSVALUE32_64)
- dataLog("[r% 3d %14s] | %10p | %-16s 0x%llx \n", registerNumber, name.ascii().data(), it, v.description(), JSValue::encode(v));
-#else
- dataLog("[r% 3d %14s] | %10p | %-16s %p \n", registerNumber, name.ascii().data(), it, v.description(), JSValue::encode(v));
-#endif
+ dataLog("[r% 3d %14s] | %10p | %-16s 0x%lld \n", registerNumber, name.ascii().data(), it, v.description(), (long long)JSValue::encode(v));
++it;
++registerCount;
} while (it != end);
@@ -361,11 +354,7 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
if (it != end) {
do {
JSValue v = (*it).jsValue();
-#if USE(JSVALUE32_64)
- dataLog("[r% 3d] | %10p | %-16s 0x%llx \n", registerCount, it, v.description(), JSValue::encode(v));
-#else
- dataLog("[r% 3d] | %10p | %-16s %p \n", registerCount, it, v.description(), JSValue::encode(v));
-#endif
+ dataLog("[r% 3d] | %10p | %-16s 0x%lld \n", registerCount, it, v.description(), (long long)JSValue::encode(v));
++it;
++registerCount;
} while (it != end);
@@ -764,6 +753,7 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, J
if (callFrame->globalData().isCollectorBusy())
CRASH();
+ StackStats::CheckPoint stackCheckPoint;
if (m_reentryDepth >= MaxSmallThreadReentryDepth && m_reentryDepth >= callFrame->globalData().maxReentryDepth)
return checkedReturn(throwStackOverflowError(callFrame));
@@ -926,6 +916,7 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT
if (callFrame->globalData().isCollectorBusy())
return jsNull();
+ StackStats::CheckPoint stackCheckPoint;
if (m_reentryDepth >= MaxSmallThreadReentryDepth && m_reentryDepth >= callFrame->globalData().maxReentryDepth)
return checkedReturn(throwStackOverflowError(callFrame));
@@ -1021,6 +1012,7 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc
if (callFrame->globalData().isCollectorBusy())
return checkedReturn(throwStackOverflowError(callFrame));
+ StackStats::CheckPoint stackCheckPoint;
if (m_reentryDepth >= MaxSmallThreadReentryDepth && m_reentryDepth >= callFrame->globalData().maxReentryDepth)
return checkedReturn(throwStackOverflowError(callFrame));
@@ -1118,6 +1110,7 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionE
if (callFrame->globalData().isCollectorBusy())
return CallFrameClosure();
+ StackStats::CheckPoint stackCheckPoint;
if (m_reentryDepth >= MaxSmallThreadReentryDepth && m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
throwStackOverflowError(callFrame);
return CallFrameClosure();
@@ -1159,6 +1152,8 @@ JSValue Interpreter::execute(CallFrameClosure& closure)
ASSERT(!closure.oldCallFrame->globalData().isCollectorBusy());
if (closure.oldCallFrame->globalData().isCollectorBusy())
return jsNull();
+
+ StackStats::CheckPoint stackCheckPoint;
closure.resetCallFrame();
if (Profiler* profiler = closure.oldCallFrame->globalData().enabledProfiler())
profiler->willExecute(closure.oldCallFrame, closure.function);
@@ -1201,6 +1196,7 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue
DynamicGlobalObjectScope globalObjectScope(*scope->globalData(), scope->globalObject());
+ StackStats::CheckPoint stackCheckPoint;
if (m_reentryDepth >= MaxSmallThreadReentryDepth && m_reentryDepth >= callFrame->globalData().maxReentryDepth)
return checkedReturn(throwStackOverflowError(callFrame));
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp
index 4eab17661..2d2991b5f 100644
--- a/Source/JavaScriptCore/jit/JIT.cpp
+++ b/Source/JavaScriptCore/jit/JIT.cpp
@@ -270,10 +270,7 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_get_by_val)
DEFINE_OP(op_get_argument_by_val)
DEFINE_OP(op_get_by_pname)
- DEFINE_OP(op_get_global_var_watchable)
- DEFINE_OP(op_get_global_var)
DEFINE_OP(op_get_pnames)
- DEFINE_OP(op_get_scoped_var)
DEFINE_OP(op_check_has_instance)
DEFINE_OP(op_instanceof)
DEFINE_OP(op_is_undefined)
@@ -339,17 +336,26 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_put_by_index)
DEFINE_OP(op_put_by_val)
DEFINE_OP(op_put_getter_setter)
- case op_init_global_const:
- DEFINE_OP(op_put_global_var)
- case op_init_global_const_check:
- DEFINE_OP(op_put_global_var_check)
- DEFINE_OP(op_put_scoped_var)
+ DEFINE_OP(op_init_global_const)
+ DEFINE_OP(op_init_global_const_check)
+
+ case op_resolve_global_property:
+ case op_resolve_global_var:
+ case op_resolve_scoped_var:
+ case op_resolve_scoped_var_on_top_scope:
+ case op_resolve_scoped_var_with_top_scope_check:
DEFINE_OP(op_resolve)
+
+ case op_resolve_base_to_global:
+ case op_resolve_base_to_global_dynamic:
+ case op_resolve_base_to_scope:
+ case op_resolve_base_to_scope_with_top_scope_check:
DEFINE_OP(op_resolve_base)
+
+ case op_put_to_base_variable:
+ DEFINE_OP(op_put_to_base)
+
DEFINE_OP(op_ensure_property_exists)
- DEFINE_OP(op_resolve_global)
- DEFINE_OP(op_resolve_global_dynamic)
- DEFINE_OP(op_resolve_skip)
DEFINE_OP(op_resolve_with_base)
DEFINE_OP(op_resolve_with_this)
DEFINE_OP(op_ret)
@@ -488,7 +494,6 @@ void JIT::privateCompileSlowCases()
DEFINE_SLOWCASE_OP(op_mul)
DEFINE_SLOWCASE_OP(op_negate)
DEFINE_SLOWCASE_OP(op_neq)
- DEFINE_SLOWCASE_OP(op_new_array)
DEFINE_SLOWCASE_OP(op_new_object)
DEFINE_SLOWCASE_OP(op_not)
DEFINE_SLOWCASE_OP(op_nstricteq)
@@ -503,16 +508,32 @@ void JIT::privateCompileSlowCases()
case op_put_by_id_transition_normal_out_of_line:
DEFINE_SLOWCASE_OP(op_put_by_id)
DEFINE_SLOWCASE_OP(op_put_by_val)
- case op_init_global_const_check:
- DEFINE_SLOWCASE_OP(op_put_global_var_check);
- DEFINE_SLOWCASE_OP(op_resolve_global)
- DEFINE_SLOWCASE_OP(op_resolve_global_dynamic)
+ DEFINE_SLOWCASE_OP(op_init_global_const_check);
DEFINE_SLOWCASE_OP(op_rshift)
DEFINE_SLOWCASE_OP(op_urshift)
DEFINE_SLOWCASE_OP(op_stricteq)
DEFINE_SLOWCASE_OP(op_sub)
DEFINE_SLOWCASE_OP(op_to_jsnumber)
DEFINE_SLOWCASE_OP(op_to_primitive)
+
+ case op_resolve_global_property:
+ case op_resolve_global_var:
+ case op_resolve_scoped_var:
+ case op_resolve_scoped_var_on_top_scope:
+ case op_resolve_scoped_var_with_top_scope_check:
+ DEFINE_SLOWCASE_OP(op_resolve)
+
+ case op_resolve_base_to_global:
+ case op_resolve_base_to_global_dynamic:
+ case op_resolve_base_to_scope:
+ case op_resolve_base_to_scope_with_top_scope_check:
+ DEFINE_SLOWCASE_OP(op_resolve_base)
+ DEFINE_SLOWCASE_OP(op_resolve_with_base)
+ DEFINE_SLOWCASE_OP(op_resolve_with_this)
+
+ case op_put_to_base_variable:
+ DEFINE_SLOWCASE_OP(op_put_to_base)
+
default:
ASSERT_NOT_REACHED();
}
@@ -645,7 +666,7 @@ JITCode JIT::privateCompile(CodePtr* functionEntryArityCheck, JITCompilationEffo
continue;
int offset = CallFrame::argumentOffsetIncludingThis(argument) * static_cast<int>(sizeof(Register));
#if USE(JSVALUE64)
- loadPtr(Address(callFrameRegister, offset), regT0);
+ load64(Address(callFrameRegister, offset), regT0);
#elif USE(JSVALUE32_64)
load32(Address(callFrameRegister, offset + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
load32(Address(callFrameRegister, offset + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1);
diff --git a/Source/JavaScriptCore/jit/JIT.h b/Source/JavaScriptCore/jit/JIT.h
index 054718573..cd832c21f 100644
--- a/Source/JavaScriptCore/jit/JIT.h
+++ b/Source/JavaScriptCore/jit/JIT.h
@@ -475,9 +475,7 @@ namespace JSC {
void emitWriteBarrier(JSCell* owner, RegisterID value, RegisterID scratch, WriteBarrierMode, WriteBarrierUseKind);
template<typename ClassType, MarkedBlock::DestructorType, typename StructureType> void emitAllocateBasicJSObject(StructureType, RegisterID result, RegisterID storagePtr);
- void emitAllocateBasicStorage(size_t, ptrdiff_t offsetFromBase, RegisterID result);
template<typename T> void emitAllocateJSFinalObject(T structure, RegisterID result, RegisterID storagePtr);
- void emitAllocateJSArray(unsigned valuesRegister, unsigned length, RegisterID cellResult, RegisterID storageResult, RegisterID storagePtr, RegisterID scratch);
#if ENABLE(VALUE_PROFILER)
// This assumes that the value to profile is in regT0 and that regT3 is available for
@@ -592,6 +590,9 @@ namespace JSC {
#endif
#else // USE(JSVALUE32_64)
+ /* This function is deprecated. */
+ void emitGetJITStubArg(unsigned argumentNumber, RegisterID dst);
+
void emitGetVirtualRegister(int src, RegisterID dst);
void emitGetVirtualRegisters(int src1, RegisterID dst1, int src2, RegisterID dst2);
void emitPutVirtualRegister(unsigned dst, RegisterID from = regT0);
@@ -676,9 +677,6 @@ namespace JSC {
void emit_op_get_by_val(Instruction*);
void emit_op_get_argument_by_val(Instruction*);
void emit_op_get_by_pname(Instruction*);
- void emit_op_get_global_var(Instruction*);
- void emit_op_get_global_var_watchable(Instruction* instruction) { emit_op_get_global_var(instruction); }
- void emit_op_get_scoped_var(Instruction*);
void emit_op_init_lazy_reg(Instruction*);
void emit_op_check_has_instance(Instruction*);
void emit_op_instanceof(Instruction*);
@@ -741,17 +739,16 @@ namespace JSC {
void emit_op_put_by_index(Instruction*);
void emit_op_put_by_val(Instruction*);
void emit_op_put_getter_setter(Instruction*);
- void emit_op_put_global_var(Instruction*);
- void emit_op_put_global_var_check(Instruction*);
- void emit_op_put_scoped_var(Instruction*);
+ void emit_op_init_global_const(Instruction*);
+ void emit_op_init_global_const_check(Instruction*);
+ void emit_resolve_operations(ResolveOperations*, const int* base, const int* value);
+ void emitSlow_link_resolve_operations(ResolveOperations*, Vector<SlowCaseEntry>::iterator&);
void emit_op_resolve(Instruction*);
void emit_op_resolve_base(Instruction*);
void emit_op_ensure_property_exists(Instruction*);
- void emit_op_resolve_global(Instruction*, bool dynamic = false);
- void emit_op_resolve_global_dynamic(Instruction*);
- void emit_op_resolve_skip(Instruction*);
void emit_op_resolve_with_base(Instruction*);
void emit_op_resolve_with_this(Instruction*);
+ void emit_op_put_to_base(Instruction*);
void emit_op_ret(Instruction*);
void emit_op_ret_object_or_this(Instruction*);
void emit_op_rshift(Instruction*);
@@ -820,23 +817,23 @@ namespace JSC {
void emitSlow_op_pre_inc(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_put_by_id(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_put_by_val(Instruction*, Vector<SlowCaseEntry>::iterator&);
- void emitSlow_op_put_global_var_check(Instruction*, Vector<SlowCaseEntry>::iterator&);
- void emitSlow_op_resolve_global(Instruction*, Vector<SlowCaseEntry>::iterator&);
- void emitSlow_op_resolve_global_dynamic(Instruction*, Vector<SlowCaseEntry>::iterator&);
+ void emitSlow_op_init_global_const_check(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_rshift(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_stricteq(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_sub(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_to_jsnumber(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_to_primitive(Instruction*, Vector<SlowCaseEntry>::iterator&);
void emitSlow_op_urshift(Instruction*, Vector<SlowCaseEntry>::iterator&);
- void emitSlow_op_new_array(Instruction*, Vector<SlowCaseEntry>::iterator&);
-
+
+ void emitSlow_op_resolve(Instruction*, Vector<SlowCaseEntry>::iterator&);
+ void emitSlow_op_resolve_base(Instruction*, Vector<SlowCaseEntry>::iterator&);
+ void emitSlow_op_resolve_with_base(Instruction*, Vector<SlowCaseEntry>::iterator&);
+ void emitSlow_op_resolve_with_this(Instruction*, Vector<SlowCaseEntry>::iterator&);
+ void emitSlow_op_put_to_base(Instruction*, Vector<SlowCaseEntry>::iterator&);
+
void emitRightShift(Instruction*, bool isUnsigned);
void emitRightShiftSlowCase(Instruction*, Vector<SlowCaseEntry>::iterator&, bool isUnsigned);
- /* This function is deprecated. */
- void emitGetJITStubArg(unsigned argumentNumber, RegisterID dst);
-
void emitInitRegister(unsigned dst);
void emitPutToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry);
@@ -845,6 +842,9 @@ namespace JSC {
void emitPutImmediateToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry);
void emitGetFromCallFrameHeaderPtr(JSStack::CallFrameHeaderEntry, RegisterID to, RegisterID from = callFrameRegister);
void emitGetFromCallFrameHeader32(JSStack::CallFrameHeaderEntry, RegisterID to, RegisterID from = callFrameRegister);
+#if USE(JSVALUE64)
+ void emitGetFromCallFrameHeader64(JSStack::CallFrameHeaderEntry, RegisterID to, RegisterID from = callFrameRegister);
+#endif
JSValue getConstantOperand(unsigned src);
bool isOperandConstantImmediateInt(unsigned src);
diff --git a/Source/JavaScriptCore/jit/JITArithmetic.cpp b/Source/JavaScriptCore/jit/JITArithmetic.cpp
index b66e2cd07..21d59bc33 100644
--- a/Source/JavaScriptCore/jit/JITArithmetic.cpp
+++ b/Source/JavaScriptCore/jit/JITArithmetic.cpp
@@ -209,8 +209,8 @@ void JIT::emit_op_negate(Instruction* currentInstruction)
srcNotInt.link(this);
emitJumpSlowCaseIfNotImmediateNumber(regT0);
- move(TrustedImmPtr(reinterpret_cast<void*>(0x8000000000000000ull)), regT1);
- xorPtr(regT1, regT0);
+ move(TrustedImm64((int64_t)0x8000000000000000ull), regT1);
+ xor64(regT1, regT0);
end.link(this);
emitPutVirtualRegister(dst);
@@ -224,7 +224,7 @@ void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEnt
linkSlowCase(iter); // double check
JITStubCall stubCall(this, cti_op_negate);
- stubCall.addArgument(regT1, regT0);
+ stubCall.addArgument(regT0);
stubCall.call(dst);
}
@@ -279,8 +279,8 @@ void JIT::emit_op_rshift(Instruction* currentInstruction)
Jump lhsIsInt = emitJumpIfImmediateInteger(regT0);
// supportsFloatingPoint() && USE(JSVALUE64) => 3 SlowCases
addSlowCase(emitJumpIfNotImmediateNumber(regT0));
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT0);
+ add64(tagTypeNumberRegister, regT0);
+ move64ToDouble(regT0, fpRegT0);
addSlowCase(branchTruncateDoubleToInt32(fpRegT0, regT0));
lhsIsInt.link(this);
emitJumpSlowCaseIfNotImmediateInteger(regT2);
@@ -377,8 +377,8 @@ void JIT::emitSlow_op_urshift(Instruction* currentInstruction, Vector<SlowCaseEn
if (supportsFloatingPointTruncate()) {
JumpList failures;
failures.append(emitJumpIfNotImmediateNumber(regT0)); // op1 is not a double
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT0);
+ add64(tagTypeNumberRegister, regT0);
+ move64ToDouble(regT0, fpRegT0);
failures.append(branchTruncateDoubleToInt32(fpRegT0, regT0));
if (shift)
urshift32(Imm32(shift & 0x1f), regT0);
@@ -399,8 +399,8 @@ void JIT::emitSlow_op_urshift(Instruction* currentInstruction, Vector<SlowCaseEn
if (supportsFloatingPointTruncate()) {
JumpList failures;
failures.append(emitJumpIfNotImmediateNumber(regT0)); // op1 is not a double
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT0);
+ add64(tagTypeNumberRegister, regT0);
+ move64ToDouble(regT0, fpRegT0);
failures.append(branchTruncateDoubleToInt32(fpRegT0, regT0));
failures.append(emitJumpIfNotImmediateInteger(regT1)); // op2 is not an int
emitFastArithImmToInt(regT1);
@@ -499,8 +499,8 @@ void JIT::emit_compareAndJumpSlow(unsigned op1, unsigned op2, unsigned target, D
if (supportsFloatingPoint()) {
Jump fail1 = emitJumpIfNotImmediateNumber(regT0);
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT0);
+ add64(tagTypeNumberRegister, regT0);
+ move64ToDouble(regT0, fpRegT0);
int32_t op2imm = getConstantOperand(op2).asInt32();
@@ -525,8 +525,8 @@ void JIT::emit_compareAndJumpSlow(unsigned op1, unsigned op2, unsigned target, D
if (supportsFloatingPoint()) {
Jump fail1 = emitJumpIfNotImmediateNumber(regT1);
- addPtr(tagTypeNumberRegister, regT1);
- movePtrToDouble(regT1, fpRegT1);
+ add64(tagTypeNumberRegister, regT1);
+ move64ToDouble(regT1, fpRegT1);
int32_t op1imm = getConstantOperand(op1).asInt32();
@@ -552,10 +552,10 @@ void JIT::emit_compareAndJumpSlow(unsigned op1, unsigned op2, unsigned target, D
Jump fail1 = emitJumpIfNotImmediateNumber(regT0);
Jump fail2 = emitJumpIfNotImmediateNumber(regT1);
Jump fail3 = emitJumpIfImmediateInteger(regT1);
- addPtr(tagTypeNumberRegister, regT0);
- addPtr(tagTypeNumberRegister, regT1);
- movePtrToDouble(regT0, fpRegT0);
- movePtrToDouble(regT1, fpRegT1);
+ add64(tagTypeNumberRegister, regT0);
+ add64(tagTypeNumberRegister, regT1);
+ move64ToDouble(regT0, fpRegT0);
+ move64ToDouble(regT1, fpRegT1);
emitJumpSlowToHot(branchDouble(condition, fpRegT0, fpRegT1), target);
@@ -585,19 +585,19 @@ void JIT::emit_op_bitand(Instruction* currentInstruction)
emitGetVirtualRegister(op2, regT0);
emitJumpSlowCaseIfNotImmediateInteger(regT0);
int32_t imm = getConstantOperandImmediateInt(op1);
- andPtr(Imm32(imm), regT0);
+ and64(Imm32(imm), regT0);
if (imm >= 0)
emitFastArithIntToImmNoCheck(regT0, regT0);
} else if (isOperandConstantImmediateInt(op2)) {
emitGetVirtualRegister(op1, regT0);
emitJumpSlowCaseIfNotImmediateInteger(regT0);
int32_t imm = getConstantOperandImmediateInt(op2);
- andPtr(Imm32(imm), regT0);
+ and64(Imm32(imm), regT0);
if (imm >= 0)
emitFastArithIntToImmNoCheck(regT0, regT0);
} else {
emitGetVirtualRegisters(op1, regT0, op2, regT1);
- andPtr(regT1, regT0);
+ and64(regT1, regT0);
emitJumpSlowCaseIfNotImmediateInteger(regT0);
}
emitPutVirtualRegister(result);
@@ -887,16 +887,16 @@ void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>:
emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this);
emitGetVirtualRegister(op1, regT1);
convertInt32ToDouble(regT1, fpRegT1);
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT2);
+ add64(tagTypeNumberRegister, regT0);
+ move64ToDouble(regT0, fpRegT2);
} else if (op2HasImmediateIntFastCase) {
notImm1.link(this);
if (!types.first().definitelyIsNumber())
emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this);
emitGetVirtualRegister(op2, regT1);
convertInt32ToDouble(regT1, fpRegT1);
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT2);
+ add64(tagTypeNumberRegister, regT0);
+ move64ToDouble(regT0, fpRegT2);
} else {
// if we get here, eax is not an int32, edx not yet checked.
notImm1.link(this);
@@ -904,8 +904,8 @@ void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>:
emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this);
if (!types.second().definitelyIsNumber())
emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this);
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT1);
+ add64(tagTypeNumberRegister, regT0);
+ move64ToDouble(regT0, fpRegT1);
Jump op2isDouble = emitJumpIfNotImmediateInteger(regT1);
convertInt32ToDouble(regT1, fpRegT2);
Jump op2wasInteger = jump();
@@ -916,8 +916,8 @@ void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>:
emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this);
convertInt32ToDouble(regT0, fpRegT1);
op2isDouble.link(this);
- addPtr(tagTypeNumberRegister, regT1);
- movePtrToDouble(regT1, fpRegT2);
+ add64(tagTypeNumberRegister, regT1);
+ move64ToDouble(regT1, fpRegT2);
op2wasInteger.link(this);
}
@@ -931,8 +931,8 @@ void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>:
ASSERT(opcodeID == op_div);
divDouble(fpRegT2, fpRegT1);
}
- moveDoubleToPtr(fpRegT1, regT0);
- subPtr(tagTypeNumberRegister, regT0);
+ moveDoubleTo64(fpRegT1, regT0);
+ sub64(tagTypeNumberRegister, regT0);
emitPutVirtualRegister(result, regT0);
end.link(this);
@@ -1041,8 +1041,8 @@ void JIT::emit_op_div(Instruction* currentInstruction)
if (isOperandConstantImmediateDouble(op1)) {
emitGetVirtualRegister(op1, regT0);
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT0);
+ add64(tagTypeNumberRegister, regT0);
+ move64ToDouble(regT0, fpRegT0);
} else if (isOperandConstantImmediateInt(op1)) {
emitLoadInt32ToDouble(op1, fpRegT0);
} else {
@@ -1053,15 +1053,15 @@ void JIT::emit_op_div(Instruction* currentInstruction)
convertInt32ToDouble(regT0, fpRegT0);
Jump skipDoubleLoad = jump();
notInt.link(this);
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT0);
+ add64(tagTypeNumberRegister, regT0);
+ move64ToDouble(regT0, fpRegT0);
skipDoubleLoad.link(this);
}
if (isOperandConstantImmediateDouble(op2)) {
emitGetVirtualRegister(op2, regT1);
- addPtr(tagTypeNumberRegister, regT1);
- movePtrToDouble(regT1, fpRegT1);
+ add64(tagTypeNumberRegister, regT1);
+ move64ToDouble(regT1, fpRegT1);
} else if (isOperandConstantImmediateInt(op2)) {
emitLoadInt32ToDouble(op2, fpRegT1);
} else {
@@ -1072,8 +1072,8 @@ void JIT::emit_op_div(Instruction* currentInstruction)
convertInt32ToDouble(regT1, fpRegT1);
Jump skipDoubleLoad = jump();
notInt.link(this);
- addPtr(tagTypeNumberRegister, regT1);
- movePtrToDouble(regT1, fpRegT1);
+ add64(tagTypeNumberRegister, regT1);
+ move64ToDouble(regT1, fpRegT1);
skipDoubleLoad.link(this);
}
divDouble(fpRegT1, fpRegT0);
@@ -1100,13 +1100,13 @@ void JIT::emit_op_div(Instruction* currentInstruction)
Jump isInteger = jump();
notInteger.link(this);
add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset)->m_counter));
- moveDoubleToPtr(fpRegT0, regT0);
- subPtr(tagTypeNumberRegister, regT0);
+ moveDoubleTo64(fpRegT0, regT0);
+ sub64(tagTypeNumberRegister, regT0);
isInteger.link(this);
#else
// Double result.
- moveDoubleToPtr(fpRegT0, regT0);
- subPtr(tagTypeNumberRegister, regT0);
+ moveDoubleTo64(fpRegT0, regT0);
+ sub64(tagTypeNumberRegister, regT0);
#endif
emitPutVirtualRegister(dst, regT0);
diff --git a/Source/JavaScriptCore/jit/JITCall.cpp b/Source/JavaScriptCore/jit/JITCall.cpp
index 1de877daa..074bf7f97 100644
--- a/Source/JavaScriptCore/jit/JITCall.cpp
+++ b/Source/JavaScriptCore/jit/JITCall.cpp
@@ -72,7 +72,7 @@ void JIT::compileLoadVarargs(Instruction* instruction)
if (canOptimize) {
emitGetVirtualRegister(arguments, regT0);
- slowCase.append(branchPtr(NotEqual, regT0, TrustedImmPtr(JSValue::encode(JSValue()))));
+ slowCase.append(branch64(NotEqual, regT0, TrustedImm64(JSValue::encode(JSValue()))));
emitGetFromCallFrameHeader32(JSStack::ArgumentCount, regT0);
slowCase.append(branch32(Above, regT0, TrustedImm32(Arguments::MaxArguments + 1)));
@@ -91,18 +91,18 @@ void JIT::compileLoadVarargs(Instruction* instruction)
// Initialize 'this'.
emitGetVirtualRegister(thisValue, regT2);
- storePtr(regT2, Address(regT1, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))));
+ store64(regT2, Address(regT1, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))));
// Copy arguments.
neg32(regT0);
signExtend32ToPtr(regT0, regT0);
- end.append(branchAddPtr(Zero, TrustedImm32(1), regT0));
+ end.append(branchAdd64(Zero, TrustedImm32(1), regT0));
// regT0: -argumentCount
Label copyLoop = label();
- loadPtr(BaseIndex(callFrameRegister, regT0, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))), regT2);
- storePtr(regT2, BaseIndex(regT1, regT0, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))));
- branchAddPtr(NonZero, TrustedImm32(1), regT0).linkTo(copyLoop, this);
+ load64(BaseIndex(callFrameRegister, regT0, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))), regT2);
+ store64(regT2, BaseIndex(regT1, regT0, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))));
+ branchAdd64(NonZero, TrustedImm32(1), regT0).linkTo(copyLoop, this);
end.append(jump());
}
@@ -124,7 +124,7 @@ void JIT::compileCallEval()
{
JITStubCall stubCall(this, cti_op_call_eval); // Initializes ScopeChain; ReturnPC; CodeBlock.
stubCall.call();
- addSlowCase(branchPtr(Equal, regT0, TrustedImmPtr(JSValue::encode(JSValue()))));
+ addSlowCase(branch64(Equal, regT0, TrustedImm64(JSValue::encode(JSValue()))));
emitGetFromCallFrameHeaderPtr(JSStack::CallerFrame, callFrameRegister);
sampleCodeBlock(m_codeBlock);
@@ -134,7 +134,7 @@ void JIT::compileCallEvalSlowCase(Vector<SlowCaseEntry>::iterator& iter)
{
linkSlowCase(iter);
- emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
+ emitGetFromCallFrameHeader64(JSStack::Callee, regT0);
emitNakedCall(m_globalData->jitStubs->ctiVirtualCall());
sampleCodeBlock(m_codeBlock);
@@ -179,8 +179,8 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned ca
store32(TrustedImm32(instruction - m_codeBlock->instructions().begin()), Address(callFrameRegister, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));
emitGetVirtualRegister(callee, regT0); // regT0 holds callee.
- storePtr(callFrameRegister, Address(regT1, JSStack::CallerFrame * static_cast<int>(sizeof(Register))));
- storePtr(regT0, Address(regT1, JSStack::Callee * static_cast<int>(sizeof(Register))));
+ store64(callFrameRegister, Address(regT1, JSStack::CallerFrame * static_cast<int>(sizeof(Register))));
+ store64(regT0, Address(regT1, JSStack::Callee * static_cast<int>(sizeof(Register))));
move(regT1, callFrameRegister);
if (opcodeID == op_call_eval) {
@@ -190,7 +190,7 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned ca
DataLabelPtr addressOfLinkedFunctionCheck;
BEGIN_UNINTERRUPTED_SEQUENCE(sequenceOpCall);
- Jump slowCase = branchPtrWithPatch(NotEqual, regT0, addressOfLinkedFunctionCheck, TrustedImmPtr(JSValue::encode(JSValue())));
+ Jump slowCase = branchPtrWithPatch(NotEqual, regT0, addressOfLinkedFunctionCheck, TrustedImmPtr(0));
END_UNINTERRUPTED_SEQUENCE(sequenceOpCall);
addSlowCase(slowCase);
diff --git a/Source/JavaScriptCore/jit/JITInlineMethods.h b/Source/JavaScriptCore/jit/JITInlineMethods.h
index a7aecd3e8..410bdf710 100644
--- a/Source/JavaScriptCore/jit/JITInlineMethods.h
+++ b/Source/JavaScriptCore/jit/JITInlineMethods.h
@@ -31,14 +31,6 @@
namespace JSC {
-/* Deprecated: Please use JITStubCall instead. */
-
-ALWAYS_INLINE void JIT::emitGetJITStubArg(unsigned argumentNumber, RegisterID dst)
-{
- unsigned argumentStackOffset = (argumentNumber * (sizeof(JSValue) / sizeof(void*))) + JITSTACKFRAME_ARGS_INDEX;
- peek(dst, argumentStackOffset);
-}
-
ALWAYS_INLINE bool JIT::isOperandConstantImmediateDouble(unsigned src)
{
return m_codeBlock->isConstantRegisterIndex(src) && getConstantOperand(src).isDouble();
@@ -50,23 +42,33 @@ ALWAYS_INLINE JSValue JIT::getConstantOperand(unsigned src)
return m_codeBlock->getConstant(src);
}
-ALWAYS_INLINE void JIT::emitPutToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry entry)
-{
- storePtr(from, payloadFor(entry, callFrameRegister));
-}
-
ALWAYS_INLINE void JIT::emitPutCellToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry entry)
{
#if USE(JSVALUE32_64)
store32(TrustedImm32(JSValue::CellTag), tagFor(entry, callFrameRegister));
+ store32(from, payloadFor(entry, callFrameRegister));
+#else
+ store64(from, addressFor(entry, callFrameRegister));
#endif
- storePtr(from, payloadFor(entry, callFrameRegister));
}
ALWAYS_INLINE void JIT::emitPutIntToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry entry)
{
+#if USE(JSVALUE32_64)
store32(TrustedImm32(Int32Tag), intTagFor(entry, callFrameRegister));
store32(from, intPayloadFor(entry, callFrameRegister));
+#else
+ store64(from, addressFor(entry, callFrameRegister));
+#endif
+}
+
+ALWAYS_INLINE void JIT::emitPutToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry entry)
+{
+#if USE(JSVALUE32_64)
+ storePtr(from, payloadFor(entry, callFrameRegister));
+#else
+ store64(from, addressFor(entry, callFrameRegister));
+#endif
}
ALWAYS_INLINE void JIT::emitPutImmediateToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry entry)
@@ -82,6 +84,22 @@ ALWAYS_INLINE void JIT::emitGetFromCallFrameHeaderPtr(JSStack::CallFrameHeaderEn
#endif
}
+ALWAYS_INLINE void JIT::emitGetFromCallFrameHeader32(JSStack::CallFrameHeaderEntry entry, RegisterID to, RegisterID from)
+{
+ load32(Address(from, entry * sizeof(Register)), to);
+#if USE(JSVALUE64)
+ killLastResultRegister();
+#endif
+}
+
+#if USE(JSVALUE64)
+ALWAYS_INLINE void JIT::emitGetFromCallFrameHeader64(JSStack::CallFrameHeaderEntry entry, RegisterID to, RegisterID from)
+{
+ load64(Address(from, entry * sizeof(Register)), to);
+ killLastResultRegister();
+}
+#endif
+
ALWAYS_INLINE void JIT::emitLoadCharacterString(RegisterID src, RegisterID dst, JumpList& failures)
{
failures.append(branchPtr(NotEqual, Address(src, JSCell::structureOffset()), TrustedImmPtr(m_globalData->stringStructure.get())));
@@ -101,14 +119,6 @@ ALWAYS_INLINE void JIT::emitLoadCharacterString(RegisterID src, RegisterID dst,
cont8Bit.link(this);
}
-ALWAYS_INLINE void JIT::emitGetFromCallFrameHeader32(JSStack::CallFrameHeaderEntry entry, RegisterID to, RegisterID from)
-{
- load32(Address(from, entry * sizeof(Register)), to);
-#if USE(JSVALUE64)
- killLastResultRegister();
-#endif
-}
-
ALWAYS_INLINE JIT::Call JIT::emitNakedCall(CodePtr function)
{
ASSERT(m_bytecodeOffset != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeOffset is set.
@@ -434,56 +444,6 @@ template <typename T> inline void JIT::emitAllocateJSFinalObject(T structure, Re
emitAllocateBasicJSObject<JSFinalObject, MarkedBlock::None, T>(structure, result, scratch);
}
-inline void JIT::emitAllocateBasicStorage(size_t size, ptrdiff_t offsetFromBase, RegisterID result)
-{
- CopiedAllocator* allocator = &m_globalData->heap.storageAllocator();
-
- loadPtr(&allocator->m_currentRemaining, result);
- addSlowCase(branchSubPtr(Signed, TrustedImm32(size), result));
- storePtr(result, &allocator->m_currentRemaining);
- negPtr(result);
- addPtr(AbsoluteAddress(&allocator->m_currentPayloadEnd), result);
- subPtr(TrustedImm32(size - offsetFromBase), result);
-}
-
-inline void JIT::emitAllocateJSArray(unsigned valuesRegister, unsigned length, RegisterID cellResult, RegisterID storageResult, RegisterID storagePtr, RegisterID scratch)
-{
- unsigned initialLength = std::max(length, BASE_VECTOR_LEN);
- size_t initialStorage = Butterfly::totalSize(0, 0, true, initialLength * sizeof(EncodedJSValue));
-
- loadPtr(m_codeBlock->globalObject()->addressOfArrayStructure(), scratch);
- load8(Address(scratch, Structure::indexingTypeOffset()), storagePtr);
- and32(TrustedImm32(IndexingShapeMask), storagePtr);
- addSlowCase(branch32(NotEqual, storagePtr, TrustedImm32(ContiguousShape)));
-
- // We allocate the backing store first to ensure that garbage collection
- // doesn't happen during JSArray initialization.
- emitAllocateBasicStorage(initialStorage, sizeof(IndexingHeader), storageResult);
-
- // Allocate the cell for the array.
- emitAllocateBasicJSObject<JSArray, MarkedBlock::None>(scratch, cellResult, storagePtr);
-
- // Store all the necessary info in the indexing header.
- store32(Imm32(length), Address(storageResult, Butterfly::offsetOfPublicLength()));
- store32(Imm32(initialLength), Address(storageResult, Butterfly::offsetOfVectorLength()));
-
- // Store the newly allocated ArrayStorage.
- storePtr(storageResult, Address(cellResult, JSObject::butterflyOffset()));
-
- // Store the values we have.
- for (unsigned i = 0; i < length; i++) {
-#if USE(JSVALUE64)
- loadPtr(Address(callFrameRegister, (valuesRegister + i) * sizeof(Register)), storagePtr);
- storePtr(storagePtr, Address(storageResult, sizeof(WriteBarrier<Unknown>) * i));
-#else
- load32(Address(callFrameRegister, (valuesRegister + i) * sizeof(Register)), storagePtr);
- store32(storagePtr, Address(storageResult, sizeof(WriteBarrier<Unknown>) * i));
- load32(Address(callFrameRegister, (valuesRegister + i) * sizeof(Register) + sizeof(uint32_t)), storagePtr);
- store32(storagePtr, Address(storageResult, sizeof(WriteBarrier<Unknown>) * i + sizeof(uint32_t)));
-#endif
- }
-}
-
#if ENABLE(VALUE_PROFILER)
inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile)
{
@@ -500,7 +460,7 @@ inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile)
// We're in a simple configuration: only one bucket, so we can just do a direct
// store.
#if USE(JSVALUE64)
- storePtr(value, valueProfile->m_buckets);
+ store64(value, valueProfile->m_buckets);
#else
EncodedValueDescriptor* descriptor = bitwise_cast<EncodedValueDescriptor*>(valueProfile->m_buckets);
store32(value, &descriptor->asBits.payload);
@@ -516,7 +476,7 @@ inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile)
and32(TrustedImm32(ValueProfile::bucketIndexMask), bucketCounterRegister);
move(TrustedImmPtr(valueProfile->m_buckets), scratch);
#if USE(JSVALUE64)
- storePtr(value, BaseIndex(scratch, bucketCounterRegister, TimesEight));
+ store64(value, BaseIndex(scratch, bucketCounterRegister, TimesEight));
#elif USE(JSVALUE32_64)
store32(value, BaseIndex(scratch, bucketCounterRegister, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
store32(valueTag, BaseIndex(scratch, bucketCounterRegister, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
@@ -538,17 +498,15 @@ inline void JIT::emitValueProfilingSite()
inline void JIT::emitArrayProfilingSite(RegisterID structureAndIndexingType, RegisterID scratch, ArrayProfile* arrayProfile)
{
+ UNUSED_PARAM(scratch); // We had found this scratch register useful here before, so I will keep it for now.
+
RegisterID structure = structureAndIndexingType;
RegisterID indexingType = structureAndIndexingType;
- if (canBeOptimized()) {
+ if (canBeOptimized())
storePtr(structure, arrayProfile->addressOfLastSeenStructure());
- load8(Address(structure, Structure::indexingTypeOffset()), indexingType);
- move(TrustedImm32(1), scratch);
- lshift32(indexingType, scratch);
- or32(scratch, AbsoluteAddress(arrayProfile->addressOfArrayModes()));
- } else
- load8(Address(structure, Structure::indexingTypeOffset()), indexingType);
+
+ load8(Address(structure, Structure::indexingTypeOffset()), indexingType);
}
inline void JIT::emitArrayProfilingSiteForBytecodeIndex(RegisterID structureAndIndexingType, RegisterID scratch, unsigned bytecodeIndex)
@@ -860,6 +818,14 @@ ALWAYS_INLINE bool JIT::getOperandConstantImmediateInt(unsigned op1, unsigned op
#else // USE(JSVALUE32_64)
+/* Deprecated: Please use JITStubCall instead. */
+
+ALWAYS_INLINE void JIT::emitGetJITStubArg(unsigned argumentNumber, RegisterID dst)
+{
+ unsigned argumentStackOffset = (argumentNumber * (sizeof(JSValue) / sizeof(void*))) + JITSTACKFRAME_ARGS_INDEX;
+ peek64(dst, argumentStackOffset);
+}
+
ALWAYS_INLINE void JIT::killLastResultRegister()
{
m_lastResultBytecodeRegister = std::numeric_limits<int>::max();
@@ -874,9 +840,9 @@ ALWAYS_INLINE void JIT::emitGetVirtualRegister(int src, RegisterID dst)
if (m_codeBlock->isConstantRegisterIndex(src)) {
JSValue value = m_codeBlock->getConstant(src);
if (!value.isNumber())
- move(TrustedImmPtr(JSValue::encode(value)), dst);
+ move(TrustedImm64(JSValue::encode(value)), dst);
else
- move(ImmPtr(JSValue::encode(value)), dst);
+ move(Imm64(JSValue::encode(value)), dst);
killLastResultRegister();
return;
}
@@ -889,7 +855,7 @@ ALWAYS_INLINE void JIT::emitGetVirtualRegister(int src, RegisterID dst)
return;
}
- loadPtr(Address(callFrameRegister, src * sizeof(Register)), dst);
+ load64(Address(callFrameRegister, src * sizeof(Register)), dst);
killLastResultRegister();
}
@@ -916,28 +882,24 @@ ALWAYS_INLINE bool JIT::isOperandConstantImmediateInt(unsigned src)
ALWAYS_INLINE void JIT::emitPutVirtualRegister(unsigned dst, RegisterID from)
{
- storePtr(from, Address(callFrameRegister, dst * sizeof(Register)));
+ store64(from, Address(callFrameRegister, dst * sizeof(Register)));
m_lastResultBytecodeRegister = (from == cachedResultRegister) ? static_cast<int>(dst) : std::numeric_limits<int>::max();
}
ALWAYS_INLINE void JIT::emitInitRegister(unsigned dst)
{
- storePtr(TrustedImmPtr(JSValue::encode(jsUndefined())), Address(callFrameRegister, dst * sizeof(Register)));
+ store64(TrustedImm64(JSValue::encode(jsUndefined())), Address(callFrameRegister, dst * sizeof(Register)));
}
ALWAYS_INLINE JIT::Jump JIT::emitJumpIfJSCell(RegisterID reg)
{
-#if USE(JSVALUE64)
- return branchTestPtr(Zero, reg, tagMaskRegister);
-#else
- return branchTest32(Zero, reg, TrustedImm32(TagMask));
-#endif
+ return branchTest64(Zero, reg, tagMaskRegister);
}
ALWAYS_INLINE JIT::Jump JIT::emitJumpIfBothJSCells(RegisterID reg1, RegisterID reg2, RegisterID scratch)
{
move(reg1, scratch);
- orPtr(reg2, scratch);
+ or64(reg2, scratch);
return emitJumpIfJSCell(scratch);
}
@@ -948,11 +910,7 @@ ALWAYS_INLINE void JIT::emitJumpSlowCaseIfJSCell(RegisterID reg)
ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotJSCell(RegisterID reg)
{
-#if USE(JSVALUE64)
- return branchTestPtr(NonZero, reg, tagMaskRegister);
-#else
- return branchTest32(NonZero, reg, TrustedImm32(TagMask));
-#endif
+ return branchTest64(NonZero, reg, tagMaskRegister);
}
ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotJSCell(RegisterID reg)
@@ -966,8 +924,6 @@ ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotJSCell(RegisterID reg, int vReg)
emitJumpSlowCaseIfNotJSCell(reg);
}
-#if USE(JSVALUE64)
-
inline void JIT::emitLoadDouble(int index, FPRegisterID value)
{
if (m_codeBlock->isConstantRegisterIndex(index)) {
@@ -985,30 +941,21 @@ inline void JIT::emitLoadInt32ToDouble(int index, FPRegisterID value)
} else
convertInt32ToDouble(addressFor(index), value);
}
-#endif
ALWAYS_INLINE JIT::Jump JIT::emitJumpIfImmediateInteger(RegisterID reg)
{
-#if USE(JSVALUE64)
- return branchPtr(AboveOrEqual, reg, tagTypeNumberRegister);
-#else
- return branchTest32(NonZero, reg, TrustedImm32(TagTypeNumber));
-#endif
+ return branch64(AboveOrEqual, reg, tagTypeNumberRegister);
}
ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotImmediateInteger(RegisterID reg)
{
-#if USE(JSVALUE64)
- return branchPtr(Below, reg, tagTypeNumberRegister);
-#else
- return branchTest32(Zero, reg, TrustedImm32(TagTypeNumber));
-#endif
+ return branch64(Below, reg, tagTypeNumberRegister);
}
ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotImmediateIntegers(RegisterID reg1, RegisterID reg2, RegisterID scratch)
{
move(reg1, scratch);
- andPtr(reg2, scratch);
+ and64(reg2, scratch);
return emitJumpIfNotImmediateInteger(scratch);
}
@@ -1027,41 +974,17 @@ ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotImmediateNumber(RegisterID reg)
addSlowCase(emitJumpIfNotImmediateNumber(reg));
}
-#if USE(JSVALUE32_64)
-ALWAYS_INLINE void JIT::emitFastArithDeTagImmediate(RegisterID reg)
-{
- subPtr(TrustedImm32(TagTypeNumber), reg);
-}
-
-ALWAYS_INLINE JIT::Jump JIT::emitFastArithDeTagImmediateJumpIfZero(RegisterID reg)
-{
- return branchSubPtr(Zero, TrustedImm32(TagTypeNumber), reg);
-}
-#endif
-
ALWAYS_INLINE void JIT::emitFastArithReTagImmediate(RegisterID src, RegisterID dest)
{
-#if USE(JSVALUE64)
emitFastArithIntToImmNoCheck(src, dest);
-#else
- if (src != dest)
- move(src, dest);
- addPtr(TrustedImm32(TagTypeNumber), dest);
-#endif
}
// operand is int32_t, must have been zero-extended if register is 64-bit.
ALWAYS_INLINE void JIT::emitFastArithIntToImmNoCheck(RegisterID src, RegisterID dest)
{
-#if USE(JSVALUE64)
if (src != dest)
move(src, dest);
- orPtr(tagTypeNumberRegister, dest);
-#else
- signExtend32ToPtr(src, dest);
- addPtr(dest, dest);
- emitFastArithReTagImmediate(dest, dest);
-#endif
+ or64(tagTypeNumberRegister, dest);
}
ALWAYS_INLINE void JIT::emitTagAsBoolImmediate(RegisterID reg)
diff --git a/Source/JavaScriptCore/jit/JITOpcodes.cpp b/Source/JavaScriptCore/jit/JITOpcodes.cpp
index c187e4725..07c8ace2a 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes.cpp
@@ -248,14 +248,14 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
// Host function signature: f(ExecState*);
move(callFrameRegister, X86Registers::edi);
- subPtr(TrustedImm32(16 - sizeof(void*)), stackPointerRegister); // Align stack after call.
+ subPtr(TrustedImm32(16 - sizeof(int64_t)), stackPointerRegister); // Align stack after call.
emitGetFromCallFrameHeaderPtr(JSStack::Callee, X86Registers::esi);
loadPtr(Address(X86Registers::esi, OBJECT_OFFSETOF(JSFunction, m_executable)), X86Registers::r9);
move(regT0, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack.
call(Address(X86Registers::r9, executableOffsetToFunction));
- addPtr(TrustedImm32(16 - sizeof(void*)), stackPointerRegister);
+ addPtr(TrustedImm32(16 - sizeof(int64_t)), stackPointerRegister);
#elif CPU(ARM)
// Load caller frame's scope chain into this callframe so that whatever we call can
@@ -316,8 +316,8 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
#endif
// Check for an exception
- loadPtr(&(globalData->exception), regT2);
- Jump exceptionHandler = branchTestPtr(NonZero, regT2);
+ load64(&(globalData->exception), regT2);
+ Jump exceptionHandler = branchTest64(NonZero, regT2);
// Return.
ret();
@@ -360,9 +360,9 @@ void JIT::emit_op_mov(Instruction* currentInstruction)
} else {
if (m_codeBlock->isConstantRegisterIndex(src)) {
if (!getConstantOperand(src).isNumber())
- storePtr(TrustedImmPtr(JSValue::encode(getConstantOperand(src))), Address(callFrameRegister, dst * sizeof(Register)));
+ store64(TrustedImm64(JSValue::encode(getConstantOperand(src))), Address(callFrameRegister, dst * sizeof(Register)));
else
- storePtr(ImmPtr(JSValue::encode(getConstantOperand(src))), Address(callFrameRegister, dst * sizeof(Register)));
+ store64(Imm64(JSValue::encode(getConstantOperand(src))), Address(callFrameRegister, dst * sizeof(Register)));
if (dst == m_lastResultBytecodeRegister)
killLastResultRegister();
} else if ((src == m_lastResultBytecodeRegister) || (dst == m_lastResultBytecodeRegister)) {
@@ -372,8 +372,8 @@ void JIT::emit_op_mov(Instruction* currentInstruction)
emitPutVirtualRegister(dst);
} else {
// Perform the copy via regT1; do not disturb any mapping in regT0.
- loadPtr(Address(callFrameRegister, src * sizeof(Register)), regT1);
- storePtr(regT1, Address(callFrameRegister, dst * sizeof(Register)));
+ load64(Address(callFrameRegister, src * sizeof(Register)), regT1);
+ store64(regT1, Address(callFrameRegister, dst * sizeof(Register)));
}
}
}
@@ -441,18 +441,18 @@ void JIT::emit_op_instanceof(Instruction* currentInstruction)
// Optimistically load the result true, and start looping.
// Initially, regT1 still contains proto and regT2 still contains value.
// As we loop regT2 will be updated with its prototype, recursively walking the prototype chain.
- move(TrustedImmPtr(JSValue::encode(jsBoolean(true))), regT0);
+ move(TrustedImm64(JSValue::encode(jsBoolean(true))), regT0);
Label loop(this);
// Load the prototype of the object in regT2. If this is equal to regT1 - WIN!
// Otherwise, check if we've hit null - if we have then drop out of the loop, if not go again.
loadPtr(Address(regT2, JSCell::structureOffset()), regT2);
- loadPtr(Address(regT2, Structure::prototypeOffset()), regT2);
+ load64(Address(regT2, Structure::prototypeOffset()), regT2);
Jump isInstance = branchPtr(Equal, regT2, regT1);
emitJumpIfJSCell(regT2).linkTo(loop, this);
// We get here either by dropping out of the loop, or if value was not an Object. Result is false.
- move(TrustedImmPtr(JSValue::encode(jsBoolean(false))), regT0);
+ move(TrustedImm64(JSValue::encode(jsBoolean(false))), regT0);
// isInstance jumps right down to here, to skip setting the result to false (it has already set true).
isInstance.link(this);
@@ -467,7 +467,7 @@ void JIT::emit_op_is_undefined(Instruction* currentInstruction)
emitGetVirtualRegister(value, regT0);
Jump isCell = emitJumpIfJSCell(regT0);
- comparePtr(Equal, regT0, TrustedImm32(ValueUndefined), regT0);
+ compare64(Equal, regT0, TrustedImm32(ValueUndefined), regT0);
Jump done = jump();
isCell.link(this);
@@ -493,8 +493,8 @@ void JIT::emit_op_is_boolean(Instruction* currentInstruction)
unsigned value = currentInstruction[2].u.operand;
emitGetVirtualRegister(value, regT0);
- xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0);
- testPtr(Zero, regT0, TrustedImm32(static_cast<int32_t>(~1)), regT0);
+ xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0);
+ test64(Zero, regT0, TrustedImm32(static_cast<int32_t>(~1)), regT0);
emitTagAsBoolImmediate(regT0);
emitPutVirtualRegister(dst);
}
@@ -505,7 +505,7 @@ void JIT::emit_op_is_number(Instruction* currentInstruction)
unsigned value = currentInstruction[2].u.operand;
emitGetVirtualRegister(value, regT0);
- testPtr(NonZero, regT0, tagTypeNumberRegister, regT0);
+ test64(NonZero, regT0, tagTypeNumberRegister, regT0);
emitTagAsBoolImmediate(regT0);
emitPutVirtualRegister(dst);
}
@@ -553,7 +553,7 @@ void JIT::emit_op_construct(Instruction* currentInstruction)
void JIT::emit_op_tear_off_activation(Instruction* currentInstruction)
{
int activation = currentInstruction[1].u.operand;
- Jump activationNotCreated = branchTestPtr(Zero, addressFor(activation));
+ Jump activationNotCreated = branchTest64(Zero, addressFor(activation));
JITStubCall stubCall(this, cti_op_tear_off_activation);
stubCall.addArgument(activation, regT2);
stubCall.call();
@@ -565,7 +565,7 @@ void JIT::emit_op_tear_off_arguments(Instruction* currentInstruction)
int arguments = currentInstruction[1].u.operand;
int activation = currentInstruction[2].u.operand;
- Jump argsNotCreated = branchTestPtr(Zero, Address(callFrameRegister, sizeof(Register) * (unmodifiedArgumentsRegister(arguments))));
+ Jump argsNotCreated = branchTest64(Zero, Address(callFrameRegister, sizeof(Register) * (unmodifiedArgumentsRegister(arguments))));
JITStubCall stubCall(this, cti_op_tear_off_arguments);
stubCall.addArgument(unmodifiedArgumentsRegister(arguments), regT2);
stubCall.addArgument(activation, regT2);
@@ -631,13 +631,6 @@ void JIT::emit_op_ret_object_or_this(Instruction* currentInstruction)
ret();
}
-void JIT::emit_op_resolve(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_resolve);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand)));
- stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
-}
-
void JIT::emit_op_to_primitive(Instruction* currentInstruction)
{
int dst = currentInstruction[1].u.operand;
@@ -662,13 +655,6 @@ void JIT::emit_op_strcat(Instruction* currentInstruction)
stubCall.call(currentInstruction[1].u.operand);
}
-void JIT::emit_op_resolve_base(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, currentInstruction[3].u.operand ? cti_op_resolve_base_strict_put : cti_op_resolve_base);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand)));
- stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
-}
-
void JIT::emit_op_ensure_property_exists(Instruction* currentInstruction)
{
JITStubCall stubCall(this, cti_op_ensure_property_exists);
@@ -677,50 +663,6 @@ void JIT::emit_op_ensure_property_exists(Instruction* currentInstruction)
stubCall.call(currentInstruction[1].u.operand);
}
-void JIT::emit_op_resolve_skip(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_resolve_skip);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand)));
- stubCall.addArgument(TrustedImm32(currentInstruction[3].u.operand));
- stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
-}
-
-void JIT::emit_op_resolve_global(Instruction* currentInstruction, bool)
-{
- // Fast case
- void* globalObject = m_codeBlock->globalObject();
- unsigned currentIndex = m_globalResolveInfoIndex++;
- GlobalResolveInfo* resolveInfoAddress = &(m_codeBlock->globalResolveInfo(currentIndex));
-
- // Check Structure of global object
- move(TrustedImmPtr(globalObject), regT0);
- move(TrustedImmPtr(resolveInfoAddress), regT2);
- loadPtr(Address(regT2, OBJECT_OFFSETOF(GlobalResolveInfo, structure)), regT1);
- addSlowCase(branchPtr(NotEqual, regT1, Address(regT0, JSCell::structureOffset()))); // Structures don't match
-
- // Load cached property
- // Assume that the global object always uses external storage.
- load32(Address(regT2, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), regT1);
- compileGetDirectOffset(regT0, regT0, regT1, regT0, KnownNotFinal);
- emitValueProfilingSite();
- emitPutVirtualRegister(currentInstruction[1].u.operand);
-}
-
-void JIT::emitSlow_op_resolve_global(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
-{
- unsigned dst = currentInstruction[1].u.operand;
- Identifier* ident = &m_codeBlock->identifier(currentInstruction[2].u.operand);
-
- unsigned currentIndex = m_globalResolveInfoIndex++;
-
- linkSlowCase(iter);
- JITStubCall stubCall(this, cti_op_resolve_global);
- stubCall.addArgument(TrustedImmPtr(ident));
- stubCall.addArgument(TrustedImm32(currentIndex));
- stubCall.addArgument(regT0);
- stubCall.callWithValueProfiling(dst);
-}
-
void JIT::emit_op_not(Instruction* currentInstruction)
{
emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
@@ -728,9 +670,9 @@ void JIT::emit_op_not(Instruction* currentInstruction)
// Invert against JSValue(false); if the value was tagged as a boolean, then all bits will be
// clear other than the low bit (which will be 0 or 1 for false or true inputs respectively).
// Then invert against JSValue(true), which will add the tag back in, and flip the low bit.
- xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0);
+ xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0);
addSlowCase(branchTestPtr(NonZero, regT0, TrustedImm32(static_cast<int32_t>(~1))));
- xorPtr(TrustedImm32(static_cast<int32_t>(ValueTrue)), regT0);
+ xor64(TrustedImm32(static_cast<int32_t>(ValueTrue)), regT0);
emitPutVirtualRegister(currentInstruction[1].u.operand);
}
@@ -740,11 +682,11 @@ void JIT::emit_op_jfalse(Instruction* currentInstruction)
unsigned target = currentInstruction[2].u.operand;
emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
- addJump(branchPtr(Equal, regT0, TrustedImmPtr(JSValue::encode(jsNumber(0)))), target);
+ addJump(branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsNumber(0)))), target);
Jump isNonZero = emitJumpIfImmediateInteger(regT0);
- addJump(branchPtr(Equal, regT0, TrustedImmPtr(JSValue::encode(jsBoolean(false)))), target);
- addSlowCase(branchPtr(NotEqual, regT0, TrustedImmPtr(JSValue::encode(jsBoolean(true)))));
+ addJump(branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsBoolean(false)))), target);
+ addSlowCase(branch64(NotEqual, regT0, TrustedImm64(JSValue::encode(jsBoolean(true)))));
isNonZero.link(this);
}
@@ -766,8 +708,8 @@ void JIT::emit_op_jeq_null(Instruction* currentInstruction)
// Now handle the immediate cases - undefined & null
isImmediate.link(this);
- andPtr(TrustedImm32(~TagBitUndefined), regT0);
- addJump(branchPtr(Equal, regT0, TrustedImmPtr(JSValue::encode(jsNull()))), target);
+ and64(TrustedImm32(~TagBitUndefined), regT0);
+ addJump(branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsNull()))), target);
isNotMasqueradesAsUndefined.link(this);
masqueradesGlobalObjectIsForeign.link(this);
@@ -789,8 +731,8 @@ void JIT::emit_op_jneq_null(Instruction* currentInstruction)
// Now handle the immediate cases - undefined & null
isImmediate.link(this);
- andPtr(TrustedImm32(~TagBitUndefined), regT0);
- addJump(branchPtr(NotEqual, regT0, TrustedImmPtr(JSValue::encode(jsNull()))), target);
+ and64(TrustedImm32(~TagBitUndefined), regT0);
+ addJump(branch64(NotEqual, regT0, TrustedImm64(JSValue::encode(jsNull()))), target);
wasNotImmediate.link(this);
}
@@ -814,32 +756,16 @@ void JIT::emit_op_eq(Instruction* currentInstruction)
emitPutVirtualRegister(currentInstruction[1].u.operand);
}
-void JIT::emit_op_resolve_with_base(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_resolve_with_base);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand)));
- stubCall.addArgument(TrustedImm32(currentInstruction[1].u.operand));
- stubCall.callWithValueProfiling(currentInstruction[2].u.operand);
-}
-
-void JIT::emit_op_resolve_with_this(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_resolve_with_this);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand)));
- stubCall.addArgument(TrustedImm32(currentInstruction[1].u.operand));
- stubCall.callWithValueProfiling(currentInstruction[2].u.operand);
-}
-
void JIT::emit_op_jtrue(Instruction* currentInstruction)
{
unsigned target = currentInstruction[2].u.operand;
emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
- Jump isZero = branchPtr(Equal, regT0, TrustedImmPtr(JSValue::encode(jsNumber(0))));
+ Jump isZero = branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsNumber(0))));
addJump(emitJumpIfImmediateInteger(regT0), target);
- addJump(branchPtr(Equal, regT0, TrustedImmPtr(JSValue::encode(jsBoolean(true)))), target);
- addSlowCase(branchPtr(NotEqual, regT0, TrustedImmPtr(JSValue::encode(jsBoolean(false)))));
+ addJump(branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsBoolean(true)))), target);
+ addSlowCase(branch64(NotEqual, regT0, TrustedImm64(JSValue::encode(jsBoolean(false)))));
isZero.link(this);
}
@@ -859,7 +785,7 @@ void JIT::emit_op_bitxor(Instruction* currentInstruction)
{
emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1);
emitJumpSlowCaseIfNotImmediateIntegers(regT0, regT1, regT2);
- xorPtr(regT1, regT0);
+ xor64(regT1, regT0);
emitFastArithReTagImmediate(regT0, regT0);
emitPutVirtualRegister(currentInstruction[1].u.operand);
}
@@ -868,7 +794,7 @@ void JIT::emit_op_bitor(Instruction* currentInstruction)
{
emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1);
emitJumpSlowCaseIfNotImmediateIntegers(regT0, regT1, regT2);
- orPtr(regT1, regT0);
+ or64(regT1, regT0);
emitPutVirtualRegister(currentInstruction[1].u.operand);
}
@@ -910,7 +836,7 @@ void JIT::emit_op_get_pnames(Instruction* currentInstruction)
getPnamesStubCall.addArgument(regT0);
getPnamesStubCall.call(dst);
load32(Address(regT0, OBJECT_OFFSETOF(JSPropertyNameIterator, m_jsStringsSize)), regT3);
- storePtr(tagTypeNumberRegister, payloadFor(i));
+ store64(tagTypeNumberRegister, addressFor(i));
store32(TrustedImm32(Int32Tag), intTagFor(size));
store32(regT3, intPayloadFor(size));
Jump end = jump();
@@ -947,7 +873,7 @@ void JIT::emit_op_next_pname(Instruction* currentInstruction)
loadPtr(addressFor(it), regT1);
loadPtr(Address(regT1, OBJECT_OFFSETOF(JSPropertyNameIterator, m_jsStrings)), regT2);
- loadPtr(BaseIndex(regT2, regT0, TimesEight), regT2);
+ load64(BaseIndex(regT2, regT0, TimesEight), regT2);
emitPutVirtualRegister(dst, regT2);
@@ -968,7 +894,7 @@ void JIT::emit_op_next_pname(Instruction* currentInstruction)
addJump(branchTestPtr(Zero, Address(regT3)), target);
Label checkPrototype(this);
- loadPtr(Address(regT2, Structure::prototypeOffset()), regT2);
+ load64(Address(regT2, Structure::prototypeOffset()), regT2);
callHasProperty.append(emitJumpIfNotJSCell(regT2));
loadPtr(Address(regT2, JSCell::structureOffset()), regT2);
callHasProperty.append(branchPtr(NotEqual, regT2, Address(regT3)));
@@ -1016,7 +942,7 @@ void JIT::compileOpStrictEq(Instruction* currentInstruction, CompileOpStrictEqTy
// Jump slow if both are cells (to cover strings).
move(regT0, regT2);
- orPtr(regT1, regT2);
+ or64(regT1, regT2);
addSlowCase(emitJumpIfJSCell(regT2));
// Jump slow if either is a double. First test if it's an integer, which is fine, and then test
@@ -1029,9 +955,9 @@ void JIT::compileOpStrictEq(Instruction* currentInstruction, CompileOpStrictEqTy
rightOK.link(this);
if (type == OpStrictEq)
- comparePtr(Equal, regT1, regT0, regT0);
+ compare64(Equal, regT1, regT0, regT0);
else
- comparePtr(NotEqual, regT1, regT0, regT0);
+ compare64(NotEqual, regT1, regT0, regT0);
emitTagAsBoolImmediate(regT0);
emitPutVirtualRegister(dst);
@@ -1077,8 +1003,8 @@ void JIT::emit_op_catch(Instruction* currentInstruction)
killLastResultRegister(); // FIXME: Implicitly treat op_catch as a labeled statement, and remove this line of code.
move(regT0, callFrameRegister);
peek(regT3, OBJECT_OFFSETOF(struct JITStackFrame, globalData) / sizeof(void*));
- loadPtr(Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception)), regT0);
- storePtr(TrustedImmPtr(JSValue::encode(JSValue())), Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception)));
+ load64(Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception)), regT0);
+ store64(TrustedImm64(JSValue::encode(JSValue())), Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception)));
emitPutVirtualRegister(currentInstruction[1].u.operand);
}
@@ -1147,9 +1073,9 @@ void JIT::emit_op_throw_reference_error(Instruction* currentInstruction)
{
JITStubCall stubCall(this, cti_op_throw_reference_error);
if (!m_codeBlock->getConstant(currentInstruction[1].u.operand).isNumber())
- stubCall.addArgument(TrustedImmPtr(JSValue::encode(m_codeBlock->getConstant(currentInstruction[1].u.operand))));
+ stubCall.addArgument(TrustedImm64(JSValue::encode(m_codeBlock->getConstant(currentInstruction[1].u.operand))));
else
- stubCall.addArgument(ImmPtr(JSValue::encode(m_codeBlock->getConstant(currentInstruction[1].u.operand))));
+ stubCall.addArgument(Imm64(JSValue::encode(m_codeBlock->getConstant(currentInstruction[1].u.operand))));
stubCall.call();
}
@@ -1189,8 +1115,8 @@ void JIT::emit_op_eq_null(Instruction* currentInstruction)
isImmediate.link(this);
- andPtr(TrustedImm32(~TagBitUndefined), regT0);
- comparePtr(Equal, regT0, TrustedImm32(ValueNull), regT0);
+ and64(TrustedImm32(~TagBitUndefined), regT0);
+ compare64(Equal, regT0, TrustedImm32(ValueNull), regT0);
wasNotImmediate.link(this);
wasNotMasqueradesAsUndefined.link(this);
@@ -1221,8 +1147,8 @@ void JIT::emit_op_neq_null(Instruction* currentInstruction)
isImmediate.link(this);
- andPtr(TrustedImm32(~TagBitUndefined), regT0);
- comparePtr(NotEqual, regT0, TrustedImm32(ValueNull), regT0);
+ and64(TrustedImm32(~TagBitUndefined), regT0);
+ compare64(NotEqual, regT0, TrustedImm32(ValueNull), regT0);
wasNotImmediate.link(this);
wasNotMasqueradesAsUndefined.link(this);
@@ -1247,7 +1173,7 @@ void JIT::emit_op_create_activation(Instruction* currentInstruction)
{
unsigned dst = currentInstruction[1].u.operand;
- Jump activationCreated = branchTestPtr(NonZero, Address(callFrameRegister, sizeof(Register) * dst));
+ Jump activationCreated = branchTest64(NonZero, Address(callFrameRegister, sizeof(Register) * dst));
JITStubCall(this, cti_op_push_activation).call(currentInstruction[1].u.operand);
emitPutVirtualRegister(dst);
activationCreated.link(this);
@@ -1257,7 +1183,7 @@ void JIT::emit_op_create_arguments(Instruction* currentInstruction)
{
unsigned dst = currentInstruction[1].u.operand;
- Jump argsCreated = branchTestPtr(NonZero, Address(callFrameRegister, sizeof(Register) * dst));
+ Jump argsCreated = branchTest64(NonZero, Address(callFrameRegister, sizeof(Register) * dst));
JITStubCall(this, cti_op_create_arguments).call();
emitPutVirtualRegister(dst);
emitPutVirtualRegister(unmodifiedArgumentsRegister(dst));
@@ -1268,7 +1194,7 @@ void JIT::emit_op_init_lazy_reg(Instruction* currentInstruction)
{
unsigned dst = currentInstruction[1].u.operand;
- storePtr(TrustedImmPtr(0), Address(callFrameRegister, sizeof(Register) * dst));
+ store64(TrustedImm64((int64_t)0), Address(callFrameRegister, sizeof(Register) * dst));
}
void JIT::emit_op_convert_this(Instruction* currentInstruction)
@@ -1327,16 +1253,16 @@ void JIT::emitSlow_op_convert_this(Instruction* currentInstruction, Vector<SlowC
linkSlowCase(iter);
if (shouldEmitProfiling())
- move(TrustedImmPtr(bitwise_cast<void*>(JSValue::encode(jsUndefined()))), regT0);
- Jump isNotUndefined = branchPtr(NotEqual, regT1, TrustedImmPtr(JSValue::encode(jsUndefined())));
+ move(TrustedImm64((JSValue::encode(jsUndefined()))), regT0);
+ Jump isNotUndefined = branch64(NotEqual, regT1, TrustedImm64(JSValue::encode(jsUndefined())));
emitValueProfilingSite();
- move(TrustedImmPtr(globalThis), regT0);
+ move(TrustedImm64(JSValue::encode(JSValue(static_cast<JSCell*>(globalThis)))), regT0);
emitPutVirtualRegister(currentInstruction[1].u.operand, regT0);
emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_convert_this));
linkSlowCase(iter);
if (shouldEmitProfiling())
- move(TrustedImmPtr(bitwise_cast<void*>(JSValue::encode(m_globalData->stringStructure.get()))), regT0);
+ move(TrustedImm64(JSValue::encode(m_globalData->stringStructure.get())), regT0);
isNotUndefined.link(this);
emitValueProfilingSite();
JITStubCall stubCall(this, cti_op_convert_this);
@@ -1356,7 +1282,7 @@ void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector<SlowC
void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
linkSlowCase(iter);
- xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0);
+ xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0);
JITStubCall stubCall(this, cti_op_not);
stubCall.addArgument(regT0);
stubCall.call(currentInstruction[1].u.operand);
@@ -1508,7 +1434,7 @@ void JIT::emit_op_get_arguments_length(Instruction* currentInstruction)
{
int dst = currentInstruction[1].u.operand;
int argumentsRegister = currentInstruction[2].u.operand;
- addSlowCase(branchTestPtr(NonZero, addressFor(argumentsRegister)));
+ addSlowCase(branchTest64(NonZero, addressFor(argumentsRegister)));
emitGetFromCallFrameHeader32(JSStack::ArgumentCount, regT0);
sub32(TrustedImm32(1), regT0);
emitFastArithReTagImmediate(regT0, regT0);
@@ -1534,7 +1460,7 @@ void JIT::emit_op_get_argument_by_val(Instruction* currentInstruction)
int dst = currentInstruction[1].u.operand;
int argumentsRegister = currentInstruction[2].u.operand;
int property = currentInstruction[3].u.operand;
- addSlowCase(branchTestPtr(NonZero, addressFor(argumentsRegister)));
+ addSlowCase(branchTest64(NonZero, addressFor(argumentsRegister)));
emitGetVirtualRegister(property, regT1);
addSlowCase(emitJumpIfNotImmediateInteger(regT1));
add32(TrustedImm32(1), regT1);
@@ -1544,7 +1470,7 @@ void JIT::emit_op_get_argument_by_val(Instruction* currentInstruction)
neg32(regT1);
signExtend32ToPtr(regT1, regT1);
- loadPtr(BaseIndex(callFrameRegister, regT1, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))), regT0);
+ load64(BaseIndex(callFrameRegister, regT1, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))), regT0);
emitValueProfilingSite();
emitPutVirtualRegister(dst, regT0);
}
@@ -1571,51 +1497,413 @@ void JIT::emitSlow_op_get_argument_by_val(Instruction* currentInstruction, Vecto
stubCall.callWithValueProfiling(dst);
}
+void JIT::emit_op_put_to_base(Instruction* currentInstruction)
+{
+ int base = currentInstruction[1].u.operand;
+ int id = currentInstruction[2].u.operand;
+ int value = currentInstruction[3].u.operand;
+
+ PutToBaseOperation* operation = m_codeBlock->putToBaseOperation(currentInstruction[4].u.operand);
+ switch (operation->m_kind) {
+ case PutToBaseOperation::GlobalVariablePutChecked:
+ addSlowCase(branchTest8(NonZero, AbsoluteAddress(operation->m_predicatePointer)));
+ case PutToBaseOperation::GlobalVariablePut: {
+ JSGlobalObject* globalObject = m_codeBlock->globalObject();
+ if (operation->m_isDynamic) {
+ emitGetVirtualRegister(base, regT0);
+ addSlowCase(branchPtr(NotEqual, regT0, TrustedImmPtr(globalObject)));
+ }
+ emitGetVirtualRegister(value, regT0);
+ store64(regT0, operation->m_registerAddress);
+ if (Heap::isWriteBarrierEnabled())
+ emitWriteBarrier(globalObject, regT0, regT2, ShouldFilterImmediates, WriteBarrierForVariableAccess);
+ return;
+ }
+ case PutToBaseOperation::VariablePut: {
+ emitGetVirtualRegisters(base, regT0, value, regT1);
+ loadPtr(Address(regT0, JSVariableObject::offsetOfRegisters()), regT2);
+ store64(regT1, Address(regT2, operation->m_offset * sizeof(Register)));
+ if (Heap::isWriteBarrierEnabled())
+ emitWriteBarrier(regT0, regT1, regT2, regT3, ShouldFilterImmediates, WriteBarrierForVariableAccess);
+ return;
+ }
+
+ case PutToBaseOperation::GlobalPropertyPut: {
+ emitGetVirtualRegisters(base, regT0, value, regT1);
+ loadPtr(&operation->m_structure, regT2);
+ addSlowCase(branchPtr(NotEqual, Address(regT0, JSCell::structureOffset()), regT2));
+ ASSERT(!operation->m_structure || !operation->m_structure->inlineCapacity());
+ loadPtr(Address(regT0, JSObject::butterflyOffset()), regT2);
+ load32(&operation->m_offsetInButterfly, regT3);
+ signExtend32ToPtr(regT3, regT3);
+ store64(regT1, BaseIndex(regT2, regT3, TimesEight));
+ if (Heap::isWriteBarrierEnabled())
+ emitWriteBarrier(regT0, regT1, regT2, regT3, ShouldFilterImmediates, WriteBarrierForVariableAccess);
+ return;
+ }
+
+ case PutToBaseOperation::Uninitialised:
+ case PutToBaseOperation::Readonly:
+ case PutToBaseOperation::Generic:
+ JITStubCall stubCall(this, cti_op_put_to_base);
+
+ stubCall.addArgument(TrustedImm32(base));
+ stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(id)));
+ stubCall.addArgument(TrustedImm32(value));
+ stubCall.addArgument(TrustedImmPtr(operation));
+ stubCall.call();
+ return;
+ }
+}
+
#endif // USE(JSVALUE64)
-void JIT::emit_op_resolve_global_dynamic(Instruction* currentInstruction)
+void JIT::emit_resolve_operations(ResolveOperations* resolveOperations, const int* baseVR, const int* valueVR)
{
- int skip = currentInstruction[5].u.operand;
-
- emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT0);
-
- bool checkTopLevel = m_codeBlock->codeType() == FunctionCode && m_codeBlock->needsFullScopeChain();
- ASSERT(skip || !checkTopLevel);
- if (checkTopLevel && skip--) {
- Jump activationNotCreated;
- if (checkTopLevel)
- activationNotCreated = branchTestPtr(Zero, addressFor(m_codeBlock->activationRegister()));
- addSlowCase(checkStructure(regT0, m_codeBlock->globalObject()->activationStructure()));
- loadPtr(Address(regT0, JSScope::offsetOfNext()), regT0);
- activationNotCreated.link(this);
+
+#if USE(JSVALUE32_64)
+ unmap();
+#else
+ killLastResultRegister();
+#endif
+
+ if (resolveOperations->isEmpty()) {
+ addSlowCase(jump());
+ return;
}
- while (skip--) {
- addSlowCase(checkStructure(regT0, m_codeBlock->globalObject()->activationStructure()));
- loadPtr(Address(regT0, JSScope::offsetOfNext()), regT0);
+
+ const RegisterID value = regT0;
+#if USE(JSVALUE32_64)
+ const RegisterID valueTag = regT1;
+#endif
+ const RegisterID scope = regT2;
+ const RegisterID scratch = regT3;
+
+ JSGlobalObject* globalObject = m_codeBlock->globalObject();
+ ResolveOperation* pc = resolveOperations->data();
+ emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, scope);
+ bool setBase = false;
+ bool resolvingBase = true;
+ while (resolvingBase) {
+ switch (pc->m_operation) {
+ case ResolveOperation::ReturnGlobalObjectAsBase:
+ move(TrustedImmPtr(globalObject), value);
+#if USE(JSVALUE32_64)
+ move(TrustedImm32(JSValue::CellTag), valueTag);
+#endif
+ emitValueProfilingSite();
+ emitStoreCell(*baseVR, value);
+ return;
+ case ResolveOperation::SetBaseToGlobal:
+ ASSERT(baseVR);
+ setBase = true;
+ move(TrustedImmPtr(globalObject), scratch);
+ emitStoreCell(*baseVR, scratch);
+ resolvingBase = false;
+ ++pc;
+ break;
+ case ResolveOperation::SetBaseToUndefined: {
+ ASSERT(baseVR);
+ setBase = true;
+#if USE(JSVALUE64)
+ move(TrustedImm64(JSValue::encode(jsUndefined())), scratch);
+ emitPutVirtualRegister(*baseVR, scratch);
+#else
+ emitStore(*baseVR, jsUndefined());
+#endif
+ resolvingBase = false;
+ ++pc;
+ break;
+ }
+ case ResolveOperation::SetBaseToScope:
+ ASSERT(baseVR);
+ setBase = true;
+ emitStoreCell(*baseVR, scope);
+ resolvingBase = false;
+ ++pc;
+ break;
+ case ResolveOperation::ReturnScopeAsBase:
+ emitStoreCell(*baseVR, scope);
+ ASSERT(!value);
+ move(scope, value);
+#if USE(JSVALUE32_64)
+ move(TrustedImm32(JSValue::CellTag), valueTag);
+#endif
+ emitValueProfilingSite();
+ return;
+ case ResolveOperation::SkipTopScopeNode: {
+#if USE(JSVALUE32_64)
+ Jump activationNotCreated = branch32(Equal, tagFor(m_codeBlock->activationRegister()), TrustedImm32(JSValue::EmptyValueTag));
+#else
+ Jump activationNotCreated = branchTest64(Zero, addressFor(m_codeBlock->activationRegister()));
+#endif
+ loadPtr(Address(scope, JSScope::offsetOfNext()), scope);
+ activationNotCreated.link(this);
+ ++pc;
+ break;
+ }
+ case ResolveOperation::CheckForDynamicEntriesBeforeGlobalScope: {
+ move(scope, regT3);
+ loadPtr(Address(regT3, JSScope::offsetOfNext()), regT1);
+ Jump atTopOfScope = branchTestPtr(Zero, regT1);
+ Label loopStart = label();
+ loadPtr(Address(regT3, JSCell::structureOffset()), regT2);
+ Jump isActivation = branchPtr(Equal, regT2, TrustedImmPtr(globalObject->activationStructure()));
+ addSlowCase(branchPtr(NotEqual, regT2, TrustedImmPtr(globalObject->nameScopeStructure())));
+ isActivation.link(this);
+ move(regT1, regT3);
+ loadPtr(Address(regT3, JSScope::offsetOfNext()), regT1);
+ branchTestPtr(NonZero, regT1, loopStart);
+ atTopOfScope.link(this);
+ ++pc;
+ break;
+ }
+ case ResolveOperation::SkipScopes: {
+ for (int i = 0; i < pc->m_scopesToSkip; i++)
+ loadPtr(Address(scope, JSScope::offsetOfNext()), scope);
+ ++pc;
+ break;
+ }
+ case ResolveOperation::Fail:
+ addSlowCase(jump());
+ return;
+ default:
+ resolvingBase = false;
+ }
}
- emit_op_resolve_global(currentInstruction, true);
+ if (baseVR && !setBase)
+ emitStoreCell(*baseVR, scope);
+
+ ASSERT(valueVR);
+ ResolveOperation* resolveValueOperation = pc;
+ switch (resolveValueOperation->m_operation) {
+ case ResolveOperation::GetAndReturnGlobalProperty: {
+ // Verify structure.
+ move(TrustedImmPtr(globalObject), regT2);
+ move(TrustedImmPtr(resolveValueOperation), regT3);
+ loadPtr(Address(regT3, OBJECT_OFFSETOF(ResolveOperation, m_structure)), regT1);
+ addSlowCase(branchPtr(NotEqual, regT1, Address(regT2, JSCell::structureOffset())));
+
+ // Load property.
+ load32(Address(regT3, OBJECT_OFFSETOF(ResolveOperation, m_offset)), regT3);
+
+ // regT2: GlobalObject
+ // regT3: offset
+#if USE(JSVALUE32_64)
+ compileGetDirectOffset(regT2, valueTag, value, regT3, KnownNotFinal);
+#else
+ compileGetDirectOffset(regT2, value, regT3, regT1, KnownNotFinal);
+#endif
+ break;
+ }
+ case ResolveOperation::GetAndReturnGlobalVarWatchable:
+ case ResolveOperation::GetAndReturnGlobalVar: {
+#if USE(JSVALUE32_64)
+ load32(reinterpret_cast<char*>(pc->m_registerAddress) + OBJECT_OFFSETOF(JSValue, u.asBits.tag), valueTag);
+ load32(reinterpret_cast<char*>(pc->m_registerAddress) + OBJECT_OFFSETOF(JSValue, u.asBits.payload), value);
+#else
+ load64(reinterpret_cast<char*>(pc->m_registerAddress), value);
+#endif
+ break;
+ }
+ case ResolveOperation::GetAndReturnScopedVar: {
+ loadPtr(Address(scope, JSVariableObject::offsetOfRegisters()), scope);
+#if USE(JSVALUE32_64)
+ load32(Address(scope, pc->m_offset * sizeof(Register) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), valueTag);
+ load32(Address(scope, pc->m_offset * sizeof(Register) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), value);
+#else
+ load64(Address(scope, pc->m_offset * sizeof(Register)), value);
+#endif
+ break;
+ }
+ default:
+ CRASH();
+ return;
+ }
+
+#if USE(JSVALUE32_64)
+ emitStore(*valueVR, valueTag, value);
+#else
+ emitPutVirtualRegister(*valueVR, value);
+#endif
+ emitValueProfilingSite();
}
-void JIT::emitSlow_op_resolve_global_dynamic(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+void JIT::emitSlow_link_resolve_operations(ResolveOperations* resolveOperations, Vector<SlowCaseEntry>::iterator& iter)
{
- unsigned dst = currentInstruction[1].u.operand;
- Identifier* ident = &m_codeBlock->identifier(currentInstruction[2].u.operand);
- int skip = currentInstruction[5].u.operand;
- while (skip--)
+ if (resolveOperations->isEmpty()) {
linkSlowCase(iter);
- JITStubCall resolveStubCall(this, cti_op_resolve);
- resolveStubCall.addArgument(TrustedImmPtr(ident));
- resolveStubCall.call(dst);
- emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_resolve_global_dynamic));
-
- unsigned currentIndex = m_globalResolveInfoIndex++;
-
- linkSlowCase(iter); // We managed to skip all the nodes in the scope chain, but the cache missed.
- JITStubCall stubCall(this, cti_op_resolve_global);
- stubCall.addArgument(TrustedImmPtr(ident));
- stubCall.addArgument(TrustedImm32(currentIndex));
- stubCall.addArgument(regT0);
- stubCall.callWithValueProfiling(dst);
+ return;
+ }
+
+ ResolveOperation* pc = resolveOperations->data();
+ bool resolvingBase = true;
+ while (resolvingBase) {
+ switch (pc->m_operation) {
+ case ResolveOperation::ReturnGlobalObjectAsBase:
+ return;
+ case ResolveOperation::SetBaseToGlobal:
+ resolvingBase = false;
+ ++pc;
+ break;
+ case ResolveOperation::SetBaseToUndefined: {
+ resolvingBase = false;
+ ++pc;
+ break;
+ }
+ case ResolveOperation::SetBaseToScope:
+ resolvingBase = false;
+ ++pc;
+ break;
+ case ResolveOperation::ReturnScopeAsBase:
+ return;
+ case ResolveOperation::SkipTopScopeNode: {
+ ++pc;
+ break;
+ }
+ case ResolveOperation::SkipScopes:
+ ++pc;
+ break;
+ case ResolveOperation::Fail:
+ linkSlowCase(iter);
+ return;
+ case ResolveOperation::CheckForDynamicEntriesBeforeGlobalScope: {
+ linkSlowCase(iter);
+ ++pc;
+ break;
+ }
+ default:
+ resolvingBase = false;
+ }
+ }
+ ResolveOperation* resolveValueOperation = pc;
+ switch (resolveValueOperation->m_operation) {
+ case ResolveOperation::GetAndReturnGlobalProperty: {
+ linkSlowCase(iter);
+ break;
+ }
+ case ResolveOperation::GetAndReturnGlobalVarWatchable:
+ case ResolveOperation::GetAndReturnGlobalVar:
+ break;
+ case ResolveOperation::GetAndReturnScopedVar:
+ break;
+ default:
+ CRASH();
+ return;
+ }
+}
+
+void JIT::emit_op_resolve(Instruction* currentInstruction)
+{
+ ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[3].u.operand);
+ int dst = currentInstruction[1].u.operand;
+ emit_resolve_operations(operations, 0, &dst);
+}
+
+void JIT::emitSlow_op_resolve(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[3].u.operand);
+ emitSlow_link_resolve_operations(operations, iter);
+ JITStubCall stubCall(this, cti_op_resolve);
+ stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand)));
+ stubCall.addArgument(TrustedImmPtr(m_codeBlock->resolveOperations(currentInstruction[3].u.operand)));
+ stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
+}
+
+void JIT::emit_op_resolve_base(Instruction* currentInstruction)
+{
+ ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
+ int dst = currentInstruction[1].u.operand;
+ emit_resolve_operations(operations, &dst, 0);
+}
+
+void JIT::emitSlow_op_resolve_base(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
+ emitSlow_link_resolve_operations(operations, iter);
+ JITStubCall stubCall(this, currentInstruction[3].u.operand ? cti_op_resolve_base_strict_put : cti_op_resolve_base);
+ stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand)));
+ stubCall.addArgument(TrustedImmPtr(m_codeBlock->resolveOperations(currentInstruction[4].u.operand)));
+ stubCall.addArgument(TrustedImmPtr(m_codeBlock->putToBaseOperation(currentInstruction[5].u.operand)));
+ stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
+}
+
+void JIT::emit_op_resolve_with_base(Instruction* currentInstruction)
+{
+ ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
+ int base = currentInstruction[1].u.operand;
+ int value = currentInstruction[2].u.operand;
+ emit_resolve_operations(operations, &base, &value);
+}
+
+void JIT::emitSlow_op_resolve_with_base(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
+ emitSlow_link_resolve_operations(operations, iter);
+ JITStubCall stubCall(this, cti_op_resolve_with_base);
+ stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand)));
+ stubCall.addArgument(TrustedImm32(currentInstruction[1].u.operand));
+ stubCall.addArgument(TrustedImmPtr(m_codeBlock->resolveOperations(currentInstruction[4].u.operand)));
+ stubCall.addArgument(TrustedImmPtr(m_codeBlock->putToBaseOperation(currentInstruction[5].u.operand)));
+ stubCall.callWithValueProfiling(currentInstruction[2].u.operand);
+}
+
+void JIT::emit_op_resolve_with_this(Instruction* currentInstruction)
+{
+ ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
+ int base = currentInstruction[1].u.operand;
+ int value = currentInstruction[2].u.operand;
+ emit_resolve_operations(operations, &base, &value);
+}
+
+void JIT::emitSlow_op_resolve_with_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
+ emitSlow_link_resolve_operations(operations, iter);
+ JITStubCall stubCall(this, cti_op_resolve_with_this);
+ stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand)));
+ stubCall.addArgument(TrustedImm32(currentInstruction[1].u.operand));
+ stubCall.addArgument(TrustedImmPtr(m_codeBlock->resolveOperations(currentInstruction[4].u.operand)));
+ stubCall.callWithValueProfiling(currentInstruction[2].u.operand);
+}
+
+void JIT::emitSlow_op_put_to_base(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ int base = currentInstruction[1].u.operand;
+ int id = currentInstruction[2].u.operand;
+ int value = currentInstruction[3].u.operand;
+ int operation = currentInstruction[4].u.operand;
+
+ PutToBaseOperation* putToBaseOperation = m_codeBlock->putToBaseOperation(currentInstruction[4].u.operand);
+ switch (putToBaseOperation->m_kind) {
+ case PutToBaseOperation::VariablePut:
+ return;
+
+ case PutToBaseOperation::GlobalVariablePut:
+ if (!putToBaseOperation->m_isDynamic)
+ return;
+ linkSlowCase(iter);
+ break;
+
+ case PutToBaseOperation::Uninitialised:
+ case PutToBaseOperation::Readonly:
+ case PutToBaseOperation::Generic:
+ return;
+
+ case PutToBaseOperation::GlobalVariablePutChecked:
+ case PutToBaseOperation::GlobalPropertyPut:
+ linkSlowCase(iter);
+ break;
+
+ }
+
+ JITStubCall stubCall(this, cti_op_put_to_base);
+
+ stubCall.addArgument(TrustedImm32(base));
+ stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(id)));
+ stubCall.addArgument(TrustedImm32(value));
+ stubCall.addArgument(TrustedImmPtr(m_codeBlock->putToBaseOperation(operation)));
+ stubCall.call();
}
void JIT::emit_op_new_regexp(Instruction* currentInstruction)
@@ -1633,7 +1921,7 @@ void JIT::emit_op_new_func(Instruction* currentInstruction)
#if USE(JSVALUE32_64)
lazyJump = branch32(NotEqual, tagFor(dst), TrustedImm32(JSValue::EmptyValueTag));
#else
- lazyJump = branchTestPtr(NonZero, addressFor(dst));
+ lazyJump = branchTest64(NonZero, addressFor(dst));
#endif
}
@@ -1660,34 +1948,6 @@ void JIT::emit_op_new_func_exp(Instruction* currentInstruction)
void JIT::emit_op_new_array(Instruction* currentInstruction)
{
- int length = currentInstruction[3].u.operand;
- if (m_codeBlock->globalObject()->isHavingABadTime()
- || CopiedSpace::isOversize(Butterfly::totalSize(0, 0, true, ArrayStorage::sizeFor(length)))) {
- JITStubCall stubCall(this, cti_op_new_array);
- stubCall.addArgument(TrustedImm32(currentInstruction[2].u.operand));
- stubCall.addArgument(TrustedImm32(currentInstruction[3].u.operand));
- stubCall.call(currentInstruction[1].u.operand);
- return;
- }
- int dst = currentInstruction[1].u.operand;
- int values = currentInstruction[2].u.operand;
-
- emitAllocateJSArray(values, length, regT0, regT1, regT2, regT3);
- emitStoreCell(dst, regT0);
-}
-
-void JIT::emitSlow_op_new_array(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
-{
- // If the allocation would be oversize, we will already make the proper stub call above in
- // emit_op_new_array.
- int length = currentInstruction[3].u.operand;
- if (m_codeBlock->globalObject()->isHavingABadTime()
- || CopiedSpace::isOversize(Butterfly::totalSize(0, 0, true, ArrayStorage::sizeFor(length))))
- return;
- linkSlowCase(iter); // We're having a bad time.
- linkSlowCase(iter); // Not enough space in CopiedSpace for storage.
- linkSlowCase(iter); // Not enough space in MarkedSpace for cell.
-
JITStubCall stubCall(this, cti_op_new_array);
stubCall.addArgument(TrustedImm32(currentInstruction[2].u.operand));
stubCall.addArgument(TrustedImm32(currentInstruction[3].u.operand));
diff --git a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
index db5365535..44123be19 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
@@ -36,6 +36,7 @@
#include "JSCell.h"
#include "JSFunction.h"
#include "JSPropertyNameIterator.h"
+#include "JSVariableObject.h"
#include "LinkBuffer.h"
namespace JSC {
@@ -718,13 +719,6 @@ void JIT::emit_op_tear_off_arguments(Instruction* currentInstruction)
argsNotCreated.link(this);
}
-void JIT::emit_op_resolve(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_resolve);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand)));
- stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
-}
-
void JIT::emit_op_to_primitive(Instruction* currentInstruction)
{
int dst = currentInstruction[1].u.operand;
@@ -760,13 +754,6 @@ void JIT::emit_op_strcat(Instruction* currentInstruction)
stubCall.call(currentInstruction[1].u.operand);
}
-void JIT::emit_op_resolve_base(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, currentInstruction[3].u.operand ? cti_op_resolve_base_strict_put : cti_op_resolve_base);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand)));
- stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
-}
-
void JIT::emit_op_ensure_property_exists(Instruction* currentInstruction)
{
JITStubCall stubCall(this, cti_op_ensure_property_exists);
@@ -775,53 +762,6 @@ void JIT::emit_op_ensure_property_exists(Instruction* currentInstruction)
stubCall.call(currentInstruction[1].u.operand);
}
-void JIT::emit_op_resolve_skip(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_resolve_skip);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand)));
- stubCall.addArgument(TrustedImm32(currentInstruction[3].u.operand));
- stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
-}
-
-void JIT::emit_op_resolve_global(Instruction* currentInstruction, bool dynamic)
-{
- // FIXME: Optimize to use patching instead of so many memory accesses.
-
- unsigned dst = currentInstruction[1].u.operand;
- void* globalObject = m_codeBlock->globalObject();
-
- unsigned currentIndex = m_globalResolveInfoIndex++;
- GlobalResolveInfo* resolveInfoAddress = &m_codeBlock->globalResolveInfo(currentIndex);
-
-
- // Verify structure.
- move(TrustedImmPtr(globalObject), regT2);
- move(TrustedImmPtr(resolveInfoAddress), regT3);
- loadPtr(Address(regT3, OBJECT_OFFSETOF(GlobalResolveInfo, structure)), regT1);
- addSlowCase(branchPtr(NotEqual, regT1, Address(regT2, JSCell::structureOffset())));
-
- // Load property.
- load32(Address(regT3, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), regT3);
- compileGetDirectOffset(regT2, regT1, regT0, regT3, KnownNotFinal);
- emitValueProfilingSite();
- emitStore(dst, regT1, regT0);
- map(m_bytecodeOffset + (dynamic ? OPCODE_LENGTH(op_resolve_global_dynamic) : OPCODE_LENGTH(op_resolve_global)), dst, regT1, regT0);
-}
-
-void JIT::emitSlow_op_resolve_global(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
-{
- unsigned dst = currentInstruction[1].u.operand;
- Identifier* ident = &m_codeBlock->identifier(currentInstruction[2].u.operand);
-
- unsigned currentIndex = m_globalResolveInfoIndex++;
-
- linkSlowCase(iter);
- JITStubCall stubCall(this, cti_op_resolve_global);
- stubCall.addArgument(TrustedImmPtr(ident));
- stubCall.addArgument(TrustedImm32(currentIndex));
- stubCall.callWithValueProfiling(dst);
-}
-
void JIT::emit_op_not(Instruction* currentInstruction)
{
unsigned dst = currentInstruction[1].u.operand;
@@ -1214,22 +1154,6 @@ void JIT::emit_op_neq_null(Instruction* currentInstruction)
emitStoreBool(dst, regT1);
}
-void JIT::emit_op_resolve_with_base(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_resolve_with_base);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand)));
- stubCall.addArgument(TrustedImm32(currentInstruction[1].u.operand));
- stubCall.callWithValueProfiling(currentInstruction[2].u.operand);
-}
-
-void JIT::emit_op_resolve_with_this(Instruction* currentInstruction)
-{
- JITStubCall stubCall(this, cti_op_resolve_with_this);
- stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand)));
- stubCall.addArgument(TrustedImm32(currentInstruction[1].u.operand));
- stubCall.callWithValueProfiling(currentInstruction[2].u.operand);
-}
-
void JIT::emit_op_throw(Instruction* currentInstruction)
{
unsigned exception = currentInstruction[1].u.operand;
@@ -1686,6 +1610,71 @@ void JIT::emitSlow_op_get_argument_by_val(Instruction* currentInstruction, Vecto
stubCall.callWithValueProfiling(dst);
}
+void JIT::emit_op_put_to_base(Instruction* currentInstruction)
+{
+ int base = currentInstruction[1].u.operand;
+ int id = currentInstruction[2].u.operand;
+ int value = currentInstruction[3].u.operand;
+
+ PutToBaseOperation* operation = m_codeBlock->putToBaseOperation(currentInstruction[4].u.operand);
+
+
+ switch (operation->m_kind) {
+ case PutToBaseOperation::GlobalVariablePutChecked:
+ addSlowCase(branchTest8(NonZero, AbsoluteAddress(operation->m_predicatePointer)));
+ case PutToBaseOperation::GlobalVariablePut: {
+ JSGlobalObject* globalObject = m_codeBlock->globalObject();
+ if (operation->m_isDynamic)
+ addSlowCase(branchPtr(NotEqual, payloadFor(base), TrustedImmPtr(globalObject)));
+
+ emitLoad(value, regT1, regT0);
+ storePtr(regT0, reinterpret_cast<char*>(operation->m_registerAddress) + OBJECT_OFFSETOF(JSValue, u.asBits.payload));
+ storePtr(regT1, reinterpret_cast<char*>(operation->m_registerAddress) + OBJECT_OFFSETOF(JSValue, u.asBits.tag));
+ if (Heap::isWriteBarrierEnabled())
+ emitWriteBarrier(globalObject, regT0, regT2, ShouldFilterImmediates, WriteBarrierForVariableAccess);
+ break;
+ }
+ case PutToBaseOperation::VariablePut: {
+ loadPtr(payloadFor(base), regT3);
+ emitLoad(value, regT1, regT0);
+ loadPtr(Address(regT3, JSVariableObject::offsetOfRegisters()), regT2);
+ store32(regT0, Address(regT2, operation->m_offset * sizeof(Register) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
+ store32(regT1, Address(regT2, operation->m_offset * sizeof(Register) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
+ if (Heap::isWriteBarrierEnabled())
+ emitWriteBarrier(regT3, regT1, regT0, regT2, ShouldFilterImmediates, WriteBarrierForVariableAccess);
+ break;
+ }
+
+ case PutToBaseOperation::GlobalPropertyPut: {
+ JSGlobalObject* globalObject = m_codeBlock->globalObject();
+ loadPtr(payloadFor(base), regT3);
+ emitLoad(value, regT1, regT0);
+ loadPtr(&operation->m_structure, regT2);
+ addSlowCase(branchPtr(NotEqual, Address(regT3, JSCell::structureOffset()), regT2));
+ ASSERT(!operation->m_structure || !operation->m_structure->inlineCapacity());
+ loadPtr(Address(regT3, JSObject::butterflyOffset()), regT2);
+ load32(&operation->m_offsetInButterfly, regT3);
+ storePtr(regT0, BaseIndex(regT2, regT3, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
+ storePtr(regT1, BaseIndex(regT2, regT3, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
+ if (Heap::isWriteBarrierEnabled())
+ emitWriteBarrier(globalObject, regT1, regT2, ShouldFilterImmediates, WriteBarrierForVariableAccess);
+ break;
+ }
+
+ case PutToBaseOperation::Uninitialised:
+ case PutToBaseOperation::Readonly:
+ case PutToBaseOperation::Generic:
+ JITStubCall stubCall(this, cti_op_put_to_base);
+
+ stubCall.addArgument(TrustedImm32(base));
+ stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(id)));
+ stubCall.addArgument(TrustedImm32(value));
+ stubCall.addArgument(TrustedImmPtr(operation));
+ stubCall.call();
+ break;
+ }
+}
+
} // namespace JSC
#endif // USE(JSVALUE32_64)
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
index 8a4017f1d..b7be821f6 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
@@ -137,7 +137,7 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction)
Label done = label();
#if !ASSERT_DISABLED
- Jump resultOK = branchTestPtr(NonZero, regT0);
+ Jump resultOK = branchTest64(NonZero, regT0);
breakpoint();
resultOK.link(this);
#endif
@@ -155,8 +155,8 @@ JIT::JumpList JIT::emitContiguousGetByVal(Instruction*, PatchableJump& badType)
badType = patchableBranch32(NotEqual, regT2, TrustedImm32(ContiguousShape));
loadPtr(Address(regT0, JSObject::butterflyOffset()), regT2);
slowCases.append(branch32(AboveOrEqual, regT1, Address(regT2, Butterfly::offsetOfPublicLength())));
- loadPtr(BaseIndex(regT2, regT1, ScalePtr), regT0);
- slowCases.append(branchTestPtr(Zero, regT0));
+ load64(BaseIndex(regT2, regT1, TimesEight), regT0);
+ slowCases.append(branchTest64(Zero, regT0));
return slowCases;
}
@@ -171,8 +171,8 @@ JIT::JumpList JIT::emitArrayStorageGetByVal(Instruction*, PatchableJump& badType
loadPtr(Address(regT0, JSObject::butterflyOffset()), regT2);
slowCases.append(branch32(AboveOrEqual, regT1, Address(regT2, ArrayStorage::vectorLengthOffset())));
- loadPtr(BaseIndex(regT2, regT1, ScalePtr, ArrayStorage::vectorOffset()), regT0);
- slowCases.append(branchTestPtr(Zero, regT0));
+ load64(BaseIndex(regT2, regT1, TimesEight, ArrayStorage::vectorOffset()), regT0);
+ slowCases.append(branchTest64(Zero, regT0));
return slowCases;
}
@@ -189,7 +189,7 @@ void JIT::emitSlow_op_get_by_val(Instruction* currentInstruction, Vector<SlowCas
linkSlowCase(iter); // base array check
Jump notString = branchPtr(NotEqual, Address(regT0, JSCell::structureOffset()), TrustedImmPtr(m_globalData->stringStructure.get()));
emitNakedCall(CodeLocationLabel(m_globalData->getCTIStub(stringGetByValStubGenerator).code()));
- Jump failed = branchTestPtr(Zero, regT0);
+ Jump failed = branchTest64(Zero, regT0);
emitPutVirtualRegister(dst, regT0);
emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_get_by_val));
failed.link(this);
@@ -235,7 +235,7 @@ void JIT::compileGetDirectOffset(RegisterID base, RegisterID result, RegisterID
neg32(offset);
}
signExtend32ToPtr(offset, offset);
- loadPtr(BaseIndex(scratch, offset, ScalePtr, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue)), result);
+ load64(BaseIndex(scratch, offset, TimesEight, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue)), result);
}
void JIT::emit_op_get_by_pname(Instruction* currentInstruction)
@@ -248,7 +248,7 @@ void JIT::emit_op_get_by_pname(Instruction* currentInstruction)
unsigned i = currentInstruction[6].u.operand;
emitGetVirtualRegister(property, regT0);
- addSlowCase(branchPtr(NotEqual, regT0, addressFor(expected)));
+ addSlowCase(branch64(NotEqual, regT0, addressFor(expected)));
emitGetVirtualRegisters(base, regT0, iter, regT1);
emitJumpSlowCaseIfNotJSCell(regT0, base);
@@ -337,7 +337,7 @@ JIT::JumpList JIT::emitContiguousPutByVal(Instruction* currentInstruction, Patch
Label storeResult = label();
emitGetVirtualRegister(value, regT3);
- storePtr(regT3, BaseIndex(regT2, regT1, ScalePtr));
+ store64(regT3, BaseIndex(regT2, regT1, TimesEight));
Jump done = jump();
outOfBounds.link(this);
@@ -367,11 +367,11 @@ JIT::JumpList JIT::emitArrayStoragePutByVal(Instruction* currentInstruction, Pat
loadPtr(Address(regT0, JSObject::butterflyOffset()), regT2);
slowCases.append(branch32(AboveOrEqual, regT1, Address(regT2, ArrayStorage::vectorLengthOffset())));
- Jump empty = branchTestPtr(Zero, BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
+ Jump empty = branchTest64(Zero, BaseIndex(regT2, regT1, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
Label storeResult(this);
emitGetVirtualRegister(value, regT3);
- storePtr(regT3, BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
+ store64(regT3, BaseIndex(regT2, regT1, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
Jump end = jump();
empty.link(this);
@@ -535,7 +535,7 @@ void JIT::compileGetByIdHotPath(int baseVReg, Identifier*)
addSlowCase(structureCheck);
ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT0);
- DataLabelCompact displacementLabel = loadPtrWithCompactAddressOffsetPatch(Address(regT0, patchGetByIdDefaultOffset), regT0);
+ DataLabelCompact displacementLabel = load64WithCompactAddressOffsetPatch(Address(regT0, patchGetByIdDefaultOffset), regT0);
Label putResult(this);
@@ -602,7 +602,7 @@ void JIT::emit_op_put_by_id(Instruction* currentInstruction)
addSlowCase(branchPtrWithPatch(NotEqual, Address(regT0, JSCell::structureOffset()), structureToCompare, TrustedImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure))));
ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT2);
- DataLabel32 displacementLabel = storePtrWithAddressOffsetPatch(regT1, Address(regT2, patchPutByIdDefaultOffset));
+ DataLabel32 displacementLabel = store64WithAddressOffsetPatch(regT1, Address(regT2, patchPutByIdDefaultOffset));
END_UNINTERRUPTED_SEQUENCE(sequencePutById);
@@ -636,35 +636,35 @@ void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector<SlowCase
void JIT::compilePutDirectOffset(RegisterID base, RegisterID value, PropertyOffset cachedOffset)
{
if (isInlineOffset(cachedOffset)) {
- storePtr(value, Address(base, JSObject::offsetOfInlineStorage() + sizeof(JSValue) * offsetInInlineStorage(cachedOffset)));
+ store64(value, Address(base, JSObject::offsetOfInlineStorage() + sizeof(JSValue) * offsetInInlineStorage(cachedOffset)));
return;
}
loadPtr(Address(base, JSObject::butterflyOffset()), base);
- storePtr(value, Address(base, sizeof(JSValue) * offsetInButterfly(cachedOffset)));
+ store64(value, Address(base, sizeof(JSValue) * offsetInButterfly(cachedOffset)));
}
// Compile a load from an object's property storage. May overwrite base.
void JIT::compileGetDirectOffset(RegisterID base, RegisterID result, PropertyOffset cachedOffset)
{
if (isInlineOffset(cachedOffset)) {
- loadPtr(Address(base, JSObject::offsetOfInlineStorage() + sizeof(JSValue) * offsetInInlineStorage(cachedOffset)), result);
+ load64(Address(base, JSObject::offsetOfInlineStorage() + sizeof(JSValue) * offsetInInlineStorage(cachedOffset)), result);
return;
}
loadPtr(Address(base, JSObject::butterflyOffset()), result);
- loadPtr(Address(result, sizeof(JSValue) * offsetInButterfly(cachedOffset)), result);
+ load64(Address(result, sizeof(JSValue) * offsetInButterfly(cachedOffset)), result);
}
void JIT::compileGetDirectOffset(JSObject* base, RegisterID result, PropertyOffset cachedOffset)
{
if (isInlineOffset(cachedOffset)) {
- loadPtr(base->locationForOffset(cachedOffset), result);
+ load64(base->locationForOffset(cachedOffset), result);
return;
}
loadPtr(base->butterflyAddress(), result);
- loadPtr(Address(result, offsetInButterfly(cachedOffset) * sizeof(WriteBarrier<Unknown>)), result);
+ load64(Address(result, offsetInButterfly(cachedOffset) * sizeof(WriteBarrier<Unknown>)), result);
}
void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, PropertyOffset cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress, bool direct)
@@ -1190,90 +1190,35 @@ void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* str
repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_id_proto_list));
}
-void JIT::emit_op_get_scoped_var(Instruction* currentInstruction)
-{
- int skip = currentInstruction[3].u.operand;
-
- emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT0);
- bool checkTopLevel = m_codeBlock->codeType() == FunctionCode && m_codeBlock->needsFullScopeChain();
- ASSERT(skip || !checkTopLevel);
- if (checkTopLevel && skip--) {
- Jump activationNotCreated;
- if (checkTopLevel)
- activationNotCreated = branchTestPtr(Zero, addressFor(m_codeBlock->activationRegister()));
- loadPtr(Address(regT0, JSScope::offsetOfNext()), regT0);
- activationNotCreated.link(this);
- }
- while (skip--)
- loadPtr(Address(regT0, JSScope::offsetOfNext()), regT0);
-
- loadPtr(Address(regT0, JSVariableObject::offsetOfRegisters()), regT0);
- loadPtr(Address(regT0, currentInstruction[2].u.operand * sizeof(Register)), regT0);
- emitValueProfilingSite();
- emitPutVirtualRegister(currentInstruction[1].u.operand);
-}
-
-void JIT::emit_op_put_scoped_var(Instruction* currentInstruction)
-{
- int skip = currentInstruction[2].u.operand;
-
- emitGetVirtualRegister(currentInstruction[3].u.operand, regT0);
-
- emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT1);
- bool checkTopLevel = m_codeBlock->codeType() == FunctionCode && m_codeBlock->needsFullScopeChain();
- ASSERT(skip || !checkTopLevel);
- if (checkTopLevel && skip--) {
- Jump activationNotCreated;
- if (checkTopLevel)
- activationNotCreated = branchTestPtr(Zero, addressFor(m_codeBlock->activationRegister()));
- loadPtr(Address(regT1, JSScope::offsetOfNext()), regT1);
- activationNotCreated.link(this);
- }
- while (skip--)
- loadPtr(Address(regT1, JSScope::offsetOfNext()), regT1);
-
- emitWriteBarrier(regT1, regT0, regT2, regT3, ShouldFilterImmediates, WriteBarrierForVariableAccess);
-
- loadPtr(Address(regT1, JSVariableObject::offsetOfRegisters()), regT1);
- storePtr(regT0, Address(regT1, currentInstruction[1].u.operand * sizeof(Register)));
-}
-
-void JIT::emit_op_get_global_var(Instruction* currentInstruction)
-{
- loadPtr(currentInstruction[2].u.registerPointer, regT0);
- emitValueProfilingSite();
- emitPutVirtualRegister(currentInstruction[1].u.operand);
-}
-
-void JIT::emit_op_put_global_var(Instruction* currentInstruction)
+void JIT::emit_op_init_global_const(Instruction* currentInstruction)
{
JSGlobalObject* globalObject = m_codeBlock->globalObject();
emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
-
- storePtr(regT0, currentInstruction[1].u.registerPointer);
+
+ store64(regT0, currentInstruction[1].u.registerPointer);
if (Heap::isWriteBarrierEnabled())
emitWriteBarrier(globalObject, regT0, regT2, ShouldFilterImmediates, WriteBarrierForVariableAccess);
}
-void JIT::emit_op_put_global_var_check(Instruction* currentInstruction)
+void JIT::emit_op_init_global_const_check(Instruction* currentInstruction)
{
emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
-
+
addSlowCase(branchTest8(NonZero, AbsoluteAddress(currentInstruction[3].u.predicatePointer)));
JSGlobalObject* globalObject = m_codeBlock->globalObject();
-
- storePtr(regT0, currentInstruction[1].u.registerPointer);
+
+ store64(regT0, currentInstruction[1].u.registerPointer);
if (Heap::isWriteBarrierEnabled())
emitWriteBarrier(globalObject, regT0, regT2, ShouldFilterImmediates, WriteBarrierForVariableAccess);
}
-void JIT::emitSlow_op_put_global_var_check(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+void JIT::emitSlow_op_init_global_const_check(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
linkSlowCase(iter);
-
- JITStubCall stubCall(this, cti_op_put_global_var_check);
+
+ JITStubCall stubCall(this, cti_op_init_global_const_check);
stubCall.addArgument(regT0);
stubCall.addArgument(TrustedImm32(currentInstruction[4].u.operand));
stubCall.call();
@@ -1585,8 +1530,8 @@ JIT::JumpList JIT::emitIntTypedArrayGetByVal(Instruction*, PatchableJump& badTyp
convertInt32ToDouble(resultPayload, fpRegT0);
addDouble(AbsoluteAddress(&twoToThe32), fpRegT0);
#if USE(JSVALUE64)
- moveDoubleToPtr(fpRegT0, resultPayload);
- subPtr(tagTypeNumberRegister, resultPayload);
+ moveDoubleTo64(fpRegT0, resultPayload);
+ sub64(tagTypeNumberRegister, resultPayload);
#else
moveDoubleToInts(fpRegT0, resultPayload, resultTag);
#endif
@@ -1596,7 +1541,7 @@ JIT::JumpList JIT::emitIntTypedArrayGetByVal(Instruction*, PatchableJump& badTyp
}
#if USE(JSVALUE64)
- orPtr(tagTypeNumberRegister, resultPayload);
+ or64(tagTypeNumberRegister, resultPayload);
#else
move(TrustedImm32(JSValue::Int32Tag), resultTag);
#endif
@@ -1645,8 +1590,8 @@ JIT::JumpList JIT::emitFloatTypedArrayGetByVal(Instruction*, PatchableJump& badT
}
#if USE(JSVALUE64)
- moveDoubleToPtr(fpRegT0, resultPayload);
- subPtr(tagTypeNumberRegister, resultPayload);
+ moveDoubleTo64(fpRegT0, resultPayload);
+ sub64(tagTypeNumberRegister, resultPayload);
#else
moveDoubleToInts(fpRegT0, resultPayload, resultTag);
#endif
@@ -1746,8 +1691,8 @@ JIT::JumpList JIT::emitFloatTypedArrayPutByVal(Instruction* currentInstruction,
Jump ready = jump();
doubleCase.link(this);
slowCases.append(emitJumpIfNotImmediateNumber(earlyScratch));
- addPtr(tagTypeNumberRegister, earlyScratch);
- movePtrToDouble(earlyScratch, fpRegT0);
+ add64(tagTypeNumberRegister, earlyScratch);
+ move64ToDouble(earlyScratch, fpRegT0);
ready.link(this);
#else
emitLoad(value, lateScratch, earlyScratch);
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
index a4a547889..5d619b94b 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
@@ -1232,72 +1232,7 @@ void JIT::emitSlow_op_get_by_pname(Instruction* currentInstruction, Vector<SlowC
stubCall.call(dst);
}
-void JIT::emit_op_get_scoped_var(Instruction* currentInstruction)
-{
- int dst = currentInstruction[1].u.operand;
- int index = currentInstruction[2].u.operand;
- int skip = currentInstruction[3].u.operand;
-
- emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT2);
- bool checkTopLevel = m_codeBlock->codeType() == FunctionCode && m_codeBlock->needsFullScopeChain();
- ASSERT(skip || !checkTopLevel);
- if (checkTopLevel && skip--) {
- Jump activationNotCreated;
- if (checkTopLevel)
- activationNotCreated = branch32(Equal, tagFor(m_codeBlock->activationRegister()), TrustedImm32(JSValue::EmptyValueTag));
- loadPtr(Address(regT2, JSScope::offsetOfNext()), regT2);
- activationNotCreated.link(this);
- }
- while (skip--)
- loadPtr(Address(regT2, JSScope::offsetOfNext()), regT2);
-
- loadPtr(Address(regT2, JSVariableObject::offsetOfRegisters()), regT2);
-
- emitLoad(index, regT1, regT0, regT2);
- emitValueProfilingSite();
- emitStore(dst, regT1, regT0);
- map(m_bytecodeOffset + OPCODE_LENGTH(op_get_scoped_var), dst, regT1, regT0);
-}
-
-void JIT::emit_op_put_scoped_var(Instruction* currentInstruction)
-{
- int index = currentInstruction[1].u.operand;
- int skip = currentInstruction[2].u.operand;
- int value = currentInstruction[3].u.operand;
-
- emitLoad(value, regT1, regT0);
-
- emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT2);
- bool checkTopLevel = m_codeBlock->codeType() == FunctionCode && m_codeBlock->needsFullScopeChain();
- ASSERT(skip || !checkTopLevel);
- if (checkTopLevel && skip--) {
- Jump activationNotCreated;
- if (checkTopLevel)
- activationNotCreated = branch32(Equal, tagFor(m_codeBlock->activationRegister()), TrustedImm32(JSValue::EmptyValueTag));
- loadPtr(Address(regT2, JSScope::offsetOfNext()), regT2);
- activationNotCreated.link(this);
- }
- while (skip--)
- loadPtr(Address(regT2, JSScope::offsetOfNext()), regT2);
-
- loadPtr(Address(regT2, JSVariableObject::offsetOfRegisters()), regT3);
- emitStore(index, regT1, regT0, regT3);
- emitWriteBarrier(regT2, regT1, regT0, regT1, ShouldFilterImmediates, WriteBarrierForVariableAccess);
-}
-
-void JIT::emit_op_get_global_var(Instruction* currentInstruction)
-{
- int dst = currentInstruction[1].u.operand;
- WriteBarrier<Unknown>* registerPointer = currentInstruction[2].u.registerPointer;
-
- load32(registerPointer->tagPointer(), regT1);
- load32(registerPointer->payloadPointer(), regT0);
- emitValueProfilingSite();
- emitStore(dst, regT1, regT0);
- map(m_bytecodeOffset + OPCODE_LENGTH(op_get_global_var), dst, regT1, regT0);
-}
-
-void JIT::emit_op_put_global_var(Instruction* currentInstruction)
+void JIT::emit_op_init_global_const(Instruction* currentInstruction)
{
WriteBarrier<Unknown>* registerPointer = currentInstruction[1].u.registerPointer;
int value = currentInstruction[2].u.operand;
@@ -1314,10 +1249,10 @@ void JIT::emit_op_put_global_var(Instruction* currentInstruction)
store32(regT1, registerPointer->tagPointer());
store32(regT0, registerPointer->payloadPointer());
- map(m_bytecodeOffset + OPCODE_LENGTH(op_put_global_var), value, regT1, regT0);
+ map(m_bytecodeOffset + OPCODE_LENGTH(op_init_global_const), value, regT1, regT0);
}
-void JIT::emit_op_put_global_var_check(Instruction* currentInstruction)
+void JIT::emit_op_init_global_const_check(Instruction* currentInstruction)
{
WriteBarrier<Unknown>* registerPointer = currentInstruction[1].u.registerPointer;
int value = currentInstruction[2].u.operand;
@@ -1338,11 +1273,11 @@ void JIT::emit_op_put_global_var_check(Instruction* currentInstruction)
unmap();
}
-void JIT::emitSlow_op_put_global_var_check(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+void JIT::emitSlow_op_init_global_const_check(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
linkSlowCase(iter);
- JITStubCall stubCall(this, cti_op_put_global_var_check);
+ JITStubCall stubCall(this, cti_op_init_global_const_check);
stubCall.addArgument(regT1, regT0);
stubCall.addArgument(TrustedImm32(currentInstruction[4].u.operand));
stubCall.call();
diff --git a/Source/JavaScriptCore/jit/JITStubCall.h b/Source/JavaScriptCore/jit/JITStubCall.h
index 352956559..25755886a 100644
--- a/Source/JavaScriptCore/jit/JITStubCall.h
+++ b/Source/JavaScriptCore/jit/JITStubCall.h
@@ -94,15 +94,15 @@ namespace JSC {
{
}
-#if USE(JSVALUE32_64)
JITStubCall(JIT* jit, EncodedJSValue (JIT_STUB *stub)(STUB_ARGS_DECLARATION))
: m_jit(jit)
, m_stub(stub)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
, m_returnType(Value)
+#endif
, m_stackIndex(JITSTACKFRAME_ARGS_INDEX)
{
}
-#endif
// Arguments are added first to last.
@@ -137,7 +137,11 @@ namespace JSC {
void addArgument(JIT::RegisterID argument)
{
+#if USE(JSVALUE32_64)
m_jit->poke(argument, m_stackIndex);
+#else
+ m_jit->poke64(argument, m_stackIndex);
+#endif
m_stackIndex += stackIndexStep;
}
@@ -148,6 +152,18 @@ namespace JSC {
m_jit->poke(JIT::Imm32(value.tag()), m_stackIndex + 1);
m_stackIndex += stackIndexStep;
}
+#else
+ void addArgument(JIT::TrustedImm64 argument)
+ {
+ m_jit->poke(argument, m_stackIndex);
+ m_stackIndex += stackIndexStep;
+ }
+
+ void addArgument(JIT::Imm64 argument)
+ {
+ m_jit->poke(argument, m_stackIndex);
+ m_stackIndex += stackIndexStep;
+ }
#endif
void addArgument(JIT::RegisterID tag, JIT::RegisterID payload)
@@ -179,9 +195,9 @@ namespace JSC {
void addArgument(unsigned src, JIT::RegisterID scratchRegister) // src is a virtual register.
{
if (m_jit->m_codeBlock->isConstantRegisterIndex(src))
- addArgument(JIT::ImmPtr(JSValue::encode(m_jit->m_codeBlock->getConstant(src))));
+ addArgument(JIT::Imm64(JSValue::encode(m_jit->m_codeBlock->getConstant(src))));
else {
- m_jit->loadPtr(JIT::Address(JIT::callFrameRegister, src * sizeof(Register)), scratchRegister);
+ m_jit->load64(JIT::Address(JIT::callFrameRegister, src * sizeof(Register)), scratchRegister);
addArgument(scratchRegister);
}
m_jit->killLastResultRegister();
@@ -242,7 +258,7 @@ namespace JSC {
#else
JIT::Call call(unsigned dst) // dst is a virtual register.
{
- ASSERT(m_returnType == VoidPtr || m_returnType == Cell);
+ ASSERT(m_returnType == Value || m_returnType == Cell);
JIT::Call call = this->call();
m_jit->emitPutVirtualRegister(dst);
return call;
@@ -250,7 +266,7 @@ namespace JSC {
JIT::Call callWithValueProfiling(unsigned dst)
{
- ASSERT(m_returnType == VoidPtr || m_returnType == Cell);
+ ASSERT(m_returnType == Value || m_returnType == Cell);
JIT::Call call = this->call();
ASSERT(JIT::returnValueRegister == JIT::regT0);
m_jit->emitValueProfilingSite();
@@ -261,10 +277,8 @@ namespace JSC {
JIT::Call call(JIT::RegisterID dst) // dst is a machine register.
{
-#if USE(JSVALUE32_64)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
ASSERT(m_returnType == Value || m_returnType == VoidPtr || m_returnType == Int || m_returnType == Cell);
-#else
- ASSERT(m_returnType == VoidPtr || m_returnType == Int || m_returnType == Cell);
#endif
JIT::Call call = this->call();
if (dst != JIT::returnValueRegister)
diff --git a/Source/JavaScriptCore/jit/JITStubs.cpp b/Source/JavaScriptCore/jit/JITStubs.cpp
index f1f2f4c9d..a16b328ad 100644
--- a/Source/JavaScriptCore/jit/JITStubs.cpp
+++ b/Source/JavaScriptCore/jit/JITStubs.cpp
@@ -2375,7 +2375,7 @@ DEFINE_STUB_FUNCTION(JSObject*, op_new_array_buffer)
return constructArray(stackFrame.callFrame, stackFrame.callFrame->codeBlock()->constantBuffer(stackFrame.args[0].int32()), stackFrame.args[1].int32());
}
-DEFINE_STUB_FUNCTION(void, op_put_global_var_check)
+DEFINE_STUB_FUNCTION(void, op_init_global_const_check)
{
STUB_INIT_STACK_FRAME(stackFrame);
@@ -2390,11 +2390,22 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve)
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = JSScope::resolve(callFrame, stackFrame.args[0].identifier());
+ JSValue result = JSScope::resolve(callFrame, stackFrame.args[0].identifier(), stackFrame.args[1].resolveOperations());
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
+DEFINE_STUB_FUNCTION(void, op_put_to_base)
+{
+ STUB_INIT_STACK_FRAME(stackFrame);
+
+ CallFrame* callFrame = stackFrame.callFrame;
+ JSValue base = callFrame->r(stackFrame.args[0].int32()).jsValue();
+ JSValue value = callFrame->r(stackFrame.args[2].int32()).jsValue();
+ JSScope::resolvePut(callFrame, base, stackFrame.args[1].identifier(), value, stackFrame.args[3].putToBaseOperation());
+ CHECK_FOR_EXCEPTION_AT_END();
+}
+
DEFINE_STUB_FUNCTION(EncodedJSValue, op_construct_NotJSConstruct)
{
STUB_INIT_STACK_FRAME(stackFrame);
@@ -2719,14 +2730,14 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_base)
{
STUB_INIT_STACK_FRAME(stackFrame);
- return JSValue::encode(JSScope::resolveBase(stackFrame.callFrame, stackFrame.args[0].identifier(), false));
+ return JSValue::encode(JSScope::resolveBase(stackFrame.callFrame, stackFrame.args[0].identifier(), false, stackFrame.args[1].resolveOperations(), stackFrame.args[2].putToBaseOperation()));
}
DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_base_strict_put)
{
STUB_INIT_STACK_FRAME(stackFrame);
- if (JSValue result = JSScope::resolveBase(stackFrame.callFrame, stackFrame.args[0].identifier(), true))
+ if (JSValue result = JSScope::resolveBase(stackFrame.callFrame, stackFrame.args[0].identifier(), true, stackFrame.args[1].resolveOperations(), stackFrame.args[2].putToBaseOperation()))
return JSValue::encode(result);
VM_THROW_EXCEPTION();
}
@@ -2745,36 +2756,6 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_ensure_property_exists)
return JSValue::encode(base);
}
-
-DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_skip)
-{
- STUB_INIT_STACK_FRAME(stackFrame);
-
- JSValue result = JSScope::resolveSkip(stackFrame.callFrame, stackFrame.args[0].identifier(), stackFrame.args[1].int32());
- CHECK_FOR_EXCEPTION_AT_END();
- return JSValue::encode(result);
-}
-
-DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_global)
-{
- STUB_INIT_STACK_FRAME(stackFrame);
-
- CallFrame* callFrame = stackFrame.callFrame;
- Identifier& ident = stackFrame.args[0].identifier();
- CodeBlock* codeBlock = callFrame->codeBlock();
- unsigned globalResolveInfoIndex = stackFrame.args[1].int32();
- GlobalResolveInfo& globalResolveInfo = codeBlock->globalResolveInfo(globalResolveInfoIndex);
-
- JSValue result = JSScope::resolveGlobal(
- callFrame,
- ident,
- callFrame->lexicalGlobalObject(),
- &globalResolveInfo.structure,
- &globalResolveInfo.offset
- );
- CHECK_FOR_EXCEPTION();
- return JSValue::encode(result);
-}
DEFINE_STUB_FUNCTION(EncodedJSValue, op_div)
{
@@ -3055,7 +3036,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_with_base)
STUB_INIT_STACK_FRAME(stackFrame);
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = JSScope::resolveWithBase(callFrame, stackFrame.args[0].identifier(), &callFrame->registers()[stackFrame.args[1].int32()]);
+ JSValue result = JSScope::resolveWithBase(callFrame, stackFrame.args[0].identifier(), &callFrame->registers()[stackFrame.args[1].int32()], stackFrame.args[2].resolveOperations(), stackFrame.args[3].putToBaseOperation());
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -3065,7 +3046,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_with_this)
STUB_INIT_STACK_FRAME(stackFrame);
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = JSScope::resolveWithThis(callFrame, stackFrame.args[0].identifier(), &callFrame->registers()[stackFrame.args[1].int32()]);
+ JSValue result = JSScope::resolveWithThis(callFrame, stackFrame.args[0].identifier(), &callFrame->registers()[stackFrame.args[1].int32()], stackFrame.args[2].resolveOperations());
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
diff --git a/Source/JavaScriptCore/jit/JITStubs.h b/Source/JavaScriptCore/jit/JITStubs.h
index 4a3b252d6..6e3141e22 100644
--- a/Source/JavaScriptCore/jit/JITStubs.h
+++ b/Source/JavaScriptCore/jit/JITStubs.h
@@ -35,6 +35,7 @@
#include "LowLevelInterpreter.h"
#include "MacroAssemblerCodeRef.h"
#include "Register.h"
+#include "ResolveOperation.h"
#include "ThunkGenerators.h"
#include <wtf/HashMap.h>
@@ -82,6 +83,8 @@ namespace JSC {
JSString* jsString() { return static_cast<JSString*>(asPointer); }
Structure* structure() { return static_cast<Structure*>(asPointer); }
ReturnAddressPtr returnAddress() { return ReturnAddressPtr(asPointer); }
+ ResolveOperations* resolveOperations() { return static_cast<ResolveOperations*>(asPointer); }
+ PutToBaseOperation* putToBaseOperation() { return static_cast<PutToBaseOperation*>(asPointer); }
};
struct TrampolineStructure {
@@ -398,11 +401,9 @@ extern "C" {
EncodedJSValue JIT_STUB cti_op_resolve_base(STUB_ARGS_DECLARATION) WTF_INTERNAL;
EncodedJSValue JIT_STUB cti_op_resolve_base_strict_put(STUB_ARGS_DECLARATION) WTF_INTERNAL;
EncodedJSValue JIT_STUB cti_op_ensure_property_exists(STUB_ARGS_DECLARATION) WTF_INTERNAL;
- EncodedJSValue JIT_STUB cti_op_resolve_global(STUB_ARGS_DECLARATION) WTF_INTERNAL;
- EncodedJSValue JIT_STUB cti_op_resolve_global_dynamic(STUB_ARGS_DECLARATION) WTF_INTERNAL;
- EncodedJSValue JIT_STUB cti_op_resolve_skip(STUB_ARGS_DECLARATION) WTF_INTERNAL;
EncodedJSValue JIT_STUB cti_op_resolve_with_base(STUB_ARGS_DECLARATION) WTF_INTERNAL;
EncodedJSValue JIT_STUB cti_op_resolve_with_this(STUB_ARGS_DECLARATION) WTF_INTERNAL;
+ void JIT_STUB cti_op_put_to_base(STUB_ARGS_DECLARATION) WTF_INTERNAL;
EncodedJSValue JIT_STUB cti_op_rshift(STUB_ARGS_DECLARATION) WTF_INTERNAL;
EncodedJSValue JIT_STUB cti_op_strcat(STUB_ARGS_DECLARATION) WTF_INTERNAL;
EncodedJSValue JIT_STUB cti_op_stricteq(STUB_ARGS_DECLARATION) WTF_INTERNAL;
@@ -450,7 +451,7 @@ extern "C" {
void JIT_STUB cti_op_put_by_val(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void JIT_STUB cti_op_put_by_val_generic(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void JIT_STUB cti_op_put_getter_setter(STUB_ARGS_DECLARATION) WTF_INTERNAL;
- void JIT_STUB cti_op_put_global_var_check(STUB_ARGS_DECLARATION) WTF_INTERNAL;
+ void JIT_STUB cti_op_init_global_const_check(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void JIT_STUB cti_op_tear_off_activation(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void JIT_STUB cti_op_tear_off_arguments(STUB_ARGS_DECLARATION) WTF_INTERNAL;
void JIT_STUB cti_op_throw_reference_error(STUB_ARGS_DECLARATION) WTF_INTERNAL;
diff --git a/Source/JavaScriptCore/jit/JSInterfaceJIT.h b/Source/JavaScriptCore/jit/JSInterfaceJIT.h
index 8d9a0c800..d2a91ba0a 100644
--- a/Source/JavaScriptCore/jit/JSInterfaceJIT.h
+++ b/Source/JavaScriptCore/jit/JSInterfaceJIT.h
@@ -270,36 +270,36 @@ namespace JSC {
#if USE(JSVALUE64)
ALWAYS_INLINE JSInterfaceJIT::Jump JSInterfaceJIT::emitJumpIfImmediateNumber(RegisterID reg)
{
- return branchTestPtr(NonZero, reg, tagTypeNumberRegister);
+ return branchTest64(NonZero, reg, tagTypeNumberRegister);
}
ALWAYS_INLINE JSInterfaceJIT::Jump JSInterfaceJIT::emitJumpIfNotImmediateNumber(RegisterID reg)
{
- return branchTestPtr(Zero, reg, tagTypeNumberRegister);
+ return branchTest64(Zero, reg, tagTypeNumberRegister);
}
inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadJSCell(unsigned virtualRegisterIndex, RegisterID dst)
{
- loadPtr(addressFor(virtualRegisterIndex), dst);
- return branchTestPtr(NonZero, dst, tagMaskRegister);
+ load64(addressFor(virtualRegisterIndex), dst);
+ return branchTest64(NonZero, dst, tagMaskRegister);
}
inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadInt32(unsigned virtualRegisterIndex, RegisterID dst)
{
- loadPtr(addressFor(virtualRegisterIndex), dst);
- Jump result = branchPtr(Below, dst, tagTypeNumberRegister);
+ load64(addressFor(virtualRegisterIndex), dst);
+ Jump result = branch64(Below, dst, tagTypeNumberRegister);
zeroExtend32ToPtr(dst, dst);
return result;
}
inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadDouble(unsigned virtualRegisterIndex, FPRegisterID dst, RegisterID scratch)
{
- loadPtr(addressFor(virtualRegisterIndex), scratch);
+ load64(addressFor(virtualRegisterIndex), scratch);
Jump notNumber = emitJumpIfNotImmediateNumber(scratch);
- Jump notInt = branchPtr(Below, scratch, tagTypeNumberRegister);
+ Jump notInt = branch64(Below, scratch, tagTypeNumberRegister);
convertInt32ToDouble(scratch, dst);
Jump done = jump();
notInt.link(this);
- addPtr(tagTypeNumberRegister, scratch);
- movePtrToDouble(scratch, dst);
+ add64(tagTypeNumberRegister, scratch);
+ move64ToDouble(scratch, dst);
done.link(this);
return notNumber;
}
diff --git a/Source/JavaScriptCore/jit/SpecializedThunkJIT.h b/Source/JavaScriptCore/jit/SpecializedThunkJIT.h
index 560f7c833..9c7fbce81 100644
--- a/Source/JavaScriptCore/jit/SpecializedThunkJIT.h
+++ b/Source/JavaScriptCore/jit/SpecializedThunkJIT.h
@@ -90,9 +90,9 @@ namespace JSC {
void returnDouble(FPRegisterID src)
{
#if USE(JSVALUE64)
- moveDoubleToPtr(src, regT0);
- Jump zero = branchTestPtr(Zero, regT0);
- subPtr(tagTypeNumberRegister, regT0);
+ moveDoubleTo64(src, regT0);
+ Jump zero = branchTest64(Zero, regT0);
+ sub64(tagTypeNumberRegister, regT0);
Jump done = jump();
zero.link(this);
move(tagTypeNumberRegister, regT0);
@@ -151,7 +151,7 @@ namespace JSC {
void tagReturnAsInt32()
{
#if USE(JSVALUE64)
- orPtr(tagTypeNumberRegister, regT0);
+ or64(tagTypeNumberRegister, regT0);
#else
move(TrustedImm32(JSValue::Int32Tag), regT1);
#endif
diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
index fbf5b8598..74beae98a 100644
--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
@@ -119,12 +119,20 @@ namespace JSC { namespace LLInt {
JSValue __rp_returnValue = (value); \
LLINT_CHECK_EXCEPTION(); \
LLINT_OP(1) = __rp_returnValue; \
- pc[OPCODE_LENGTH(opcode) - 1].u.profile->m_buckets[0] = \
- JSValue::encode(__rp_returnValue); \
+ LLINT_PROFILE_VALUE(opcode, __rp_returnValue); \
LLINT_END_IMPL(); \
} while (false)
+
+#define LLINT_PROFILE_VALUE(opcode, value) do { \
+ pc[OPCODE_LENGTH(opcode) - 1].u.profile->m_buckets[0] = \
+ JSValue::encode(value); \
+ } while (false)
+
#else // ENABLE(VALUE_PROFILER)
#define LLINT_RETURN_PROFILED(opcode, value) LLINT_RETURN(value)
+
+#define LLINT_PROFILE_VALUE(opcode, value) do { } while (false)
+
#endif // ENABLE(VALUE_PROFILER)
#define LLINT_CALL_END_IMPL(exec, callTarget) LLINT_RETURN_TWO((callTarget), (exec))
@@ -777,52 +785,84 @@ LLINT_SLOW_PATH_DECL(slow_path_in)
LLINT_SLOW_PATH_DECL(slow_path_resolve)
{
LLINT_BEGIN();
- LLINT_RETURN_PROFILED(op_resolve, JSScope::resolve(exec, exec->codeBlock()->identifier(pc[2].u.operand)));
-}
+ Identifier ident = exec->codeBlock()->identifier(pc[2].u.operand);
+ ResolveOperations* operations = exec->codeBlock()->resolveOperations(pc[3].u.operand);
+ JSValue result = JSScope::resolve(exec, ident, operations);
+ ASSERT(operations->size());
+ ASSERT(operations == exec->codeBlock()->resolveOperations(pc[3].u.operand));
+ switch (operations->data()[0].m_operation) {
+ case ResolveOperation::GetAndReturnGlobalProperty:
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_resolve_global_property);
+ break;
-LLINT_SLOW_PATH_DECL(slow_path_resolve_skip)
-{
- LLINT_BEGIN();
- LLINT_RETURN_PROFILED(
- op_resolve_skip,
- JSScope::resolveSkip(
- exec,
- exec->codeBlock()->identifier(pc[2].u.operand),
- pc[3].u.operand));
-}
+ case ResolveOperation::GetAndReturnGlobalVar:
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_resolve_global_var);
+ break;
-LLINT_SLOW_PATH_DECL(slow_path_resolve_global)
-{
- LLINT_BEGIN();
- Identifier& ident = exec->codeBlock()->identifier(pc[2].u.operand);
- LLINT_RETURN_PROFILED(op_resolve_global, JSScope::resolveGlobal(exec, ident, exec->lexicalGlobalObject(), &pc[3].u.structure, &pc[4].u.operand));
-}
+ case ResolveOperation::SkipTopScopeNode:
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_resolve_scoped_var_with_top_scope_check);
+ break;
-LLINT_SLOW_PATH_DECL(slow_path_resolve_global_dynamic)
-{
- // FIXME: <rdar://problem/12185487> LLInt resolve_global_dynamic doesn't check intervening scopes for modification
- LLINT_BEGIN();
- Identifier& ident = exec->codeBlock()->identifier(pc[2].u.operand);
- LLINT_RETURN_PROFILED(op_resolve_global_dynamic, JSScope::resolveGlobal(exec, ident, exec->lexicalGlobalObject(), &pc[3].u.structure, &pc[4].u.operand));
+ case ResolveOperation::SkipScopes:
+ if (operations->data()[0].m_scopesToSkip)
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_resolve_scoped_var);
+ else
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_resolve_scoped_var_on_top_scope);
+ break;
+
+ default:
+ break;
+ }
+ LLINT_RETURN_PROFILED(op_resolve, result);
}
-LLINT_SLOW_PATH_DECL(slow_path_resolve_for_resolve_global_dynamic)
+LLINT_SLOW_PATH_DECL(slow_path_put_to_base)
{
LLINT_BEGIN();
- LLINT_RETURN_PROFILED(op_resolve_global_dynamic, JSScope::resolve(exec, exec->codeBlock()->identifier(pc[2].u.operand)));
+ PutToBaseOperation* operation = exec->codeBlock()->putToBaseOperation(pc[4].u.operand);
+ JSScope::resolvePut(exec, LLINT_OP_C(1).jsValue(), exec->codeBlock()->identifier(pc[2].u.operand), LLINT_OP_C(3).jsValue(), operation);
+ switch (operation->m_kind) {
+ case PutToBaseOperation::VariablePut:
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_put_to_base_variable);
+ break;
+
+ default:
+ break;
+ }
+ LLINT_END();
}
LLINT_SLOW_PATH_DECL(slow_path_resolve_base)
{
LLINT_BEGIN();
Identifier& ident = exec->codeBlock()->identifier(pc[2].u.operand);
+ ResolveOperations* operations = exec->codeBlock()->resolveOperations(pc[4].u.operand);
+ JSValue result;
if (pc[3].u.operand) {
- if (JSValue result = JSScope::resolveBase(exec, ident, true))
- LLINT_RETURN(result);
- LLINT_THROW(globalData.exception);
+ result = JSScope::resolveBase(exec, ident, true, operations, exec->codeBlock()->putToBaseOperation(pc[5].u.operand));
+ if (!result)
+ LLINT_THROW(globalData.exception);
+ } else
+ result = JSScope::resolveBase(exec, ident, false, operations, exec->codeBlock()->putToBaseOperation(pc[5].u.operand));
+ ASSERT(operations->size());
+ switch (operations->data()[0].m_operation) {
+ case ResolveOperation::ReturnGlobalObjectAsBase:
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_resolve_base_to_global);
+ break;
+
+ case ResolveOperation::SkipTopScopeNode:
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_resolve_base_to_scope_with_top_scope_check);
+ break;
+
+ case ResolveOperation::SkipScopes:
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_resolve_base_to_scope);
+ break;
+
+ default:
+ break;
}
-
- LLINT_RETURN_PROFILED(op_resolve_base, JSScope::resolveBase(exec, ident, false));
+ LLINT_PROFILE_VALUE(op_resolve_base, result);
+ LLINT_RETURN(result);
}
LLINT_SLOW_PATH_DECL(slow_path_ensure_property_exists)
@@ -839,24 +879,26 @@ LLINT_SLOW_PATH_DECL(slow_path_ensure_property_exists)
LLINT_SLOW_PATH_DECL(slow_path_resolve_with_base)
{
LLINT_BEGIN();
- JSValue result = JSScope::resolveWithBase(exec, exec->codeBlock()->identifier(pc[3].u.operand), &LLINT_OP(1));
+ ResolveOperations* operations = exec->codeBlock()->resolveOperations(pc[4].u.operand);
+ JSValue result = JSScope::resolveWithBase(exec, exec->codeBlock()->identifier(pc[3].u.operand), &LLINT_OP(1), operations, exec->codeBlock()->putToBaseOperation(pc[5].u.operand));
LLINT_CHECK_EXCEPTION();
LLINT_OP(2) = result;
- // FIXME: technically should have profiling, but we don't do it because the DFG won't use it.
+ LLINT_PROFILE_VALUE(op_resolve_with_base, result);
LLINT_END();
}
LLINT_SLOW_PATH_DECL(slow_path_resolve_with_this)
{
LLINT_BEGIN();
- JSValue result = JSScope::resolveWithThis(exec, exec->codeBlock()->identifier(pc[3].u.operand), &LLINT_OP(1));
+ ResolveOperations* operations = exec->codeBlock()->resolveOperations(pc[4].u.operand);
+ JSValue result = JSScope::resolveWithThis(exec, exec->codeBlock()->identifier(pc[3].u.operand), &LLINT_OP(1), operations);
LLINT_CHECK_EXCEPTION();
LLINT_OP(2) = result;
- // FIXME: technically should have profiling, but we don't do it because the DFG won't use it.
+ LLINT_PROFILE_VALUE(op_resolve_with_this, result);
LLINT_END();
}
-LLINT_SLOW_PATH_DECL(slow_path_put_global_var_check)
+LLINT_SLOW_PATH_DECL(slow_path_init_global_const_check)
{
LLINT_BEGIN();
CodeBlock* codeBlock = exec->codeBlock();
diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.h b/Source/JavaScriptCore/llint/LLIntSlowPaths.h
index 3d770f3c5..f78476841 100644
--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.h
+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.h
@@ -157,15 +157,12 @@ LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_is_object);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_is_function);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_in);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_skip);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_global);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_global_dynamic);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_for_resolve_global_dynamic);
+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_to_base);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_base);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_ensure_property_exists);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_with_base);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_with_this);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_global_var_check);
+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_init_global_const_check);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_id);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_arguments_length);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_id);
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
index ad509e05d..022637dbe 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
@@ -54,8 +54,28 @@ if JSVALUE64
const PB = t6
const tagTypeNumber = csr1
const tagMask = csr2
+
+ macro loadisFromInstruction(offset, dest)
+ loadis offset * 8[PB, PC, 8], dest
+ end
+
+ macro loadpFromInstruction(offset, dest)
+ loadp offset * 8[PB, PC, 8], dest
+ end
+
+ macro storepToInstruction(value, offset)
+ storep value, offset * 8[PB, PC, 8]
+ end
+
else
const PC = t4
+ macro loadisFromInstruction(offset, dest)
+ loadis offset * 4[PC], dest
+ end
+
+ macro loadpFromInstruction(offset, dest)
+ loadp offset * 4[PC], dest
+ end
end
# Constants for reasoning about value representation.
@@ -100,6 +120,29 @@ const HashFlags8BitBuffer = 64
# Copied from PropertyOffset.h
const firstOutOfLineOffset = 100
+# From ResolveOperations.h
+const ResolveOperationFail = 0
+const ResolveOperationSetBaseToUndefined = 1
+const ResolveOperationReturnScopeAsBase = 2
+const ResolveOperationSetBaseToScope = 3
+const ResolveOperationSetBaseToGlobal = 4
+const ResolveOperationGetAndReturnScopedVar = 5
+const ResolveOperationGetAndReturnGlobalVar = 6
+const ResolveOperationGetAndReturnGlobalVarWatchable = 7
+const ResolveOperationSkipTopScopeNode = 8
+const ResolveOperationSkipScopes = 9
+const ResolveOperationReturnGlobalObjectAsBase = 10
+const ResolveOperationGetAndReturnGlobalProperty = 11
+const ResolveOperationCheckForDynamicEntriesBeforeGlobalScope = 12
+
+const PutToBaseOperationKindUninitialised = 0
+const PutToBaseOperationKindGeneric = 1
+const PutToBaseOperationKindReadonly = 2
+const PutToBaseOperationKindGlobalVariablePut = 3
+const PutToBaseOperationKindGlobalVariablePutChecked = 4
+const PutToBaseOperationKindGlobalPropertyPut = 5
+const PutToBaseOperationKindVariablePut = 6
+
# Allocation constants
if JSVALUE64
const JSFinalObjectSizeClassIndex = 1
@@ -196,13 +239,8 @@ macro arrayProfile(structureAndIndexingType, profile, scratch)
const indexingType = structureAndIndexingType
if VALUE_PROFILER
storep structure, ArrayProfile::m_lastSeenStructure[profile]
- loadb Structure::m_indexingType[structure], indexingType
- move 1, scratch
- lshifti indexingType, scratch
- ori scratch, ArrayProfile::m_observedArrayModes[profile]
- else
- loadb Structure::m_indexingType[structure], indexingType
end
+ loadb Structure::m_indexingType[structure], indexingType
end
macro checkSwitchToJIT(increment, action)
@@ -499,41 +537,417 @@ _llint_op_in:
callSlowPath(_llint_slow_path_in)
dispatch(4)
+macro getPutToBaseOperationField(scratch, scratch1, fieldOffset, fieldGetter)
+ loadisFromInstruction(4, scratch)
+ mulp sizeof PutToBaseOperation, scratch, scratch
+ loadp CodeBlock[cfr], scratch1
+ loadp VectorBufferOffset + CodeBlock::m_putToBaseOperations[scratch1], scratch1
+ fieldGetter(fieldOffset[scratch1, scratch, 1])
+end
+
+macro moveJSValueFromRegisterWithoutProfiling(value, destBuffer, destOffsetReg)
+ storep value, [destBuffer, destOffsetReg, 8]
+end
+
+
+macro moveJSValueFromRegistersWithoutProfiling(tag, payload, destBuffer, destOffsetReg)
+ storep tag, TagOffset[destBuffer, destOffsetReg, 8]
+ storep payload, PayloadOffset[destBuffer, destOffsetReg, 8]
+end
+
+macro putToBaseVariableBody(variableOffset, scratch1, scratch2, scratch3)
+ loadisFromInstruction(1, scratch1)
+ loadp PayloadOffset[cfr, scratch1, 8], scratch1
+ loadp JSVariableObject::m_registers[scratch1], scratch1
+ loadisFromInstruction(3, scratch2)
+ if JSVALUE64
+ loadConstantOrVariable(scratch2, scratch3)
+ moveJSValueFromRegisterWithoutProfiling(scratch3, scratch1, variableOffset)
+ else
+ loadConstantOrVariable2Reg(scratch2, scratch3, scratch2) # scratch3=tag, scratch2=payload
+ moveJSValueFromRegistersWithoutProfiling(scratch3, scratch2, scratch1, variableOffset)
+ end
+end
+
+_llint_op_put_to_base_variable:
+ traceExecution()
+ getPutToBaseOperationField(t0, t1, PutToBaseOperation::m_offset, macro(addr)
+ loadis addr, t0
+ end)
+ putToBaseVariableBody(t0, t1, t2, t3)
+ dispatch(5)
+
+_llint_op_put_to_base:
+ traceExecution()
+ getPutToBaseOperationField(t0, t1, 0, macro(addr)
+ leap addr, t0
+ bbneq PutToBaseOperation::m_kindAsUint8[t0], PutToBaseOperationKindVariablePut, .notPutToBaseVariable
+ loadis PutToBaseOperation::m_offset[t0], t0
+ putToBaseVariableBody(t0, t1, t2, t3)
+ dispatch(5)
+ .notPutToBaseVariable:
+ end)
+ callSlowPath(_llint_slow_path_put_to_base)
+ dispatch(5)
+
+macro getResolveOperation(resolveOperationIndex, dest, scratch)
+ loadisFromInstruction(resolveOperationIndex, dest)
+ mulp sizeof ResolveOperations, dest, dest
+ loadp CodeBlock[cfr], scratch
+ loadp VectorBufferOffset + CodeBlock::m_resolveOperations[scratch], scratch
+ loadp VectorBufferOffset[scratch, dest, 1], dest
+end
+
+macro getScope(loadInitialScope, scopeCount, dest, scratch)
+ loadInitialScope(dest)
+ loadi scopeCount, scratch
+
+ btiz scratch, .done
+.loop:
+ loadp JSScope::m_next[dest], dest
+ subi 1, scratch
+ btinz scratch, .loop
+
+.done:
+end
+
+macro moveJSValue(sourceBuffer, sourceOffsetReg, destBuffer, destOffsetReg, profileOffset, scratchRegister)
+ if JSVALUE64
+ loadp [sourceBuffer, sourceOffsetReg, 8], scratchRegister
+ storep scratchRegister, [destBuffer, destOffsetReg, 8]
+ loadpFromInstruction(profileOffset, destOffsetReg)
+ valueProfile(scratchRegister, destOffsetReg)
+ else
+ loadp PayloadOffset[sourceBuffer, sourceOffsetReg, 8], scratchRegister
+ storep scratchRegister, PayloadOffset[destBuffer, destOffsetReg, 8]
+ loadp TagOffset[sourceBuffer, sourceOffsetReg, 8], sourceOffsetReg
+ storep sourceOffsetReg, TagOffset[destBuffer, destOffsetReg, 8]
+ loadpFromInstruction(profileOffset, destOffsetReg)
+ valueProfile(sourceOffsetReg, scratchRegister, destOffsetReg)
+ end
+end
+
+macro moveJSValueFromSlot(slot, destBuffer, destOffsetReg, profileOffset, scratchRegister)
+ if JSVALUE64
+ loadp [slot], scratchRegister
+ storep scratchRegister, [destBuffer, destOffsetReg, 8]
+ loadpFromInstruction(profileOffset, destOffsetReg)
+ valueProfile(scratchRegister, destOffsetReg)
+ else
+ loadp PayloadOffset[slot], scratchRegister
+ storep scratchRegister, PayloadOffset[destBuffer, destOffsetReg, 8]
+ loadp TagOffset[slot], slot
+ storep slot, TagOffset[destBuffer, destOffsetReg, 8]
+ loadpFromInstruction(profileOffset, destOffsetReg)
+ valueProfile(slot, scratchRegister, destOffsetReg)
+ end
+end
+
+macro moveJSValueFromRegister(value, destBuffer, destOffsetReg, profileOffset)
+ storep value, [destBuffer, destOffsetReg, 8]
+ loadpFromInstruction(profileOffset, destOffsetReg)
+ valueProfile(value, destOffsetReg)
+end
+
+macro moveJSValueFromRegisters(tag, payload, destBuffer, destOffsetReg, profileOffset)
+ storep tag, TagOffset[destBuffer, destOffsetReg, 8]
+ storep payload, PayloadOffset[destBuffer, destOffsetReg, 8]
+ loadpFromInstruction(profileOffset, destOffsetReg)
+ valueProfile(tag, payload, destOffsetReg)
+end
+
+_llint_op_resolve_global_property:
+ traceExecution()
+ getResolveOperation(3, t0, t1)
+ loadp CodeBlock[cfr], t1
+ loadp CodeBlock::m_globalObject[t1], t1
+ loadp ResolveOperation::m_structure[t0], t2
+ bpneq JSCell::m_structure[t1], t2, _llint_op_resolve
+ loadis ResolveOperation::m_offset[t0], t0
+ if JSVALUE64
+ loadPropertyAtVariableOffsetKnownNotInline(t0, t1, t2)
+ loadisFromInstruction(1, t0)
+ moveJSValueFromRegister(t2, cfr, t0, 4)
+ else
+ loadPropertyAtVariableOffsetKnownNotInline(t0, t1, t2, t3)
+ loadisFromInstruction(1, t0)
+ moveJSValueFromRegisters(t2, t3, cfr, t0, 4)
+ end
+ dispatch(5)
+
+_llint_op_resolve_global_var:
+ traceExecution()
+ getResolveOperation(3, t0, t1)
+ loadp ResolveOperation::m_registerAddress[t0], t0
+ loadisFromInstruction(1, t1)
+ moveJSValueFromSlot(t0, cfr, t1, 4, t3)
+ dispatch(5)
+
+macro resolveScopedVarBody(resolveOperations)
+ # First ResolveOperation is to skip scope chain nodes
+ getScope(macro(dest)
+ loadp ScopeChain + PayloadOffset[cfr], dest
+ end,
+ ResolveOperation::m_scopesToSkip[resolveOperations], t1, t2)
+ loadp JSVariableObject::m_registers[t1], t1 # t1 now contains the activation registers
+
+ # Second ResolveOperation tells us what offset to use
+ loadis ResolveOperation::m_offset + sizeof ResolveOperation[resolveOperations], t2
+ loadisFromInstruction(1, t3)
+ moveJSValue(t1, t2, cfr, t3, 4, t0)
+end
+
+_llint_op_resolve_scoped_var:
+ traceExecution()
+ getResolveOperation(3, t0, t1)
+ resolveScopedVarBody(t0)
+ dispatch(5)
+
+_llint_op_resolve_scoped_var_on_top_scope:
+ traceExecution()
+ getResolveOperation(3, t0, t1)
+
+ # Load destination index
+ loadisFromInstruction(1, t3)
+
+ # We know we want the top scope chain entry
+ loadp ScopeChain + PayloadOffset[cfr], t1
+ loadp JSVariableObject::m_registers[t1], t1 # t1 now contains the activation registers
+
+ # Second ResolveOperation tells us what offset to use
+ loadis ResolveOperation::m_offset + sizeof ResolveOperation[t0], t2
+
+ moveJSValue(t1, t2, cfr, t3, 4, t0)
+ dispatch(5)
+
+_llint_op_resolve_scoped_var_with_top_scope_check:
+ traceExecution()
+ getResolveOperation(3, t0, t1)
+ # First ResolveOperation tells us what register to check
+ loadis ResolveOperation::m_activationRegister[t0], t1
+
+ loadp PayloadOffset[cfr, t1, 8], t1
+
+ getScope(macro(dest)
+ btpz t1, .scopeChainNotCreated
+ loadp JSScope::m_next[t1], dest
+ jmp .done
+ .scopeChainNotCreated:
+ loadp ScopeChain + PayloadOffset[cfr], dest
+ .done:
+ end,
+ # Second ResolveOperation tells us how many more nodes to skip
+ ResolveOperation::m_scopesToSkip + sizeof ResolveOperation[t0], t1, t2)
+ loadp JSVariableObject::m_registers[t1], t1 # t1 now contains the activation registers
+
+ # Third operation tells us what offset to use
+ loadis ResolveOperation::m_offset + 2 * sizeof ResolveOperation[t0], t2
+ loadisFromInstruction(1, t3)
+ moveJSValue(t1, t2, cfr, t3, 4, t0)
+ dispatch(5)
_llint_op_resolve:
traceExecution()
+ getResolveOperation(3, t0, t1)
+ btpz t0, .noInstructions
+ loadis ResolveOperation::m_operation[t0], t1
+ bineq t1, ResolveOperationSkipScopes, .notSkipScopes
+ resolveScopedVarBody(t0)
+ dispatch(5)
+.notSkipScopes:
+ bineq t1, ResolveOperationGetAndReturnGlobalVar, .notGetAndReturnGlobalVar
+ loadp ResolveOperation::m_registerAddress[t0], t0
+ loadisFromInstruction(1, t1)
+ moveJSValueFromSlot(t0, cfr, t1, 4, t3)
+ dispatch(5)
+.notGetAndReturnGlobalVar:
+
+.noInstructions:
callSlowPath(_llint_slow_path_resolve)
- dispatch(4)
+ dispatch(5)
+
+_llint_op_resolve_base_to_global:
+ traceExecution()
+ loadp CodeBlock[cfr], t1
+ loadp CodeBlock::m_globalObject[t1], t1
+ loadisFromInstruction(1, t3)
+ if JSVALUE64
+ moveJSValueFromRegister(t1, cfr, t3, 6)
+ else
+ move CellTag, t2
+ moveJSValueFromRegisters(t2, t1, cfr, t3, 6)
+ end
+ dispatch(7)
+_llint_op_resolve_base_to_global_dynamic:
+ jmp _llint_op_resolve_base
-_llint_op_resolve_skip:
+_llint_op_resolve_base_to_scope:
traceExecution()
- callSlowPath(_llint_slow_path_resolve_skip)
- dispatch(5)
+ getResolveOperation(4, t0, t1)
+ # First ResolveOperation is to skip scope chain nodes
+ getScope(macro(dest)
+ loadp ScopeChain + PayloadOffset[cfr], dest
+ end,
+ ResolveOperation::m_scopesToSkip[t0], t1, t2)
+ loadisFromInstruction(1, t3)
+ if JSVALUE64
+ moveJSValueFromRegister(t1, cfr, t3, 6)
+ else
+ move CellTag, t2
+ moveJSValueFromRegisters(t2, t1, cfr, t3, 6)
+ end
+ dispatch(7)
+_llint_op_resolve_base_to_scope_with_top_scope_check:
+ traceExecution()
+ getResolveOperation(4, t0, t1)
+ # First ResolveOperation tells us what register to check
+ loadis ResolveOperation::m_activationRegister[t0], t1
+
+ loadp PayloadOffset[cfr, t1, 8], t1
+
+ getScope(macro(dest)
+ btpz t1, .scopeChainNotCreated
+ loadp JSScope::m_next[t1], dest
+ jmp .done
+ .scopeChainNotCreated:
+ loadp ScopeChain + PayloadOffset[cfr], dest
+ .done:
+ end,
+ # Second ResolveOperation tells us how many more nodes to skip
+ ResolveOperation::m_scopesToSkip + sizeof ResolveOperation[t0], t1, t2)
+
+ loadisFromInstruction(1, t3)
+ if JSVALUE64
+ moveJSValueFromRegister(t1, cfr, t3, 6)
+ else
+ move CellTag, t2
+ moveJSValueFromRegisters(t2, t1, cfr, t3, 6)
+ end
+ dispatch(7)
_llint_op_resolve_base:
traceExecution()
callSlowPath(_llint_slow_path_resolve_base)
- dispatch(5)
-
+ dispatch(7)
_llint_op_ensure_property_exists:
traceExecution()
callSlowPath(_llint_slow_path_ensure_property_exists)
dispatch(3)
+macro interpretResolveWithBase(opcodeLength, slowPath)
+ traceExecution()
+ getResolveOperation(4, t0, t1)
+ btpz t0, .slowPath
+
+ loadp ScopeChain[cfr], t3
+ # Get the base
+ loadis ResolveOperation::m_operation[t0], t2
+
+ bineq t2, ResolveOperationSkipScopes, .notSkipScopes
+ getScope(macro(dest) move t3, dest end,
+ ResolveOperation::m_scopesToSkip[t0], t1, t2)
+ move t1, t3
+ addp sizeof ResolveOperation, t0, t0
+ jmp .haveCorrectScope
+
+ .notSkipScopes:
+
+ bineq t2, ResolveOperationSkipTopScopeNode, .notSkipTopScopeNode
+ loadis ResolveOperation::m_activationRegister[t0], t1
+ loadp PayloadOffset[cfr, t1, 8], t1
+
+ getScope(macro(dest)
+ btpz t1, .scopeChainNotCreated
+ loadp JSScope::m_next[t1], dest
+ jmp .done
+ .scopeChainNotCreated:
+ loadp ScopeChain + PayloadOffset[cfr], dest
+ .done:
+ end,
+ sizeof ResolveOperation + ResolveOperation::m_scopesToSkip[t0], t1, t2)
+ move t1, t3
+ # We've handled two opcodes here
+ addp 2 * sizeof ResolveOperation, t0, t0
+
+ .notSkipTopScopeNode:
+
+ .haveCorrectScope:
+
+ # t3 now contains the correct Scope
+ # t0 contains a pointer to the current ResolveOperation
+
+ loadis ResolveOperation::m_operation[t0], t2
+ # t2 contains the next instruction
+
+ loadisFromInstruction(1, t1)
+ # t1 now contains the index for the base register
+
+ bineq t2, ResolveOperationSetBaseToScope, .notSetBaseToScope
+ storep t3, PayloadOffset[cfr, t1, 8]
+ if JSVALUE64
+ else
+ storep CellTag, TagOffset[cfr, t1, 8]
+ end
+ jmp .haveSetBase
+
+ .notSetBaseToScope:
+
+ bineq t2, ResolveOperationSetBaseToUndefined, .notSetBaseToUndefined
+ if JSVALUE64
+ storep ValueUndefined, PayloadOffset[cfr, t1, 8]
+ else
+ storep 0, PayloadOffset[cfr, t1, 8]
+ storep UndefinedTag, TagOffset[cfr, t1, 8]
+ end
+ jmp .haveSetBase
+
+ .notSetBaseToUndefined:
+ bineq t2, ResolveOperationSetBaseToGlobal, .slowPath
+ loadp JSCell::m_structure[t3], t2
+ loadp Structure::m_globalObject[t2], t2
+ storep t2, PayloadOffset[cfr, t1, 8]
+ if JSVALUE64
+ else
+ storep CellTag, TagOffset[cfr, t1, 8]
+ end
+
+ .haveSetBase:
+
+ # Get the value
+
+ # Load the operation into t2
+ loadis ResolveOperation::m_operation + sizeof ResolveOperation[t0], t2
+
+ # Load the index for the value register into t1
+ loadisFromInstruction(2, t1)
+
+ bineq t2, ResolveOperationGetAndReturnScopedVar, .notGetAndReturnScopedVar
+ loadp JSVariableObject::m_registers[t3], t3 # t3 now contains the activation registers
+
+ # Second ResolveOperation tells us what offset to use
+ loadis ResolveOperation::m_offset + sizeof ResolveOperation[t0], t2
+ moveJSValue(t3, t2, cfr, t1, opcodeLength - 1, t0)
+ dispatch(opcodeLength)
+
+ .notGetAndReturnScopedVar:
+ bineq t2, ResolveOperationGetAndReturnGlobalProperty, .slowPath
+ callSlowPath(slowPath)
+ dispatch(opcodeLength)
+
+.slowPath:
+ callSlowPath(slowPath)
+ dispatch(opcodeLength)
+end
_llint_op_resolve_with_base:
- traceExecution()
- callSlowPath(_llint_slow_path_resolve_with_base)
- dispatch(5)
+ interpretResolveWithBase(7, _llint_slow_path_resolve_with_base)
_llint_op_resolve_with_this:
- traceExecution()
- callSlowPath(_llint_slow_path_resolve_with_this)
- dispatch(5)
+ interpretResolveWithBase(6, _llint_slow_path_resolve_with_this)
macro withInlineStorage(object, propertyStorage, continuation)
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
index f0d45eb0e..d0072d714 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
@@ -976,126 +976,7 @@ macro resolveGlobal(size, slow)
valueProfile(t2, t3, t0)
end
-_llint_op_resolve_global:
- traceExecution()
- resolveGlobal(6, .opResolveGlobalSlow)
- dispatch(6)
-
-.opResolveGlobalSlow:
- callSlowPath(_llint_slow_path_resolve_global)
- dispatch(6)
-
-
-# Gives you the scope in t0, while allowing you to optionally perform additional checks on the
-# scopes as they are traversed. scopeCheck() is called with two arguments: the register
-# holding the scope, and a register that can be used for scratch. Note that this does not
-# use t3, so you can hold stuff in t3 if need be.
-macro getScope(deBruijinIndexOperand, scopeCheck)
- loadp ScopeChain + PayloadOffset[cfr], t0
- loadi deBruijinIndexOperand, t2
-
- btiz t2, .done
-
- loadp CodeBlock[cfr], t1
- bineq CodeBlock::m_codeType[t1], FunctionCode, .loop
- btbz CodeBlock::m_needsFullScopeChain[t1], .loop
-
- loadi CodeBlock::m_activationRegister[t1], t1
-
- # Need to conditionally skip over one scope.
- bieq TagOffset[cfr, t1, 8], EmptyValueTag, .noActivation
- scopeCheck(t0, t1)
- loadp JSScope::m_next[t0], t0
-.noActivation:
- subi 1, t2
-
- btiz t2, .done
-.loop:
- scopeCheck(t0, t1)
- loadp JSScope::m_next[t0], t0
- subi 1, t2
- btinz t2, .loop
-
-.done:
-end
-
-_llint_op_resolve_global_dynamic:
- traceExecution()
- loadp CodeBlock[cfr], t3
- loadp CodeBlock::m_globalObject[t3], t3
- loadp JSGlobalObject::m_activationStructure[t3], t3
- getScope(
- 20[PC],
- macro (scope, scratch)
- bpneq JSCell::m_structure[scope], t3, .opResolveGlobalDynamicSuperSlow
- end)
- resolveGlobal(7, .opResolveGlobalDynamicSlow)
- dispatch(7)
-
-.opResolveGlobalDynamicSuperSlow:
- callSlowPath(_llint_slow_path_resolve_for_resolve_global_dynamic)
- dispatch(7)
-
-.opResolveGlobalDynamicSlow:
- callSlowPath(_llint_slow_path_resolve_global_dynamic)
- dispatch(7)
-
-
-_llint_op_get_scoped_var:
- traceExecution()
- # Operands are as follows:
- # 4[PC] Destination for the load.
- # 8[PC] Index of register in the scope.
- # 12[PC] De Bruijin index.
- getScope(12[PC], macro (scope, scratch) end)
- loadi 4[PC], t1
- loadi 8[PC], t2
- loadp JSVariableObject::m_registers[t0], t0
- loadi TagOffset[t0, t2, 8], t3
- loadi PayloadOffset[t0, t2, 8], t0
- storei t3, TagOffset[cfr, t1, 8]
- storei t0, PayloadOffset[cfr, t1, 8]
- loadi 16[PC], t1
- valueProfile(t3, t0, t1)
- dispatch(5)
-
-
-_llint_op_put_scoped_var:
- traceExecution()
- getScope(8[PC], macro (scope, scratch) end)
- loadi 12[PC], t1
- loadConstantOrVariable(t1, t3, t2)
- loadi 4[PC], t1
- writeBarrier(t3, t2)
- loadp JSVariableObject::m_registers[t0], t0
- storei t3, TagOffset[t0, t1, 8]
- storei t2, PayloadOffset[t0, t1, 8]
- dispatch(4)
-
-
-macro getGlobalVar(size)
- traceExecution()
- loadp 8[PC], t0
- loadi 4[PC], t3
- loadi TagOffset[t0], t2
- loadi PayloadOffset[t0], t1
- storei t2, TagOffset[cfr, t3, 8]
- storei t1, PayloadOffset[cfr, t3, 8]
- loadi (size - 1) * 4[PC], t3
- valueProfile(t2, t1, t3)
- dispatch(size)
-end
-
-_llint_op_get_global_var:
- getGlobalVar(4)
-
-
-_llint_op_get_global_var_watchable:
- getGlobalVar(5)
-
-
_llint_op_init_global_const:
-_llint_op_put_global_var:
traceExecution()
loadi 8[PC], t1
loadi 4[PC], t0
@@ -1107,22 +988,20 @@ _llint_op_put_global_var:
_llint_op_init_global_const_check:
-_llint_op_put_global_var_check:
traceExecution()
loadp 12[PC], t2
loadi 8[PC], t1
loadi 4[PC], t0
- btbnz [t2], .opPutGlobalVarCheckSlow
+ btbnz [t2], .opInitGlobalConstCheckSlow
loadConstantOrVariable(t1, t2, t3)
writeBarrier(t2, t3)
storei t2, TagOffset[t0]
storei t3, PayloadOffset[t0]
dispatch(5)
-.opPutGlobalVarCheckSlow:
- callSlowPath(_llint_slow_path_put_global_var_check)
+.opInitGlobalConstCheckSlow:
+ callSlowPath(_llint_slow_path_init_global_const_check)
dispatch(5)
-
# We only do monomorphic get_by_id caching for now, and we do not modify the
# opcode. We do, however, allow for the cache to change anytime if fails, since
# ping-ponging is free. At best we get lucky and the get_by_id will continue
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
index 8b72674ab..59fa18ccf 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
@@ -815,139 +815,7 @@ macro loadPropertyAtVariableOffset(propertyOffsetAsInt, objectAndStorage, value)
loadp (firstOutOfLineOffset - 2) * 8[objectAndStorage, propertyOffsetAsInt, 8], value
end
-macro resolveGlobal(size, slow)
- # Operands are as follows:
- # 8[PB, PC, 8] Destination for the load.
- # 16[PB, PC, 8] Property identifier index in the code block.
- # 24[PB, PC, 8] Structure pointer, initialized to 0 by bytecode generator.
- # 32[PB, PC, 8] Offset in global object, initialized to 0 by bytecode generator.
- loadp CodeBlock[cfr], t0
- loadp CodeBlock::m_globalObject[t0], t0
- loadp JSCell::m_structure[t0], t1
- bpneq t1, 24[PB, PC, 8], slow
- loadis 32[PB, PC, 8], t1
- loadPropertyAtVariableOffsetKnownNotInline(t1, t0, t2)
- loadis 8[PB, PC, 8], t0
- storep t2, [cfr, t0, 8]
- loadp (size - 1) * 8[PB, PC, 8], t0
- valueProfile(t2, t0)
-end
-
-_llint_op_resolve_global:
- traceExecution()
- resolveGlobal(6, .opResolveGlobalSlow)
- dispatch(6)
-
-.opResolveGlobalSlow:
- callSlowPath(_llint_slow_path_resolve_global)
- dispatch(6)
-
-
-# Gives you the scope in t0, while allowing you to optionally perform additional checks on the
-# scopes as they are traversed. scopeCheck() is called with two arguments: the register
-# holding the scope, and a register that can be used for scratch. Note that this does not
-# use t3, so you can hold stuff in t3 if need be.
-macro getScope(deBruijinIndexOperand, scopeCheck)
- loadp ScopeChain[cfr], t0
- loadis deBruijinIndexOperand, t2
-
- btiz t2, .done
-
- loadp CodeBlock[cfr], t1
- bineq CodeBlock::m_codeType[t1], FunctionCode, .loop
- btbz CodeBlock::m_needsFullScopeChain[t1], .loop
-
- loadis CodeBlock::m_activationRegister[t1], t1
-
- # Need to conditionally skip over one scope.
- btpz [cfr, t1, 8], .noActivation
- scopeCheck(t0, t1)
- loadp JSScope::m_next[t0], t0
-.noActivation:
- subi 1, t2
-
- btiz t2, .done
-.loop:
- scopeCheck(t0, t1)
- loadp JSScope::m_next[t0], t0
- subi 1, t2
- btinz t2, .loop
-
-.done:
-end
-
-_llint_op_resolve_global_dynamic:
- traceExecution()
- loadp CodeBlock[cfr], t3
- loadp CodeBlock::m_globalObject[t3], t3
- loadp JSGlobalObject::m_activationStructure[t3], t3
- getScope(
- 40[PB, PC, 8],
- macro (scope, scratch)
- bpneq JSCell::m_structure[scope], t3, .opResolveGlobalDynamicSuperSlow
- end)
- resolveGlobal(7, .opResolveGlobalDynamicSlow)
- dispatch(7)
-
-.opResolveGlobalDynamicSuperSlow:
- callSlowPath(_llint_slow_path_resolve_for_resolve_global_dynamic)
- dispatch(7)
-
-.opResolveGlobalDynamicSlow:
- callSlowPath(_llint_slow_path_resolve_global_dynamic)
- dispatch(7)
-
-
-_llint_op_get_scoped_var:
- traceExecution()
- # Operands are as follows:
- # 8[PB, PC, 8] Destination for the load
- # 16[PB, PC, 8] Index of register in the scope
- # 24[PB, PC, 8] De Bruijin index.
- getScope(24[PB, PC, 8], macro (scope, scratch) end)
- loadis 8[PB, PC, 8], t1
- loadis 16[PB, PC, 8], t2
- loadp JSVariableObject::m_registers[t0], t0
- loadp [t0, t2, 8], t3
- storep t3, [cfr, t1, 8]
- loadp 32[PB, PC, 8], t1
- valueProfile(t3, t1)
- dispatch(5)
-
-
-_llint_op_put_scoped_var:
- traceExecution()
- getScope(16[PB, PC, 8], macro (scope, scratch) end)
- loadis 24[PB, PC, 8], t1
- loadConstantOrVariable(t1, t3)
- loadis 8[PB, PC, 8], t1
- writeBarrier(t3)
- loadp JSVariableObject::m_registers[t0], t0
- storep t3, [t0, t1, 8]
- dispatch(4)
-
-
-macro getGlobalVar(size)
- traceExecution()
- loadp 16[PB, PC, 8], t0
- loadis 8[PB, PC, 8], t3
- loadp [t0], t1
- storep t1, [cfr, t3, 8]
- loadp (size - 1) * 8[PB, PC, 8], t0
- valueProfile(t1, t0)
- dispatch(size)
-end
-
-_llint_op_get_global_var:
- getGlobalVar(4)
-
-
-_llint_op_get_global_var_watchable:
- getGlobalVar(5)
-
-
_llint_op_init_global_const:
-_llint_op_put_global_var:
traceExecution()
loadis 16[PB, PC, 8], t1
loadp 8[PB, PC, 8], t0
@@ -958,21 +826,19 @@ _llint_op_put_global_var:
_llint_op_init_global_const_check:
-_llint_op_put_global_var_check:
traceExecution()
loadp 24[PB, PC, 8], t2
loadis 16[PB, PC, 8], t1
loadp 8[PB, PC, 8], t0
- btbnz [t2], .opPutGlobalVarCheckSlow
+ btbnz [t2], .opInitGlobalConstCheckSlow
loadConstantOrVariable(t1, t2)
writeBarrier(t2)
storep t2, [t0]
dispatch(5)
-.opPutGlobalVarCheckSlow:
- callSlowPath(_llint_slow_path_put_global_var_check)
+.opInitGlobalConstCheckSlow:
+ callSlowPath(_llint_slow_path_init_global_const_check)
dispatch(5)
-
macro getById(getPropertyStorage)
traceExecution()
# We only do monomorphic get_by_id caching for now, and we do not modify the
diff --git a/Source/JavaScriptCore/offlineasm/armv7.rb b/Source/JavaScriptCore/offlineasm/armv7.rb
index 07543574e..ab0496f71 100644
--- a/Source/JavaScriptCore/offlineasm/armv7.rb
+++ b/Source/JavaScriptCore/offlineasm/armv7.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2011 Apple Inc. All rights reserved.
+# Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -24,6 +24,7 @@
require "config"
require "ast"
require "opt"
+require "risc"
class Node
def armV7Single
@@ -33,7 +34,7 @@ class Node
end
end
-class SpecialRegister < NoChildren
+class SpecialRegister
def armV7Operand
@name
end
@@ -133,487 +134,6 @@ class AbsoluteAddress
end
#
-# Lowering of branch ops. For example:
-#
-# baddiz foo, bar, baz
-#
-# will become:
-#
-# addi foo, bar
-# bz baz
-#
-
-def armV7LowerBranchOps(list)
- newList = []
- list.each {
- | node |
- if node.is_a? Instruction
- annotation = node.annotation
- case node.opcode
- when /^b(addi|subi|ori|addp)/
- op = $1
- branch = "b" + $~.post_match
-
- case op
- when "addi", "addp"
- op = "addis"
- when "subi"
- op = "subis"
- when "ori"
- op = "oris"
- end
-
- newList << Instruction.new(node.codeOrigin, op, node.operands[0..-2], annotation)
- newList << Instruction.new(node.codeOrigin, branch, [node.operands[-1]])
- when "bmulio"
- tmp1 = Tmp.new(node.codeOrigin, :gpr)
- tmp2 = Tmp.new(node.codeOrigin, :gpr)
- newList << Instruction.new(node.codeOrigin, "smulli", [node.operands[0], node.operands[1], node.operands[1], tmp1], annotation)
- newList << Instruction.new(node.codeOrigin, "rshifti", [node.operands[-2], Immediate.new(node.codeOrigin, 31), tmp2])
- newList << Instruction.new(node.codeOrigin, "bineq", [tmp1, tmp2, node.operands[-1]])
- when /^bmuli/
- condition = $~.post_match
- newList << Instruction.new(node.codeOrigin, "muli", node.operands[0..-2], annotation)
- newList << Instruction.new(node.codeOrigin, "bti" + condition, [node.operands[-2], node.operands[-1]])
- else
- newList << node
- end
- else
- newList << node
- end
- }
- newList
-end
-
-#
-# Lowering of shift ops. For example:
-#
-# lshifti foo, bar
-#
-# will become:
-#
-# andi foo, 31, tmp
-# lshifti tmp, bar
-#
-
-def armV7SanitizeShift(operand, list)
- return operand if operand.immediate?
-
- tmp = Tmp.new(operand.codeOrigin, :gpr)
- list << Instruction.new(operand.codeOrigin, "andi", [operand, Immediate.new(operand.codeOrigin, 31), tmp])
- tmp
-end
-
-def armV7LowerShiftOps(list)
- newList = []
- list.each {
- | node |
- if node.is_a? Instruction
- case node.opcode
- when "lshifti", "rshifti", "urshifti", "lshiftp", "rshiftp", "urshiftp"
- if node.operands.size == 2
- newList << Instruction.new(node.codeOrigin, node.opcode, [armV7SanitizeShift(node.operands[0], newList), node.operands[1]], node.annotation)
- else
- newList << Instruction.new(node.codeOrigin, node.opcode, [node.operands[0], armV7SanitizeShift(node.operands[1], newList), node.operands[2]], node.annotation)
- raise "Wrong number of operands for shift at #{node.codeOriginString}" unless node.operands.size == 3
- end
- else
- newList << node
- end
- else
- newList << node
- end
- }
- newList
-end
-
-#
-# Lowering of malformed addresses. For example:
-#
-# loadp 10000[foo], bar
-#
-# will become:
-#
-# move 10000, tmp
-# addp foo, tmp
-# loadp 0[tmp], bar
-#
-
-class Node
- def armV7LowerMalformedAddressesRecurse(list)
- mapChildren {
- | node |
- node.armV7LowerMalformedAddressesRecurse(list)
- }
- end
-end
-
-class Address
- def armV7LowerMalformedAddressesRecurse(list)
- if offset.value < -0xff or offset.value > 0xfff
- tmp = Tmp.new(codeOrigin, :gpr)
- list << Instruction.new(codeOrigin, "move", [offset, tmp])
- list << Instruction.new(codeOrigin, "addp", [base, tmp])
- Address.new(codeOrigin, tmp, Immediate.new(codeOrigin, 0))
- else
- self
- end
- end
-end
-
-class BaseIndex
- def armV7LowerMalformedAddressesRecurse(list)
- if offset.value != 0
- tmp = Tmp.new(codeOrigin, :gpr)
- list << Instruction.new(codeOrigin, "move", [offset, tmp])
- list << Instruction.new(codeOrigin, "addp", [base, tmp])
- BaseIndex.new(codeOrigin, tmp, index, scale, Immediate.new(codeOrigin, 0))
- else
- self
- end
- end
-end
-
-class AbsoluteAddress
- def armV7LowerMalformedAddressesRecurse(list)
- tmp = Tmp.new(codeOrigin, :gpr)
- list << Instruction.new(codeOrigin, "move", [address, tmp])
- Address.new(codeOrigin, tmp, Immediate.new(codeOrigin, 0))
- end
-end
-
-def armV7LowerMalformedAddresses(list)
- newList = []
- list.each {
- | node |
- newList << node.armV7LowerMalformedAddressesRecurse(newList)
- }
- newList
-end
-
-#
-# Lowering of malformed addresses in double loads and stores. For example:
-#
-# loadd [foo, bar, 8], baz
-#
-# becomes:
-#
-# leap [foo, bar, 8], tmp
-# loadd [tmp], baz
-#
-
-class Node
- def armV7DoubleAddress(list)
- self
- end
-end
-
-class BaseIndex
- def armV7DoubleAddress(list)
- tmp = Tmp.new(codeOrigin, :gpr)
- list << Instruction.new(codeOrigin, "leap", [self, tmp])
- Address.new(codeOrigin, tmp, Immediate.new(codeOrigin, 0))
- end
-end
-
-def armV7LowerMalformedAddressesDouble(list)
- newList = []
- list.each {
- | node |
- if node.is_a? Instruction
- case node.opcode
- when "loadd"
- newList << Instruction.new(node.codeOrigin, "loadd", [node.operands[0].armV7DoubleAddress(newList), node.operands[1]], node.annotation)
- when "stored"
- newList << Instruction.new(node.codeOrigin, "stored", [node.operands[0], node.operands[1].armV7DoubleAddress(newList)], node.annotation)
- else
- newList << node
- end
- else
- newList << node
- end
- }
- newList
-end
-
-#
-# Lowering of misplaced immediates. For example:
-#
-# storei 0, [foo]
-#
-# will become:
-#
-# move 0, tmp
-# storei tmp, [foo]
-#
-
-def armV7LowerMisplacedImmediates(list)
- newList = []
- list.each {
- | node |
- if node.is_a? Instruction
- case node.opcode
- when "storeb", "storei", "storep"
- operands = node.operands
- newOperands = []
- operands.each {
- | operand |
- if operand.is_a? Immediate
- tmp = Tmp.new(operand.codeOrigin, :gpr)
- newList << Instruction.new(operand.codeOrigin, "move", [operand, tmp])
- newOperands << tmp
- else
- newOperands << operand
- end
- }
- newList << Instruction.new(node.codeOrigin, node.opcode, newOperands, node.annotation)
- else
- newList << node
- end
- else
- newList << node
- end
- }
- newList
-end
-
-#
-# Lowering of malformed immediates except when used in a "move" instruction.
-# For example:
-#
-# addp 642641, foo
-#
-# will become:
-#
-# move 642641, tmp
-# addp tmp, foo
-#
-
-class Node
- def armV7LowerMalformedImmediatesRecurse(list)
- mapChildren {
- | node |
- node.armV7LowerMalformedImmediatesRecurse(list)
- }
- end
-end
-
-class Address
- def armV7LowerMalformedImmediatesRecurse(list)
- self
- end
-end
-
-class BaseIndex
- def armV7LowerMalformedImmediatesRecurse(list)
- self
- end
-end
-
-class AbsoluteAddress
- def armV7LowerMalformedImmediatesRecurse(list)
- self
- end
-end
-
-class Immediate
- def armV7LowerMalformedImmediatesRecurse(list)
- if value < 0 or value > 255
- tmp = Tmp.new(codeOrigin, :gpr)
- list << Instruction.new(codeOrigin, "move", [self, tmp])
- tmp
- else
- self
- end
- end
-end
-
-def armV7LowerMalformedImmediates(list)
- newList = []
- list.each {
- | node |
- if node.is_a? Instruction
- annotation = node.annotation
- case node.opcode
- when "move"
- newList << node
- when "addi", "addp", "addis", "subi", "subp", "subis"
- if node.operands[0].is_a? Immediate and
- node.operands[0].value < 0 and
- node.operands[0].value >= 255 and
- node.operands.size == 2
- if node.opcode =~ /add/
- newOpcode = "sub" + node.opcode[-1..-1]
- else
- newOpcode = "add" + node.opcode[-1..-1]
- end
- newList << Instruction.new(node.codeOrigin, newOpcode,
- [Immediate.new(-node.operands[0].value)] + node.operands[1..-1],
- annotation)
- else
- newList << node.armV7LowerMalformedImmediatesRecurse(newList)
- end
- when "muli", "mulp"
- if node.operands[0].is_a? Immediate
- tmp = Tmp.new(codeOrigin, :gpr)
- newList << Instruction.new(node.codeOrigin, "move", [node.operands[0], tmp], annotation)
- newList << Instruction.new(node.codeOrigin, "muli", [tmp] + node.operands[1..-1])
- else
- newList << node.armV7LowerMalformedImmediatesRecurse(newList)
- end
- else
- newList << node.armV7LowerMalformedImmediatesRecurse(newList)
- end
- else
- newList << node
- end
- }
- newList
-end
-
-#
-# Lowering of misplaced addresses. For example:
-#
-# addi foo, [bar]
-#
-# will become:
-#
-# loadi [bar], tmp
-# addi foo, tmp
-# storei tmp, [bar]
-#
-# Another example:
-#
-# addi [foo], bar
-#
-# will become:
-#
-# loadi [foo], tmp
-# addi tmp, bar
-#
-
-def armV7AsRegister(preList, postList, operand, suffix, needStore)
- return operand unless operand.address?
-
- tmp = Tmp.new(operand.codeOrigin, if suffix == "d" then :fpr else :gpr end)
- preList << Instruction.new(operand.codeOrigin, "load" + suffix, [operand, tmp])
- if needStore
- postList << Instruction.new(operand.codeOrigin, "store" + suffix, [tmp, operand])
- end
- tmp
-end
-
-def armV7AsRegisters(preList, postList, operands, suffix)
- newOperands = []
- operands.each_with_index {
- | operand, index |
- newOperands << armV7AsRegister(preList, postList, operand, suffix, index == operands.size - 1)
- }
- newOperands
-end
-
-def armV7LowerMisplacedAddresses(list)
- newList = []
- list.each {
- | node |
- if node.is_a? Instruction
- postInstructions = []
- annotation = node.annotation
- case node.opcode
- when "addi", "addp", "addis", "andi", "andp", "lshifti", "lshiftp", "muli", "mulp", "negi",
- "negp", "noti", "ori", "oris", "orp", "rshifti", "urshifti", "rshiftp", "urshiftp", "subi",
- "subp", "subis", "xori", "xorp", /^bi/, /^bp/, /^bti/, /^btp/, /^ci/, /^cp/, /^ti/
- newList << Instruction.new(node.codeOrigin,
- node.opcode,
- armV7AsRegisters(newList, postInstructions, node.operands, "i"),
- annotation)
- when "bbeq", "bbneq", "bba", "bbaeq", "bbb", "bbbeq", "btbz", "btbnz", "tbz", "tbnz",
- "cbeq", "cbneq", "cba", "cbaeq", "cbb", "cbbeq"
- newList << Instruction.new(node.codeOrigin,
- node.opcode,
- armV7AsRegisters(newList, postInstructions, node.operands, "b"),
- annotation)
- when "bbgt", "bbgteq", "bblt", "bblteq", "btbs", "tbs", "cbgt", "cbgteq", "cblt", "cblteq"
- newList << Instruction.new(node.codeOrigin,
- node.opcode,
- armV7AsRegisters(newList, postInstructions, node.operands, "bs"),
- annotation)
- when "addd", "divd", "subd", "muld", "sqrtd", /^bd/
- newList << Instruction.new(node.codeOrigin,
- node.opcode,
- armV7AsRegisters(newList, postInstructions, node.operands, "d"),
- annotation)
- when "jmp", "call"
- newList << Instruction.new(node.codeOrigin,
- node.opcode,
- [armV7AsRegister(newList, postInstructions, node.operands[0], "p", false)],
- annotation)
- else
- newList << node
- end
- newList += postInstructions
- else
- newList << node
- end
- }
- newList
-end
-
-#
-# Lowering of register reuse in compare instructions. For example:
-#
-# cieq t0, t1, t0
-#
-# will become:
-#
-# mov tmp, t0
-# cieq tmp, t1, t0
-#
-
-def armV7LowerRegisterReuse(list)
- newList = []
- list.each {
- | node |
- if node.is_a? Instruction
- annotation = node.annotation
- case node.opcode
- when "cieq", "cineq", "cia", "ciaeq", "cib", "cibeq", "cigt", "cigteq", "cilt", "cilteq",
- "cpeq", "cpneq", "cpa", "cpaeq", "cpb", "cpbeq", "cpgt", "cpgteq", "cplt", "cplteq",
- "tis", "tiz", "tinz", "tbs", "tbz", "tbnz", "tps", "tpz", "tpnz", "cbeq", "cbneq",
- "cba", "cbaeq", "cbb", "cbbeq", "cbgt", "cbgteq", "cblt", "cblteq"
- if node.operands.size == 2
- if node.operands[0] == node.operands[1]
- tmp = Tmp.new(node.codeOrigin, :gpr)
- newList << Instruction.new(node.codeOrigin, "move", [node.operands[0], tmp], annotation)
- newList << Instruction.new(node.codeOrigin, node.opcode, [tmp, node.operands[1]])
- else
- newList << node
- end
- else
- raise "Wrong number of arguments at #{node.codeOriginString}" unless node.operands.size == 3
- if node.operands[0] == node.operands[2]
- tmp = Tmp.new(node.codeOrigin, :gpr)
- newList << Instruction.new(node.codeOrigin, "move", [node.operands[0], tmp], annotation)
- newList << Instruction.new(node.codeOrigin, node.opcode, [tmp, node.operands[1], node.operands[2]])
- elsif node.operands[1] == node.operands[2]
- tmp = Tmp.new(node.codeOrigin, :gpr)
- newList << Instruction.new(node.codeOrigin, "move", [node.operands[1], tmp], annotation)
- newList << Instruction.new(node.codeOrigin, node.opcode, [node.operands[0], tmp, node.operands[2]])
- else
- newList << node
- end
- end
- else
- newList << node
- end
- else
- newList << node
- end
- }
- newList
-end
-
-#
# Lea support.
#
@@ -642,31 +162,28 @@ end
class Sequence
def getModifiedListARMv7
- myList = @list
-
- # Verify that we will only see instructions and labels.
- myList.each {
- | node |
- unless node.is_a? Instruction or
- node.is_a? Label or
- node.is_a? LocalLabel or
- node.is_a? Skip
- raise "Unexpected #{node.inspect} at #{node.codeOrigin}"
+ result = @list
+ result = riscLowerSimpleBranchOps(result)
+ result = riscLowerHardBranchOps(result)
+ result = riscLowerShiftOps(result)
+ result = riscLowerMalformedAddresses(result) {
+ | node, address |
+ if address.is_a? BaseIndex
+ address.offset.value == 0
+ elsif address.is_a? Address
+ (-0xff..0xfff).include? address.offset.value
+ else
+ false
end
}
-
- myList = armV7LowerBranchOps(myList)
- myList = armV7LowerShiftOps(myList)
- myList = armV7LowerMalformedAddresses(myList)
- myList = armV7LowerMalformedAddressesDouble(myList)
- myList = armV7LowerMisplacedImmediates(myList)
- myList = armV7LowerMalformedImmediates(myList)
- myList = armV7LowerMisplacedAddresses(myList)
- myList = armV7LowerRegisterReuse(myList)
- myList = assignRegistersToTemporaries(myList, :gpr, ARMv7_EXTRA_GPRS)
- myList = assignRegistersToTemporaries(myList, :fpr, ARMv7_EXTRA_FPRS)
-
- return myList
+ result = riscLowerMalformedAddressesDouble(result)
+ result = riscLowerMisplacedImmediates(result)
+ result = riscLowerMalformedImmediates(result, 0..0xff)
+ result = riscLowerMisplacedAddresses(result)
+ result = riscLowerRegisterReuse(result)
+ result = assignRegistersToTemporaries(result, :gpr, ARMv7_EXTRA_GPRS)
+ result = assignRegistersToTemporaries(result, :fpr, ARMv7_EXTRA_FPRS)
+ return result
end
end
@@ -747,8 +264,8 @@ class Instruction
$asm.annotation annotation if $enableInstrAnnotations
case opcode
- when "addi", "addp", "addis"
- if opcode == "addis"
+ when "addi", "addp", "addis", "addps"
+ if opcode == "addis" or opcode == "addps"
suffix = "s"
else
suffix = ""
@@ -837,7 +354,7 @@ class Instruction
$asm.puts "vcmpe.f64 #{armV7Operands(operands[0..1])}"
$asm.puts "vmrs apsr_nzcv, fpscr"
isUnordered = LocalLabel.unique("bdneq")
- $asm.puts "bvs #{LabelReference.new(codeOrigin, isUnordered).asmLabel}"
+ $asm.puts "bvs #{LocalLabelReference.new(codeOrigin, isUnordered).asmLabel}"
$asm.puts "bne #{operands[2].asmLabel}"
isUnordered.lower("ARMv7")
when "bdgt"
diff --git a/Source/JavaScriptCore/offlineasm/risc.rb b/Source/JavaScriptCore/offlineasm/risc.rb
new file mode 100644
index 000000000..44b4dbd71
--- /dev/null
+++ b/Source/JavaScriptCore/offlineasm/risc.rb
@@ -0,0 +1,555 @@
+# Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+require 'config'
+require 'ast'
+require 'opt'
+
+# This file contains utilities that are useful for implementing a backend
+# for RISC-like processors (ARM, MIPS, etc).
+
+#
+# Lowering of simple branch ops. For example:
+#
+# baddiz foo, bar, baz
+#
+# will become:
+#
+# addi foo, bar
+# bz baz
+#
+
+def riscLowerSimpleBranchOps(list)
+ newList = []
+ list.each {
+ | node |
+ if node.is_a? Instruction
+ annotation = node.annotation
+ case node.opcode
+ when /^b(addi|subi|ori|addp)/
+ op = $1
+ branch = "b" + $~.post_match
+
+ case op
+ when "addi"
+ op = "addis"
+ when "addp"
+ op = "addps"
+ when "subi"
+ op = "subis"
+ when "ori"
+ op = "oris"
+ end
+
+ newList << Instruction.new(node.codeOrigin, op, node.operands[0..-2], annotation)
+ newList << Instruction.new(node.codeOrigin, branch, [node.operands[-1]])
+ when 'bmulis', 'bmulz', 'bmulnz'
+ condition = $~.post_match
+ newList << Instruction.new(node.codeOrigin, "muli", node.operands[0..-2], annotation)
+ newList << Instruction.new(node.codeOrigin, "bti" + condition, [node.operands[-2], node.operands[-1]])
+ else
+ newList << node
+ end
+ else
+ newList << node
+ end
+ }
+ newList
+end
+
+#
+# Lowing of complex branch ops. For example:
+#
+# bmulio foo, bar, baz
+#
+# becomes:
+#
+# smulli foo, bar, bar, tmp1
+# rshifti bar, 31, tmp2
+# bineq tmp1, tmp2, baz
+#
+
+def riscLowerHardBranchOps(list)
+ newList = []
+ list.each {
+ | node |
+ if node.is_a? Instruction and node.opcode == "bmulio"
+ tmp1 = Tmp.new(node.codeOrigin, :gpr)
+ tmp2 = Tmp.new(node.codeOrigin, :gpr)
+ newList << Instruction.new(node.codeOrigin, "smulli", [node.operands[0], node.operands[1], node.operands[1], tmp1], node.annotation)
+ newList << Instruction.new(node.codeOrigin, "rshifti", [node.operands[-2], Immediate.new(node.codeOrigin, 31), tmp2])
+ newList << Instruction.new(node.codeOrigin, "bineq", [tmp1, tmp2, node.operands[-1]])
+ else
+ newList << node
+ end
+ }
+ newList
+end
+
+#
+# Lowering of shift ops. For example:
+#
+# lshifti foo, bar
+#
+# will become:
+#
+# andi foo, 31, tmp
+# lshifti tmp, bar
+#
+
+def riscSanitizeShift(operand, list)
+ return operand if operand.immediate?
+
+ tmp = Tmp.new(operand.codeOrigin, :gpr)
+ list << Instruction.new(operand.codeOrigin, "andi", [operand, Immediate.new(operand.codeOrigin, 31), tmp])
+ tmp
+end
+
+def riscLowerShiftOps(list)
+ newList = []
+ list.each {
+ | node |
+ if node.is_a? Instruction
+ case node.opcode
+ when "lshifti", "rshifti", "urshifti", "lshiftp", "rshiftp", "urshiftp"
+ if node.operands.size == 2
+ newList << Instruction.new(node.codeOrigin, node.opcode, [riscSanitizeShift(node.operands[0], newList), node.operands[1]], node.annotation)
+ else
+ newList << Instruction.new(node.codeOrigin, node.opcode, [node.operands[0], riscSanitizeShift(node.operands[1], newList), node.operands[2]], node.annotation)
+ raise "Wrong number of operands for shift at #{node.codeOriginString}" unless node.operands.size == 3
+ end
+ else
+ newList << node
+ end
+ else
+ newList << node
+ end
+ }
+ newList
+end
+
+#
+# Lowering of malformed addresses. For example:
+#
+# loadp 10000[foo], bar
+#
+# will become:
+#
+# move 10000, tmp
+# addp foo, tmp
+# loadp 0[tmp], bar
+#
+# Note that you use this lowering phase by passing it a block that returns true
+# if you don't want to lower the address, or false if you do. For example to get
+# the effect of the example above, the block would have to say something like:
+#
+# riscLowerMalformedAddresses(thingy) {
+# | node, address |
+# if address.is_a? Address
+# address.offset.value > 1000
+# else
+# true # don't lower anything else, in this example
+# end
+# }
+#
+# See armv7.rb for a different example, in which we lower all BaseIndex addresses
+# that have non-zero offset, all Address addresses that have large offsets, and
+# all other addresses (like AbsoluteAddress).
+#
+
+class Node
+ def riscLowerMalformedAddressesRecurse(list, topLevelNode, &block)
+ mapChildren {
+ | subNode |
+ subNode.riscLowerMalformedAddressesRecurse(list, topLevelNode, &block)
+ }
+ end
+end
+
+class Address
+ def riscLowerMalformedAddressesRecurse(list, node)
+ return self if yield node, self
+
+ tmp = Tmp.new(codeOrigin, :gpr)
+ list << Instruction.new(codeOrigin, "move", [offset, tmp])
+ list << Instruction.new(codeOrigin, "addp", [base, tmp])
+ Address.new(codeOrigin, tmp, Immediate.new(codeOrigin, 0))
+ end
+end
+
+class BaseIndex
+ def riscLowerMalformedAddressesRecurse(list, node, &block)
+ return self if yield node, self
+
+ tmp = Tmp.new(codeOrigin, :gpr)
+ list << Instruction.new(codeOrigin, "leap", [BaseIndex.new(codeOrigin, base, index, scale, Immediate.new(codeOrigin, 0)), tmp])
+ Address.new(codeOrigin, tmp, offset).riscLowerMalformedAddressesRecurse(list, node, &block)
+ end
+end
+
+class AbsoluteAddress
+ def riscLowerMalformedAddressesRecurse(list, node)
+ return self if yield node, self
+
+ tmp = Tmp.new(codeOrigin, :gpr)
+ list << Instruction.new(codeOrigin, "move", [address, tmp])
+ Address.new(codeOrigin, tmp, Immediate.new(codeOrigin, 0))
+ end
+end
+
+def riscLowerMalformedAddresses(list, &block)
+ newList = []
+ list.each {
+ | node |
+ newList << node.riscLowerMalformedAddressesRecurse(newList, node, &block)
+ }
+ newList
+end
+
+#
+# Lowering of malformed addresses in double loads and stores. For example:
+#
+# loadd [foo, bar, 8], baz
+#
+# becomes:
+#
+# leap [foo, bar, 8], tmp
+# loadd [tmp], baz
+#
+
+class Node
+ def riscDoubleAddress(list)
+ self
+ end
+end
+
+class BaseIndex
+ def riscDoubleAddress(list)
+ tmp = Tmp.new(codeOrigin, :gpr)
+ list << Instruction.new(codeOrigin, "leap", [self, tmp])
+ Address.new(codeOrigin, tmp, Immediate.new(codeOrigin, 0))
+ end
+end
+
+def riscLowerMalformedAddressesDouble(list)
+ newList = []
+ list.each {
+ | node |
+ if node.is_a? Instruction
+ case node.opcode
+ when "loadd"
+ newList << Instruction.new(node.codeOrigin, "loadd", [node.operands[0].riscDoubleAddress(newList), node.operands[1]], node.annotation)
+ when "stored"
+ newList << Instruction.new(node.codeOrigin, "stored", [node.operands[0], node.operands[1].riscDoubleAddress(newList)], node.annotation)
+ else
+ newList << node
+ end
+ else
+ newList << node
+ end
+ }
+ newList
+end
+
+#
+# Lowering of misplaced immediates. For example:
+#
+# storei 0, [foo]
+#
+# will become:
+#
+# move 0, tmp
+# storei tmp, [foo]
+#
+
+def riscLowerMisplacedImmediates(list)
+ newList = []
+ list.each {
+ | node |
+ if node.is_a? Instruction
+ case node.opcode
+ when "storeb", "storei", "storep"
+ operands = node.operands
+ newOperands = []
+ operands.each {
+ | operand |
+ if operand.is_a? Immediate
+ tmp = Tmp.new(operand.codeOrigin, :gpr)
+ newList << Instruction.new(operand.codeOrigin, "move", [operand, tmp])
+ newOperands << tmp
+ else
+ newOperands << operand
+ end
+ }
+ newList << Instruction.new(node.codeOrigin, node.opcode, newOperands, node.annotation)
+ else
+ newList << node
+ end
+ else
+ newList << node
+ end
+ }
+ newList
+end
+
+#
+# Lowering of malformed immediates except when used in a "move" instruction.
+# For example:
+#
+# addp 642641, foo
+#
+# will become:
+#
+# move 642641, tmp
+# addp tmp, foo
+#
+
+class Node
+ def riscLowerMalformedImmediatesRecurse(list, validImmediates)
+ mapChildren {
+ | node |
+ node.riscLowerMalformedImmediatesRecurse(list, validImmediates)
+ }
+ end
+end
+
+class Address
+ def riscLowerMalformedImmediatesRecurse(list, validImmediates)
+ self
+ end
+end
+
+class BaseIndex
+ def riscLowerMalformedImmediatesRecurse(list, validImmediates)
+ self
+ end
+end
+
+class AbsoluteAddress
+ def riscLowerMalformedImmediatesRecurse(list, validImmediates)
+ self
+ end
+end
+
+class Immediate
+ def riscLowerMalformedImmediatesRecurse(list, validImmediates)
+ unless validImmediates.include? value
+ tmp = Tmp.new(codeOrigin, :gpr)
+ list << Instruction.new(codeOrigin, "move", [self, tmp])
+ tmp
+ else
+ self
+ end
+ end
+end
+
+def riscLowerMalformedImmediates(list, validImmediates)
+ newList = []
+ list.each {
+ | node |
+ if node.is_a? Instruction
+ annotation = node.annotation
+ case node.opcode
+ when "move"
+ newList << node
+ when "addi", "addp", "addis", "subi", "subp", "subis"
+ if node.operands[0].is_a? Immediate and
+ (not validImmediates.include? node.operands[0].value) and
+ validImmediates.include? -node.operands[0].value
+ node.operands.size == 2
+ if node.opcode =~ /add/
+ newOpcode = "sub" + $~.post_match
+ else
+ newOpcode = "add" + $~.post_match
+ end
+ newList << Instruction.new(node.codeOrigin, newOpcode,
+ [Immediate.new(node.codeOrigin, -node.operands[0].value)] + node.operands[1..-1],
+ annotation)
+ else
+ newList << node.riscLowerMalformedImmediatesRecurse(newList, validImmediates)
+ end
+ when "muli", "mulp"
+ if node.operands[0].is_a? Immediate
+ tmp = Tmp.new(codeOrigin, :gpr)
+ newList << Instruction.new(node.codeOrigin, "move", [node.operands[0], tmp], annotation)
+ newList << Instruction.new(node.codeOrigin, node.opcode, [tmp] + node.operands[1..-1])
+ else
+ newList << node.riscLowerMalformedImmediatesRecurse(newList, validImmediates)
+ end
+ else
+ newList << node.riscLowerMalformedImmediatesRecurse(newList, validImmediates)
+ end
+ else
+ newList << node
+ end
+ }
+ newList
+end
+
+#
+# Lowering of misplaced addresses. For example:
+#
+# addi foo, [bar]
+#
+# will become:
+#
+# loadi [bar], tmp
+# addi foo, tmp
+# storei tmp, [bar]
+#
+# Another example:
+#
+# addi [foo], bar
+#
+# will become:
+#
+# loadi [foo], tmp
+# addi tmp, bar
+#
+
+def riscAsRegister(preList, postList, operand, suffix, needStore)
+ return operand unless operand.address?
+
+ tmp = Tmp.new(operand.codeOrigin, if suffix == "d" then :fpr else :gpr end)
+ preList << Instruction.new(operand.codeOrigin, "load" + suffix, [operand, tmp])
+ if needStore
+ postList << Instruction.new(operand.codeOrigin, "store" + suffix, [tmp, operand])
+ end
+ tmp
+end
+
+def riscAsRegisters(preList, postList, operands, suffix)
+ newOperands = []
+ operands.each_with_index {
+ | operand, index |
+ newOperands << riscAsRegister(preList, postList, operand, suffix, index == operands.size - 1)
+ }
+ newOperands
+end
+
+def riscLowerMisplacedAddresses(list)
+ newList = []
+ list.each {
+ | node |
+ if node.is_a? Instruction
+ postInstructions = []
+ annotation = node.annotation
+ case node.opcode
+ when "addi", "addis", "andi", "lshifti", "muli", "negi", "noti", "ori", "oris",
+ "rshifti", "urshifti", "subi", "subis", "xori", /^bi/, /^bti/, /^ci/, /^ti/
+ newList << Instruction.new(node.codeOrigin,
+ node.opcode,
+ riscAsRegisters(newList, postInstructions, node.operands, "i"),
+ annotation)
+ when "addp", "andp", "lshiftp", "mulp", "negp", "orp", "rshiftp", "urshiftp",
+ "subp", "xorp", /^bp/, /^btp/, /^cp/
+ newList << Instruction.new(node.codeOrigin,
+ node.opcode,
+ riscAsRegisters(newList, postInstructions, node.operands, "p"),
+ annotation)
+ when "bbeq", "bbneq", "bba", "bbaeq", "bbb", "bbbeq", "btbz", "btbnz", "tbz", "tbnz",
+ "cbeq", "cbneq", "cba", "cbaeq", "cbb", "cbbeq"
+ newList << Instruction.new(node.codeOrigin,
+ node.opcode,
+ riscAsRegisters(newList, postInstructions, node.operands, "b"),
+ annotation)
+ when "bbgt", "bbgteq", "bblt", "bblteq", "btbs", "tbs", "cbgt", "cbgteq", "cblt", "cblteq"
+ newList << Instruction.new(node.codeOrigin,
+ node.opcode,
+ riscAsRegisters(newList, postInstructions, node.operands, "bs"),
+ annotation)
+ when "addd", "divd", "subd", "muld", "sqrtd", /^bd/
+ newList << Instruction.new(node.codeOrigin,
+ node.opcode,
+ riscAsRegisters(newList, postInstructions, node.operands, "d"),
+ annotation)
+ when "jmp", "call"
+ newList << Instruction.new(node.codeOrigin,
+ node.opcode,
+ [riscAsRegister(newList, postInstructions, node.operands[0], "p", false)],
+ annotation)
+ else
+ newList << node
+ end
+ newList += postInstructions
+ else
+ newList << node
+ end
+ }
+ newList
+end
+
+#
+# Lowering of register reuse in compare instructions. For example:
+#
+# cieq t0, t1, t0
+#
+# will become:
+#
+# mov tmp, t0
+# cieq tmp, t1, t0
+#
+
+def riscLowerRegisterReuse(list)
+ newList = []
+ list.each {
+ | node |
+ if node.is_a? Instruction
+ annotation = node.annotation
+ case node.opcode
+ when "cieq", "cineq", "cia", "ciaeq", "cib", "cibeq", "cigt", "cigteq", "cilt", "cilteq",
+ "cpeq", "cpneq", "cpa", "cpaeq", "cpb", "cpbeq", "cpgt", "cpgteq", "cplt", "cplteq",
+ "tis", "tiz", "tinz", "tbs", "tbz", "tbnz", "tps", "tpz", "tpnz", "cbeq", "cbneq",
+ "cba", "cbaeq", "cbb", "cbbeq", "cbgt", "cbgteq", "cblt", "cblteq"
+ if node.operands.size == 2
+ if node.operands[0] == node.operands[1]
+ tmp = Tmp.new(node.codeOrigin, :gpr)
+ newList << Instruction.new(node.codeOrigin, "move", [node.operands[0], tmp], annotation)
+ newList << Instruction.new(node.codeOrigin, node.opcode, [tmp, node.operands[1]])
+ else
+ newList << node
+ end
+ else
+ raise "Wrong number of arguments at #{node.codeOriginString}" unless node.operands.size == 3
+ if node.operands[0] == node.operands[2]
+ tmp = Tmp.new(node.codeOrigin, :gpr)
+ newList << Instruction.new(node.codeOrigin, "move", [node.operands[0], tmp], annotation)
+ newList << Instruction.new(node.codeOrigin, node.opcode, [tmp, node.operands[1], node.operands[2]])
+ elsif node.operands[1] == node.operands[2]
+ tmp = Tmp.new(node.codeOrigin, :gpr)
+ newList << Instruction.new(node.codeOrigin, "move", [node.operands[1], tmp], annotation)
+ newList << Instruction.new(node.codeOrigin, node.opcode, [node.operands[0], tmp, node.operands[2]])
+ else
+ newList << node
+ end
+ end
+ else
+ newList << node
+ end
+ else
+ newList << node
+ end
+ }
+ newList
+end
+
diff --git a/Source/JavaScriptCore/parser/Lexer.cpp b/Source/JavaScriptCore/parser/Lexer.cpp
index 8c9eaa12c..8b2020987 100644
--- a/Source/JavaScriptCore/parser/Lexer.cpp
+++ b/Source/JavaScriptCore/parser/Lexer.cpp
@@ -1617,7 +1617,7 @@ bool Lexer<T>::scanRegExp(const Identifier*& pattern, const Identifier*& flags,
}
}
- pattern = makeIdentifier(m_buffer16.data(), m_buffer16.size());
+ pattern = makeIdentifierSameType(m_buffer16.data(), m_buffer16.size());
m_buffer16.resize(0);
while (isIdentPart(m_current)) {
@@ -1625,7 +1625,7 @@ bool Lexer<T>::scanRegExp(const Identifier*& pattern, const Identifier*& flags,
shift();
}
- flags = makeIdentifier(m_buffer16.data(), m_buffer16.size());
+ flags = makeIdentifierSameType(m_buffer16.data(), m_buffer16.size());
m_buffer16.resize(0);
return true;
diff --git a/Source/JavaScriptCore/parser/Lexer.h b/Source/JavaScriptCore/parser/Lexer.h
index d75f2020d..aa1599b96 100644
--- a/Source/JavaScriptCore/parser/Lexer.h
+++ b/Source/JavaScriptCore/parser/Lexer.h
@@ -146,6 +146,9 @@ private:
ALWAYS_INLINE const Identifier* makeIdentifier(const LChar* characters, size_t length);
ALWAYS_INLINE const Identifier* makeIdentifier(const UChar* characters, size_t length);
+ ALWAYS_INLINE const Identifier* makeLCharIdentifier(const LChar* characters, size_t length);
+ ALWAYS_INLINE const Identifier* makeLCharIdentifier(const UChar* characters, size_t length);
+ ALWAYS_INLINE const Identifier* makeIdentifierSameType(const UChar* characters, size_t length);
ALWAYS_INLINE const Identifier* makeIdentifierLCharFromUChar(const UChar* characters, size_t length);
ALWAYS_INLINE bool lastTokenWasRestrKeyword() const;
@@ -239,6 +242,18 @@ ALWAYS_INLINE const Identifier* Lexer<T>::makeIdentifier(const UChar* characters
}
template <>
+ALWAYS_INLINE const Identifier* Lexer<LChar>::makeIdentifierSameType(const UChar* characters, size_t length)
+{
+ return &m_arena->makeIdentifierLCharFromUChar(m_globalData, characters, length);
+}
+
+template <>
+ALWAYS_INLINE const Identifier* Lexer<UChar>::makeIdentifierSameType(const UChar* characters, size_t length)
+{
+ return &m_arena->makeIdentifier(m_globalData, characters, length);
+}
+
+template <>
ALWAYS_INLINE void Lexer<LChar>::setCodeStart(const StringImpl* sourceString)
{
ASSERT(sourceString->is8Bit());
@@ -259,6 +274,18 @@ ALWAYS_INLINE const Identifier* Lexer<T>::makeIdentifierLCharFromUChar(const UCh
}
template <typename T>
+ALWAYS_INLINE const Identifier* Lexer<T>::makeLCharIdentifier(const LChar* characters, size_t length)
+{
+ return &m_arena->makeIdentifier(m_globalData, characters, length);
+}
+
+template <typename T>
+ALWAYS_INLINE const Identifier* Lexer<T>::makeLCharIdentifier(const UChar* characters, size_t length)
+{
+ return &m_arena->makeIdentifierLCharFromUChar(m_globalData, characters, length);
+}
+
+template <typename T>
ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSTokenData* tokenData, JSTokenLocation* tokenLocation, unsigned lexerFlags, bool strictMode)
{
ASSERT((lexerFlags & LexerFlagsIgnoreReservedWords));
@@ -293,7 +320,7 @@ ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSTokenData* tokenData,
if (lexerFlags & LexexFlagsDontBuildKeywords)
tokenData->ident = 0;
else
- tokenData->ident = makeIdentifier(start, ptr - start);
+ tokenData->ident = makeLCharIdentifier(start, ptr - start);
tokenLocation->line = m_lineNumber;
tokenLocation->startOffset = start - m_codeStart;
tokenLocation->endOffset = currentOffset();
diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h
index 4c005fa5e..dc42d36ba 100644
--- a/Source/JavaScriptCore/parser/Parser.h
+++ b/Source/JavaScriptCore/parser/Parser.h
@@ -882,7 +882,7 @@ private:
bool canRecurse()
{
- return m_stack.recursionCheck();
+ return m_stack.isSafeToRecurse();
}
int lastTokenEnd() const
diff --git a/Source/JavaScriptCore/runtime/JSScope.cpp b/Source/JavaScriptCore/runtime/JSScope.cpp
index 8fd49b861..508a90540 100644
--- a/Source/JavaScriptCore/runtime/JSScope.cpp
+++ b/Source/JavaScriptCore/runtime/JSScope.cpp
@@ -86,126 +86,388 @@ int JSScope::localDepth()
return scopeDepth;
}
-JSValue JSScope::resolve(CallFrame* callFrame, const Identifier& identifier)
-{
- JSScope* scope = callFrame->scope();
- ASSERT(scope);
+struct LookupResult {
+ JSValue base() const { return m_base; }
+ JSValue value() const { return m_value; }
+ void setBase(JSValue base) { ASSERT(base); m_base = base; }
+ void setValue(JSValue value) { ASSERT(value); m_value = value; }
- do {
- JSObject* object = JSScope::objectAtScope(scope);
- PropertySlot slot(object);
- if (object->getPropertySlot(callFrame, identifier, slot))
- return slot.getValue(callFrame, identifier);
- } while ((scope = scope->next()));
+private:
+ JSValue m_base;
+ JSValue m_value;
+};
- return throwError(callFrame, createUndefinedVariableError(callFrame, identifier));
+
+static void setPutPropertyAccessOffset(PutToBaseOperation* operation, PropertyOffset offset)
+{
+ ASSERT(isOutOfLineOffset(offset));
+ operation->m_offset = offset;
+ operation->m_offsetInButterfly = offsetInButterfly(offset);
+}
+
+static bool executeResolveOperations(CallFrame* callFrame, JSScope* scope, const Identifier& propertyName, ResolveOperation* pc, LookupResult& result)
+{
+ while (true) {
+ switch (pc->m_operation) {
+ case ResolveOperation::Fail:
+ return false;
+ case ResolveOperation::CheckForDynamicEntriesBeforeGlobalScope: {
+ while (JSScope* nextScope = scope->next()) {
+ if (scope->isActivationObject() && scope->structure() != scope->globalObject()->activationStructure())
+ return false;
+ ASSERT(scope->isNameScopeObject() || scope->isVariableObject() || scope->isGlobalObject());
+ scope = nextScope;
+ }
+ pc++;
+ break;
+ }
+ case ResolveOperation::SetBaseToUndefined:
+ result.setBase(jsUndefined());
+ pc++;
+ continue;
+ case ResolveOperation::SetBaseToScope:
+ result.setBase(scope);
+ pc++;
+ continue;
+ case ResolveOperation::ReturnScopeAsBase:
+ result.setBase(scope);
+ return true;
+ case ResolveOperation::SetBaseToGlobal:
+ result.setBase(scope->globalObject());
+ pc++;
+ continue;
+ case ResolveOperation::SkipScopes: {
+ int count = pc->m_scopesToSkip;
+ while (count--)
+ scope = scope->next();
+ ASSERT(scope);
+ pc++;
+ continue;
+ }
+ case ResolveOperation::SkipTopScopeNode:
+ if (callFrame->r(pc->m_activationRegister).jsValue())
+ scope = scope->next();
+ ASSERT(scope);
+ pc++;
+ continue;
+ case ResolveOperation::GetAndReturnScopedVar:
+ ASSERT(jsCast<JSVariableObject*>(scope)->registerAt(pc->m_offset).get());
+ result.setValue(jsCast<JSVariableObject*>(scope)->registerAt(pc->m_offset).get());
+ return true;
+ case ResolveOperation::GetAndReturnGlobalVar:
+ result.setValue(pc->m_registerAddress->get());
+ return true;
+ case ResolveOperation::GetAndReturnGlobalVarWatchable:
+ result.setValue(pc->m_registerAddress->get());
+ return true;
+ case ResolveOperation::ReturnGlobalObjectAsBase:
+ result.setBase(callFrame->lexicalGlobalObject());
+ return true;
+ case ResolveOperation::GetAndReturnGlobalProperty: {
+ JSGlobalObject* globalObject = scope->globalObject();
+ if (globalObject->structure() == pc->m_structure.get()) {
+ result.setValue(globalObject->getDirectOffset(pc->m_offset));
+ return true;
+ }
+
+ PropertySlot slot(globalObject);
+ if (!globalObject->getPropertySlot(callFrame, propertyName, slot))
+ return false;
+
+ JSValue value = slot.getValue(callFrame, propertyName);
+ if (callFrame->hadException())
+ return false;
+
+ Structure* structure = globalObject->structure();
+
+ // Don't try to cache prototype lookups
+ if (globalObject != slot.slotBase() || !slot.isCacheableValue() || !structure->propertyAccessesAreCacheable()) {
+ result.setValue(value);
+ return true;
+ }
+
+ pc->m_structure.set(callFrame->globalData(), callFrame->codeBlock()->ownerExecutable(), structure);
+ pc->m_offset = slot.cachedOffset();
+ result.setValue(value);
+ return true;
+ }
+ }
+ }
}
-JSValue JSScope::resolveSkip(CallFrame* callFrame, const Identifier& identifier, int skip)
+template <JSScope::LookupMode mode, JSScope::ReturnValues returnValues> JSObject* JSScope::resolveContainingScopeInternal(CallFrame* callFrame, const Identifier& identifier, PropertySlot& slot, Vector<ResolveOperation>* operations, PutToBaseOperation* putToBaseOperation, bool )
{
JSScope* scope = callFrame->scope();
ASSERT(scope);
-
+ int scopeCount = 0;
+ bool seenGenericObjectScope = false;
+ bool requiresDynamicChecks = false;
+ bool skipTopScopeNode = false;
+ int activationRegister = 0;
CodeBlock* codeBlock = callFrame->codeBlock();
-
- bool checkTopLevel = codeBlock->codeType() == FunctionCode && codeBlock->needsFullScopeChain();
- ASSERT(skip || !checkTopLevel);
- if (checkTopLevel && skip--) {
- if (callFrame->uncheckedR(codeBlock->activationRegister()).jsValue())
- scope = scope->next();
- }
- while (skip--) {
- scope = scope->next();
- ASSERT(scope);
- }
+ if (mode == UnknownResolve) {
+ ASSERT(operations->isEmpty());
+ if (codeBlock->codeType() == FunctionCode && codeBlock->needsActivation()) {
+ activationRegister = codeBlock->activationRegister();
+ JSValue activation = callFrame->r(activationRegister).jsValue();
+
+ // If the activation register doesn't match our actual scope, a dynamic
+ // scope has been inserted so we shouldn't skip the top scope node.
+ if (activation == scope) {
+ jsCast<JSActivation*>(activation.asCell())->isDynamicScope(requiresDynamicChecks);
+ if (!requiresDynamicChecks) {
+ ASSERT(jsCast<JSActivation*>(activation.asCell())->symbolTable()->get(identifier.impl()).isNull());
+ scope = scope->next();
+ ASSERT(scope);
+ skipTopScopeNode = true;
+ }
+ } else if (!activation)
+ skipTopScopeNode = true;
+ }
+ } else
+ ASSERT(operations->size());
+
+ if (codeBlock->codeType() == EvalCode && scope->next())
+ requiresDynamicChecks = true;
+
+ if (mode == UnknownResolve && putToBaseOperation)
+ putToBaseOperation->m_kind = PutToBaseOperation::Generic;
do {
JSObject* object = JSScope::objectAtScope(scope);
- PropertySlot slot(object);
- if (object->getPropertySlot(callFrame, identifier, slot))
- return slot.getValue(callFrame, identifier);
+ slot = PropertySlot(object);
+
+ bool currentScopeNeedsDynamicChecks = false;
+ if (!(scope->isVariableObject() || scope->isNameScopeObject()) || (scope->next() && scope->isDynamicScope(currentScopeNeedsDynamicChecks)))
+ seenGenericObjectScope = true;
+
+ requiresDynamicChecks = requiresDynamicChecks || currentScopeNeedsDynamicChecks;
+
+ if (object->getPropertySlot(callFrame, identifier, slot)) {
+ if (mode == UnknownResolve) {
+ if (seenGenericObjectScope)
+ goto fail;
+ if (putToBaseOperation)
+ putToBaseOperation->m_isDynamic = requiresDynamicChecks;
+ if (!scope->next()) {
+ // Global lookup of some kind
+ JSGlobalObject* globalObject = jsCast<JSGlobalObject*>(scope);
+ SymbolTableEntry entry = globalObject->symbolTable()->get(identifier.impl());
+ if (!entry.isNull()) {
+ if (requiresDynamicChecks)
+ operations->append(ResolveOperation::checkForDynamicEntriesBeforeGlobalScope());
+
+ if (putToBaseOperation) {
+ putToBaseOperation->m_isDynamic = requiresDynamicChecks;
+ if (entry.isReadOnly())
+ putToBaseOperation->m_kind = PutToBaseOperation::Readonly;
+ else if (entry.couldBeWatched()) {
+ putToBaseOperation->m_kind = PutToBaseOperation::GlobalVariablePutChecked;
+ putToBaseOperation->m_predicatePointer = entry.addressOfIsWatched();
+ } else
+ putToBaseOperation->m_kind = PutToBaseOperation::GlobalVariablePut;
+ putToBaseOperation->m_registerAddress = &globalObject->registerAt(entry.getIndex());
+ }
+ // Override custom accessor behaviour that the DOM introduces for some
+ // event handlers declared on function declarations.
+ if (!requiresDynamicChecks)
+ slot.setValue(globalObject, globalObject->registerAt(entry.getIndex()).get());
+ switch (returnValues) {
+ case ReturnValue:
+ ASSERT(!putToBaseOperation);
+ operations->append(ResolveOperation::getAndReturnGlobalVar(&globalObject->registerAt(entry.getIndex()), entry.couldBeWatched()));
+ break;
+ case ReturnBase:
+ ASSERT(putToBaseOperation);
+ operations->append(ResolveOperation::returnGlobalObjectAsBase());
+ break;
+ case ReturnBaseAndValue:
+ ASSERT(putToBaseOperation);
+ operations->append(ResolveOperation::setBaseToGlobal());
+ operations->append(ResolveOperation::getAndReturnGlobalVar(&globalObject->registerAt(entry.getIndex()), entry.couldBeWatched()));
+ break;
+ case ReturnThisAndValue:
+ ASSERT(!putToBaseOperation);
+ operations->append(ResolveOperation::setBaseToUndefined());
+ operations->append(ResolveOperation::getAndReturnGlobalVar(&globalObject->registerAt(entry.getIndex()), entry.couldBeWatched()));
+ break;
+ }
+ } else {
+ if (!slot.isCacheableValue() || slot.slotBase() != globalObject)
+ goto fail;
+
+ if (requiresDynamicChecks)
+ operations->append(ResolveOperation::checkForDynamicEntriesBeforeGlobalScope());
+
+ if (putToBaseOperation) {
+ putToBaseOperation->m_isDynamic = requiresDynamicChecks;
+ putToBaseOperation->m_kind = PutToBaseOperation::GlobalPropertyPut;
+ putToBaseOperation->m_structure.set(callFrame->globalData(), callFrame->codeBlock()->ownerExecutable(), globalObject->structure());
+ setPutPropertyAccessOffset(putToBaseOperation, slot.cachedOffset());
+ }
+ switch (returnValues) {
+ case ReturnValue:
+ ASSERT(!putToBaseOperation);
+ operations->append(ResolveOperation::getAndReturnGlobalProperty());
+ break;
+ case ReturnBase:
+ ASSERT(putToBaseOperation);
+ operations->append(ResolveOperation::returnGlobalObjectAsBase());
+ break;
+ case ReturnBaseAndValue:
+ ASSERT(putToBaseOperation);
+ operations->append(ResolveOperation::setBaseToGlobal());
+ operations->append(ResolveOperation::getAndReturnGlobalProperty());
+ break;
+ case ReturnThisAndValue:
+ ASSERT(!putToBaseOperation);
+ operations->append(ResolveOperation::setBaseToUndefined());
+ operations->append(ResolveOperation::getAndReturnGlobalProperty());
+ break;
+ }
+ }
+ return object;
+ }
+ if (!requiresDynamicChecks) {
+ // Normal lexical lookup
+ JSVariableObject* variableObject = jsCast<JSVariableObject*>(scope);
+ ASSERT(variableObject);
+ ASSERT(variableObject->symbolTable());
+ SymbolTableEntry entry = variableObject->symbolTable()->get(identifier.impl());
+ // Variable was actually inserted by eval
+ if (entry.isNull()) {
+ ASSERT(!jsDynamicCast<JSNameScope*>(variableObject));
+ goto fail;
+ }
+
+ if (putToBaseOperation) {
+ putToBaseOperation->m_kind = entry.isReadOnly() ? PutToBaseOperation::Readonly : PutToBaseOperation::VariablePut;
+ putToBaseOperation->m_structure.set(callFrame->globalData(), callFrame->codeBlock()->ownerExecutable(), callFrame->lexicalGlobalObject()->activationStructure());
+ putToBaseOperation->m_offset = entry.getIndex();
+ putToBaseOperation->m_scopeDepth = (skipTopScopeNode ? 1 : 0) + scopeCount;
+ }
+
+ if (skipTopScopeNode)
+ operations->append(ResolveOperation::skipTopScopeNode(activationRegister));
+
+ operations->append(ResolveOperation::skipScopes(scopeCount));
+ switch (returnValues) {
+ case ReturnBaseAndValue:
+ operations->append(ResolveOperation::setBaseToScope());
+ operations->append(ResolveOperation::getAndReturnScopedVar(entry.getIndex()));
+ break;
+
+ case ReturnBase:
+ operations->append(ResolveOperation::returnScopeAsBase());
+ break;
+
+ case ReturnThisAndValue:
+ operations->append(ResolveOperation::setBaseToUndefined());
+ // fallthrough
+ case ReturnValue:
+ operations->append(ResolveOperation::getAndReturnScopedVar(entry.getIndex()));
+ break;
+ }
+ return object;
+ }
+ fail:
+ if (!operations->size())
+ operations->append(ResolveOperation::resolveFail());
+ }
+ return object;
+ }
+ scopeCount++;
} while ((scope = scope->next()));
-
- return throwError(callFrame, createUndefinedVariableError(callFrame, identifier));
+
+ if (mode == UnknownResolve) {
+ ASSERT(operations->isEmpty());
+ if (seenGenericObjectScope) {
+ operations->append(ResolveOperation::resolveFail());
+ return 0;
+ }
+ if (putToBaseOperation) {
+ putToBaseOperation->m_isDynamic = requiresDynamicChecks;
+ putToBaseOperation->m_kind = PutToBaseOperation::GlobalPropertyPut;
+ putToBaseOperation->m_structure.clear();
+ putToBaseOperation->m_offset = -1;
+ }
+ if (requiresDynamicChecks)
+ operations->append(ResolveOperation::checkForDynamicEntriesBeforeGlobalScope());
+ switch (returnValues) {
+ case ReturnValue:
+ ASSERT(!putToBaseOperation);
+ operations->append(ResolveOperation::getAndReturnGlobalProperty());
+ break;
+ case ReturnBase:
+ ASSERT(putToBaseOperation);
+ operations->append(ResolveOperation::returnGlobalObjectAsBase());
+ break;
+ case ReturnBaseAndValue:
+ ASSERT(putToBaseOperation);
+ operations->append(ResolveOperation::setBaseToGlobal());
+ operations->append(ResolveOperation::getAndReturnGlobalProperty());
+ break;
+ case ReturnThisAndValue:
+ ASSERT(!putToBaseOperation);
+ operations->append(ResolveOperation::setBaseToUndefined());
+ operations->append(ResolveOperation::getAndReturnGlobalProperty());
+ break;
+ }
+ }
+ return 0;
}
-JSValue JSScope::resolveGlobal(
- CallFrame* callFrame,
- const Identifier& identifier,
- JSGlobalObject* globalObject,
- WriteBarrierBase<Structure>* cachedStructure,
- PropertyOffset* cachedOffset
-)
+template <JSScope::ReturnValues returnValues> JSObject* JSScope::resolveContainingScope(CallFrame* callFrame, const Identifier& identifier, PropertySlot& slot, Vector<ResolveOperation>* operations, PutToBaseOperation* putToBaseOperation, bool isStrict)
{
- if (globalObject->structure() == cachedStructure->get())
- return globalObject->getDirectOffset(*cachedOffset);
-
- PropertySlot slot(globalObject);
- if (!globalObject->getPropertySlot(callFrame, identifier, slot))
- return throwError(callFrame, createUndefinedVariableError(callFrame, identifier));
-
- JSValue result = slot.getValue(callFrame, identifier);
- if (callFrame->globalData().exception)
- return JSValue();
-
- if (slot.isCacheableValue() && !globalObject->structure()->isUncacheableDictionary() && slot.slotBase() == globalObject) {
- cachedStructure->set(callFrame->globalData(), callFrame->codeBlock()->ownerExecutable(), globalObject->structure());
- *cachedOffset = slot.cachedOffset();
- }
+ if (operations->size())
+ return resolveContainingScopeInternal<KnownResolve, returnValues>(callFrame, identifier, slot, operations, putToBaseOperation, isStrict);
+ JSObject* result = resolveContainingScopeInternal<UnknownResolve, returnValues>(callFrame, identifier, slot, operations, putToBaseOperation, isStrict);
+ operations->shrinkToFit();
return result;
}
-JSValue JSScope::resolveGlobalDynamic(
- CallFrame* callFrame,
- const Identifier& identifier,
- int skip,
- WriteBarrierBase<Structure>* cachedStructure,
- PropertyOffset* cachedOffset
-)
+JSValue JSScope::resolve(CallFrame* callFrame, const Identifier& identifier, ResolveOperations* operations)
{
- JSScope* scope = callFrame->scope();
- ASSERT(scope);
-
- CodeBlock* codeBlock = callFrame->codeBlock();
-
- bool checkTopLevel = codeBlock->codeType() == FunctionCode && codeBlock->needsFullScopeChain();
- ASSERT(skip || !checkTopLevel);
- if (checkTopLevel && skip--) {
- if (callFrame->uncheckedR(codeBlock->activationRegister()).jsValue())
- scope = scope->next();
+ ASSERT(operations);
+ LookupResult fastResult;
+ if (operations->size() && executeResolveOperations(callFrame, callFrame->scope(), identifier, operations->data(), fastResult)) {
+ ASSERT(fastResult.value());
+ ASSERT(!callFrame->hadException());
+ return fastResult.value();
}
- while (skip--) {
- JSObject* object = JSScope::objectAtScope(scope);
- if (!object->hasCustomProperties())
- continue;
- PropertySlot slot(object);
- if (!object->getPropertySlot(callFrame, identifier, slot))
- continue;
+ if (callFrame->hadException())
+ return JSValue();
- JSValue result = slot.getValue(callFrame, identifier);
- if (callFrame->globalData().exception)
- return JSValue();
- return result;
+ PropertySlot slot;
+ if (JSScope::resolveContainingScope<ReturnValue>(callFrame, identifier, slot, operations, 0, false)) {
+ ASSERT(operations->size());
+ return slot.getValue(callFrame, identifier);
}
+ ASSERT(operations->size());
- return resolveGlobal(callFrame, identifier, callFrame->lexicalGlobalObject(), cachedStructure, cachedOffset);
+ return throwError(callFrame, createUndefinedVariableError(callFrame, identifier));
}
-JSValue JSScope::resolveBase(CallFrame* callFrame, const Identifier& identifier, bool isStrict)
+JSValue JSScope::resolveBase(CallFrame* callFrame, const Identifier& identifier, bool isStrict, ResolveOperations* operations, PutToBaseOperation* putToBaseOperations)
{
- JSScope* scope = callFrame->scope();
- ASSERT(scope);
-
- do {
- JSObject* object = JSScope::objectAtScope(scope);
+ ASSERT(operations);
+ ASSERT_UNUSED(putToBaseOperations, putToBaseOperations);
+ LookupResult fastResult;
+ if (operations->size() && executeResolveOperations(callFrame, callFrame->scope(), identifier, operations->data(), fastResult)) {
+ ASSERT(fastResult.base());
+ ASSERT(!callFrame->hadException());
+ return fastResult.base();
+ }
- PropertySlot slot(object);
- if (!object->getPropertySlot(callFrame, identifier, slot))
- continue;
+ if (callFrame->hadException())
+ return JSValue();
- return JSValue(object);
- } while ((scope = scope->next()));
+ PropertySlot slot;
+ if (JSObject* base = JSScope::resolveContainingScope<ReturnBase>(callFrame, identifier, slot, operations, putToBaseOperations, isStrict)) {
+ ASSERT(operations->size());
+ return base;
+ }
if (!isStrict)
return callFrame->lexicalGlobalObject();
@@ -213,50 +475,157 @@ JSValue JSScope::resolveBase(CallFrame* callFrame, const Identifier& identifier,
return throwError(callFrame, createErrorForInvalidGlobalAssignment(callFrame, identifier.string()));
}
-JSValue JSScope::resolveWithBase(CallFrame* callFrame, const Identifier& identifier, Register* base)
+JSValue JSScope::resolveWithBase(CallFrame* callFrame, const Identifier& identifier, Register* base, ResolveOperations* operations, PutToBaseOperation* putToBaseOperations)
{
- JSScope* scope = callFrame->scope();
- ASSERT(scope);
-
- do {
- JSObject* object = JSScope::objectAtScope(scope);
+ ASSERT(operations);
+ ASSERT_UNUSED(putToBaseOperations, putToBaseOperations);
+ LookupResult fastResult;
+ if (operations->size() && executeResolveOperations(callFrame, callFrame->scope(), identifier, operations->data(), fastResult)) {
+ ASSERT(fastResult.base());
+ ASSERT(fastResult.value());
+ ASSERT(!callFrame->hadException());
+ *base = fastResult.base();
+ return fastResult.value();
+ }
- PropertySlot slot(object);
- if (!object->getPropertySlot(callFrame, identifier, slot))
- continue;
+ if (callFrame->hadException())
+ return JSValue();
+ PropertySlot slot;
+ if (JSObject* propertyBase = JSScope::resolveContainingScope<ReturnBaseAndValue>(callFrame, identifier, slot, operations, putToBaseOperations, false)) {
+ ASSERT(operations->size());
JSValue value = slot.getValue(callFrame, identifier);
if (callFrame->globalData().exception)
return JSValue();
- *base = JSValue(object);
+ *base = propertyBase;
return value;
- } while ((scope = scope->next()));
+ }
+ ASSERT(operations->size());
return throwError(callFrame, createUndefinedVariableError(callFrame, identifier));
}
-JSValue JSScope::resolveWithThis(CallFrame* callFrame, const Identifier& identifier, Register* base)
+JSValue JSScope::resolveWithThis(CallFrame* callFrame, const Identifier& identifier, Register* base, ResolveOperations* operations)
{
- JSScope* scope = callFrame->scope();
- ASSERT(scope);
-
- do {
- JSObject* object = JSScope::objectAtScope(scope);
+ ASSERT(operations);
+ LookupResult fastResult;
+ if (operations->size() && executeResolveOperations(callFrame, callFrame->scope(), identifier, operations->data(), fastResult)) {
+ ASSERT(fastResult.base());
+ ASSERT(fastResult.value());
+ ASSERT(!callFrame->hadException());
+ *base = fastResult.base();
+ return fastResult.value();
+ }
- PropertySlot slot(object);
- if (!object->getPropertySlot(callFrame, identifier, slot))
- continue;
+ if (callFrame->hadException())
+ return JSValue();
+ PropertySlot slot;
+ if (JSObject* propertyBase = JSScope::resolveContainingScope<ReturnThisAndValue>(callFrame, identifier, slot, operations, 0, false)) {
+ ASSERT(operations->size());
JSValue value = slot.getValue(callFrame, identifier);
if (callFrame->globalData().exception)
return JSValue();
-
- *base = object->structure()->typeInfo().isEnvironmentRecord() ? jsUndefined() : JSValue(object);
+ ASSERT(value);
+ *base = propertyBase->structure()->typeInfo().isEnvironmentRecord() ? jsUndefined() : JSValue(propertyBase);
return value;
- } while ((scope = scope->next()));
+ }
+ ASSERT(operations->size());
+
+ return throwError(callFrame, createUndefinedVariableError(callFrame, identifier));
+}
+
+void JSScope::resolvePut(CallFrame* callFrame, JSValue base, const Identifier& property, JSValue value, PutToBaseOperation* operation)
+{
+ ASSERT_UNUSED(operation, operation);
+ ASSERT(base);
+ ASSERT(value);
+ switch (operation->m_kind) {
+ case PutToBaseOperation::Uninitialised:
+ CRASH();
+
+ case PutToBaseOperation::Readonly:
+ return;
+
+ case PutToBaseOperation::GlobalVariablePutChecked:
+ if (*operation->m_predicatePointer)
+ goto genericHandler;
+ case PutToBaseOperation::GlobalVariablePut:
+ if (operation->m_isDynamic) {
+ JSObject* baseObject = jsCast<JSObject*>(base);
+ if (baseObject != callFrame->lexicalGlobalObject()) {
+ if (baseObject->isGlobalObject())
+ ASSERT(!jsCast<JSGlobalObject*>(baseObject)->assertRegisterIsInThisObject(operation->m_registerAddress));
+ goto genericHandler;
+ }
+ }
+ operation->m_registerAddress->set(callFrame->globalData(), base.asCell(), value);
+ return;
+
+ case PutToBaseOperation::VariablePut: {
+ if (operation->m_isDynamic) {
+ JSObject* baseObject = jsCast<JSObject*>(base);
+ if (baseObject->structure() != operation->m_structure.get())
+ goto genericHandler;
+ }
+ JSVariableObject* variableObject = jsCast<JSVariableObject*>(base);
+ variableObject->registerAt(operation->m_offset).set(callFrame->globalData(), variableObject, value);
+ return;
+ }
+
+ case PutToBaseOperation::GlobalPropertyPut: {
+ JSObject* object = jsCast<JSObject*>(base);
+ if (operation->m_structure.get() != object->structure())
+ break;
+ object->putDirectOffset(callFrame->globalData(), operation->m_offset, value);
+ return;
+ }
+
+ genericHandler:
+ case PutToBaseOperation::Generic:
+ PutPropertySlot slot(operation->m_isStrict);
+ base.put(callFrame, property, value, slot);
+ return;
+ }
+ ASSERT(operation->m_kind == PutToBaseOperation::GlobalPropertyPut);
+ PutPropertySlot slot(operation->m_isStrict);
+ base.put(callFrame, property, value, slot);
+ if (!slot.isCacheable())
+ return;
+ if (callFrame->hadException())
+ return;
+ JSObject* baseObject = jsCast<JSObject*>(base);
+ if (!baseObject->structure()->propertyAccessesAreCacheable())
+ return;
+ if (slot.base() != callFrame->lexicalGlobalObject())
+ return;
+ if (slot.base() != baseObject)
+ return;
+ ASSERT(!baseObject->hasInlineStorage());
+ operation->m_structure.set(callFrame->globalData(), callFrame->codeBlock()->ownerExecutable(), baseObject->structure());
+ setPutPropertyAccessOffset(operation, slot.cachedOffset());
+ return;
+}
+
+JSValue JSScope::resolveGlobal(CallFrame* callFrame, const Identifier& identifier, JSGlobalObject* globalObject, ResolveOperation* resolveOperation)
+{
+ ASSERT(resolveOperation);
+ ASSERT(resolveOperation->m_operation == ResolveOperation::GetAndReturnGlobalProperty);
+ ASSERT_UNUSED(globalObject, callFrame->lexicalGlobalObject() == globalObject);
+
+ LookupResult fastResult;
+ if (executeResolveOperations(callFrame, callFrame->scope(), identifier, resolveOperation, fastResult)) {
+ ASSERT(fastResult.value());
+ ASSERT(!callFrame->hadException());
+ return fastResult.value();
+ }
+
+ if (callFrame->hadException())
+ return JSValue();
return throwError(callFrame, createUndefinedVariableError(callFrame, identifier));
}
+
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSScope.h b/Source/JavaScriptCore/runtime/JSScope.h
index 011aff57e..a9a9dd8d8 100644
--- a/Source/JavaScriptCore/runtime/JSScope.h
+++ b/Source/JavaScriptCore/runtime/JSScope.h
@@ -27,6 +27,7 @@
#define JSScope_h
#include "JSObject.h"
+#include "ResolveOperation.h"
namespace JSC {
@@ -41,25 +42,12 @@ public:
JS_EXPORT_PRIVATE static JSObject* objectAtScope(JSScope*);
- static JSValue resolve(CallFrame*, const Identifier&);
- static JSValue resolveSkip(CallFrame*, const Identifier&, int skip);
- static JSValue resolveGlobal(
- CallFrame*,
- const Identifier&,
- JSGlobalObject* globalObject,
- WriteBarrierBase<Structure>* cachedStructure,
- PropertyOffset* cachedOffset
- );
- static JSValue resolveGlobalDynamic(
- CallFrame*,
- const Identifier&,
- int skip,
- WriteBarrierBase<Structure>* cachedStructure,
- PropertyOffset* cachedOffset
- );
- static JSValue resolveBase(CallFrame*, const Identifier&, bool isStrict);
- static JSValue resolveWithBase(CallFrame*, const Identifier&, Register* base);
- static JSValue resolveWithThis(CallFrame*, const Identifier&, Register* base);
+ static JSValue resolve(CallFrame*, const Identifier&, ResolveOperations*);
+ static JSValue resolveBase(CallFrame*, const Identifier&, bool isStrict, ResolveOperations*, PutToBaseOperation*);
+ static JSValue resolveWithBase(CallFrame*, const Identifier&, Register* base, ResolveOperations*, PutToBaseOperation*);
+ static JSValue resolveWithThis(CallFrame*, const Identifier&, Register* base, ResolveOperations*);
+ static JSValue resolveGlobal(CallFrame*, const Identifier&, JSGlobalObject*, ResolveOperation*);
+ static void resolvePut(CallFrame*, JSValue base, const Identifier&, JSValue, PutToBaseOperation*);
static void visitChildren(JSCell*, SlotVisitor&);
@@ -80,6 +68,16 @@ protected:
private:
WriteBarrier<JSScope> m_next;
+ enum ReturnValues {
+ ReturnValue = 1,
+ ReturnBase = 2,
+ ReturnThis = 4,
+ ReturnBaseAndValue = ReturnValue | ReturnBase,
+ ReturnThisAndValue = ReturnValue | ReturnThis,
+ };
+ enum LookupMode { UnknownResolve, KnownResolve };
+ template <LookupMode, ReturnValues> static JSObject* resolveContainingScopeInternal(CallFrame*, const Identifier&, PropertySlot&, ResolveOperations*, PutToBaseOperation*, bool isStrict);
+ template <ReturnValues> static JSObject* resolveContainingScope(CallFrame*, const Identifier&, PropertySlot&, ResolveOperations*, PutToBaseOperation*, bool isStrict);
};
inline JSScope::JSScope(JSGlobalData& globalData, Structure* structure, JSScope* next)
diff --git a/Source/JavaScriptCore/runtime/JSValue.cpp b/Source/JavaScriptCore/runtime/JSValue.cpp
index 651e50cec..a5cdf700b 100644
--- a/Source/JavaScriptCore/runtime/JSValue.cpp
+++ b/Source/JavaScriptCore/runtime/JSValue.cpp
@@ -204,7 +204,7 @@ char* JSValue::description() const
snprintf(description, size, "Int32: %d", asInt32());
else if (isDouble()) {
#if USE(JSVALUE64)
- snprintf(description, size, "Double: %lx, %lf", reinterpretDoubleToIntptr(asDouble()), asDouble());
+ snprintf(description, size, "Double: %lld, %lf", (long long)reinterpretDoubleToInt64(asDouble()), asDouble());
#else
union {
double asDouble;
diff --git a/Source/JavaScriptCore/runtime/JSValue.h b/Source/JavaScriptCore/runtime/JSValue.h
index 6e01d8d2d..7b5c81aa9 100644
--- a/Source/JavaScriptCore/runtime/JSValue.h
+++ b/Source/JavaScriptCore/runtime/JSValue.h
@@ -69,11 +69,7 @@ namespace JSC {
enum PreferredPrimitiveType { NoPreference, PreferNumber, PreferString };
-#if USE(JSVALUE32_64)
typedef int64_t EncodedJSValue;
-#else
- typedef void* EncodedJSValue;
-#endif
union EncodedValueDescriptor {
int64_t asInt64;
@@ -390,9 +386,9 @@ namespace JSC {
EncodedValueDescriptor u;
};
-#if USE(JSVALUE32_64)
typedef IntHash<EncodedJSValue> EncodedJSValueHash;
+#if USE(JSVALUE32_64)
struct EncodedJSValueHashTraits : HashTraits<EncodedJSValue> {
static const bool emptyValueIsZero = false;
static EncodedJSValue emptyValue() { return JSValue::encode(JSValue()); }
@@ -400,8 +396,6 @@ namespace JSC {
static bool isDeletedValue(EncodedJSValue value) { return value == JSValue::encode(JSValue(JSValue::HashTableDeletedValue)); }
};
#else
- typedef PtrHash<EncodedJSValue> EncodedJSValueHash;
-
struct EncodedJSValueHashTraits : HashTraits<EncodedJSValue> {
static void constructDeletedValue(EncodedJSValue& slot) { slot = JSValue::encode(JSValue(JSValue::HashTableDeletedValue)); }
static bool isDeletedValue(EncodedJSValue value) { return value == JSValue::encode(JSValue(JSValue::HashTableDeletedValue)); }
diff --git a/Source/JavaScriptCore/runtime/JSValueInlineMethods.h b/Source/JavaScriptCore/runtime/JSValueInlineMethods.h
index 4c582ab2a..52b747890 100644
--- a/Source/JavaScriptCore/runtime/JSValueInlineMethods.h
+++ b/Source/JavaScriptCore/runtime/JSValueInlineMethods.h
@@ -140,7 +140,6 @@ namespace JSC {
*this = JSValue(static_cast<int32_t>(d));
}
-#if USE(JSVALUE32_64)
inline EncodedJSValue JSValue::encode(JSValue value)
{
return value.u.asInt64;
@@ -153,6 +152,7 @@ namespace JSC {
return v;
}
+#if USE(JSVALUE32_64)
inline JSValue::JSValue()
{
u.asBits.tag = EmptyValueTag;
@@ -333,17 +333,6 @@ namespace JSC {
#else // !USE(JSVALUE32_64) i.e. USE(JSVALUE64)
- // JSValue member functions.
- inline EncodedJSValue JSValue::encode(JSValue value)
- {
- return value.u.ptr;
- }
-
- inline JSValue JSValue::decode(EncodedJSValue ptr)
- {
- return JSValue(reinterpret_cast<JSCell*>(ptr));
- }
-
// 0x0 can never occur naturally because it has a tag of 00, indicating a pointer value, but a payload of 0x0, which is in the (invalid) zero page.
inline JSValue::JSValue()
{
@@ -358,27 +347,27 @@ namespace JSC {
inline JSValue::JSValue(JSCell* ptr)
{
- u.ptr = ptr;
+ u.asInt64 = reinterpret_cast<uintptr_t>(ptr);
}
inline JSValue::JSValue(const JSCell* ptr)
{
- u.ptr = const_cast<JSCell*>(ptr);
+ u.asInt64 = reinterpret_cast<uintptr_t>(const_cast<JSCell*>(ptr));
}
inline JSValue::operator bool() const
{
- return u.ptr;
+ return u.asInt64;
}
inline bool JSValue::operator==(const JSValue& other) const
{
- return u.ptr == other.u.ptr;
+ return u.asInt64 == other.u.asInt64;
}
inline bool JSValue::operator!=(const JSValue& other) const
{
- return u.ptr != other.u.ptr;
+ return u.asInt64 != other.u.asInt64;
}
inline bool JSValue::isEmpty() const
@@ -464,18 +453,18 @@ namespace JSC {
return (u.asInt64 & TagTypeNumber) == TagTypeNumber;
}
- inline intptr_t reinterpretDoubleToIntptr(double value)
+ inline int64_t reinterpretDoubleToInt64(double value)
{
- return bitwise_cast<intptr_t>(value);
+ return bitwise_cast<int64_t>(value);
}
- inline double reinterpretIntptrToDouble(intptr_t value)
+ inline double reinterpretInt64ToDouble(int64_t value)
{
return bitwise_cast<double>(value);
}
ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, double d)
{
- u.asInt64 = reinterpretDoubleToIntptr(d) + DoubleEncodeOffset;
+ u.asInt64 = reinterpretDoubleToInt64(d) + DoubleEncodeOffset;
}
inline JSValue::JSValue(int i)
@@ -486,7 +475,7 @@ namespace JSC {
inline double JSValue::asDouble() const
{
ASSERT(isDouble());
- return reinterpretIntptrToDouble(u.asInt64 - DoubleEncodeOffset);
+ return reinterpretInt64ToDouble(u.asInt64 - DoubleEncodeOffset);
}
inline bool JSValue::isNumber() const
diff --git a/Source/JavaScriptCore/runtime/JSVariableObject.cpp b/Source/JavaScriptCore/runtime/JSVariableObject.cpp
index c815dcd11..9b03a2c64 100644
--- a/Source/JavaScriptCore/runtime/JSVariableObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSVariableObject.cpp
@@ -31,4 +31,6 @@
namespace JSC {
+const ClassInfo JSVariableObject::s_info = { "VariableObject", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSVariableObject) };
+
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSVariableObject.h b/Source/JavaScriptCore/runtime/JSVariableObject.h
index 25961dc09..3ff7aa841 100644
--- a/Source/JavaScriptCore/runtime/JSVariableObject.h
+++ b/Source/JavaScriptCore/runtime/JSVariableObject.h
@@ -53,6 +53,8 @@ namespace JSC {
WriteBarrierBase<Unknown>* const * addressOfRegisters() const { return &m_registers; }
static size_t offsetOfRegisters() { return OBJECT_OFFSETOF(JSVariableObject, m_registers); }
+ static const ClassInfo s_info;
+
protected:
static const unsigned StructureFlags = Base::StructureFlags;
diff --git a/Source/JavaScriptCore/runtime/RegExpKey.h b/Source/JavaScriptCore/runtime/RegExpKey.h
index f93fbbc1d..58fa38725 100644
--- a/Source/JavaScriptCore/runtime/RegExpKey.h
+++ b/Source/JavaScriptCore/runtime/RegExpKey.h
@@ -73,9 +73,17 @@ struct RegExpKey {
, pattern(pattern)
{
}
+
+ friend inline bool operator==(const RegExpKey& a, const RegExpKey& b);
+
+ struct Hash {
+ static unsigned hash(const RegExpKey& key) { return key.pattern->hash(); }
+ static bool equal(const RegExpKey& a, const RegExpKey& b) { return a == b; }
+ static const bool safeToCompareToEmptyOrDeleted = false;
+ };
};
-inline bool operator==(const RegExpKey& a, const RegExpKey& b)
+inline bool operator==(const RegExpKey& a, const RegExpKey& b)
{
if (a.flagsValue != b.flagsValue)
return false;
@@ -90,16 +98,9 @@ inline bool operator==(const RegExpKey& a, const RegExpKey& b)
namespace WTF {
template<typename T> struct DefaultHash;
-template<typename T> struct RegExpHash;
-
-template<> struct RegExpHash<JSC::RegExpKey> {
- static unsigned hash(const JSC::RegExpKey& key) { return key.pattern->hash(); }
- static bool equal(const JSC::RegExpKey& a, const JSC::RegExpKey& b) { return a == b; }
- static const bool safeToCompareToEmptyOrDeleted = false;
-};
template<> struct DefaultHash<JSC::RegExpKey> {
- typedef RegExpHash<JSC::RegExpKey> Hash;
+ typedef JSC::RegExpKey::Hash Hash;
};
template<> struct HashTraits<JSC::RegExpKey> : GenericHashTraits<JSC::RegExpKey> {
diff --git a/Source/JavaScriptCore/runtime/StringRecursionChecker.h b/Source/JavaScriptCore/runtime/StringRecursionChecker.h
index 127d028e0..831e25b46 100644
--- a/Source/JavaScriptCore/runtime/StringRecursionChecker.h
+++ b/Source/JavaScriptCore/runtime/StringRecursionChecker.h
@@ -21,6 +21,7 @@
#define StringRecursionChecker_h
#include "Interpreter.h"
+#include <wtf/StackStats.h>
namespace JSC {
@@ -41,6 +42,8 @@ private:
ExecState* m_exec;
JSObject* m_thisObject;
JSValue m_earlyReturnValue;
+
+ StackStats::CheckPoint stackCheckpoint;
};
inline JSValue StringRecursionChecker::performCheck()
diff --git a/Source/JavaScriptCore/runtime/Structure.h b/Source/JavaScriptCore/runtime/Structure.h
index f45e9f1d9..5f1299766 100644
--- a/Source/JavaScriptCore/runtime/Structure.h
+++ b/Source/JavaScriptCore/runtime/Structure.h
@@ -140,6 +140,8 @@ namespace JSC {
bool isDictionary() const { return m_dictionaryKind != NoneDictionaryKind; }
bool isUncacheableDictionary() const { return m_dictionaryKind == UncachedDictionaryKind; }
+ bool propertyAccessesAreCacheable() { return m_dictionaryKind != UncachedDictionaryKind && !typeInfo().prohibitsPropertyCaching(); }
+
// Type accessors.
const TypeInfo& typeInfo() const { ASSERT(structure()->classInfo() == &s_info); return m_typeInfo; }
bool isObject() const { return typeInfo().isObject(); }
diff --git a/Source/Platform/ChangeLog b/Source/Platform/ChangeLog
index 71c773ce1..8dae5d48b 100644
--- a/Source/Platform/ChangeLog
+++ b/Source/Platform/ChangeLog
@@ -1,3 +1,70 @@
+2012-10-22 Keishi Hattori <keishi@webkit.org>
+
+ Remove monthFormatInLDML
+ https://bugs.webkit.org/show_bug.cgi?id=99971
+
+ Reviewed by Kent Tamura.
+
+ * chromium/public/WebLocalizedString.h:
+
+2012-10-22 Keishi Hattori <keishi@webkit.org>
+
+ [Chromium] Rename WeekFormatInLDML to WeekFormatTemplate
+ https://bugs.webkit.org/show_bug.cgi?id=99972
+
+ Reviewed by Kent Tamura.
+
+ Renaming because Chromium won't be returning a week format in LDML.
+
+ * chromium/public/WebLocalizedString.h:
+
+2012-10-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r131944.
+ http://trac.webkit.org/changeset/131944
+ https://bugs.webkit.org/show_bug.cgi?id=99891
+
+ On second thoughts, not such a great idea (Requested by jamesr
+ on #webkit).
+
+ * chromium/public/WebCompositorSupport.h:
+ (WebCompositorSupport):
+
+2012-10-19 Alexandre Elias <aelias@chromium.org>
+
+ [chromium] API to pass impl thread via WebLayerTreeView
+ https://bugs.webkit.org/show_bug.cgi?id=99863
+
+ Reviewed by James Robinson.
+
+ This adds an API to pass the compositor impl thread via WebView and
+ WebLayerTreeView. This is currently a no-op change, but in the future
+ this codepath will supercede WebCompositor. The goal is to avoid statics
+ in compositor initialization.
+
+ * chromium/public/WebCompositorSupport.h:
+ (WebKit::WebCompositorSupport::createLayerTreeView):
+ (WebCompositorSupport):
+ * chromium/public/WebLayerTreeView.h:
+ (WebKit):
+ (WebLayerTreeView):
+
+2012-10-18 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Do some cleanup in the chromium WebKit API
+ https://bugs.webkit.org/show_bug.cgi?id=99713
+
+ Reviewed by Adam Barth.
+
+ Removing the deprecated version of WebMediaStreamDescriptor::initialize and making
+ the two constructSDP functions in WebMediaStreamCenter optional to override.
+ This is part of the preparation to remove PeerConnection00.
+
+ * chromium/public/WebMediaStreamCenter.h:
+ (WebKit::WebMediaStreamCenter::constructSDP):
+ * chromium/public/WebMediaStreamDescriptor.h:
+ (WebMediaStreamDescriptor):
+
2012-10-17 Adrienne Walker <enne@chromium.org>
[chromium] Make WebContentLayer include what it uses
diff --git a/Source/Platform/chromium/public/WebLocalizedString.h b/Source/Platform/chromium/public/WebLocalizedString.h
index 20612476c..d9ec484fd 100644
--- a/Source/Platform/chromium/public/WebLocalizedString.h
+++ b/Source/Platform/chromium/public/WebLocalizedString.h
@@ -69,7 +69,6 @@ struct WebLocalizedString {
KeygenMenuHighGradeKeySize,
KeygenMenuMediumGradeKeySize,
MissingPluginText,
- MonthFormatInLDML,
MultipleFileUploadText,
OtherColorLabel,
OtherDateLabel,
@@ -102,7 +101,7 @@ struct WebLocalizedString {
ValidationValueMissingForMultipleFile,
ValidationValueMissingForRadio,
ValidationValueMissingForSelect,
- WeekFormatInLDML,
+ WeekFormatTemplate,
};
};
diff --git a/Source/Platform/chromium/public/WebMediaStreamCenter.h b/Source/Platform/chromium/public/WebMediaStreamCenter.h
index 2cea5e622..b399105a7 100644
--- a/Source/Platform/chromium/public/WebMediaStreamCenter.h
+++ b/Source/Platform/chromium/public/WebMediaStreamCenter.h
@@ -51,8 +51,8 @@ public:
virtual bool didRemoveMediaStreamTrack(const WebMediaStreamDescriptor&, const WebMediaStreamComponent&) { return false; };
virtual void didStopLocalMediaStream(const WebMediaStreamDescriptor&) = 0;
virtual void didCreateMediaStream(WebMediaStreamDescriptor&) = 0;
- virtual WebString constructSDP(const WebICECandidateDescriptor&) = 0;
- virtual WebString constructSDP(const WebSessionDescriptionDescriptor&) = 0;
+ virtual WebString constructSDP(const WebICECandidateDescriptor&) { return WebString(); }
+ virtual WebString constructSDP(const WebSessionDescriptionDescriptor&) { return WebString(); }
};
} // namespace WebKit
diff --git a/Source/Platform/chromium/public/WebMediaStreamDescriptor.h b/Source/Platform/chromium/public/WebMediaStreamDescriptor.h
index d1b385367..34575cec5 100644
--- a/Source/Platform/chromium/public/WebMediaStreamDescriptor.h
+++ b/Source/Platform/chromium/public/WebMediaStreamDescriptor.h
@@ -59,9 +59,6 @@ public:
WEBKIT_EXPORT void assign(const WebMediaStreamDescriptor&);
- // DEPRECATED
- WEBKIT_EXPORT void initialize(const WebString& label, const WebVector<WebMediaStreamSource>&);
-
WEBKIT_EXPORT void initialize(const WebString& label, const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources);
WEBKIT_EXPORT void reset();
bool isNull() const { return m_private.isNull(); }
diff --git a/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj b/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
index 8f2be60f5..3207eca8a 100644
--- a/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
+++ b/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
@@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
312BDB0C15FECAC90097EBC7 /* ANGLE.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 312BDB0915FEC91E0097EBC7 /* ANGLE.plist */; };
312BDB0E15FECAE50097EBC7 /* ANGLE.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 312BDB0A15FECA3A0097EBC7 /* ANGLE.txt */; };
+ 3158EA0E1630968D006BE5EE /* ArrayBoundsClamper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3158EA0C1630968D006BE5EE /* ArrayBoundsClamper.cpp */; };
+ 3158EA0F1630968D006BE5EE /* ArrayBoundsClamper.h in Headers */ = {isa = PBXBuildFile; fileRef = 3158EA0D1630968D006BE5EE /* ArrayBoundsClamper.h */; };
49951C0314B7AAB30060E96E /* length_limits.h in Headers */ = {isa = PBXBuildFile; fileRef = 49951C0214B7AAB30060E96E /* length_limits.h */; };
49951C0914B7AAD80060E96E /* BuiltInFunctionEmulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */; };
49951C0A14B7AAD80060E96E /* BuiltInFunctionEmulator.h in Headers */ = {isa = PBXBuildFile; fileRef = 49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */; };
@@ -136,6 +138,8 @@
/* Begin PBXFileReference section */
312BDB0915FEC91E0097EBC7 /* ANGLE.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ANGLE.plist; sourceTree = "<group>"; };
312BDB0A15FECA3A0097EBC7 /* ANGLE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ANGLE.txt; sourceTree = "<group>"; };
+ 3158EA0C1630968D006BE5EE /* ArrayBoundsClamper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArrayBoundsClamper.cpp; sourceTree = "<group>"; };
+ 3158EA0D1630968D006BE5EE /* ArrayBoundsClamper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayBoundsClamper.h; sourceTree = "<group>"; };
49951C0214B7AAB30060E96E /* length_limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = length_limits.h; sourceTree = "<group>"; };
49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BuiltInFunctionEmulator.cpp; sourceTree = "<group>"; };
49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuiltInFunctionEmulator.h; sourceTree = "<group>"; };
@@ -544,6 +548,8 @@
FB39D2201200F35A00088E69 /* compiler */ = {
isa = PBXGroup;
children = (
+ 3158EA0C1630968D006BE5EE /* ArrayBoundsClamper.cpp */,
+ 3158EA0D1630968D006BE5EE /* ArrayBoundsClamper.h */,
FB39D2211200F35A00088E69 /* BaseTypes.h */,
49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */,
49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */,
@@ -712,6 +718,7 @@
A265683E159C23E100398539 /* DependencyGraphOutput.h in Headers */,
A2656841159C23E100398539 /* RestrictFragmentShaderTiming.h in Headers */,
A2656843159C23E100398539 /* RestrictVertexShaderTiming.h in Headers */,
+ 3158EA0F1630968D006BE5EE /* ArrayBoundsClamper.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -829,6 +836,7 @@
A265683F159C23E100398539 /* DependencyGraphTraverse.cpp in Sources */,
A2656840159C23E100398539 /* RestrictFragmentShaderTiming.cpp in Sources */,
A2656842159C23E100398539 /* RestrictVertexShaderTiming.cpp in Sources */,
+ 3158EA0E1630968D006BE5EE /* ArrayBoundsClamper.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/ThirdParty/ANGLE/ChangeLog b/Source/ThirdParty/ANGLE/ChangeLog
index dbb15212d..bc892b5c1 100644
--- a/Source/ThirdParty/ANGLE/ChangeLog
+++ b/Source/ThirdParty/ANGLE/ChangeLog
@@ -1,3 +1,59 @@
+2012-10-18 Dean Jackson <dino@apple.com>
+
+ Shader translator needs option to clamp uniform array accesses in vertex shaders
+ https://bugs.webkit.org/show_bug.cgi?id=98977
+ https://code.google.com/p/angleproject/issues/detail?id=49
+
+ Reviewed by Alok Priyadarshi and Ken Russell.
+
+ WebGL does not allow GLSL code to index a uniform array outside its bounds. Add a
+ flag to the ANGLE compiler to insert clamp statements around such indexing.
+ Since it is possible to access vec2/3/4 and mat2/3/4 components by array indexing,
+ they must be similarly clamped.
+
+ Unfortunately, it is currently not possible to always determine that the indexing is
+ operating on a uniform variable. For example, suppose we have "uniform mat4 a". ANGLE
+ is currently not able to tell us that the rvalue of "a[0]" is a uniform, just that
+ it has a size of 4. Therefore, the clamping is done on all indirect array indexing.
+
+ This will have a performance impact. Future enhancements may be able to determine
+ cases where the clamping is not necessary. Currently only direct indexing is skipped
+ (i.e. looking up a value using a constant index).
+
+ The clamp insertion is only performed on the GLSL output. Direct3D already guarantees
+ that out-of-bounds uniform array access returns a zero value.
+
+ * ANGLE.xcodeproj/project.pbxproj:
+ * Target.pri:
+ * include/GLSLANG/ShaderLang.h: New compiler option.
+ * src/compiler/ArrayBoundsClamper.cpp: Added.
+ (ArrayBoundsClamper::ArrayBoundsClamper):
+ (ArrayBoundsClamper::OutputClampingFunctionDefinition): Injects a clamping function for integers into GLSL source.
+ (ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping): Examines the AST looking for non-direct array indexing.
+ * src/compiler/ArrayBoundsClamper.h: Added.
+ (ArrayBoundsClamper):
+ (ArrayBoundsClamper::GetArrayBoundsClampDefinitionNeeded):
+ (ArrayBoundsClamper::SetArrayBoundsClampDefinitionNeeded): Marks the object as needing to output the clamping function.
+ (ArrayBoundsClamper::Cleanup): Resets the state so that subsequent runs start fresh.
+ * src/compiler/Compiler.cpp:
+ (TCompiler::compile): Run the clamping code if the compile option was set.
+ (TCompiler::clearResults):
+ (TCompiler::getArrayBoundsClamper):
+ * src/compiler/OutputGLSLBase.cpp:
+ (TOutputGLSLBase::visitBinary): If the expression has been flagged, insert an appropriate "clamp" statement.
+ * src/compiler/ShHandle.h:
+ (TCompiler):
+ * src/compiler/TranslatorESSL.cpp:
+ (TranslatorESSL::translate):
+ * src/compiler/TranslatorGLSL.cpp:
+ (TranslatorGLSL::translate):
+ * src/compiler/intermOut.cpp:
+ (TType::getCompleteString): Add array size to intermediate tree output.
+ * src/compiler/intermediate.h:
+ (TIntermBinary::setAddIndexClamp): New flag for indicating a binary expression needs clamping.
+ (TIntermBinary::getAddIndexClamp):
+ (TIntermBinary):
+
2012-09-13 Mark Rowe <mrowe@apple.com>
<rdar://problem/12255720> Fix the build with newer Clang
diff --git a/Source/ThirdParty/ANGLE/Target.pri b/Source/ThirdParty/ANGLE/Target.pri
index 4e9303ab7..eaa936d88 100644
--- a/Source/ThirdParty/ANGLE/Target.pri
+++ b/Source/ThirdParty/ANGLE/Target.pri
@@ -17,6 +17,7 @@ INCLUDEPATH += \
$$SOURCE_DIR/include
HEADERS += \
+ src/compiler/ArrayBoundsClamper.h \
src/compiler/BaseTypes.h \
src/compiler/BuiltInFunctionEmulator.h \
src/compiler/Common.h \
@@ -90,6 +91,7 @@ HEADERS += \
src/compiler/VersionGLSL.h
SOURCES += \
+ src/compiler/ArrayBoundsClamper.cpp \
src/compiler/BuiltInFunctionEmulator.cpp \
src/compiler/CodeGenGLSL.cpp \
src/compiler/Compiler.cpp \
diff --git a/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h b/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
index 9a4a36dbf..d82931ea1 100644
--- a/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
+++ b/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
@@ -142,7 +142,13 @@ typedef enum {
// - The shader spec is SH_WEBGL_SPEC.
// - The compile options contain the SH_TIMING_RESTRICTIONS flag.
// - The shader type is SH_FRAGMENT_SHADER.
- SH_DEPENDENCY_GRAPH = 0x0400
+ SH_DEPENDENCY_GRAPH = 0x0400,
+
+ // This flag ensures all indirect (expression-based) array indexing
+ // is clamped to the bounds of the array. This ensures, for example,
+ // that you cannot read off the end of a uniform, whether an array
+ // vec234, or mat234 type.
+ SH_CLAMP_INDIRECT_ARRAY_BOUNDS = 0x0800
} ShCompileOptions;
//
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.cpp b/Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.cpp
new file mode 100644
index 000000000..6a317217c
--- /dev/null
+++ b/Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "compiler/ArrayBoundsClamper.h"
+
+const char* kIntClampBegin = "// BEGIN: Generated code for array bounds clamping\n\n";
+const char* kIntClampEnd = "// END: Generated code for array bounds clamping\n\n";
+const char* kIntClampDefinition = "int webgl_int_clamp(int value, int minValue, int maxValue) { return ((value < minValue) ? minValue : ((value > maxValue) ? maxValue : value)); }\n\n";
+
+namespace {
+
+class ArrayBoundsClamperMarker : public TIntermTraverser {
+public:
+ ArrayBoundsClamperMarker()
+ : mNeedsClamp(false)
+ {
+ }
+
+ virtual bool visitBinary(Visit visit, TIntermBinary* node)
+ {
+ if (node->getOp() == EOpIndexIndirect)
+ {
+ TIntermTyped* left = node->getLeft();
+ if (left->isArray() || left->isVector() || left->isMatrix())
+ {
+ node->setAddIndexClamp();
+ mNeedsClamp = true;
+ }
+ }
+ return true;
+ }
+
+ bool GetNeedsClamp() { return mNeedsClamp; }
+
+private:
+ bool mNeedsClamp;
+};
+
+} // anonymous namespace
+
+ArrayBoundsClamper::ArrayBoundsClamper()
+ : mArrayBoundsClampDefinitionNeeded(false)
+{
+}
+
+void ArrayBoundsClamper::OutputClampingFunctionDefinition(TInfoSinkBase& out) const
+{
+ if (!mArrayBoundsClampDefinitionNeeded)
+ {
+ return;
+ }
+ out << kIntClampBegin << kIntClampDefinition << kIntClampEnd;
+}
+
+void ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping(TIntermNode* root)
+{
+ ASSERT(root);
+
+ ArrayBoundsClamperMarker clamper;
+ root->traverse(&clamper);
+ if (clamper.GetNeedsClamp())
+ {
+ SetArrayBoundsClampDefinitionNeeded();
+ }
+}
+
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.h b/Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.h
new file mode 100644
index 000000000..d4a8d6994
--- /dev/null
+++ b/Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef COMPILER_ARRAY_BOUNDS_CLAMPER_H_
+#define COMPILER_ARRAY_BOUNDS_CLAMPER_H_
+
+#include "GLSLANG/ShaderLang.h"
+
+#include "compiler/InfoSink.h"
+#include "compiler/intermediate.h"
+
+class ArrayBoundsClamper {
+public:
+ ArrayBoundsClamper();
+
+ // Output array clamp function source into the shader source.
+ void OutputClampingFunctionDefinition(TInfoSinkBase& out) const;
+
+ // Marks nodes in the tree that index arrays indirectly as
+ // requiring clamping.
+ void MarkIndirectArrayBoundsForClamping(TIntermNode* root);
+
+ void Cleanup()
+ {
+ mArrayBoundsClampDefinitionNeeded = false;
+ }
+
+private:
+ bool GetArrayBoundsClampDefinitionNeeded() const { return mArrayBoundsClampDefinitionNeeded; }
+ void SetArrayBoundsClampDefinitionNeeded() { mArrayBoundsClampDefinitionNeeded = true; }
+
+ bool mArrayBoundsClampDefinitionNeeded;
+};
+
+#endif // COMPILER_ARRAY_BOUNDS_CLAMPER_H_
diff --git a/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp b/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
index cab8056bc..db5f7290f 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
@@ -4,6 +4,7 @@
// found in the LICENSE file.
//
+#include "compiler/ArrayBoundsClamper.h"
#include "compiler/BuiltInFunctionEmulator.h"
#include "compiler/DetectRecursion.h"
#include "compiler/ForLoopUnroll.h"
@@ -186,6 +187,10 @@ bool TCompiler::compile(const char* const shaderStrings[],
if (success && (compileOptions & SH_EMULATE_BUILT_IN_FUNCTIONS))
builtInFunctionEmulator.MarkBuiltInFunctionsForEmulation(root);
+ // Clamping uniform array bounds needs to happen after validateLimitations pass.
+ if (success && (compileOptions & SH_CLAMP_INDIRECT_ARRAY_BOUNDS))
+ arrayBoundsClamper.MarkIndirectArrayBoundsForClamping(root);
+
// Call mapLongVariableNames() before collectAttribsUniforms() so in
// collectAttribsUniforms() we already have the mapped symbol names and
// we could composite mapped and original variable names.
@@ -231,6 +236,7 @@ void TCompiler::clearResults()
uniforms.clear();
builtInFunctionEmulator.Cleanup();
+ arrayBoundsClamper.Cleanup();
}
bool TCompiler::detectRecursion(TIntermNode* root)
@@ -331,3 +337,9 @@ const BuiltInFunctionEmulator& TCompiler::getBuiltInFunctionEmulator() const
{
return builtInFunctionEmulator;
}
+
+const ArrayBoundsClamper& TCompiler::getArrayBoundsClamper() const
+{
+ return arrayBoundsClamper;
+}
+
diff --git a/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp b/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp
index 552fa5066..2100eaa0a 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp
@@ -235,9 +235,38 @@ bool TOutputGLSLBase::visitBinary(Visit visit, TIntermBinary* node)
break;
case EOpIndexDirect:
- case EOpIndexIndirect:
writeTriplet(visit, NULL, "[", "]");
break;
+ case EOpIndexIndirect:
+ if (node->getAddIndexClamp())
+ {
+ if (visit == InVisit)
+ {
+ out << "[webgl_int_clamp(";
+ }
+ else if (visit == PostVisit)
+ {
+ int maxSize;
+ TIntermTyped *left = node->getLeft();
+ TType leftType = left->getType();
+
+ if (left->isArray())
+ {
+ // The shader will fail validation if the array length is not > 0.
+ maxSize = leftType.getArraySize() - 1;
+ }
+ else
+ {
+ maxSize = leftType.getNominalSize() - 1;
+ }
+ out << ", 0, " << maxSize << ")]";
+ }
+ }
+ else
+ {
+ writeTriplet(visit, NULL, "[", "]");
+ }
+ break;
case EOpIndexDirectStruct:
if (visit == InVisit)
{
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h b/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h
index 26528b8db..3eaf19f56 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h
@@ -16,6 +16,7 @@
#include "GLSLANG/ShaderLang.h"
+#include "compiler/ArrayBoundsClamper.h"
#include "compiler/BuiltInFunctionEmulator.h"
#include "compiler/ExtensionBehavior.h"
#include "compiler/InfoSink.h"
@@ -98,6 +99,7 @@ protected:
// Get built-in extensions with default behavior.
const TExtensionBehavior& getExtensionBehavior() const;
+ const ArrayBoundsClamper& getArrayBoundsClamper() const;
const BuiltInFunctionEmulator& getBuiltInFunctionEmulator() const;
private:
@@ -110,6 +112,7 @@ private:
// Built-in extensions with default behavior.
TExtensionBehavior extensionBehavior;
+ ArrayBoundsClamper arrayBoundsClamper;
BuiltInFunctionEmulator builtInFunctionEmulator;
// Results of compilation.
diff --git a/Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp b/Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp
index e3a2c2a80..d90c70cb2 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp
@@ -22,6 +22,9 @@ void TranslatorESSL::translate(TIntermNode* root) {
getBuiltInFunctionEmulator().OutputEmulatedFunctionDefinition(
sink, getShaderType() == SH_FRAGMENT_SHADER);
+ // Write array bounds clamping emulation if needed.
+ getArrayBoundsClamper().OutputClampingFunctionDefinition(sink);
+
// Write translated shader.
TOutputESSL outputESSL(sink);
root->traverse(&outputESSL);
diff --git a/Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp b/Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp
index bb07a1eb4..ba38112c2 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp
@@ -35,6 +35,9 @@ void TranslatorGLSL::translate(TIntermNode* root) {
getBuiltInFunctionEmulator().OutputEmulatedFunctionDefinition(
sink, false);
+ // Write array bounds clamping emulation if needed.
+ getArrayBoundsClamper().OutputClampingFunctionDefinition(sink);
+
// Write translated shader.
TOutputGLSL outputGLSL(sink);
root->traverse(&outputGLSL);
diff --git a/Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp b/Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp
index e83c7b72f..f48a049c6 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp
@@ -42,7 +42,7 @@ TString TType::getCompleteString() const
if (qualifier != EvqTemporary && qualifier != EvqGlobal)
stream << getQualifierString() << " " << getPrecisionString() << " ";
if (array)
- stream << "array of ";
+ stream << "array[" << getArraySize() << "] of ";
if (matrix)
stream << size << "X" << size << " matrix of ";
else if (size > 1)
diff --git a/Source/ThirdParty/ANGLE/src/compiler/intermediate.h b/Source/ThirdParty/ANGLE/src/compiler/intermediate.h
index 843c40ebb..9e9abbc3a 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/intermediate.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/intermediate.h
@@ -400,9 +400,15 @@ public:
TIntermTyped* getRight() const { return right; }
bool promote(TInfoSink&);
+ void setAddIndexClamp() { addIndexClamp = true; }
+ bool getAddIndexClamp() { return addIndexClamp; }
+
protected:
TIntermTyped* left;
TIntermTyped* right;
+
+ // If set to true, wrap any EOpIndexIndirect with a clamp to bounds.
+ bool addIndexClamp;
};
//
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index fc9ae9456..458eb3dcd 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,183 @@
+2012-10-22 Simon Hausmann <simon.hausmann@digia.com>
+
+ Unreviewed: Re-enable LLINT on Qt/Linux after r131932.
+
+ * wtf/Platform.h:
+
+2012-10-22 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: do not double count memory of objects with multiple ancestors
+ https://bugs.webkit.org/show_bug.cgi?id=99958
+
+ Reviewed by Alexander Pavlov.
+
+ Make sure memory occupied by objects of classes with multiple inheritance is
+ not double counted.
+
+ * wtf/MemoryInstrumentation.h:
+ (WTF::MemoryObjectInfo::MemoryObjectInfo):
+ (WTF::MemoryObjectInfo::reportedPointer):
+ (WTF::MemoryObjectInfo::reportObjectInfo): 1) Store actual pointer to the instrumented
+ object as it may differ from the original pointer by which it was reported. 2) Make
+ the method non-template and calculate object size on the caller side.
+ (MemoryObjectInfo):
+ (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
+ (WTF::MemoryClassInfo::MemoryClassInfo):
+ (WTF::MemoryInstrumentation::InstrumentedPointer::process): use adjusted pointer
+ returned by reportMemoryUsage to check if the object has already been visited when
+ the pointer differs from the orinal one(it may happen if the object was reported
+ by a pointer to one of its base classes).
+
+2012-10-20 Martin Robinson <mrobinson@igalia.com>
+
+ Fix 'make dist' for the GTK+ port
+
+ * GNUmakefile.list.am: Add missing files to the source list.
+
+2012-10-19 Mark Lam <mark.lam@apple.com>
+
+ Added WTF::StackStats mechanism.
+ https://bugs.webkit.org/show_bug.cgi?id=99805.
+
+ Reviewed by Geoffrey Garen.
+
+ Disabled by default. Should have no performance and memory cost when
+ disabled. To enable, #define ENABLE_STACK_STATS 1 in StackStats.h.
+ The output is currently hardcoded to be dumped in /tmp/stack-stats.log,
+ and is in the form of stack sample events. By default, it only logs
+ a sample event when a new high watermark value is encountered.
+
+ Also renamed StackBounds::recursiveCheck() to isSafeToRecurse().
+
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/StackBounds.h:
+ (StackBounds):
+ (WTF::StackBounds::size):
+ (WTF::StackBounds::isSafeToRecurse):
+ * wtf/StackStats.cpp: Added.
+ (WTF):
+ (WTF::StackStats::initialize):
+ (WTF::StackStats::PerThreadStats::PerThreadStats):
+ (WTF::StackStats::CheckPoint::CheckPoint):
+ (WTF::StackStats::CheckPoint::~CheckPoint):
+ (WTF::StackStats::probe):
+ (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
+ (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
+ * wtf/StackStats.h: Added.
+ (WTF):
+ (StackStats):
+ (CheckPoint):
+ (WTF::StackStats::CheckPoint::CheckPoint):
+ (PerThreadStats):
+ (WTF::StackStats::PerThreadStats::PerThreadStats):
+ (LayoutCheckPoint):
+ (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
+ (WTF::StackStats::initialize):
+ (WTF::StackStats::probe):
+ * wtf/ThreadingPthreads.cpp:
+ (WTF::initializeThreading):
+ * wtf/WTFThreadData.cpp:
+ (WTF::WTFThreadData::WTFThreadData):
+ * wtf/WTFThreadData.h:
+ (WTFThreadData):
+ (WTF::WTFThreadData::stackStats):
+
+2012-10-19 Anders Carlsson <andersca@apple.com>
+
+ Deque can use std::reverse_iterator for its reverse iterators
+ https://bugs.webkit.org/show_bug.cgi?id=99789
+
+ Reviewed by Andreas Kling.
+
+ Remove DequeReverseIterator and DequeConstReverseIterator and just use std::reverse_iterator directly.
+ Also, remove the DequeIteratorBase<T, inlineCapacity> to Base typedef - We can already use DequeIteratorBase since it's
+ equivalent to the full class template type.
+
+ * wtf/Deque.h:
+ (WTF::Deque::rbegin):
+ (WTF::Deque::rend):
+ (DequeIteratorBase):
+ (WTF::DequeIteratorBase::assign):
+ (DequeIterator):
+ (DequeConstIterator):
+ (WTF::::checkValidity):
+ (WTF::::DequeIteratorBase):
+ (WTF::=):
+ (WTF::::isEqual):
+
+2012-10-19 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed buildfix, use C-style comment instead of C++
+
+ * wtf/Platform.h:
+
+2012-10-19 Csaba Osztrogonác <ossy@webkit.org>
+
+ REGRESSION(r131822): It made 500+ tests crash on 32 bit platforms
+ https://bugs.webkit.org/show_bug.cgi?id=99814
+
+ Reviewed by Simon Hausmann.
+
+ * wtf/Platform.h: Disable LLINT on (PLATFORM(QT) && CPU(X86)) temporarily until proper fix.
+
+2012-10-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Web Inspector: NMI provide data for mixing with tcmalloc heap dumps.
+ https://bugs.webkit.org/show_bug.cgi?id=99457
+
+ Reviewed by Yury Semikhatsky.
+
+ countObjectSize now accepts ptr as the first argument and saves it into HashMap if the binary was ran with HEAPPROFILE env variable.
+ getProcessMemoryDistribution does snapshot and calls the downstream code with the map of counted objects.
+
+ * wtf/MemoryInstrumentation.h:
+ (MemoryInstrumentationClient):
+ (WTF::MemoryInstrumentation::countObjectSize):
+ (WTF::MemoryInstrumentation::addRawBuffer):
+ (WTF::MemoryClassInfo::addPrivateBuffer):
+ (WTF::MemoryInstrumentation::addObjectImpl):
+ (WTF::MemoryInstrumentation::addListHashSet):
+ (WTF::::process):
+
+2012-10-18 Michael Saboff <msaboff@apple.com>
+
+ convertUTF8ToUTF16() Should Check for ASCII Input
+ ihttps://bugs.webkit.org/show_bug.cgi?id=99739
+
+ Reviewed by Geoffrey Garen.
+
+ Added code to accumulate the "or" of all characters seen during the UTF8 to UTF16 conversion. This is
+ used to check to see if all characters are ASCII and is returned via a bool*.
+
+ * wtf/unicode/UTF8.cpp:
+ (WTF::Unicode::convertUTF8ToUTF16):
+ * wtf/unicode/UTF8.h:
+
+2012-10-18 Michael Saboff <msaboff@apple.com>
+
+ Mac WTF build checks dependencies before copying header files
+ https://bugs.webkit.org/show_bug.cgi?id=99770
+
+ Reviewed by Mark Rowe.
+
+ Fixed up build rules per Mark Rowe. Made new target an Aggregate and removed "WTF copy".
+
+ * Configurations/CopyWTFHeaders.xcconfig: Added.
+ * Configurations/WTF.xcconfig:
+ * WTF.xcodeproj/project.pbxproj:
+
+2012-10-18 Michael Saboff <msaboff@apple.com>
+
+ Mac WTF build checks dependencies before copying header files
+ https://bugs.webkit.org/show_bug.cgi?id=99770
+
+ Reviewed by Geoffrey Garen.
+
+ Added a new build target "Copy WTF HEaders" to copy the header files and made that new target a dependency
+ for the main WTF build target. Moved the "Copy WTF Headers" phase from WTF target to the new target.
+
+ * WTF.xcodeproj/project.pbxproj:
+
2012-10-17 Anders Carlsson <andersca@apple.com>
Clean up Vector.h
diff --git a/Source/WTF/Configurations/CopyWTFHeaders.xcconfig b/Source/WTF/Configurations/CopyWTFHeaders.xcconfig
new file mode 100644
index 000000000..112af7a7e
--- /dev/null
+++ b/Source/WTF/Configurations/CopyWTFHeaders.xcconfig
@@ -0,0 +1,26 @@
+// Copyright (C) 2011 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/wtf;
+INSTALLHDRS_SCRIPT_PHASE = YES;
diff --git a/Source/WTF/Configurations/WTF.xcconfig b/Source/WTF/Configurations/WTF.xcconfig
index badf04be4..8d7887edc 100644
--- a/Source/WTF/Configurations/WTF.xcconfig
+++ b/Source/WTF/Configurations/WTF.xcconfig
@@ -24,6 +24,4 @@
EXECUTABLE_PREFIX = lib;
PRODUCT_NAME = WTF;
-PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/wtf;
-INSTALLHDRS_SCRIPT_PHASE = YES;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
diff --git a/Source/WTF/GNUmakefile.list.am b/Source/WTF/GNUmakefile.list.am
index ecd5c25fd..9063fb5f7 100644
--- a/Source/WTF/GNUmakefile.list.am
+++ b/Source/WTF/GNUmakefile.list.am
@@ -146,6 +146,7 @@ wtf_sources += \
Source/WTF/wtf/Spectrum.h \
Source/WTF/wtf/StackBounds.cpp \
Source/WTF/wtf/StackBounds.h \
+ Source/WTF/wtf/StackStats.h \
Source/WTF/wtf/StaticConstructors.h \
Source/WTF/wtf/StdLibExtras.h \
Source/WTF/wtf/StreamBuffer.h \
diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj
index c2ff612e0..ab1251eeb 100644
--- a/Source/WTF/WTF.xcodeproj/project.pbxproj
+++ b/Source/WTF/WTF.xcodeproj/project.pbxproj
@@ -6,6 +6,20 @@
objectVersion = 46;
objects = {
+/* Begin PBXAggregateTarget section */
+ 65AFA16F1630B977003D723C /* Copy WTF Headers */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 65AFA2881630B977003D723C /* Build configuration list for PBXAggregateTarget "Copy WTF Headers" */;
+ buildPhases = (
+ 65AFA1701630B977003D723C /* Copy WTF Headers */,
+ );
+ dependencies = (
+ );
+ name = "Copy WTF Headers";
+ productName = "Copy WTF Headers";
+ };
+/* End PBXAggregateTarget section */
+
/* Begin PBXBuildFile section */
0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AC4154FB22E00983E72 /* FastBitVector.h */; settings = {ATTRIBUTES = (); }; };
143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143F611D1565F0F900DB514A /* RAMSize.cpp */; };
@@ -282,8 +296,20 @@
F3525E461619A4EE00278BC1 /* MemoryInstrumentationHashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = F3525E451619A4EE00278BC1 /* MemoryInstrumentationHashMap.h */; };
F3FBC71E161AF7BF00BB4BD4 /* MemoryInstrumentationHashCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FBC71D161AF7BF00BB4BD4 /* MemoryInstrumentationHashCountedSet.h */; };
F3FBC720161AF7CD00BB4BD4 /* MemoryInstrumentationSequence.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FBC71F161AF7CD00BB4BD4 /* MemoryInstrumentationSequence.h */; };
+ FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDACD3B1630F83F00C69634 /* StackStats.cpp */; };
+ FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDACD3C1630F83F00C69634 /* StackStats.h */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ 65AFA28D1630B99E003D723C /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 5D247B5914689B8600E78B76 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 65AFA16F1630B977003D723C;
+ remoteInfo = "Copy Headers";
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXFileReference section */
0FD81AC4154FB22E00983E72 /* FastBitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastBitVector.h; sourceTree = "<group>"; };
143F611D1565F0F900DB514A /* RAMSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RAMSize.cpp; sourceTree = "<group>"; };
@@ -331,6 +357,7 @@
5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
5D247B7314689C4700E78B76 /* WTF.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WTF.xcconfig; sourceTree = "<group>"; };
5D247EB11468B01500E78B76 /* HeaderDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HeaderDetection.h; path = DerivedSources/WTF/HeaderDetection.h; sourceTree = BUILT_PRODUCTS_DIR; };
+ 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CopyWTFHeaders.xcconfig; sourceTree = "<group>"; };
7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjcRuntimeExtras.h; sourceTree = "<group>"; };
8134013615B092FD001FF0B8 /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = "<group>"; };
8134013715B092FD001FF0B8 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; };
@@ -569,6 +596,8 @@
F3525E451619A4EE00278BC1 /* MemoryInstrumentationHashMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationHashMap.h; sourceTree = "<group>"; };
F3FBC71D161AF7BF00BB4BD4 /* MemoryInstrumentationHashCountedSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationHashCountedSet.h; sourceTree = "<group>"; };
F3FBC71F161AF7CD00BB4BD4 /* MemoryInstrumentationSequence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationSequence.h; sourceTree = "<group>"; };
+ FEDACD3B1630F83F00C69634 /* StackStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackStats.cpp; sourceTree = "<group>"; };
+ FEDACD3C1630F83F00C69634 /* StackStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StackStats.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -602,6 +631,7 @@
5D247B6D14689C4700E78B76 /* Configurations */ = {
isa = PBXGroup;
children = (
+ 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */,
5D247B6E14689C4700E78B76 /* Base.xcconfig */,
5D247B6F14689C4700E78B76 /* CompilerVersion.xcconfig */,
5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */,
@@ -778,6 +808,8 @@
A8A4730D151A825B004123FF /* Spectrum.h */,
A8A4730E151A825B004123FF /* StackBounds.cpp */,
A8A4730F151A825B004123FF /* StackBounds.h */,
+ FEDACD3B1630F83F00C69634 /* StackStats.cpp */,
+ FEDACD3C1630F83F00C69634 /* StackStats.h */,
A8A47310151A825B004123FF /* StaticConstructors.h */,
A8A47311151A825B004123FF /* StdLibExtras.h */,
1A6BB768162F300500DD16DB /* StreamBuffer.h */,
@@ -1124,6 +1156,7 @@
A8A47424151A825B004123FF /* SinglyLinkedList.h in Headers */,
A8A47426151A825B004123FF /* Spectrum.h in Headers */,
A8A47428151A825B004123FF /* StackBounds.h in Headers */,
+ FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */,
A8A47429151A825B004123FF /* StaticConstructors.h in Headers */,
A8A4742A151A825B004123FF /* StdLibExtras.h in Headers */,
1A6BB769162F300500DD16DB /* StreamBuffer.h in Headers */,
@@ -1191,7 +1224,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 5D247B6614689B8600E78B76 /* Build configuration list for PBXNativeTarget "WTF" */;
buildPhases = (
- 5D247CF11468A3CD00E78B76 /* Copy WTF Headers */,
5D247E9D1468AEE200E78B76 /* Detect Available Headers */,
5D247B5E14689B8600E78B76 /* Sources */,
5D247B5F14689B8600E78B76 /* Frameworks */,
@@ -1200,6 +1232,7 @@
buildRules = (
);
dependencies = (
+ 65AFA28E1630B99E003D723C /* PBXTargetDependency */,
);
name = WTF;
productName = WTF;
@@ -1227,40 +1260,41 @@
projectRoot = "";
targets = (
5D247B6114689B8600E78B76 /* WTF */,
+ 65AFA16F1630B977003D723C /* Copy WTF Headers */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
- 5D247CF11468A3CD00E78B76 /* Copy WTF Headers */ = {
+ 5D247E9D1468AEE200E78B76 /* Detect Available Headers */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
+ "$(SDKROOT)/System/Library/CoreServices/SystemVersion.plist",
);
- name = "Copy WTF Headers";
+ name = "Detect Available Headers";
outputPaths = (
+ "$(BUILT_PRODUCTS_DIR)/DerivedSources/WTF/HeaderDetection.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [[ \"${DEPLOYMENT_LOCATION}\" == \"NO\" ]]; then\n PRIVATE_HEADERS_PATH=\"${TARGET_BUILD_DIR%%/}${PRIVATE_HEADERS_FOLDER_PATH}\"\nelse\n PRIVATE_HEADERS_PATH=\"${DSTROOT%%/}${PRIVATE_HEADERS_FOLDER_PATH}\"\nfi;\n\nmkdir -p \"${PRIVATE_HEADERS_PATH}\"\nrsync -av --no-owner --no-group --prune-empty-dirs --exclude \".svn\" --exclude \"usr\" --exclude \"DerivedSources\" --include \"*/\" --include \"*.h\" --exclude \"*\" \"${SRCROOT}/wtf/\" \"${PRIVATE_HEADERS_PATH}\"\n";
+ shellScript = "OUTPUT_FILE=\"${BUILT_PRODUCTS_DIR}/DerivedSources/WTF/HeaderDetection.h\"\necho \"/* This is a generated file. Do not edit. */\" > \"${OUTPUT_FILE}\"\n\nif [[ -f \"${SDKROOT}/System/Library/Frameworks/System.framework/PrivateHeaders/pthread_machdep.h\" ]]; then\n echo \"#define HAVE_PTHREAD_MACHDEP_H 1\" >> \"${OUTPUT_FILE}\"\nfi\n";
};
- 5D247E9D1468AEE200E78B76 /* Detect Available Headers */ = {
+ 65AFA1701630B977003D723C /* Copy WTF Headers */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "$(SDKROOT)/System/Library/CoreServices/SystemVersion.plist",
);
- name = "Detect Available Headers";
+ name = "Copy WTF Headers";
outputPaths = (
- "$(BUILT_PRODUCTS_DIR)/DerivedSources/WTF/HeaderDetection.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "OUTPUT_FILE=\"${BUILT_PRODUCTS_DIR}/DerivedSources/WTF/HeaderDetection.h\"\necho \"/* This is a generated file. Do not edit. */\" > \"${OUTPUT_FILE}\"\n\nif [[ -f \"${SDKROOT}/System/Library/Frameworks/System.framework/PrivateHeaders/pthread_machdep.h\" ]]; then\n echo \"#define HAVE_PTHREAD_MACHDEP_H 1\" >> \"${OUTPUT_FILE}\"\nfi\n";
+ shellScript = "if [[ \"${DEPLOYMENT_LOCATION}\" == \"NO\" ]]; then\n PRIVATE_HEADERS_PATH=\"${TARGET_BUILD_DIR%%/}${PRIVATE_HEADERS_FOLDER_PATH}\"\nelse\n PRIVATE_HEADERS_PATH=\"${DSTROOT%%/}${PRIVATE_HEADERS_FOLDER_PATH}\"\nfi;\n\nmkdir -p \"${PRIVATE_HEADERS_PATH}\"\nrsync -av --no-owner --no-group --prune-empty-dirs --exclude \".svn\" --exclude \"usr\" --exclude \"DerivedSources\" --include \"*/\" --include \"*.h\" --exclude \"*\" \"${SRCROOT}/wtf/\" \"${PRIVATE_HEADERS_PATH}\"\n\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -1314,6 +1348,7 @@
A8A47421151A825B004123FF /* SHA1.cpp in Sources */,
A8A47425151A825B004123FF /* SizeLimits.cpp in Sources */,
A8A47427151A825B004123FF /* StackBounds.cpp in Sources */,
+ FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */,
A8A4743C151A825B004123FF /* StringBuilder.cpp in Sources */,
A8A4742B151A825B004123FF /* StringExtras.cpp in Sources */,
A8A47440151A825B004123FF /* StringImpl.cpp in Sources */,
@@ -1351,6 +1386,14 @@
};
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ 65AFA28E1630B99E003D723C /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 65AFA16F1630B977003D723C /* Copy WTF Headers */;
+ targetProxy = 65AFA28D1630B99E003D723C /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin XCBuildConfiguration section */
5D247B6414689B8600E78B76 /* Debug */ = {
isa = XCBuildConfiguration;
@@ -1398,6 +1441,30 @@
};
name = Production;
};
+ 65AFA2891630B977003D723C /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ 65AFA28A1630B977003D723C /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+ 65AFA28B1630B977003D723C /* Production */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Production;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -1421,6 +1488,16 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Production;
};
+ 65AFA2881630B977003D723C /* Build configuration list for PBXAggregateTarget "Copy WTF Headers" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 65AFA2891630B977003D723C /* Debug */,
+ 65AFA28A1630B977003D723C /* Release */,
+ 65AFA28B1630B977003D723C /* Production */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Production;
+ };
/* End XCConfigurationList section */
};
rootObject = 5D247B5914689B8600E78B76 /* Project object */;
diff --git a/Source/WTF/wtf/Deque.h b/Source/WTF/wtf/Deque.h
index be69c81db..e5c47b63e 100644
--- a/Source/WTF/wtf/Deque.h
+++ b/Source/WTF/wtf/Deque.h
@@ -33,6 +33,7 @@
// FIXME: Could move what Vector and Deque share into a separate file.
// Deque doesn't actually use Vector.
+#include <iterator>
#include <wtf/PassTraits.h>
#include <wtf/Vector.h>
@@ -41,8 +42,6 @@ namespace WTF {
template<typename T, size_t inlineCapacity> class DequeIteratorBase;
template<typename T, size_t inlineCapacity> class DequeIterator;
template<typename T, size_t inlineCapacity> class DequeConstIterator;
- template<typename T, size_t inlineCapacity> class DequeReverseIterator;
- template<typename T, size_t inlineCapacity> class DequeConstReverseIterator;
template<typename T, size_t inlineCapacity = 0>
class Deque {
@@ -50,8 +49,8 @@ namespace WTF {
public:
typedef DequeIterator<T, inlineCapacity> iterator;
typedef DequeConstIterator<T, inlineCapacity> const_iterator;
- typedef DequeReverseIterator<T, inlineCapacity> reverse_iterator;
- typedef DequeConstReverseIterator<T, inlineCapacity> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef PassTraits<T> Pass;
typedef typename PassTraits<T>::PassType PassType;
@@ -69,10 +68,10 @@ namespace WTF {
iterator end() { return iterator(this, m_end); }
const_iterator begin() const { return const_iterator(this, m_start); }
const_iterator end() const { return const_iterator(this, m_end); }
- reverse_iterator rbegin() { return reverse_iterator(this, m_end); }
- reverse_iterator rend() { return reverse_iterator(this, m_start); }
- const_reverse_iterator rbegin() const { return const_reverse_iterator(this, m_end); }
- const_reverse_iterator rend() const { return const_reverse_iterator(this, m_start); }
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
T& first() { ASSERT(m_start != m_end); return m_buffer.buffer()[m_start]; }
const T& first() const { ASSERT(m_start != m_end); return m_buffer.buffer()[m_start]; }
@@ -117,17 +116,14 @@ namespace WTF {
template<typename T, size_t inlineCapacity = 0>
class DequeIteratorBase {
- private:
- typedef DequeIteratorBase<T, inlineCapacity> Base;
-
protected:
DequeIteratorBase();
DequeIteratorBase(const Deque<T, inlineCapacity>*, size_t);
- DequeIteratorBase(const Base&);
- Base& operator=(const Base&);
+ DequeIteratorBase(const DequeIteratorBase&);
+ DequeIteratorBase& operator=(const DequeIteratorBase&);
~DequeIteratorBase();
- void assign(const Base& other) { *this = other; }
+ void assign(const DequeIteratorBase& other) { *this = other; }
void increment();
void decrement();
@@ -135,13 +131,13 @@ namespace WTF {
T* before() const;
T* after() const;
- bool isEqual(const Base&) const;
+ bool isEqual(const DequeIteratorBase&) const;
private:
void addToIteratorsList();
void removeFromIteratorsList();
void checkValidity() const;
- void checkValidity(const Base&) const;
+ void checkValidity(const DequeIteratorBase&) const;
Deque<T, inlineCapacity>* m_deque;
size_t m_index;
@@ -161,6 +157,12 @@ namespace WTF {
typedef DequeIterator<T, inlineCapacity> Iterator;
public:
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef T* pointer;
+ typedef T& reference;
+ typedef std::bidirectional_iterator_tag iterator_category;
+
DequeIterator(Deque<T, inlineCapacity>* deque, size_t index) : Base(deque, index) { }
DequeIterator(const Iterator& other) : Base(other) { }
@@ -186,6 +188,12 @@ namespace WTF {
typedef DequeIterator<T, inlineCapacity> NonConstIterator;
public:
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T* pointer;
+ typedef const T& reference;
+ typedef std::bidirectional_iterator_tag iterator_category;
+
DequeConstIterator(const Deque<T, inlineCapacity>* deque, size_t index) : Base(deque, index) { }
DequeConstIterator(const Iterator& other) : Base(other) { }
@@ -205,57 +213,6 @@ namespace WTF {
// postfix -- intentionally omitted
};
- template<typename T, size_t inlineCapacity = 0>
- class DequeReverseIterator : public DequeIteratorBase<T, inlineCapacity> {
- private:
- typedef DequeIteratorBase<T, inlineCapacity> Base;
- typedef DequeReverseIterator<T, inlineCapacity> Iterator;
-
- public:
- DequeReverseIterator(const Deque<T, inlineCapacity>* deque, size_t index) : Base(deque, index) { }
-
- DequeReverseIterator(const Iterator& other) : Base(other) { }
- DequeReverseIterator& operator=(const Iterator& other) { Base::assign(other); return *this; }
-
- T& operator*() const { return *Base::before(); }
- T* operator->() const { return Base::before(); }
-
- bool operator==(const Iterator& other) const { return Base::isEqual(other); }
- bool operator!=(const Iterator& other) const { return !Base::isEqual(other); }
-
- Iterator& operator++() { Base::decrement(); return *this; }
- // postfix ++ intentionally omitted
- Iterator& operator--() { Base::increment(); return *this; }
- // postfix -- intentionally omitted
- };
-
- template<typename T, size_t inlineCapacity = 0>
- class DequeConstReverseIterator : public DequeIteratorBase<T, inlineCapacity> {
- private:
- typedef DequeIteratorBase<T, inlineCapacity> Base;
- typedef DequeConstReverseIterator<T, inlineCapacity> Iterator;
- typedef DequeReverseIterator<T, inlineCapacity> NonConstIterator;
-
- public:
- DequeConstReverseIterator(const Deque<T, inlineCapacity>* deque, size_t index) : Base(deque, index) { }
-
- DequeConstReverseIterator(const Iterator& other) : Base(other) { }
- DequeConstReverseIterator(const NonConstIterator& other) : Base(other) { }
- DequeConstReverseIterator& operator=(const Iterator& other) { Base::assign(other); return *this; }
- DequeConstReverseIterator& operator=(const NonConstIterator& other) { Base::assign(other); return *this; }
-
- const T& operator*() const { return *Base::before(); }
- const T* operator->() const { return Base::before(); }
-
- bool operator==(const Iterator& other) const { return Base::isEqual(other); }
- bool operator!=(const Iterator& other) const { return !Base::isEqual(other); }
-
- Iterator& operator++() { Base::decrement(); return *this; }
- // postfix ++ intentionally omitted
- Iterator& operator--() { Base::increment(); return *this; }
- // postfix -- intentionally omitted
- };
-
#ifdef NDEBUG
template<typename T, size_t inlineCapacity> inline void Deque<T, inlineCapacity>::checkValidity() const { }
template<typename T, size_t inlineCapacity> inline void Deque<T, inlineCapacity>::checkIndexValidity(size_t) const { }
@@ -540,7 +497,7 @@ namespace WTF {
}
template<typename T, size_t inlineCapacity>
- void DequeIteratorBase<T, inlineCapacity>::checkValidity(const Base& other) const
+ void DequeIteratorBase<T, inlineCapacity>::checkValidity(const DequeIteratorBase& other) const
{
checkValidity();
other.checkValidity();
@@ -602,7 +559,7 @@ namespace WTF {
}
template<typename T, size_t inlineCapacity>
- inline DequeIteratorBase<T, inlineCapacity>::DequeIteratorBase(const Base& other)
+ inline DequeIteratorBase<T, inlineCapacity>::DequeIteratorBase(const DequeIteratorBase& other)
: m_deque(other.m_deque)
, m_index(other.m_index)
{
@@ -611,7 +568,7 @@ namespace WTF {
}
template<typename T, size_t inlineCapacity>
- inline DequeIteratorBase<T, inlineCapacity>& DequeIteratorBase<T, inlineCapacity>::operator=(const Base& other)
+ inline DequeIteratorBase<T, inlineCapacity>& DequeIteratorBase<T, inlineCapacity>::operator=(const DequeIteratorBase& other)
{
other.checkValidity();
removeFromIteratorsList();
@@ -633,7 +590,7 @@ namespace WTF {
}
template<typename T, size_t inlineCapacity>
- inline bool DequeIteratorBase<T, inlineCapacity>::isEqual(const Base& other) const
+ inline bool DequeIteratorBase<T, inlineCapacity>::isEqual(const DequeIteratorBase& other) const
{
checkValidity(other);
return m_index == other.m_index;
diff --git a/Source/WTF/wtf/MemoryInstrumentation.h b/Source/WTF/wtf/MemoryInstrumentation.h
index 0b7c21731..7ea5cc65f 100644
--- a/Source/WTF/wtf/MemoryInstrumentation.h
+++ b/Source/WTF/wtf/MemoryInstrumentation.h
@@ -54,12 +54,14 @@ public:
: m_memoryInstrumentation(memoryInstrumentation)
, m_objectType(ownerObjectType)
, m_objectSize(0)
+ , m_pointer(0)
{ }
typedef MemoryClassInfo ClassInfo;
MemoryObjectType objectType() const { return m_objectType; }
size_t objectSize() const { return m_objectSize; }
+ const void* reportedPointer() const { return m_pointer; }
MemoryInstrumentation* memoryInstrumentation() { return m_memoryInstrumentation; }
@@ -67,10 +69,11 @@ private:
friend class MemoryClassInfo;
friend class MemoryInstrumentation;
- template<typename T> void reportObjectInfo(MemoryObjectType objectType, size_t actualSize)
+ void reportObjectInfo(const void* pointer, MemoryObjectType objectType, size_t objectSize)
{
if (!m_objectSize) {
- m_objectSize = actualSize ? actualSize : sizeof(T);
+ m_pointer = pointer;
+ m_objectSize = objectSize;
if (objectType)
m_objectType = objectType;
}
@@ -79,6 +82,7 @@ private:
MemoryInstrumentation* m_memoryInstrumentation;
MemoryObjectType m_objectType;
size_t m_objectSize;
+ const void* m_pointer;
};
template<typename T> void reportMemoryUsage(const T* const&, MemoryObjectInfo*);
@@ -86,7 +90,7 @@ template<typename T> void reportMemoryUsage(const T* const&, MemoryObjectInfo*);
class MemoryInstrumentationClient {
public:
virtual ~MemoryInstrumentationClient() { }
- virtual void countObjectSize(MemoryObjectType, size_t) = 0;
+ virtual void countObjectSize(const void*, MemoryObjectType, size_t) = 0;
virtual bool visited(const void*) = 0;
virtual void checkCountedObject(const void*) = 0;
};
@@ -110,7 +114,7 @@ protected:
};
private:
- void countObjectSize(MemoryObjectType objectType, size_t size) { m_client->countObjectSize(objectType, size); }
+ void countObjectSize(const void* object, MemoryObjectType objectType, size_t size) { m_client->countObjectSize(object, objectType, size); }
bool visited(const void* pointer) { return m_client->visited(pointer); }
void checkCountedObject(const void* pointer) { return m_client->checkCountedObject(pointer); }
@@ -135,9 +139,9 @@ private:
}
template<typename T, typename Type>
- static void reportObjectMemoryUsage(const T* const&, MemoryObjectInfo* memoryObjectInfo, ...)
+ static void reportObjectMemoryUsage(const T* const& object, MemoryObjectInfo* memoryObjectInfo, ...)
{
- memoryObjectInfo->reportObjectInfo<T>(0, sizeof(T));
+ memoryObjectInfo->reportObjectInfo(object, 0, sizeof(T));
}
template<typename T>
@@ -159,7 +163,7 @@ private:
{
if (!buffer || visited(buffer))
return;
- countObjectSize(ownerObjectType, size);
+ countObjectSize(buffer, ownerObjectType, size);
}
template<typename T>
@@ -188,18 +192,18 @@ private:
class MemoryClassInfo {
public:
template<typename T>
- MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T*, MemoryObjectType objectType = 0, size_t actualSize = 0)
+ MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T* pointer, MemoryObjectType objectType = 0, size_t actualSize = 0)
: m_memoryObjectInfo(memoryObjectInfo)
, m_memoryInstrumentation(memoryObjectInfo->memoryInstrumentation())
{
- m_memoryObjectInfo->reportObjectInfo<T>(objectType, actualSize);
+ m_memoryObjectInfo->reportObjectInfo(pointer, objectType, actualSize ? actualSize : sizeof(T));
m_objectType = memoryObjectInfo->objectType();
}
template<typename M> void addMember(const M& member) { m_memoryInstrumentation->addObject(member, m_objectType); }
template<typename ListHashSetType> void addListHashSet(const ListHashSetType& set) { m_memoryInstrumentation->addListHashSet(set, m_objectType, true); }
void addRawBuffer(const void* const& buffer, size_t size) { m_memoryInstrumentation->addRawBuffer(buffer, m_objectType, size); }
- void addPrivateBuffer(size_t size) { m_memoryInstrumentation->countObjectSize(m_objectType, size); }
+ void addPrivateBuffer(size_t size) { m_memoryInstrumentation->countObjectSize(0, m_objectType, size); }
void addWeakPointer(void*) { }
@@ -232,20 +236,16 @@ void MemoryInstrumentation::addObjectImpl(const T* const& object, MemoryObjectTy
template<typename T>
void MemoryInstrumentation::addObjectImpl(const OwnPtr<T>* const& object, MemoryObjectType ownerObjectType, MemoryOwningType owningType)
{
- if (owningType == byPointer && !visited(object)) {
- countObjectSize(ownerObjectType, sizeof(*object));
- checkCountedObject(object);
- }
+ if (owningType == byPointer && !visited(object))
+ countObjectSize(object, ownerObjectType, sizeof(*object));
addObjectImpl(object->get(), ownerObjectType, byPointer);
}
template<typename T>
void MemoryInstrumentation::addObjectImpl(const RefPtr<T>* const& object, MemoryObjectType ownerObjectType, MemoryOwningType owningType)
{
- if (owningType == byPointer && !visited(object)) {
- countObjectSize(ownerObjectType, sizeof(*object));
- checkCountedObject(object);
- }
+ if (owningType == byPointer && !visited(object))
+ countObjectSize(object, ownerObjectType, sizeof(*object));
addObjectImpl(object->get(), ownerObjectType, byPointer);
}
@@ -255,7 +255,7 @@ void MemoryInstrumentation::addListHashSet(const ListHashSetType& hashSet, Memor
if (visited(&hashSet))
return;
size_t size = (contentOnly ? 0 : sizeof(ListHashSetType)) + hashSet.capacity() * sizeof(void*) + hashSet.size() * (sizeof(typename ListHashSetType::ValueType) + 2 * sizeof(void*));
- countObjectSize(ownerObjectType, size);
+ countObjectSize(&hashSet, ownerObjectType, size);
}
template<typename T>
@@ -263,7 +263,12 @@ void MemoryInstrumentation::InstrumentedPointer<T>::process(MemoryInstrumentatio
{
MemoryObjectInfo memoryObjectInfo(memoryInstrumentation, m_ownerObjectType);
reportMemoryUsage(m_pointer, &memoryObjectInfo);
- memoryInstrumentation->countObjectSize(memoryObjectInfo.objectType(), memoryObjectInfo.objectSize());
+
+ const void* pointer = memoryObjectInfo.reportedPointer();
+ ASSERT(pointer);
+ if (pointer != m_pointer && memoryInstrumentation->visited(pointer))
+ return;
+ memoryInstrumentation->countObjectSize(pointer, memoryObjectInfo.objectType(), memoryObjectInfo.objectSize());
}
// Link time guard for classes with external memory instrumentation.
diff --git a/Source/WTF/wtf/StackBounds.h b/Source/WTF/wtf/StackBounds.h
index afce8606f..185afec22 100644
--- a/Source/WTF/wtf/StackBounds.h
+++ b/Source/WTF/wtf/StackBounds.h
@@ -30,9 +30,15 @@
namespace WTF {
class StackBounds {
- // recursionCheck() / recursionLimit() tests (by default)
+ // isSafeToRecurse() / recursionLimit() tests (by default)
// that we are at least this far from the end of the stack.
- const static size_t s_defaultAvailabilityDelta = 4096;
+ //
+ // This 64k number was picked because a sampling of stack usage differences
+ // between consecutive entries into one of the Interpreter::execute...()
+ // functions was seen to be as high as 27k. Hence, 64k is chosen as a
+ // conservative availability value that is not too large but comfortably
+ // exceeds 27k with some buffer for error.
+ const static size_t s_defaultAvailabilityDelta = 64 * 1024;
public:
StackBounds()
@@ -62,6 +68,13 @@ public:
return currentPosition;
}
+ size_t size() const
+ {
+ return isGrowingDownward()
+ ? static_cast<char*>(m_origin) - static_cast<char*>(m_bound)
+ : static_cast<char*>(m_bound) - static_cast<char*>(m_origin);
+ }
+
void* recursionLimit(size_t minAvailableDelta = s_defaultAvailabilityDelta) const
{
checkConsistency();
@@ -70,7 +83,7 @@ public:
: static_cast<char*>(m_bound) - minAvailableDelta;
}
- bool recursionCheck(size_t minAvailableDelta = s_defaultAvailabilityDelta) const
+ bool isSafeToRecurse(size_t minAvailableDelta = s_defaultAvailabilityDelta) const
{
checkConsistency();
return isGrowingDownward()
@@ -105,6 +118,8 @@ private:
void* m_origin;
void* m_bound;
+
+ friend class StackStats;
};
} // namespace WTF
diff --git a/Source/WTF/wtf/StackStats.cpp b/Source/WTF/wtf/StackStats.cpp
new file mode 100644
index 000000000..0bc11ed7b
--- /dev/null
+++ b/Source/WTF/wtf/StackStats.cpp
@@ -0,0 +1,309 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "StackStats.h"
+
+#if ENABLE(STACK_STATS)
+
+#include "Assertions.h"
+#include "DataLog.h"
+#include "WTFThreadData.h"
+
+// Define the following flag if you want to collect stats on every single
+// checkpoint. By default, we only log checkpoints that establish new
+// max values.
+
+// #define ENABLE_VERBOSE_STACK_STATS 1
+
+
+namespace WTF {
+
+// CheckPoint management:
+Mutex* StackStats::s_sharedLock = 0;
+StackStats::CheckPoint* StackStats::s_topCheckPoint = 0;
+StackStats::LayoutCheckPoint* StackStats::s_firstLayoutCheckPoint = 0;
+StackStats::LayoutCheckPoint* StackStats::s_topLayoutCheckPoint = 0;
+
+// High watermark stats:
+int StackStats::s_maxCheckPointDiff = 0;
+int StackStats::s_maxStackHeight = 0;
+int StackStats::s_maxReentryDepth = 0;
+
+int StackStats::s_maxLayoutCheckPointDiff = 0;
+int StackStats::s_maxTotalLayoutCheckPointDiff = 0;
+int StackStats::s_maxLayoutReentryDepth = 0;
+
+
+// Initializes locks and the log. Should only be called once.
+void StackStats::initialize()
+{
+ s_sharedLock = new Mutex();
+ dataLog(" === LOG new stack stats ========\n");
+}
+
+StackStats::PerThreadStats::PerThreadStats()
+{
+ const StackBounds& stack = wtfThreadData().stack();
+ m_reentryDepth = 0;
+ m_stackStart = (char*)stack.origin();
+ m_currentCheckPoint = 0;
+
+ dataLog(" === THREAD new stackStart %p ========\n", m_stackStart);
+}
+
+StackStats::CheckPoint::CheckPoint()
+{
+ MutexLocker locker(*StackStats::s_sharedLock);
+ WTFThreadData* threadData = const_cast<WTFThreadData*>(&wtfThreadData());
+ StackStats::PerThreadStats& t = threadData->stackStats();
+ const StackBounds& stack = threadData->stack();
+
+ bool isGrowingDownward = stack.isGrowingDownward();
+ bool needToLog = false;
+ char* current = reinterpret_cast<char*>(this);
+ char* last = reinterpret_cast<char*>(t.m_currentCheckPoint);
+
+ // If there was no previous checkpoint, measure from the start of the stack:
+ if (!last)
+ last = t.m_stackStart;
+
+ // Update the reentry depth stats:
+ t.m_reentryDepth++;
+ if (t.m_reentryDepth > StackStats::s_maxReentryDepth) {
+ StackStats::s_maxReentryDepth = t.m_reentryDepth;
+ needToLog = true;
+ }
+
+ // Update the stack height stats:
+ int height = t.m_stackStart - current;
+ if (!isGrowingDownward)
+ height = -height;
+ if (height > StackStats::s_maxStackHeight) {
+ StackStats::s_maxStackHeight = height;
+ needToLog = true;
+ }
+
+ // Update the checkpoint diff stats:
+ int diff = last - current;
+ if (!isGrowingDownward)
+ diff = -diff;
+ if (diff > StackStats::s_maxCheckPointDiff) {
+ StackStats::s_maxCheckPointDiff = diff;
+ needToLog = true;
+ }
+
+ // Push this checkpoint:
+ m_prev = t.m_currentCheckPoint;
+ t.m_currentCheckPoint = this;
+
+#if ENABLE(VERBOSE_STACK_STATS)
+ needToLog = true; // always log.
+#endif
+
+ // Log this checkpoint if needed:
+ if (needToLog)
+ dataLog(" CHECKPOINT %p diff %d/%.1fk/max %.1fk | reentry %d/max %d | height %.1fk/max %.1fk | stack %p size %.1fk\n",
+ this, diff, diff / 1024.0, StackStats::s_maxCheckPointDiff / 1024.0,
+ t.m_reentryDepth, StackStats::s_maxReentryDepth,
+ height / 1024.0, StackStats::s_maxStackHeight / 1024.0,
+ stack.origin(), stack.size() / 1024.0);
+}
+
+StackStats::CheckPoint::~CheckPoint()
+{
+ MutexLocker locker(*StackStats::s_sharedLock);
+ WTFThreadData* threadData = const_cast<WTFThreadData*>(&wtfThreadData());
+ StackStats::PerThreadStats& t = threadData->stackStats();
+
+ // Pop to previous checkpoint:
+ t.m_currentCheckPoint = m_prev;
+ --t.m_reentryDepth;
+
+ // Log this checkpoint if needed:
+#if ENABLE(VERBOSE_STACK_STATS)
+ if (!m_prev) {
+ const StackBounds& stack = threadData->stack();
+ bool isGrowingDownward = stack.isGrowingDownward();
+
+ char* current = reinterpret_cast<char*>(this);
+ int height = t.m_stackStart - current;
+
+ if (!isGrowingDownward)
+ height = -height;
+
+ dataLog(" POP to %p diff max %.1fk | reentry %d/%d max | height %.1fk/max %.1fk | stack %p size %.1fk)\n",
+ this, StackStats::s_maxCheckPointDiff / 1024.0,
+ t.m_reentryDepth, StackStats::s_maxReentryDepth,
+ height / 1024.0, StackStats::s_maxStackHeight / 1024.0,
+ stack.origin(), stack.size() / 1024.0);
+ }
+#endif
+}
+
+void StackStats::probe()
+{
+ MutexLocker locker(*StackStats::s_sharedLock);
+ WTFThreadData* threadData = const_cast<WTFThreadData*>(&wtfThreadData());
+ StackStats::PerThreadStats& t = threadData->stackStats();
+ const StackBounds& stack = threadData->stack();
+
+ bool isGrowingDownward = stack.isGrowingDownward();
+
+ bool needToLog = false;
+
+ int dummy;
+ char* current = reinterpret_cast<char*>(&dummy);
+ char* last = reinterpret_cast<char*>(t.m_currentCheckPoint);
+
+ // If there was no previous checkpoint, measure from the start of the stack:
+ if (!last)
+ last = t.m_stackStart;
+
+ // We did not reach another checkpoint yet. Hence, we do not touch the
+ // reentry stats.
+
+ // Update the stack height stats:
+ int height = t.m_stackStart - current;
+ if (!isGrowingDownward)
+ height = -height;
+ if (height > StackStats::s_maxStackHeight) {
+ StackStats::s_maxStackHeight = height;
+ needToLog = true;
+ }
+
+ // Update the checkpoint diff stats:
+ int diff = last - current;
+ if (!isGrowingDownward)
+ diff = -diff;
+ if (diff > StackStats::s_maxCheckPointDiff) {
+ StackStats::s_maxCheckPointDiff = diff;
+ needToLog = true;
+ }
+
+#if ENABLE(VERBOSE_STACK_STATS)
+ needToLog = true; // always log.
+#endif
+
+ if (needToLog)
+ dataLog(" PROBE %p diff %d/%.1fk/max %.1fk | reentry %d/max %d | height %.1fk/max %.1fk | stack %p size %.1fk\n",
+ current, diff, diff / 1024.0, StackStats::s_maxCheckPointDiff / 1024.0,
+ t.m_reentryDepth, StackStats::s_maxReentryDepth,
+ height / 1024.0, StackStats::s_maxStackHeight / 1024.0,
+ stack.origin(), stack.size() / 1024.0);
+}
+
+StackStats::LayoutCheckPoint::LayoutCheckPoint()
+{
+ // While a layout checkpoint is not necessarily a checkpoint where we
+ // we will do a recursion check, it is a convenient spot for doing a
+ // probe to measure the height of stack usage.
+ //
+ // We'll do this probe before we commence with the layout checkpoint.
+ // This is because the probe also locks the sharedLock. By calling the
+ // probe first, we can avoid re-entering the lock.
+ StackStats::probe();
+
+ MutexLocker locker(*StackStats::s_sharedLock);
+ WTFThreadData* threadData = const_cast<WTFThreadData*>(&wtfThreadData());
+ StackStats::PerThreadStats& t = threadData->stackStats();
+ const StackBounds& stack = threadData->stack();
+
+ bool isGrowingDownward = stack.isGrowingDownward();
+
+ // Push this checkpoint:
+ m_prev = StackStats::s_topLayoutCheckPoint;
+ if (m_prev)
+ m_depth = m_prev->m_depth + 1;
+ else {
+ StackStats::s_firstLayoutCheckPoint = this;
+ m_depth = 0;
+ }
+ StackStats::s_topLayoutCheckPoint = this;
+
+ //
+ char* current = reinterpret_cast<char*>(this);
+ char* last = reinterpret_cast<char*>(m_prev);
+ char* root = reinterpret_cast<char*>(StackStats::s_firstLayoutCheckPoint);
+ bool needToLog = false;
+
+ int diff = last - current;
+ if (!last)
+ diff = 0;
+ int totalDiff = root - current;
+ if (!root)
+ totalDiff = 0;
+
+ // Update the stack height stats:
+ int height = t.m_stackStart - current;
+ if (!isGrowingDownward)
+ height = -height;
+ if (height > StackStats::s_maxStackHeight) {
+ StackStats::s_maxStackHeight = height;
+ needToLog = true;
+ }
+
+ // Update the layout checkpoint diff stats:
+ if (!isGrowingDownward)
+ diff = -diff;
+ if (diff > StackStats::s_maxLayoutCheckPointDiff) {
+ StackStats::s_maxLayoutCheckPointDiff = diff;
+ needToLog = true;
+ }
+
+ // Update the total layout checkpoint diff stats:
+ if (!isGrowingDownward)
+ totalDiff = -totalDiff;
+ if (totalDiff > StackStats::s_maxTotalLayoutCheckPointDiff) {
+ StackStats::s_maxTotalLayoutCheckPointDiff = totalDiff;
+ needToLog = true;
+ }
+
+#if ENABLE(VERBOSE_STACK_STATS)
+ needToLog = true; // always log.
+#endif
+
+ if (needToLog)
+ dataLog(" LAYOUT %p diff %d/%.1fk/max %.1fk | reentry %d/max %d | height %.1fk/max %.1fk | stack %p size %.1fk\n",
+ current, diff, diff / 1024.0, StackStats::s_maxLayoutCheckPointDiff / 1024.0,
+ m_depth, StackStats::s_maxLayoutReentryDepth,
+ totalDiff / 1024.0, StackStats::s_maxTotalLayoutCheckPointDiff / 1024.0,
+ stack.origin(), stack.size() / 1024.0);
+}
+
+StackStats::LayoutCheckPoint::~LayoutCheckPoint()
+{
+ MutexLocker locker(*StackStats::s_sharedLock);
+
+ // Pop to the previous layout checkpoint:
+ StackStats::s_topLayoutCheckPoint = m_prev;
+ if (!m_depth)
+ StackStats::s_firstLayoutCheckPoint = 0;
+}
+
+} // namespace WTF
+
+#endif // ENABLE(STACK_STATS)
+
diff --git a/Source/WTF/wtf/StackStats.h b/Source/WTF/wtf/StackStats.h
new file mode 100644
index 000000000..263567974
--- /dev/null
+++ b/Source/WTF/wtf/StackStats.h
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StackStats_h
+#define StackStats_h
+
+#include "ExportMacros.h"
+#include "ThreadingPrimitives.h"
+
+
+// Define this flag to enable Stack stats collection. This feature is useful
+// for getting a sample of native stack usage sizes.
+//
+// Enabling this will cause stats to be collected and written to a log file at
+// various instrumented points in the code. It will result in noticeable
+// performance loss. Hence, this should only be enable when you want to do
+// some stats location in your local build. This code is provided here as a
+// convenience for collecting that data. It is not meant to be enabled by
+// default on release or debug builds.
+
+// #define ENABLE_STACK_STATS 1
+
+
+namespace WTF {
+
+#if !ENABLE(STACK_STATS)
+
+class StackStats {
+public:
+ // The CheckPoint class is for marking check points corresponding
+ // each location in code where a stack recursion check is being done.
+
+ class CheckPoint {
+ public:
+ CheckPoint() { }
+ };
+
+ class PerThreadStats {
+ public:
+ PerThreadStats() { }
+ };
+
+ class LayoutCheckPoint {
+ public:
+ LayoutCheckPoint() { }
+ };
+
+ static void initialize() { }
+ static void probe() { }
+};
+
+#else // ENABLE(STACK_STATS)
+
+class StackStats {
+public:
+ // The CheckPoint class is for marking check points corresponding
+ // each location in code where a stack recursion check is being done.
+
+ class CheckPoint {
+ public:
+ CheckPoint();
+ ~CheckPoint();
+ private:
+ CheckPoint* m_prev;
+ };
+
+ class PerThreadStats {
+ public:
+ PerThreadStats();
+
+ private:
+ int m_reentryDepth;
+ char* m_stackStart;
+ CheckPoint* m_currentCheckPoint;
+
+ friend class CheckPoint;
+ friend class StackStats;
+ };
+
+ class LayoutCheckPoint {
+ public:
+ WTF_EXPORT_PRIVATE LayoutCheckPoint();
+ WTF_EXPORT_PRIVATE ~LayoutCheckPoint();
+
+ private:
+ LayoutCheckPoint* m_prev;
+ int m_depth;
+ };
+
+ // Initializes locks and the log file. Should only be called once.
+ static void initialize();
+
+ // Used for probing the stack at places where we suspect to be high
+ // points of stack usage but are NOT check points where stack recursion
+ // is checked.
+ //
+ // The more places where we add this probe, the more accurate our
+ // stats data will be. However, adding too many probes will also
+ // result in unnecessary performance loss. So, only add these probes
+ // judiciously where appropriate.
+ static void probe();
+
+private:
+ // CheckPoint management:
+ static Mutex* s_sharedLock;
+ static CheckPoint* s_topCheckPoint;
+ static LayoutCheckPoint* s_firstLayoutCheckPoint;
+ static LayoutCheckPoint* s_topLayoutCheckPoint;
+
+ // High watermark stats:
+ static int s_maxCheckPointDiff;
+ static int s_maxStackHeight;
+ static int s_maxReentryDepth;
+
+ static int s_maxLayoutCheckPointDiff;
+ static int s_maxTotalLayoutCheckPointDiff;
+ static int s_maxLayoutReentryDepth;
+
+ friend class CheckPoint;
+ friend class LayoutCheckPoint;
+};
+
+#endif // ENABLE(STACK_STATS)
+
+} // namespace WTF
+
+using WTF::StackStats;
+
+#endif // StackStats_h
diff --git a/Source/WTF/wtf/ThreadingPthreads.cpp b/Source/WTF/wtf/ThreadingPthreads.cpp
index b70ccdd9a..1dd84f0ed 100644
--- a/Source/WTF/wtf/ThreadingPthreads.cpp
+++ b/Source/WTF/wtf/ThreadingPthreads.cpp
@@ -39,6 +39,7 @@
#include "dtoa/cached-powers.h"
#include "HashMap.h"
#include "RandomNumberSeed.h"
+#include "StackStats.h"
#include "StdLibExtras.h"
#include "ThreadFunctionInvocation.h"
#include "ThreadIdentifierDataPthreads.h"
@@ -138,6 +139,7 @@ void initializeThreading()
threadMapMutex();
initializeRandomNumberGenerator();
ThreadIdentifierData::initializeOnce();
+ StackStats::initialize();
wtfThreadData();
s_dtoaP5Mutex = new Mutex;
initializeDates();
diff --git a/Source/WTF/wtf/WTFThreadData.cpp b/Source/WTF/wtf/WTFThreadData.cpp
index 3a903f895..7d9074844 100644
--- a/Source/WTF/wtf/WTFThreadData.cpp
+++ b/Source/WTF/wtf/WTFThreadData.cpp
@@ -38,7 +38,10 @@ WTFThreadData::WTFThreadData()
, m_defaultIdentifierTable(new JSC::IdentifierTable())
, m_currentIdentifierTable(m_defaultIdentifierTable)
, m_stackBounds(StackBounds::currentThreadStackBounds())
+#if ENABLE(STACK_STATS)
+ , m_stackStats()
#endif
+#endif // USE(JSC)
{
}
diff --git a/Source/WTF/wtf/WTFThreadData.h b/Source/WTF/wtf/WTFThreadData.h
index dbc5ba6ac..9c2a5db41 100644
--- a/Source/WTF/wtf/WTFThreadData.h
+++ b/Source/WTF/wtf/WTFThreadData.h
@@ -31,6 +31,7 @@
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include <wtf/StackBounds.h>
+#include <wtf/StackStats.h>
#include <wtf/text/StringHash.h>
#include <wtf/ThreadSpecific.h>
#include <wtf/Threading.h>
@@ -108,7 +109,14 @@ public:
{
return m_stackBounds;
}
+
+#if ENABLE(STACK_STATS)
+ StackStats::PerThreadStats& stackStats()
+ {
+ return m_stackStats;
+ }
#endif
+#endif // USE(JSC)
private:
AtomicStringTable* m_atomicStringTable;
@@ -118,7 +126,10 @@ private:
JSC::IdentifierTable* m_defaultIdentifierTable;
JSC::IdentifierTable* m_currentIdentifierTable;
StackBounds m_stackBounds;
+#if ENABLE(STACK_STATS)
+ StackStats::PerThreadStats m_stackStats;
#endif
+#endif // USE(JSC)
static WTF_EXPORTDATA ThreadSpecific<WTFThreadData>* staticData;
friend WTFThreadData& wtfThreadData();
diff --git a/Source/WTF/wtf/unicode/UTF8.cpp b/Source/WTF/wtf/unicode/UTF8.cpp
index 6bec4051b..cb3039a53 100644
--- a/Source/WTF/wtf/unicode/UTF8.cpp
+++ b/Source/WTF/wtf/unicode/UTF8.cpp
@@ -297,11 +297,12 @@ static inline UChar32 readUTF8Sequence(const char*& sequence, unsigned length)
ConversionResult convertUTF8ToUTF16(
const char** sourceStart, const char* sourceEnd,
- UChar** targetStart, UChar* targetEnd, bool strict)
+ UChar** targetStart, UChar* targetEnd, bool* sourceAllASCII, bool strict)
{
ConversionResult result = conversionOK;
const char* source = *sourceStart;
UChar* target = *targetStart;
+ UChar orAllData = 0;
while (source < sourceEnd) {
int utf8SequenceLength = inlineUTF8SequenceLength(*source);
if (sourceEnd - source < utf8SequenceLength) {
@@ -329,10 +330,14 @@ ConversionResult convertUTF8ToUTF16(
source -= utf8SequenceLength; // return to the illegal value itself
result = sourceIllegal;
break;
- } else
+ } else {
*target++ = replacementCharacter;
- } else
+ orAllData |= replacementCharacter;
+ }
+ } else {
*target++ = character; // normal case
+ orAllData |= character;
+ }
} else if (U_IS_SUPPLEMENTARY(character)) {
// target is a character in range 0xFFFF - 0x10FFFF
if (target + 1 >= targetEnd) {
@@ -342,17 +347,24 @@ ConversionResult convertUTF8ToUTF16(
}
*target++ = U16_LEAD(character);
*target++ = U16_TRAIL(character);
+ orAllData = 0xffff;
} else {
if (strict) {
source -= utf8SequenceLength; // return to the start
result = sourceIllegal;
break; // Bail out; shouldn't continue
- } else
+ } else {
*target++ = replacementCharacter;
+ orAllData |= replacementCharacter;
+ }
}
}
*sourceStart = source;
*targetStart = target;
+
+ if (sourceAllASCII)
+ *sourceAllASCII = !(orAllData & 0x7f);
+
return result;
}
diff --git a/Source/WTF/wtf/unicode/UTF8.h b/Source/WTF/wtf/unicode/UTF8.h
index 33497daf6..1fc21baad 100644
--- a/Source/WTF/wtf/unicode/UTF8.h
+++ b/Source/WTF/wtf/unicode/UTF8.h
@@ -64,7 +64,7 @@ namespace Unicode {
WTF_EXPORT_PRIVATE ConversionResult convertUTF8ToUTF16(
const char** sourceStart, const char* sourceEnd,
- UChar** targetStart, UChar* targetEnd, bool strict = true);
+ UChar** targetStart, UChar* targetEnd, bool* isSourceAllASCII = 0, bool strict = true);
WTF_EXPORT_PRIVATE ConversionResult convertLatin1ToUTF8(
const LChar** sourceStart, const LChar* sourceEnd,
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 7637c6f2b..78f9898df 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -522,6 +522,7 @@ SET(WebCore_IDL_FILES
html/canvas/OESStandardDerivatives.idl
html/canvas/OESTextureFloat.idl
html/canvas/OESVertexArrayObject.idl
+ html/canvas/OESElementIndexUint.idl
html/canvas/Uint16Array.idl
html/canvas/Uint32Array.idl
html/canvas/Uint8Array.idl
@@ -1079,6 +1080,7 @@ SET(WebCore_SOURCES
css/SelectorChecker.cpp
css/ShadowValue.cpp
css/StyleBuilder.cpp
+ css/StyleInvalidationAnalysis.cpp
css/StyleMedia.cpp
css/StylePropertySet.cpp
css/StylePropertyShorthand.cpp
@@ -1483,6 +1485,7 @@ SET(WebCore_SOURCES
html/canvas/OESStandardDerivatives.cpp
html/canvas/OESTextureFloat.cpp
html/canvas/OESVertexArrayObject.cpp
+ html/canvas/OESElementIndexUint.cpp
html/canvas/WebGLBuffer.cpp
html/canvas/WebGLCompressedTextureS3TC.cpp
html/canvas/WebGLContextAttributes.cpp
@@ -2543,6 +2546,7 @@ IF (ENABLE_WEBGL)
html/canvas/OESStandardDerivatives.cpp
html/canvas/OESTextureFloat.cpp
html/canvas/OESVertexArrayObject.cpp
+ html/canvas/OESElementIndexUint.cpp
html/canvas/WebGLBuffer.cpp
html/canvas/WebGLCompressedTextureS3TC.cpp
html/canvas/WebGLContextAttributes.cpp
@@ -2570,12 +2574,14 @@ IF (ENABLE_WEBGL)
html/canvas/OESStandardDerivatives.cpp
html/canvas/OESTextureFloat.cpp
html/canvas/OESVertexArrayObject.cpp
+ html/canvas/OESElementIndexUint.cpp
)
LIST(APPEND WebCore_IDL_FILES
html/canvas/EXTTextureFilterAnisotropic.idl
html/canvas/OESStandardDerivatives.idl
html/canvas/OESTextureFloat.idl
html/canvas/OESVertexArrayObject.idl
+ html/canvas/OESElementIndexUint.idl
html/canvas/WebGLActiveInfo.idl
html/canvas/WebGLBuffer.idl
html/canvas/WebGLCompressedTextureS3TC.idl
@@ -2624,6 +2630,7 @@ IF (WTF_USE_3D_GRAPHICS)
ENDIF ()
LIST(APPEND ANGLESupport_SOURCES
+ ${THIRDPARTY_DIR}/ANGLE/src/compiler/ArrayBoundsClamper.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/CodeGenGLSL.cpp
${THIRDPARTY_DIR}/ANGLE/src/compiler/Compiler.cpp
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 396a7c4c5..820680b03 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,3045 @@
+2012-10-22 Keishi Hattori <keishi@webkit.org>
+
+ Remove monthFormatInLDML
+ https://bugs.webkit.org/show_bug.cgi?id=99971
+
+ Reviewed by Kent Tamura.
+
+ Removing monthFormatInLDML from localized strings because Localizer class now provides the same functionality.
+
+ No new tests. Just removing unused code.
+
+ * platform/LocalizedStrings.h:
+ (WebCore):
+
+2012-10-22 Zan Dobersek <zandobersek@gmail.com>
+
+ [GTK] Enable Microdata DOM API
+ https://bugs.webkit.org/show_bug.cgi?id=99033
+
+ Reviewed by Martin Robinson.
+
+ Enable the Microdata DOM API, but still disable it when the unstable
+ features should be disabled (for instance in release builds).
+
+ No new tests - related tests are being unskipped and are expected to pass.
+
+ * GNUmakefile.am:
+ * GNUmakefile.features.am:
+ * bindings/gobject/GNUmakefile.am: Add the required files so the Microdata
+ API GObject bindings are generated and built.
+
+2012-10-22 Zan Dobersek <zandobersek@gmail.com>
+
+ [GTK] Enable CSP 1.1
+ https://bugs.webkit.org/show_bug.cgi?id=99064
+
+ Reviewed by Martin Robinson.
+
+ Enable CSP 1.1 in development builds but keep it disabled when the
+ unstable features should not be enabled (like in stable releases).
+
+ No new tests - they already exist and will be unskipped.
+
+ * GNUmakefile.am:
+ * GNUmakefile.features.am:
+
+2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page
+ https://bugs.webkit.org/show_bug.cgi?id=98514
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The problem is that we call setFixedVisibleContentRect, which triggers
+ a layout, after the document has been put in the page cache and before
+ the load has been actually committed.
+
+ This applies the same trick as with setFixedLayoutSize by passing the rect
+ in Frame::createView and calling setFixedVisibleContentRect before the
+ new FrameView gets attached to the Frame/Document to prevent the layout.
+
+ * WebCore.exp.in:
+ * page/Frame.cpp:
+ (WebCore::Frame::createView): Give a default value to the fixedLayoutSize and
+ useFixedLayout arguments as well since they are used exceptionally.
+ * page/Frame.h:
+ (Frame):
+
+2012-10-22 Allan Sandfeld Jensen <allan.jensen@digia.com>
+
+ [Qt] Handle GET of blob URLs.
+ https://bugs.webkit.org/show_bug.cgi?id=99053
+
+ Reviewed by Simon Hausmann.
+
+ Let BlobResourceHandle handle Blob request internally.
+
+ * platform/network/qt/ResourceHandleQt.cpp:
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+
+2012-10-22 Kenichi Ishibashi <bashi@chromium.org>
+
+ HarfBuzzShaper::shape() should return false when it adds no glyph to GlyphBuffer
+ https://bugs.webkit.org/show_bug.cgi?id=99966
+
+ Reviewed by Kent Tamura.
+
+ If no glyph is added to GlyphBuffer, HarfBuzzShaper::shape() returns false.
+
+ No new tests. Confirmed the fix by using Address Sanitizer.
+
+ * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp:
+ (WebCore::HarfBuzzShaper::shape):
+ (WebCore::HarfBuzzShaper::fillGlyphBuffer): Returns false when glyphBuffer.size() == 0
+ * platform/graphics/harfbuzz/ng/HarfBuzzShaper.h:
+ (HarfBuzzShaper):
+
+2012-10-22 Shinya Kawanaka <shinyak@chromium.org>
+
+ [Shadow] ASSERT triggered when we try reprojecting fallback elements.
+ https://bugs.webkit.org/show_bug.cgi?id=99815
+
+ Reviewed by Hajime Morita.
+
+ When fallback elements of InsertionPoint is reprojected, they were attached twice.
+ We have to skip attaching them if they are attached. We also add a few ASSERT not to
+ allow attaching twice if not necessary.
+
+ We have confirmed that this patch does not regress the performance. The summary of the
+ performance test is the following:
+
+ Dromaeo/dom-modify.html [runs/s]:
+ median stdev min max
+ without this patch: 3928 184 3655 4361
+ with this patch : 3925 178 3652 4350
+
+ Parser/html5-full-render.html [s]:
+ median stdev min max
+ without this patch: 3821 17 3811 3850
+ with this patch : 3838 4.4 3833 3844
+
+ Test: fast/dom/shadow/content-reprojection-fallback-crash.html
+
+ * dom/ContainerNode.cpp:
+ (WebCore):
+ (WebCore::childAttachedAllowedWhenAttachingChildren): If true, children of this node might
+ be attached in advance because of ShadowDOM attaching process.
+ * dom/ContainerNode.h:
+ (ContainerNode):
+ (WebCore):
+ (WebCore::ContainerNode::attachChildren):
+ * dom/Element.cpp:
+ (WebCore::Element::attach):
+ * dom/ShadowRoot.cpp:
+ (WebCore::ShadowRoot::attach):
+
+2012-10-22 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: merge "docked" state into the "dock side" enum.
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Reviewed by Vsevolod Vlasov.
+
+ Otherwise, it is hard to manage these inter-dependent flags.
+
+ * WebCore.exp.in:
+ * inspector/InspectorFrontendClient.h:
+ (InspectorFrontendClient):
+ * inspector/InspectorFrontendClientLocal.cpp:
+ (WebCore::InspectorFrontendClientLocal::requestSetDockSide):
+ (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
+ * inspector/InspectorFrontendClientLocal.h:
+ (InspectorFrontendClientLocal):
+ * inspector/InspectorFrontendHost.cpp:
+ (WebCore::InspectorFrontendHost::requestSetDockSide):
+ * inspector/InspectorFrontendHost.h:
+ (InspectorFrontendHost):
+ * inspector/InspectorFrontendHost.idl:
+ * inspector/front-end/DockController.js:
+ (WebInspector.DockController):
+ (WebInspector.DockController.prototype._updateUI.get sides):
+ (WebInspector.DockController.prototype._updateUI):
+ (WebInspector.DockController.prototype._toggleDockState):
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.setAttachedWindow):
+ (InspectorFrontendAPI.setDockSide):
+ * inspector/front-end/InspectorFrontendHostStub.js:
+ (.WebInspector.InspectorFrontendHostStub.prototype.requestSetDockSide):
+ * inspector/front-end/externs.js:
+
+2012-10-22 MORITA Hajime <morrita@google.com>
+
+ Unreviewed follow up to update test result after r132033.
+
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::V8TestObj::installPerContextProperties):
+
+2012-10-21 MORITA Hajime <morrita@google.com>
+
+ [V8] V8EnablePerContext shouldn't require document() accessor to the native object.
+ https://bugs.webkit.org/show_bug.cgi?id=99954
+
+ Reviewed by Kentaro Hara.
+
+ It now refers ScriptExecutionContext of the creation context instead of document() of
+ wrapped object.
+
+ No new tests. No behavior change at this time.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateImplementation):
+
+2012-10-21 Kent Tamura <tkent@chromium.org>
+
+ Page popup: Fix crash by events after closing
+ https://bugs.webkit.org/show_bug.cgi?id=99951
+
+ Reviewed by Hajime Morita.
+
+ WebCore should provide a way to uninstall a DOMWindowPagePopup supplement.
+
+ No new tests. The bug is timing-dependent.
+
+ * page/DOMWindowPagePopup.cpp:
+ (WebCore::DOMWindowPagePopup::uninstall):
+ Added. Calls Supplementable::removeSupplement.
+ * page/DOMWindowPagePopup.h:
+ (DOMWindowPagePopup): Declare uninstall.
+ * platform/Supplementable.h:
+ (WebCore::Supplementable::removeSupplement): Added.
+
+2012-10-21 Keishi Hattori <keishi@webkit.org>
+
+ Refactor picker tests to fix flakiness and share code
+ https://bugs.webkit.org/show_bug.cgi?id=99671
+
+ Reviewed by Kent Tamura.
+
+ Disable transitions until the picker is fully ready. This should fix flakiness.
+
+ No new tests.
+
+ * Resources/pagepopups/calendarPicker.css:
+ (.preparing .unavailable): Disable transitions.
+ (.preparing .available): Disable transitions.
+ * Resources/pagepopups/calendarPicker.js:
+ (CalendarPicker): Set "preparing" class.
+ (CalendarPicker.prototype._handleWindowResize): Remove the "preparing" class when the window finishes resizing.
+
+2012-10-21 Shinya Kawanaka <shinyak@chromium.org>
+
+ Web Inspector: Shadow DOM: Node removal doesn't reflect.
+ https://bugs.webkit.org/show_bug.cgi?id=99567
+
+ Reviewed by Pavel Feldman.
+
+ We have to call InspectorInstrumentation::willRemoveDOMNode() even if a node is in a shadow tree.
+ Otherwise, node won't be removed from the inspector.
+
+ Test: inspector/elements/update-shadowdom.html
+
+ * dom/ContainerNode.cpp:
+ (WebCore::dispatchChildRemovalEvents):
+
+2012-10-21 Andreas Kling <kling@webkit.org>
+
+ Remove Page::javaScriptURLsAreAllowed setting.
+ <http://webkit.org/b/99944>
+
+ Reviewed by Anders Carlsson.
+
+ This setting was exposed through internal WebView API in Apple's WebKit1.
+ There are no longer any clients of that API.
+
+ This is a step towards preventing elements from modifying their own attributes
+ below attributeChanged().
+
+ * WebCore.exp.in:
+ * WebCore.order:
+ * bindings/ScriptControllerBase.cpp:
+ (WebCore::ScriptController::executeIfJavaScriptURL):
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::parseAttribute):
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+ * page/Page.h:
+ (Page):
+
+2012-10-21 Hyungchan Kim <hyungchan2.kim@lge.com>
+
+ Add a separate flag for rgb swizzling whether it can be modified or not
+ https://bugs.webkit.org/show_bug.cgi?id=98728
+
+ BitmapTexture swizzles the source image if the OpenGL driver
+ doesn't support the BGRA extension.
+ In case of directly composited images, the source image should not
+ be modified.
+
+ http://www.satine.org/research/webkit/snowleopard/snowstack.html
+
+ Reviewed by Noam Rosenthal.
+
+ No new tests as this is only testable on specific hardware and
+ currently not avaiable in the bots.
+
+ * platform/graphics/texmap/TextureMapper.h:
+ (BitmapTexture):
+ * platform/graphics/texmap/TextureMapperBackingStore.cpp:
+ (WebCore::TextureMapperTile::updateContents):
+ (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
+ (WebCore::TextureMapperTiledBackingStore::updateContents):
+ * platform/graphics/texmap/TextureMapperBackingStore.h:
+ (TextureMapperTile):
+ (TextureMapperTiledBackingStore):
+ (WebCore::TextureMapperTiledBackingStore::updateContents):
+ * platform/graphics/texmap/TextureMapperGL.cpp:
+ (WebCore::TextureMapperGL::drawRepaintCounter):
+ (WebCore::BitmapTextureGL::updateContents):
+ * platform/graphics/texmap/TextureMapperGL.h:
+ (BitmapTextureGL):
+ * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
+ (WebCore::BitmapTextureImageBuffer::updateContents):
+ * platform/graphics/texmap/TextureMapperImageBuffer.h:
+ (BitmapTextureImageBuffer):
+ * platform/graphics/texmap/TextureMapperLayer.cpp:
+ (WebCore::TextureMapperLayer::updateBackingStore):
+
+2012-10-21 Antti Koivisto <antti@apple.com>
+
+ Factor stylesheet invalidation analysis code into a class
+ https://bugs.webkit.org/show_bug.cgi?id=99933
+
+ Reviewed by Sam Weinig.
+
+ Currently the stylesheet analysis code is all over the place. It should be factored into a class to make
+ further progress easier.
+
+ The patch adds StyleInvalidationAnalysis class and moves a bunch of code from SelectorChecker, StyleResolver
+ and DocumentStyleSheetCollection there. No functional changes.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/SelectorChecker.cpp:
+ (WebCore):
+ * css/SelectorChecker.h:
+ (WebCore):
+ * css/StyleInvalidationAnalysis.cpp: Added.
+ (WebCore):
+ (WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis):
+ (WebCore::StyleInvalidationAnalysis::create):
+ (WebCore::determineSelectorScopes):
+ (WebCore::StyleInvalidationAnalysis::analyzeStyleSheet):
+ (WebCore::elementMatchesSelectorScopes):
+ (WebCore::StyleInvalidationAnalysis::invalidateStyle):
+ * css/StyleInvalidationAnalysis.h: Added.
+ (WebCore):
+ (StyleInvalidationAnalysis):
+ (WebCore::StyleInvalidationAnalysis::dirtiesAllStyle):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::checkRegionSelector):
+ * css/StyleResolver.h:
+ (StyleResolver):
+ * dom/DocumentStyleSheetCollection.cpp:
+ (WebCore):
+ (WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange):
+ * dom/DocumentStyleSheetCollection.h:
+ (DocumentStyleSheetCollection):
+
+2012-10-08 Robert Hogan <robert@webkit.org>
+
+ In some float situations, the original layout is wrong and only corrects itself on repaint
+ https://bugs.webkit.org/show_bug.cgi?id=18939
+
+ Reviewed by Levi Weintraub.
+
+ A <br> that follows collapsing spaces and has clearance set always needs to get a run and a linebox of its own.
+ This allows the line below it to check for clearance from the <br> if it gets dirtied but the line with the <br>
+ does not.
+
+ Test: fast/block/br-with-clearance-after-collapsing-space.html
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::LineBreaker::nextLineBreak):
+
+2012-10-08 Robert Hogan <robert@webkit.org>
+
+ floated element with negative margin causes text wrap bug
+ https://bugs.webkit.org/show_bug.cgi?id=94825
+
+ Reviewed by Levi Weintraub.
+
+ Avoid over-estimating the available width on the line by ensuring that the offset taken to avoid
+ floats on the line is at least as much as the offset given by border, margin and padding. This only
+ happens when a negative margin on the float brings its edge back before the offset
+ given by the border, margin and padding of its parents.
+
+ Test: fast/block/float/float-on-line-obeys-container-padding.html
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
+
+2012-10-20 Martin Robinson <mrobinson@igalia.com>
+
+ Fix 'make dist' for the GTK+ port
+
+ * GNUmakefile.am: Add missing files to the source list.
+ * GNUmakefile.list.am: Ditto.
+
+2012-10-20 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/12512710> [mac] Text with zero font size renders as 12px sometimes
+ https://bugs.webkit.org/show_bug.cgi?id=99918
+
+ Reviewed by Geoff Garen.
+
+ -[NSFont fontWithName:size:] returns an NSFont of size 12 (the default User Font size) when
+ asked for size 0, and this is what Font::drawGlyphs uses to draw the text.
+
+ Test: fast/text/zero-font-size-2.html
+
+ * platform/graphics/mac/FontMac.mm:
+ (WebCore::Font::drawGlyphs): Added an early return if the size is zero.
+
+2012-10-20 Andreas Kling <kling@webkit.org>
+
+ Clean up QualifiedName-as-hash-key scenario.
+ <http://webkit.org/b/99394>
+
+ Reviewed by Anders Carlsson.
+
+ Cache the hash on QualifiedNameImpl after the first time it's computed.
+ This grows QualifiedNameImpl by 4 bytes on 32-bit (no change on 64-bit due to base class padding)
+ which I believe is fine, since QualifiedName is a shared object.
+
+ Add a global nullQName() function that returns a QualifiedName(nullAtom, nullAtom, nullAtom)
+ and use this to implement HashTraits<QualifiedName>::emptyValue(). The old implementation would
+ create a new QualifiedName(nullAtom, nullAtom, nullAtom) each time, which had to be hashed,
+ added to the global QualifiedName cache, etc.
+
+ Finally, don't have SVGAttributeHashTranslator create a temporary QualifiedName just to compute
+ the hash of a (namespace, prefix, localName) tuple, use QualifiedNameComponents and hashComponents()
+ directly instead.
+
+ Altogether this shaves ~100ms off of the RoboHornet svgresize.html benchmark on my MBP.
+
+ * dom/QualifiedName.cpp:
+ (WebCore::nullQName):
+ (WebCore::QualifiedName::QualifiedNameImpl::computeHash):
+ * dom/QualifiedName.h:
+ (QualifiedNameImpl):
+ (WebCore::QualifiedName::QualifiedNameImpl::QualifiedNameImpl):
+ (WebCore::QualifiedNameHash::hash):
+ * svg/SVGElement.h:
+ (WebCore::SVGAttributeHashTranslator::hash):
+
+2012-10-20 Yael Aharon <yael.aharon@intel.com>
+
+ [EFL][AC] Build fix after r131933
+ https://bugs.webkit.org/show_bug.cgi?id=99901
+
+ Reviewed by Kentaro Hara.
+
+ Add ArrayBoundsClamper.cpp to WebCore/CMakeLists.txt.
+
+ No new tests.
+
+ * CMakeLists.txt:
+
+2012-10-19 Adam Barth <abarth@webkit.org>
+
+ [V8] V8DOMWrapper should avoid using its document parameter (so we can remove it soon)
+ https://bugs.webkit.org/show_bug.cgi?id=99876
+
+ Reviewed by Kentaro Hara.
+
+ We want to remove the document parameter to instantiateV8Object. There
+ isn't always a Document available, so it doesn't make sense to pass it
+ as a parameter. We're just waiting for a V8 API change so we can still
+ construct Node wrappers quickly.
+
+ This patch removes a use of the document that snuck in. Rather than
+ passing the ScriptExecutionContext around, we get it from the
+ CreationContext of the prototype object (and only when we actually need
+ it).
+
+ * Modules/notifications/NotificationCenter.cpp:
+ * Modules/notifications/NotificationCenter.h:
+ (NotificationCenter):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateHeader):
+ (GenerateConstructorGetter):
+ (GenerateImplementation):
+ (GenerateToV8Converters):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::installDOMWindow):
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::instantiateV8Object):
+ * bindings/v8/V8PerContextData.cpp:
+ (WebCore::V8PerContextData::createWrapperFromCacheSlowCase):
+ (WebCore::V8PerContextData::constructorForTypeSlowCase):
+ * bindings/v8/V8PerContextData.h:
+ (WebCore::V8PerContextData::createWrapperFromCache):
+ (WebCore::V8PerContextData::constructorForType):
+ (V8PerContextData):
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ (WebCore::WorkerContextExecutionProxy::initializeIfNeeded):
+ * bindings/v8/WrapperTypeInfo.h:
+ (WebCore):
+ (WebCore::WrapperTypeInfo::installPerContextPrototypeProperties):
+
+2012-10-19 Florin Malita <fmalita@chromium.org>
+
+ Incorrect pattern scaling
+ https://bugs.webkit.org/show_bug.cgi?id=99870
+
+ Reviewed by Dirk Schulze.
+
+ The pattern space transform scale should reflect the tile_size(user space)
+ to tile_image_size ratio, instead of tile_size to absolute_tile_size.
+
+ Test: svg/custom/pattern-scaling.svg
+
+ * rendering/svg/RenderSVGResourcePattern.cpp:
+ (WebCore::RenderSVGResourcePattern::applyResource):
+
+2012-10-19 Tony Chang <tony@chromium.org>
+
+ RenderFlexibleBox::preferredMainAxisContentExtentForChild can return a negative value
+ https://bugs.webkit.org/show_bug.cgi?id=97827
+
+ Reviewed by Ojan Vafai.
+
+ I'm pretty sure this isn't possible (logicalHeight and maxPreferredLogicalWidth should always include
+ border and padding), so just add an assert.
+
+ No new tests, the assert is for code clarity.
+
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
+
+2012-10-19 Tony Chang <tony@chromium.org>
+
+ Replace calls to updateLogicalHeight with calls to computeLogicalHeight
+ https://bugs.webkit.org/show_bug.cgi?id=99883
+
+ Reviewed by Ojan Vafai.
+
+ In RenderBox and RenderBlock, switch to using computeLogicalHeight instead of
+ saving the old height, calling update logical height, then restoring the old height.
+
+ No new tests, this is just a refactoring.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): Simple replace.
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computePercentageLogicalHeight): Adjust for content height.
+ (WebCore::RenderBox::computeReplacedLogicalHeightUsing): Adjust for content height.
+ (WebCore::RenderBox::availableLogicalHeightUsing): Adjust for content height.
+
+2012-10-19 Pablo Flouret <pablof@motorola.com>
+
+ Implement setRangeText() on text controls
+ https://bugs.webkit.org/show_bug.cgi?id=91907
+
+ Reviewed by Kent Tamura.
+
+ setRangeText() replaces a range of text with some other text, and
+ adjusts the existing selection according to its parameters.
+
+ Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#dom-textarea/input-setrangetext
+
+ Tests: fast/forms/color/color-setrangetext.html
+ fast/forms/date/date-setrangetext.html
+ fast/forms/datetime/datetime-setrangetext.html
+ fast/forms/datetimelocal/datetimelocal-setrangetext.html
+ fast/forms/file/file-setrangetext.html
+ fast/forms/hidden/hidden-setrangetext.html
+ fast/forms/image/image-setrangetext.html
+ fast/forms/month/month-setrangetext.html
+ fast/forms/number/number-setrangetext.html
+ fast/forms/range/range-setrangetext.html
+ fast/forms/search/search-setrangetext.html
+ fast/forms/setrangetext.html
+ fast/forms/textarea/textarea-setrangetext.html
+ fast/forms/time/time-setrangetext.html
+ fast/forms/week/week-setrangetext.html
+
+
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ (SkipFunction):
+ The GObject generator doesn't support function overloads, so skip the
+ version of setRangeText() that has only one argument, its behavior
+ can be emulated with the four-argument version.
+
+ * html/InputType.cpp:
+ (WebCore::InputType::supportsSelectionAPI):
+ (WebCore):
+ * html/InputType.h:
+ (InputType):
+ Add supportsSelectionAPI() which indicates whether the various
+ selection api functions like setRangeText, setSelectionRange, etc.
+ are supported by this input element.
+
+ * html/BaseTextInputType.cpp:
+ (WebCore::BaseTextInputType::supportsSelectionAPI):
+ (WebCore):
+ * html/BaseTextInputType.h:
+ (BaseTextInputType):
+ Text-based input types support the selection APIs.
+
+ * html/EmailInputType.cpp:
+ (WebCore::EmailInputType::supportsSelectionAPI):
+ (WebCore):
+ * html/EmailInputType.h:
+ (EmailInputType):
+ Email inputs don't support the selection APIs.
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setRangeText):
+ * html/HTMLInputElement.h:
+ (HTMLInputElement):
+ Add a setRangeText override which checks if it should apply to the
+ input type, and calls the actual implementation on the parent class.
+ * html/HTMLInputElement.idl:
+ * html/HTMLTextAreaElement.idl:
+
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setRangeText):
+ * html/HTMLTextFormControlElement.h:
+ (HTMLTextFormControlElement):
+ setRangeText implementation.
+
+
+2012-10-19 Luke Macpherson <macpherson@chromium.org>
+
+ Remove HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE macro in StyleResolver.
+ https://bugs.webkit.org/show_bug.cgi?id=99782
+
+ Reviewed by Sam Weinig.
+
+ Removes last usage of HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE macro, so that in future there will be no temptation
+ to use it instead of adding a line to StyleBuilder.
+ Also removes redundant checks for inital and inherit (HANDLE_INHERIT_AND_INTIAL already returns in those cases).
+ I don't want to move this code into StyleBuilder until the FIXME that is already there is fixed.
+
+ Covered by many existing writing mode tests (eg. fast/html/details-writing-mode.html)
+
+ * css/StyleResolver.cpp:
+ (WebCore):
+ (WebCore::StyleResolver::applyProperty):
+
+2012-10-19 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Hidden indexing events are visible to script via bubbling/capture
+ https://bugs.webkit.org/show_bug.cgi?id=96566
+
+ Reviewed by Tony Chang.
+
+ Stop propagation of error events fired at internal indexing requests as a result of
+ aborting, as they should not be visible to scripts.
+
+ Test: storage/indexeddb/index-population.html
+
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::createIndex):
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::dispatchEvent):
+ * Modules/indexeddb/IDBRequest.h:
+ (WebCore::IDBRequest::preventPropagation):
+ (IDBRequest):
+
+2012-10-19 Simon Fraser <simon.fraser@apple.com>
+
+ Remove .get() calls in assertions as suggested by Darin Adler.
+
+ * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+ (PlatformCALayer::appendSublayer):
+ (PlatformCALayer::insertSublayer):
+ (PlatformCALayer::replaceSublayer):
+
+2012-10-19 Simon Fraser <simon.fraser@apple.com>
+
+ Fix a hang when combining tile cache layers with preserve-3d or reflections
+ https://bugs.webkit.org/show_bug.cgi?id=99890
+ <rdar://problem/12539560>
+
+ Reviewed by Dean Jackson.
+
+ The new tile cache code added an updateSublayers() call when switching to/from
+ tiled layers. This confused later sublayer rebuilding, causing us to attempt to
+ add a layer as a child of itself, causing a hang in CA.
+
+ Fix by removing all the explicit calls to updateFoo when updating the structural
+ layer and switching to/from tiled layers. Instead, we set dirty flags, and rely
+ on the fact that these flag-dirtying functions get called before the later functions
+ that process those dirty flags. This is assured by some reordering of the update
+ function calls.
+
+ A final wrinkle is that ensureStructuralLayer() can change the layer that our
+ parent GraphicsLayer put in its sublayer list. Rather than diddle with that sublayer
+ list directly like we used to, just call noteSublayersChanged() on the parent, and have
+ commitLayerChangesAfterSublayers() check the ChildrenChanged and do a second update
+ of sublayers if necessary (we clear the flag in commitLayerChangesBeforeSublayers(), so
+ only do this work if a sublayer requested it).
+
+ Tests: compositing/tiling/preserve3d-tiled.html
+ compositing/tiling/reflected-tiled.html
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
+ (WebCore::GraphicsLayerCA::commitLayerChangesAfterSublayers):
+ (WebCore::GraphicsLayerCA::ensureStructuralLayer):
+ (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
+ * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+ (PlatformCALayer::appendSublayer): Add assertion about adding a layer to itself.
+ (PlatformCALayer::insertSublayer): Ditto.
+ (PlatformCALayer::replaceSublayer): Ditto.
+
+2012-10-19 Chris Fleizach <cfleizach@apple.com>
+
+ AX: aria-hidden=false does not work as expected
+ https://bugs.webkit.org/show_bug.cgi?id=98787
+
+ Reviewed by Beth Dakin.
+
+ ARIA requires that aria-hidden=false override an element's native visibility and include that
+ node in the AX hierarchy.
+
+ To accomplish this we have to allow invisible items to be included, as well as items that
+ have no renderers associated with them.
+
+ Test: accessibility/aria-hidden-negates-no-visibility.html
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::getOrCreate):
+ * accessibility/AccessibilityARIAGrid.cpp:
+ (WebCore::AccessibilityARIAGrid::addTableCellChild):
+ (WebCore::AccessibilityARIAGrid::addChildren):
+ * accessibility/AccessibilityARIAGrid.h:
+ (AccessibilityARIAGrid):
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore):
+ (WebCore::AccessibilityNodeObject::boundingBoxRect):
+ (WebCore::AccessibilityNodeObject::insertChild):
+ (WebCore::AccessibilityNodeObject::addChild):
+ (WebCore::AccessibilityNodeObject::addChildren):
+ (WebCore::AccessibilityNodeObject::textUnderElement):
+ * accessibility/AccessibilityNodeObject.h:
+ (AccessibilityNodeObject):
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
+ (WebCore):
+ * accessibility/AccessibilityObject.h:
+ (AccessibilityObject):
+ (WebCore::AccessibilityObject::addChild):
+ (WebCore::AccessibilityObject::insertChild):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore):
+ (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase):
+ (WebCore::AccessibilityRenderObject::addHiddenChildren):
+ (WebCore::AccessibilityRenderObject::addChildren):
+ * accessibility/AccessibilityRenderObject.h:
+ (AccessibilityRenderObject):
+
+2012-10-19 Michael Saboff <msaboff@apple.com>
+
+ Add String version of visitedLinkHash() to properly handle 8-bit URL Strings.
+ https://bugs.webkit.org/show_bug.cgi?id=99735
+
+ Reviewed by Filip Pizlo.
+
+ Added String version of visitedLinkHash(). Made speculative addition of visitedLinkHash()
+ to chromium platform version of LinkHashChromium.cpp.
+ Changed calls in the form of visitedLinkHash(string.characters(), string.length()) to use the
+ new form.
+
+ No changes to functionality, so no new tests.
+
+ * WebCore.exp.in:
+ * loader/HistoryController.cpp:
+ (WebCore::addVisitedLink):
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::addVisitedLink):
+ * platform/LinkHash.cpp:
+ (WebCore::visitedLinkHashInline):
+ (WebCore::visitedLinkHash):
+ * platform/LinkHash.h:
+ * platform/chromium/LinkHashChromium.cpp:
+ (WebCore::visitedLinkHash):
+
+2012-10-19 Michael Saboff <msaboff@apple.com>
+
+ String(CFStringRef) should try to converting to an 8 bit string before converting to 16 bit string
+ https://bugs.webkit.org/show_bug.cgi?id=99794
+
+ Reviewed by Filip Pizlo.
+
+ Try getting a Latin1 byte string before getting a UTF16 (UChar*) string.
+
+ No new test, added 8 bit path.
+
+ * platform/text/cf/StringCF.cpp:
+ (WTF::String::String):
+
+2012-10-19 Dima Gorbik <dgorbik@apple.com>
+
+ Page should be removed from the cache right after restore was called.
+ https://bugs.webkit.org/show_bug.cgi?id=99737
+
+ Reviewed by Brady Eidson.
+
+ The pageCache was inconsistent after the restoration for a period of time because the cachedFrame is being nulled,
+ but the page is still in the Cache. Now the page is being removed from the cache right after the restoration.
+ This issue was spotted in a custom built application using WebKit and unfortunately there is no way to test this
+ behavior in LayoutTests. All the current tests that exercise the page cache do pass.
+
+ No new tests.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::commitProvisionalLoad):
+
+2012-10-19 Max Vujovic <mvujovic@adobe.com>
+
+ [WebGL] getUniformLocation fails for uniform array name without array brackets
+ https://bugs.webkit.org/show_bug.cgi?id=99854
+
+ Reviewed by Dean Jackson.
+
+ Before this patch, gl.getUniformLocation(program, "array[0]") would return the array
+ location, but gl.getUniformLocation(program, "array") would not. Now, the latter also
+ returns the array location.
+
+ In the process of adding a check to the following Khronos WebGL conformance test:
+ conformance/glsl/misc/glsl-long-variable-names.html
+
+ * platform/graphics/ANGLEWebKitBridge.cpp:
+ (WebCore::getSymbolInfo):
+ Before, we used to check that the symbol size was greater than one to determine that the
+ symbol was an array. However, this doesn't identify arrays of length one. Now, we check
+ if the symbol name ends in "[0]", since ANGLE appends this suffix to array symbol
+ names.
+ If the symbol is an array, we strip off the "[0]" and add a symbol with just the base
+ name. We set the isArray flag on the symbol, so we don't lose the information that it is
+ an array.
+ Then, we create symbols for each array element like before. However, instead of
+ replacing the "0" in array[0]" with each index, we take the base name "array" and
+ append array brackets containing each index (e.g. "array" + "[7]").
+ * platform/graphics/ANGLEWebKitBridge.h:
+ (ANGLEShaderSymbol):
+ Add isArray boolean to ANGLEShaderSymbol. Since array symbols don't end in "[0]"
+ anymore, this is the only way to identify arrays.
+
+2012-10-19 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed, rolling out r131915.
+ http://trac.webkit.org/changeset/131915
+ https://bugs.webkit.org/show_bug.cgi?id=98787
+
+ It broke the build on platforms with \!HAVE(ACCESSIBILITY)
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::getOrCreate):
+ (WebCore::AXObjectCache::nodeIsTextControl):
+ * accessibility/AXObjectCache.h:
+ (WebCore):
+ * accessibility/AccessibilityARIAGrid.cpp:
+ (WebCore::AccessibilityARIAGrid::addChild):
+ (WebCore::AccessibilityARIAGrid::addChildren):
+ * accessibility/AccessibilityARIAGrid.h:
+ (AccessibilityARIAGrid):
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::elementRect):
+ (WebCore::AccessibilityNodeObject::addChildren):
+ (WebCore::AccessibilityNodeObject::textUnderElement):
+ * accessibility/AccessibilityNodeObject.h:
+ (AccessibilityNodeObject):
+ * accessibility/AccessibilityObject.cpp:
+ * accessibility/AccessibilityObject.h:
+ (AccessibilityObject):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::textIteratorBehaviorForTextRange):
+ (WebCore):
+ (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase):
+ (WebCore::AccessibilityRenderObject::addChildren):
+ * accessibility/AccessibilityRenderObject.h:
+ (AccessibilityRenderObject):
+
+2012-10-19 Tony Chang <tony@chromium.org>
+
+ Unreviewed, rolling out r131936.
+ http://trac.webkit.org/changeset/131936
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Broke the clang build
+
+ * WebCore.exp.in:
+ * inspector/InspectorFrontendClient.h:
+ (InspectorFrontendClient):
+ * inspector/InspectorFrontendClientLocal.cpp:
+ (WebCore::InspectorFrontendClientLocal::requestAttachWindow):
+ (WebCore):
+ (WebCore::InspectorFrontendClientLocal::requestDetachWindow):
+ (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
+ * inspector/InspectorFrontendClientLocal.h:
+ (InspectorFrontendClientLocal):
+ (WebCore::InspectorFrontendClientLocal::requestSetDockSide):
+ * inspector/InspectorFrontendHost.cpp:
+ (WebCore::InspectorFrontendHost::requestAttachWindow):
+ (WebCore):
+ (WebCore::InspectorFrontendHost::requestDetachWindow):
+ (WebCore::InspectorFrontendHost::requestSetDockSide):
+ * inspector/InspectorFrontendHost.h:
+ (InspectorFrontendHost):
+ * inspector/InspectorFrontendHost.idl:
+ * inspector/front-end/DockController.js:
+ (WebInspector.DockController):
+ (WebInspector.DockController.prototype.setDocked):
+ (WebInspector.DockController.prototype._innerSetDocked.set if):
+ (WebInspector.DockController.prototype._innerSetDocked):
+ (WebInspector.DockController.prototype._updateUI.get states):
+ (WebInspector.DockController.prototype._updateUI):
+ (WebInspector.DockController.prototype._toggleDockState):
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.setAttachedWindow):
+ (InspectorFrontendAPI.setDockSide):
+ * inspector/front-end/InspectorFrontendHostStub.js:
+ (.WebInspector.InspectorFrontendHostStub.prototype.requestAttachWindow):
+ (.WebInspector.InspectorFrontendHostStub.prototype.requestDetachWindow):
+ (.WebInspector.InspectorFrontendHostStub.prototype.requestSetDockSide):
+ * inspector/front-end/externs.js:
+ (InspectorFrontendHostAPI.prototype.requestAttachWindow):
+ (InspectorFrontendHostAPI.prototype.requestDetachWindow):
+
+2012-10-09 Martin Robinson <mrobinson@igalia.com>
+
+ REGRESSION (r130699): 5 various fast/ tests started failing
+ https://bugs.webkit.org/show_bug.cgi?id=98729
+
+ Reviewed by Xan Lopez.
+
+ Do not try to remove the URL fragment for data URLs. This will likely
+ just corrupt the URL.
+
+ No new tests. This unskips some previously failing tests.
+
+ * platform/network/soup/ResourceRequestSoup.cpp:
+ (WebCore::ResourceRequest::urlStringForSoup): Do nothing for data URLs.
+
+2012-10-19 Simon Fraser <simon.fraser@apple.com>
+
+ Use tile caches in place of CATiledLayer
+ https://bugs.webkit.org/show_bug.cgi?id=99806
+ <rdar://problem/6474145>
+
+ Reviewed by Tim Horton.
+
+ Have GraphicsLayerCA use TileCaches instead of CATiledLayer now for
+ layers that exceed the 2000px size threshold.
+
+ * platform/graphics/TiledBacking.h:
+ (TiledBacking): Have normal getter and setter for the visible rect.
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly): We need
+ to pass in an old visibleRect to commitLayerChangesBeforeSublayers(). Just use
+ our current visible rect, which result in no tile area work.
+ (WebCore::GraphicsLayerCA::computeVisibleRect): Make this const and have it
+ return the rect, for clarity.
+ (WebCore::GraphicsLayerCA::recursiveCommitChanges): Keep track of the old
+ visible rect, and use the change flags mechanism to ensure that we recompute
+ tile areas later.
+ When calling commitLayerChangesBeforeSublayers() on the mask layer, just pass
+ its own visible rect as the old visible rect.
+ (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Pass in the
+ oldVisibleRect so that updateVisibleRect() can use this to see how the
+ visibleRect is changing.
+ (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect): This member function
+ compares the old and new visible rects, and extends the tile coverage area
+ in directions where more content is being exposed. It takes care to avoid
+ "jitter" in the visible rect deltas causing edge tiles to get created then
+ destroyed by keeping any extra padding that already exists in a direction
+ where more content is being exposed.
+ (WebCore::GraphicsLayerCA::updateVisibleRect): Call adjustTiledLayerVisibleRect()
+ and use the result to update the TiledBacking's visibleRect.
+ (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Create layers of type
+ LayerTypeTileCacheLayer instead of LayerTypeWebTiledLayer. Because tile
+ cache layers involve adding an extra layer to the hierarchy (the tile container),
+ we call updateSublayerList() when changing layer type.
+ * platform/graphics/ca/GraphicsLayerCA.h: New m_sizeAtLastVisibleRectUpdate member
+ that is used to prevent the adjustTiledLayerVisibleRect() logic being confused by
+ size changes.
+ (WebCore::GraphicsLayerCA::visibleRect):
+ * platform/graphics/ca/mac/TileCache.h: Have normal getter and setter for the visible rect.
+ * platform/graphics/ca/mac/TileCache.mm:
+ (WebCore::TileCache::setVisibleRect): Renamed to setVisibleRect().
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Avoid doing work
+ for pages in the page cache, for which the root layer is unattached.
+ (WebCore::RenderLayerCompositor::frameViewDidScroll): visibleRectChanged() was renamed
+ to setVisibleRect().
+
+2012-10-19 Beth Dakin <bdakin@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=99768
+ We should limit the tile cache coverage when a page can't take
+ advantage of fast tile scrolling anyway
+
+ Reviewed by Simon Fraser.
+
+ When sites can't use fast-scrolling, there is no need to inflate the
+ tile cache. In fact, we get a performance boost by keeping it small
+ on painting-intensive sites.
+
+ Instead of just looking a whether or not the FrameView
+ canHaveScrollbar(), consult
+ shouldUpdateScrollLayerPositionOnMainThread().
+ * page/FrameView.cpp:
+ (WebCore::FrameView::performPostLayoutTasks):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::RenderLayerBacking):
+
+ Expose shouldUpdateScrollLayerPositionOnMainThread().
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::hasNonLayerFixedObjects):
+ (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionOnMainThread):
+ (WebCore):
+ (WebCore::ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread):
+ * page/scrolling/ScrollingCoordinator.h:
+ (ScrollingCoordinator):
+
+ Bug fix. Should be bitwise and.
+ * platform/graphics/ca/mac/TileCache.mm:
+ (WebCore::TileCache::tileCoverageRect):
+
+2012-10-19 Mark Lam <mark.lam@apple.com>
+
+ Added WTF::StackStats mechanism.
+ https://bugs.webkit.org/show_bug.cgi?id=99805.
+
+ Reviewed by Geoffrey Garen.
+
+ Added StackStats probes in layout methods.
+
+ * dom/Document.cpp:
+ (WebCore::Document::updateLayout):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layout):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::layout):
+ * rendering/RenderDialog.cpp:
+ (WebCore::RenderDialog::layout):
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::layout):
+ * rendering/RenderFlowThread.cpp:
+ (WebCore::RenderFlowThread::layout):
+ * rendering/RenderFrameSet.cpp:
+ (WebCore::RenderFrameSet::layout):
+ * rendering/RenderIFrame.cpp:
+ (WebCore::RenderIFrame::layout):
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::layout):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::layout):
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::layout):
+ * rendering/RenderListMarker.cpp:
+ (WebCore::RenderListMarker::layout):
+ * rendering/RenderMedia.cpp:
+ (WebCore::RenderMedia::layout):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::layout):
+ * rendering/RenderObject.h:
+ * rendering/RenderRegion.cpp:
+ (WebCore::RenderRegion::layout):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::layout):
+ * rendering/RenderReplica.cpp:
+ (WebCore::RenderReplica::layout):
+ * rendering/RenderRubyRun.cpp:
+ (WebCore::RenderRubyRun::layoutSpecialExcludedChild):
+ * rendering/RenderScrollbarPart.cpp:
+ (WebCore::RenderScrollbarPart::layout):
+ * rendering/RenderSlider.cpp:
+ (WebCore::RenderSlider::layout):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::layout):
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::layout):
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::layout):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::layout):
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::layout):
+ * rendering/RenderTextTrackCue.cpp:
+ (WebCore::RenderTextTrackCue::layout):
+ * rendering/RenderVideo.cpp:
+ (WebCore::RenderVideo::layout):
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::layout):
+ * rendering/RenderWidget.cpp:
+ (WebCore::RenderWidget::layout):
+ * rendering/svg/RenderSVGContainer.cpp:
+ (WebCore::RenderSVGContainer::layout):
+ * rendering/svg/RenderSVGForeignObject.cpp:
+ (WebCore::RenderSVGForeignObject::layout):
+ * rendering/svg/RenderSVGGradientStop.cpp:
+ (WebCore::RenderSVGGradientStop::layout):
+ * rendering/svg/RenderSVGHiddenContainer.cpp:
+ (WebCore::RenderSVGHiddenContainer::layout):
+ * rendering/svg/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::layout):
+ * rendering/svg/RenderSVGResourceContainer.cpp:
+ (WebCore::RenderSVGResourceContainer::layout):
+ * rendering/svg/RenderSVGResourceMarker.cpp:
+ (WebCore::RenderSVGResourceMarker::layout):
+ * rendering/svg/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::layout):
+ * rendering/svg/RenderSVGShape.cpp:
+ (WebCore::RenderSVGShape::layout):
+ * rendering/svg/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::layout):
+
+2012-10-19 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: merge "docked" state into the "dock side" enum.
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Reviewed by Vsevolod Vlasov.
+
+ Otherwise, it is hard to manage these inter-dependent flags.
+
+ * inspector/InspectorFrontendClient.h:
+ (InspectorFrontendClient):
+ * inspector/InspectorFrontendClientLocal.cpp:
+ (WebCore::InspectorFrontendClientLocal::requestSetDockSide):
+ (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
+ * inspector/InspectorFrontendClientLocal.h:
+ (InspectorFrontendClientLocal):
+ * inspector/InspectorFrontendHost.cpp:
+ (WebCore::InspectorFrontendHost::requestSetDockSide):
+ * inspector/InspectorFrontendHost.h:
+ (InspectorFrontendHost):
+ * inspector/InspectorFrontendHost.idl:
+ * inspector/front-end/DockController.js:
+ (WebInspector.DockController):
+ (WebInspector.DockController.prototype._updateUI.get sides):
+ (WebInspector.DockController.prototype._updateUI):
+ (WebInspector.DockController.prototype._toggleDockState):
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.setAttachedWindow):
+ * inspector/front-end/InspectorFrontendHostStub.js:
+ (.WebInspector.InspectorFrontendHostStub.prototype.requestSetDockSide):
+
+2012-10-19 Joshua Bell <jsbell@chromium.org>
+
+ [V8] IndexedDB: Crash when lazy-indexing Date keys
+ https://bugs.webkit.org/show_bug.cgi?id=99860
+
+ Reviewed by Adam Barth.
+
+ Missing a scope/context needed when digging values out of Date objects
+ in an indexing callback.
+
+ Test: storage/indexeddb/lazy-index-types.html
+
+ * bindings/v8/IDBBindingUtilities.cpp:
+ (WebCore::createIDBKeyFromScriptValueAndKeyPath):
+
+2012-10-18 Dean Jackson <dino@apple.com>
+
+ Shader translator needs option to clamp uniform array accesses in vertex shaders
+ https://bugs.webkit.org/show_bug.cgi?id=98977
+ https://code.google.com/p/angleproject/issues/detail?id=49
+
+ Reviewed by Alok Priyadarshi and Ken Russell.
+
+ WebGL forbids out-of-bounds array access in shaders. Rewrite any shaders to
+ ensure that non-direct array indexing is clamped to the bounds of the array.
+
+ Test: fast/canvas/webgl/array-bounds-clamping.html
+
+ * platform/graphics/ANGLEWebKitBridge.cpp:
+ (WebCore::ANGLEWebKitBridge::compileShaderSource): Pass new compiler option SH_CLAMP_INDIRECT_ARRAY_BOUNDS
+
+2012-10-19 Justin Novosad <junov@chromium.org>
+
+ [Chromium] Reduce memory footprint of canvas pattern object with deferred rendering
+ https://bugs.webkit.org/show_bug.cgi?id=99856
+
+ Reviewed by Stephen White.
+
+ Marking internal bitmap copy as immutable to prevent it from being
+ unnecessarily duplicated in skia by SkBitmapHeap.
+
+ No new tests: code path already well covered by existing layout tests
+ fast/canvas/canvas-pattern-*
+
+ * platform/graphics/skia/PatternSkia.cpp:
+ (WebCore::Pattern::platformPattern):
+
+2012-10-19 Antti Koivisto <antti@apple.com>
+
+ Maintain a list of active CSS stylesheets
+ https://bugs.webkit.org/show_bug.cgi?id=99843
+
+ Reviewed by Andreas Kling.
+
+ Currently we maintain a per-document list of stylesheets that matches what is returned by the StyleSheetList DOM API.
+ This list contains both CSS and XSLT stylesheets which internally have basically nothing in common. Maintaining
+ a list of active CSS stylesheets separately simplifies code in number of places.
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::StyleResolver):
+ (WebCore::StyleResolver::addStylesheetsFromSeamlessParents):
+ (WebCore::StyleResolver::appendAuthorStyleSheets):
+ (WebCore::collectCSSOMWrappers):
+ * css/StyleResolver.h:
+ (StyleResolver):
+ * css/StyleSheetList.cpp:
+ (WebCore::StyleSheetList::styleSheets):
+ (WebCore::StyleSheetList::detachFromDocument):
+ * dom/Document.cpp:
+ (WebCore::Document::setCompatibilityMode):
+ * dom/DocumentStyleSheetCollection.cpp:
+ (WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange):
+ (WebCore::styleSheetsUseRemUnits):
+ (WebCore::filterEnabledCSSStyleSheets):
+ (WebCore):
+ (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
+ (WebCore::DocumentStyleSheetCollection::reportMemoryUsage):
+ * dom/DocumentStyleSheetCollection.h:
+ (WebCore::DocumentStyleSheetCollection::styleSheetsForStyleSheetList):
+ (DocumentStyleSheetCollection):
+ (WebCore::DocumentStyleSheetCollection::activeAuthorStyleSheets):
+
+2012-09-08 Alpha Lam <hclam@chromium.org>
+
+ [chromium] Implement deferred image decoding
+ https://bugs.webkit.org/show_bug.cgi?id=94240
+
+ Reviewed by Stephen White.
+
+ Objectives:
+
+ To record image decoding operations during painting and to defer
+ decoding operations until rasterization.
+
+ Rationale:
+
+ This is a key feature that enables impl-side painting which requires
+ fast recording of drawing operations. The existing decode-on-draw
+ restricts that recording has to block on expensive decoding operations.
+ This change allows recording of image decoding operations during paint
+ time.
+
+ Design:
+
+ Image decoding happens when a BitmapImage is drawn into a
+ GraphicsContext. When per-tile painting is enabled GraphicsContext
+ is backed by SkCanvas in recording mode. This SkCanvas records drawing
+ and image decoding operations to minimize recording time.
+
+ An image decoding operation is recorded as a SkPixelRef object
+ implemented by LazyDecodingPixelRef. This object references raw encoded
+ data, regions to be decoded and scaling information.
+
+ When used in conjunction with per-tile painting this feature defers
+ image decoding until the SkCanvas referencing the image is rasterized.
+
+ Both recording and rasterization happen on the main thread.
+
+ Performance Impact:
+
+ This feature is enabled by WebKit::setDeferredImageDecodingEnabled()
+ and does not have an impact when disabled.
+
+ This feature is disabled by default.
+
+ Upcoming Changes:
+
+ 1. Implement a full-featured image cache in ImageDecodingStore.
+ 2. Allow rasterization and decoding on impl thread.
+
+ Classes Involved:
+
+ BitmapImage
+
+ BitmapImage is the entry point for deferred image decoding. When
+ drawing a BitmapImage into a GraphicsContext it makes a request to
+ create a NativeImageSkia. We substitute the content in NativeImageSkia
+ such that it is lazily decoded.
+
+ DeferredImageDecoder
+
+ This is the platform implementation of a image decoder for Chromium.
+ This is a bridge layer that either delegates calls to the actual
+ ImageDecoder or create a lazily-decoded SkBitmap and delegates calls
+ to ImageDecodingStore.
+
+ ImageDecodingStore
+
+ This object manages all encoded images. It keeps track of encoded
+ data and the corresponding ImageDecoder for doing actual decoding. It
+ is also responsible for generating lazily decoded SkBitmaps. This
+ SkBitmap contains a LazyDecodingPixelRef object which references to an
+ image entry in ImageDecodingStore.
+
+ ScaledImageFragment
+
+ A container for a scaled image fragment. In addition to bitmap pixels
+ it contains information about the ID of the image, scale and clipping.
+
+ ImageFrameGenerator
+
+ This object is responsible for generating decoded pixels. It is also
+ a container for encoded image data and corresponding image decoder.
+
+ LazyDecodingPixelRef
+
+ This object is embedded in a SkBitmap to enable lazy decoding. When
+ SkBitmap needs to access pixels LazyDecodingPixelRef is locked. It
+ contains information to locate an image and scaling info, these
+ information is submitted to ImageDecodingStore to access actual pixels.
+
+ Layout tests. There are about 80 tests in this virtual test suite
+ running this feature in this directory:
+
+ platform/chromium/virtual/deferred/fast/images
+
+ Unit tests. Added DeferredImageDecoderTest to verify deferred
+ image decoding behavior.
+
+ * WebCore.gypi:
+ * platform/graphics/ImageSource.cpp:
+ (WebCore::ImageSource::setData):
+ * platform/graphics/ImageSource.h:
+ (WebCore):
+ (ImageSource):
+ * platform/graphics/chromium/DeferredImageDecoder.cpp: Added.
+ (WebCore):
+ (WebCore::DeferredImageDecoder::DeferredImageDecoder):
+ (WebCore::DeferredImageDecoder::~DeferredImageDecoder):
+ (WebCore::DeferredImageDecoder::create):
+ (WebCore::DeferredImageDecoder::createForTesting):
+ (WebCore::DeferredImageDecoder::filenameExtension):
+ (WebCore::DeferredImageDecoder::frameBufferAtIndex):
+ (WebCore::DeferredImageDecoder::setData):
+ (WebCore::DeferredImageDecoder::isSizeAvailable):
+ (WebCore::DeferredImageDecoder::size):
+ (WebCore::DeferredImageDecoder::frameSizeAtIndex):
+ (WebCore::DeferredImageDecoder::frameCount):
+ (WebCore::DeferredImageDecoder::repetitionCount):
+ (WebCore::DeferredImageDecoder::clearFrameBufferCache):
+ (WebCore::DeferredImageDecoder::frameHasAlphaAtIndex):
+ (WebCore::DeferredImageDecoder::frameBytesAtIndex):
+ * platform/graphics/chromium/DeferredImageDecoder.h: Added.
+ (WebCore):
+ (DeferredImageDecoder):
+ * platform/graphics/chromium/ImageDecodingStore.cpp: Added.
+ (WebCore::ImageDecodingStore::ImageDecodingStore):
+ (WebCore):
+ (WebCore::ImageDecodingStore::~ImageDecodingStore):
+ (WebCore::ImageDecodingStore::instanceOnMainThread):
+ (WebCore::ImageDecodingStore::initializeOnMainThread):
+ (WebCore::ImageDecodingStore::shutdown):
+ (WebCore::ImageDecodingStore::isLazyDecoded):
+ (WebCore::ImageDecodingStore::createLazyDecodedSkBitmap):
+ (WebCore::ImageDecodingStore::resizeLazyDecodedSkBitmap):
+ (WebCore::ImageDecodingStore::setData):
+ (WebCore::ImageDecodingStore::lockPixels):
+ (WebCore::ImageDecodingStore::unlockPixels):
+ (WebCore::ImageDecodingStore::frameGeneratorBeingDestroyed):
+ (WebCore::ImageDecodingStore::calledOnValidThread):
+ (WebCore::ImageDecodingStore::lookupFrameCache):
+ (WebCore::ImageDecodingStore::deleteFrameCache):
+ * platform/graphics/chromium/ImageDecodingStore.h: Added.
+ (WebCore):
+ (ImageDecodingStore):
+ (WebCore::ImageDecodingStore::create):
+ * platform/graphics/chromium/ScaledImageFragment.cpp: Added.
+ (WebCore):
+ (WebCore::ScaledImageFragment::~ScaledImageFragment):
+ (WebCore::ScaledImageFragment::ScaledImageFragment):
+ (WebCore::ScaledImageFragment::isEqual):
+ * platform/graphics/chromium/ScaledImageFragment.h: Added.
+ (WebCore):
+ (ScaledImageFragment):
+ (WebCore::ScaledImageFragment::create):
+ (WebCore::ScaledImageFragment::bitmap):
+ (WebCore::ScaledImageFragment::isComplete):
+ * platform/graphics/chromium/ImageFrameGenerator.cpp: Added.
+ (WebCore):
+ (WebCore::ImageFrameGenerator::ImageFrameGenerator):
+ (WebCore::ImageFrameGenerator::~ImageFrameGenerator):
+ (WebCore::ImageFrameGenerator::decoder):
+ (WebCore::ImageFrameGenerator::setData):
+ * platform/graphics/chromium/ImageFrameGenerator.h: Added.
+ (WebCore):
+ (ImageFrameGenerator):
+ (WebCore::ImageFrameGenerator::create):
+ (WebCore::ImageFrameGenerator::size):
+ (WebCore::ImageFrameGenerator::imageId):
+ * platform/graphics/chromium/LazyDecodingPixelRef.cpp: Added.
+ (WebCore):
+ (WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef):
+ (WebCore::LazyDecodingPixelRef::~LazyDecodingPixelRef):
+ (WebCore::LazyDecodingPixelRef::isScaled):
+ (WebCore::LazyDecodingPixelRef::isClipped):
+ (WebCore::LazyDecodingPixelRef::onLockPixels):
+ (WebCore::LazyDecodingPixelRef::onUnlockPixels):
+ (WebCore::LazyDecodingPixelRef::onLockPixelsAreWritable):
+ * platform/graphics/chromium/LazyDecodingPixelRef.h: Added.
+ (WebCore):
+ (LazyDecodingPixelRef):
+ (WebCore::LazyDecodingPixelRef::frameGenerator):
+ * platform/graphics/skia/NativeImageSkia.cpp:
+ (WebCore::NativeImageSkia::resizedBitmap):
+ * platform/image-decoders/ImageDecoder.h:
+ (ImageFrame):
+ (WebCore::ImageFrame::setSkBitmap):
+ (WebCore::ImageFrame::getSkBitmap):
+
+2012-10-18 Yael Aharon <yael.aharon@intel.com>
+
+ [EFL] GraphicsContext3D::m_renderStyle is not initialized
+ https://bugs.webkit.org/show_bug.cgi?id=99721
+
+ Reviewed by Antonio Gomes.
+
+ Initialize GraphicsContext3D::m_renderStyle.
+
+ No new tests, no new functionality.
+
+ * platform/graphics/efl/GraphicsContext3DEfl.cpp:
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2012-10-19 Dongwoo Joshua Im <dw.im@samsung.com>
+
+ Rename ENABLE_CSS3_TEXT_DECORATION to ENABLE_CSS3_TEXT
+ https://bugs.webkit.org/show_bug.cgi?id=99804
+
+ Reviewed by Julien Chaffraix.
+
+ CSS3 text related properties will be implemented under this flag,
+ including text decoration, text-align-last, and text-justify.
+
+ No new functionality, no new test.
+
+ * Configurations/FeatureDefines.xcconfig:
+ * GNUmakefile.am:
+ * GNUmakefile.features.am:
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore):
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ (WebCore::CSSParser::addTextDecorationProperty):
+ (WebCore::CSSParser::parseTextDecoration):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/CSSPropertyNames.in:
+ * css/CSSValueKeywords.in:
+ * css/StyleBuilder.cpp:
+ (WebCore::StyleBuilder::StyleBuilder):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::applyProperty):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/RenderStyleConstants.h:
+ (WebCore):
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator==):
+ * rendering/style/StyleRareNonInheritedData.h:
+ (StyleRareNonInheritedData):
+
+2012-10-19 Nate Chapin <japhet@chromium.org>
+
+ Reorder some functions in SubresourceLoader to permit main resources
+ https://bugs.webkit.org/show_bug.cgi?id=99769
+
+ Reviewed by Adam Barth.
+
+ Most resource types that go through the memory cache (and therefore
+ through SubresourceLoader) are not sensitive to the exact ordering of
+ the callbacks they receive, particularly as it relates to ResourceLoadNotifier
+ calls. Main resources are not so lenient. For main resources to be cacheable
+ and maintain the current behavior as precisely as possible, we will need to
+ rearrange SubresourceLoader's willSendRequest() and didReceiveData().
+
+ No new tests, refactor only.
+
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::willSendRequest): There are a series of checks that can result
+ in the request being canceled, plus calls to CachedResource::willSendRequest() and
+ ResourceLoader::willSendRequest(). MainResourceLoader (which will be a
+ CachedResourceClient) has work it expects to do before ResourceLoader::willSendRequest()
+ is called, but the calls are out of order for that, so swap those.
+ (WebCore::SubresourceLoader::didReceiveData): We need to populate ResourceLoader::m_resourceData
+ before notifying CachedResource of new data, but we also want to do CachedResourceClients calls
+ before calling ResourceLoadNotifier. This means we can't delegate to ResourceLoader.
+
+2012-10-19 Chris Fleizach <cfleizach@apple.com>
+
+ AX: aria-hidden=false does not work as expected
+ https://bugs.webkit.org/show_bug.cgi?id=98787
+
+ Reviewed by Beth Dakin.
+
+ ARIA requires that aria-hidden=false override an element's native visibility and include that
+ node in the AX hierarchy.
+
+ To accomplish this we have to allow invisible items to be included, as well as items that
+ have no renderers associated with them.
+
+ Test: accessibility/aria-hidden-negates-no-visibility.html
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::getOrCreate):
+ * accessibility/AccessibilityARIAGrid.cpp:
+ (WebCore::AccessibilityARIAGrid::addTableCellChild):
+ (WebCore::AccessibilityARIAGrid::addChildren):
+ * accessibility/AccessibilityARIAGrid.h:
+ (AccessibilityARIAGrid):
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore):
+ (WebCore::AccessibilityNodeObject::boundingBoxRect):
+ (WebCore::AccessibilityNodeObject::insertChild):
+ (WebCore::AccessibilityNodeObject::addChild):
+ (WebCore::AccessibilityNodeObject::addChildren):
+ (WebCore::AccessibilityNodeObject::textUnderElement):
+ * accessibility/AccessibilityNodeObject.h:
+ (AccessibilityNodeObject):
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
+ (WebCore):
+ * accessibility/AccessibilityObject.h:
+ (AccessibilityObject):
+ (WebCore::AccessibilityObject::addChild):
+ (WebCore::AccessibilityObject::insertChild):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore):
+ (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase):
+ (WebCore::AccessibilityRenderObject::addHiddenChildren):
+ (WebCore::AccessibilityRenderObject::addChildren):
+ * accessibility/AccessibilityRenderObject.h:
+ (AccessibilityRenderObject):
+
+2012-10-19 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Rename owner to client in MediaStreamDescriptor
+ https://bugs.webkit.org/show_bug.cgi?id=99593
+
+ Reviewed by Adam Barth.
+
+ This patch renames owner to client in MediaStreamDescriptor as discussed in #99080.
+
+ No new tests needed, covered by existing tests.
+
+ * Modules/mediastream/MediaStream.cpp:
+ (WebCore::MediaStream::MediaStream):
+ (WebCore::MediaStream::~MediaStream):
+ * Modules/mediastream/MediaStream.h:
+ (MediaStream):
+ * Modules/mediastream/PeerConnection00.cpp:
+ (WebCore::PeerConnection00::didRemoveRemoteStream):
+ * Modules/mediastream/RTCPeerConnection.cpp:
+ (WebCore::RTCPeerConnection::didRemoveRemoteStream):
+ * platform/mediastream/MediaStreamCenter.cpp:
+ (WebCore::MediaStreamCenter::endLocalMediaStream):
+ (WebCore::MediaStreamCenter::addMediaStreamTrack):
+ (WebCore::MediaStreamCenter::removeMediaStreamTrack):
+ * platform/mediastream/MediaStreamDescriptor.h:
+ (WebCore::MediaStreamDescriptorClient::~MediaStreamDescriptorClient):
+ (WebCore::MediaStreamDescriptor::client):
+ (WebCore::MediaStreamDescriptor::setClient):
+ (WebCore::MediaStreamDescriptor::MediaStreamDescriptor):
+ (MediaStreamDescriptor):
+
+2012-10-19 Shinya Kawanaka <shinyak@chromium.org>
+
+ Elements assigned to <shadow> should not be reprojected.
+ https://bugs.webkit.org/show_bug.cgi?id=99680
+
+ Reviewed by Dimitri Glazkov.
+
+ In the current spec, we don't have shadow reprojection, i.e. elements assigned to <shadow> should not be
+ reprojected to content. However, we can select them by <shadow>.
+
+ Tests: fast/dom/shadow/content-reprojection-complex.html
+ fast/dom/shadow/content-reprojection-shadow.html
+ fast/dom/shadow/shadow-reprojection-prohibited.html
+
+ * html/shadow/ContentDistributor.cpp:
+ (WebCore::ContentDistributor::distribute): When a node is <shadow>, we should not add elements assigned to <shadow>
+ to POOL. Instead, <shadow> itself should be added to POOL.
+ * html/shadow/HTMLContentElement.h:
+ (WebCore::isHTMLContentElement):
+ (WebCore):
+
+2012-10-19 Chris Fleizach <cfleizach@apple.com>
+
+ VO issues with hidden <legend> and last explicitly labelled element within a group <fieldset>
+ https://bugs.webkit.org/show_bug.cgi?id=96325
+
+ Reviewed by Beth Dakin.
+
+ When finding a <legend> for accessibility, we need to consider those that are offscreen. This patch
+ modifies the original findLegend method to take a parameter to determine what should be done.
+
+ Test: accessibility/hidden-legend.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::titleUIElement):
+ * rendering/RenderFieldset.cpp:
+ (WebCore::RenderFieldset::findLegend):
+ * rendering/RenderFieldset.h:
+
+2012-10-17 Chris Fleizach <cfleizach@apple.com>
+
+ AX: Refactor accessibility name computation so it's more platform independent
+ https://bugs.webkit.org/show_bug.cgi?id=99502
+
+ Reviewed by Beth Dakin.
+
+ The current model of determining the accessible text for an object has a lot of Mac biases built in
+ due to legacy implementation.
+
+ This change categorizes and orders accessibility text based on WAI-ARIA text computation rules and then
+ allows the platform (only Mac right now) to decide how best to apply that text to its own AX API.
+ http://www.w3.org/TR/wai-aria/roles#textalternativecomputation
+
+ This change tried very hard not to change any test behavior, even though it exposed a number of weird
+ edge cases where we were treating attributes differently based on element type.
+
+ Future patches will resolve those discrepancies.
+
+ * accessibility/AccessibilityImageMapLink.cpp:
+ (WebCore::AccessibilityImageMapLink::accessibilityText):
+ * accessibility/AccessibilityImageMapLink.h:
+ (AccessibilityImageMapLink):
+ * accessibility/AccessibilityMediaControls.cpp:
+ (WebCore::AccessibilityMediaControl::accessibilityText):
+ * accessibility/AccessibilityMediaControls.h:
+ (AccessibilityMediaControl):
+ (WebCore::AccessibilityMediaTimeDisplay::isMediaControlLabel):
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::titleElementText):
+ (WebCore::AccessibilityNodeObject::accessibilityText):
+ (WebCore::AccessibilityNodeObject::ariaLabeledByText):
+ (WebCore::AccessibilityNodeObject::alternativeText):
+ (WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
+ (WebCore::AccessibilityNodeObject::visibleText):
+ (WebCore::AccessibilityNodeObject::helpText):
+ (WebCore::AccessibilityNodeObject::ariaDescribedByAttribute):
+ * accessibility/AccessibilityNodeObject.h:
+ (AccessibilityNodeObject):
+ * accessibility/AccessibilityObject.h:
+ (AccessibilityText):
+ (WebCore::AccessibilityText::AccessibilityText):
+ (WebCore::AccessibilityObject::isMediaControlLabel):
+ (AccessibilityObject):
+ (WebCore::AccessibilityObject::accessibilityText):
+ (WebCore::AccessibilityObject::setAccessibleName):
+ (WebCore::AccessibilityObject::accessibilityDescription):
+ (WebCore::AccessibilityObject::title):
+ (WebCore::AccessibilityObject::helpText):
+ (WebCore::AccessibilityObject::stringValue):
+ (WebCore::AccessibilityObject::textUnderElement):
+ (WebCore::AccessibilityObject::text):
+ (WebCore::AccessibilityObject::textLength):
+ (WebCore::AccessibilityObject::setRoleValue):
+ (WebCore::AccessibilityObject::roleValue):
+ (WebCore::AccessibilityObject::selection):
+ (WebCore::AccessibilityObject::hierarchicalLevel):
+ * accessibility/AccessibilityRenderObject.cpp:
+ * accessibility/AccessibilityRenderObject.h:
+ (AccessibilityRenderObject):
+ * accessibility/mac/WebAccessibilityObjectWrapper.mm:
+ (-[WebAccessibilityObjectWrapper titleTagShouldBeUsedInDescriptionField]):
+ (-[WebAccessibilityObjectWrapper accessibilityTitle]):
+ (-[WebAccessibilityObjectWrapper accessibilityDescription]):
+ (-[WebAccessibilityObjectWrapper accessibilityHelpText]):
+ (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+ * platform/LocalizedStrings.cpp:
+ (WebCore::localizedMediaControlElementHelpText):
+
+2012-10-19 Kent Tamura <tkent@chromium.org>
+
+ Use Localizer::monthFormat to construct input[type=month] UI
+ https://bugs.webkit.org/show_bug.cgi?id=99818
+
+ Reviewed by Kentaro Hara.
+
+ Use an LDML format returned by Localizer::monthFormat for
+ input[type=month] UI.
+
+ Because the format may contain symbolic month names and symbolic
+ stand-alone month names, we need to add:
+ - Symbolic/numeric detection in DateTimeEditBuilder
+ - Normal/stand-alone detection in DateTimeEditBuilder
+ - Symbolic edit field for months
+
+ Test: fast/forms/month-multiple-fields/month-multiple-fields-appearance-l10n.html,
+ fast/forms/month-multiple-fields/month-multiple-fields-keyboard-events.html
+
+ * html/MonthInputType.cpp:
+ (WebCore::MonthInputType::setupLayoutParameters):
+ Use Localizer::monthFormat.
+
+ * html/shadow/DateTimeEditElement.cpp:
+ (WebCore::DateTimeEditBuilder::visitField):
+ - If the number of continuous field character is greater than 2, use
+ DateTimeSymbolicMonthFieldElement.
+ - Supports stand-alone month field.
+
+ * html/shadow/DateTimeFieldElements.h:
+ (DateTimeSymbolicMonthFieldElement): Added. A subclass of DateTimeSymbolicFieldElement.
+ * html/shadow/DateTimeFieldElements.cpp:
+ (WebCore::DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement):
+ Added.
+ (WebCore::DateTimeSymbolicMonthFieldElement::create): Added.
+ (WebCore::DateTimeSymbolicMonthFieldElement::populateDateTimeFieldsState):
+ We need to add 1 because the internal integer representation is 0-based
+ and DateTimeFieldsState uses 1-based month.
+ (WebCore::DateTimeSymbolicMonthFieldElement::setValueAsDate):
+ DateComponents::month is 0-based.
+ (WebCore::DateTimeSymbolicMonthFieldElement::setValueAsDateTimeFieldsState):
+ We need to subtract 1 because the internal integer representation is 0-based
+ and DateTimeFieldsState uses 1-based month.
+
+ * html/shadow/DateTimeSymbolicFieldElement.h:
+ (WebCore::DateTimeSymbolicFieldElement::symbolsSize):
+ Added for DateTimeSymbolicMonthFieldElement::setValueAsDateTimeFieldsState.
+
+2012-10-19 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Web Inspector: inspector/styles/styles-history.html is failing Text on Windows and Linux
+ https://bugs.webkit.org/show_bug.cgi?id=99519
+
+ Reviewed by Alexander Pavlov.
+
+ Extracted _styleContentSet callback in a class method to make it sniffable by tests.
+
+ * inspector/front-end/StylesSourceMapping.js:
+ (WebInspector.StyleFile.prototype._commitIncrementalEdit):
+ (WebInspector.StyleFile.prototype._styleContentSet):
+
+2012-10-19 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: add object-src 'none' to the inspector.html
+ https://bugs.webkit.org/show_bug.cgi?id=99728
+
+ Reviewed by Vsevolod Vlasov.
+
+ * inspector/front-end/inspector.html:
+
+2012-10-19 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Web Inspector: Get rid of isSnippetEvaluation flag on UISourceCode
+ https://bugs.webkit.org/show_bug.cgi?id=99823
+
+ Reviewed by Yury Semikhatsky.
+
+ Replaced isSnippetEvaluation flag with a pair of isSnippet and isTemporary set.
+
+ * inspector/front-end/ResourceScriptMapping.js:
+ (WebInspector.ResourceScriptMapping.prototype._getOrCreateTemporaryUISourceCode):
+ * inspector/front-end/ScriptSnippetModel.js:
+ (WebInspector.ScriptSnippetModel.prototype._releasedUISourceCodes):
+ (WebInspector.ScriptSnippetModel.prototype._createUISourceCodeForScript):
+ * inspector/front-end/ScriptsNavigator.js:
+ (WebInspector.ScriptsNavigator.prototype._snippetsNavigatorViewForUISourceCode):
+ (WebInspector.ScriptsNavigator.prototype.revealUISourceCode):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._createSourceFrame):
+ * inspector/front-end/Workspace.js:
+ (WebInspector.Project.prototype.addTemporaryUISourceCode):
+
+2012-10-19 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: Invalid Regex in SASSSourceMapping/didRequestContent, breaks Support for Sass experiment
+ https://bugs.webkit.org/show_bug.cgi?id=99729
+
+ Reviewed by Vsevolod Vlasov.
+
+ Decode only the first line number digit written in a six-character escaped Unicode format.
+
+ * inspector/front-end/SASSSourceMapping.js:
+ (WebInspector.SASSSourceMapping.prototype._resourceAdded.didRequestContent):
+ (WebInspector.SASSSourceMapping.prototype._resourceAdded):
+
+2012-10-19 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Update the RuntimeEnabledFeatures flags
+ https://bugs.webkit.org/show_bug.cgi?id=99714
+
+ Reviewed by Adam Barth.
+
+ Updating the RuntimeEnabledFeatures flags to match reality:
+ isMediaStreamEnabled and isPeerConnectionEnabled should be true by default and
+ isDeprecatedPeerConnectionEnabled false.
+
+ Patch covered by existing tests.
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ (WebCore):
+
+2012-10-19 Adam Barth <abarth@webkit.org>
+
+ [V8] Simplify GCPrologueVisitor
+ https://bugs.webkit.org/show_bug.cgi?id=99819
+
+ Reviewed by Kentaro Hara.
+
+ Previously, GCPrologueVisitor used a complicated traits-based template
+ design. That's not necessary. We can just implement it directly without
+ template magic.
+
+ The one subtly here is that MessagePort is not actually a subclass of
+ ActiveDOMObject. The next stage of this cleanup is to make MessagePort
+ inherit from ActiveDOMObject and remove this special case entirely.
+
+ * bindings/v8/V8GCController.cpp:
+ (WebCore::EnsureWeakDOMNodeVisitor::visitDOMWrapper):
+ (WebCore):
+ (WebCore::ActiveDOMObjectPrologueVisitor::visitDOMWrapper):
+ (WebCore::NodeVisitor::visitDOMWrapper):
+ (WebCore::V8GCController::gcPrologue):
+
+2012-10-19 Eugene Klyuchnikov <eustas.bug@gmail.com>
+
+ Web Inspector: Saving HAR, snapshots and timeline data do not work in remote debugging mode
+ https://bugs.webkit.org/show_bug.cgi?id=99179
+
+ Reviewed by Yury Semikhatsky.
+
+ Added method "close" to InspectorFrontendHost.
+ Symantically, this method forces to flush all unsaved buffers for
+ specified file. In native implementation this turns to be no-op.
+
+ In stub implementation "close" causes compilation of blob object an
+ navigating to blob-schema url.
+
+ Removed "canAppend", as appending in now suppurted
+ by all implementations.
+
+ Repaced schema "data" with "blob" in InspectorFrontendHostStub "save"
+ to avoid out-of-memory errors.
+
+ * inspector/InspectorFrontendHost.cpp:
+ (WebCore::InspectorFrontendHost::close): Compiles blob object and
+ navigates to blob-object url.
+ (WebCore):
+ * inspector/InspectorFrontendHost.h: Added "close" method.
+ * inspector/InspectorFrontendHost.idl: Ditto.
+ * inspector/front-end/FileManager.js:
+ (WebInspector.FileManager.prototype.close): Proxy to InspectorFrontend.
+ * inspector/front-end/FileUtils.js:
+ (WebInspector.FileOutputStream.prototype.close):
+ Invoke "close" on FileManager.
+ (WebInspector.FileOutputStream.prototype._onAppendDone): Ditto.
+ * inspector/front-end/HandlerRegistry.js: Added mandatory "close" call.
+ * inspector/front-end/HeapSnapshotView.js:
+ (WebInspector.HeapProfileHeader.prototype.canSaveToFile): Fixed check.
+ * inspector/front-end/InspectorFrontendHostStub.js:
+ (.WebInspector.InspectorFrontendHostStub):
+ Added "appendable" behaviour emulation.
+ * inspector/front-end/SourceFrame.js: Added mandatory "close" call.
+ * inspector/front-end/externs.js: Replaced "canAppend" with "close"
+
+2012-10-18 Dominic Mazzoni <dmazzoni@google.com>
+
+ AX: labelForElement is slow when there are a lot of DOM elements
+ https://bugs.webkit.org/show_bug.cgi?id=97825
+
+ Reviewed by Ryosuke Niwa.
+
+ Adds a DocumentOrderedMap to TreeScope that allows accessibility to
+ quickly map from an id to the label for that id. This speeds up
+ AccessibilityNode::labelForElement, which was a bottleneck in Chromium
+ when accessibility was on.
+
+ Tests: accessibility/title-ui-element-correctness.html
+ perf/accessibility-title-ui-element.html
+
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::labelForElement):
+ * dom/DocumentOrderedMap.cpp:
+ (WebCore::keyMatchesLabelForAttribute):
+ (WebCore):
+ (WebCore::DocumentOrderedMap::get):
+ (WebCore::DocumentOrderedMap::getElementByLabelForAttribute):
+ * dom/DocumentOrderedMap.h:
+ (DocumentOrderedMap):
+ * dom/Element.cpp:
+ (WebCore::Element::insertedInto):
+ (WebCore::Element::removedFrom):
+ (WebCore::Element::updateLabel):
+ (WebCore):
+ (WebCore::Element::willModifyAttribute):
+ * dom/Element.h:
+ (Element):
+ * dom/TreeScope.cpp:
+ (WebCore::TreeScope::TreeScope):
+ (WebCore::TreeScope::destroyTreeScopeData):
+ (WebCore::TreeScope::addLabel):
+ (WebCore):
+ (WebCore::TreeScope::removeLabel):
+ (WebCore::TreeScope::labelElementForId):
+ * dom/TreeScope.h:
+ (WebCore):
+ (TreeScope):
+ (WebCore::TreeScope::shouldCacheLabelsByForAttribute):
+
+2012-10-19 Eugene Klyuchnikov <eustas.bug@gmail.com>
+
+ Web Inspector: Update localizedStrings.js
+ https://bugs.webkit.org/show_bug.cgi?id=99701
+
+ Reviewed by Yury Semikhatsky.
+
+ Fixed most of missing strings and orphans.
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/SettingsScreen.js:
+
+2012-10-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Web Inspector: NMI provide data for mixing with tcmalloc heap dumps.
+ https://bugs.webkit.org/show_bug.cgi?id=99457
+
+ Reviewed by Yury Semikhatsky.
+
+ countObjectSize now accepts ptr as the first argument and saves it into HashMap if the binary was ran with HEAPPROFILE env variable.
+ getProcessMemoryDistribution does snapshot and calls the downstream code with the map of counted objects.
+
+ * inspector/InspectorClient.h:
+ (WebCore::InspectorClient::dumpUncountedAllocatedObjects):
+ * inspector/InspectorMemoryAgent.cpp:
+ (WebCore::reportJSHeapInfo):
+ (WebCore::reportRenderTreeInfo):
+ (WebCore):
+ (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
+ * inspector/MemoryInstrumentationImpl.cpp:
+ (WebCore::MemoryInstrumentationClientImpl::countObjectSize):
+ (WebCore::MemoryInstrumentationClientImpl::reportMemoryUsage):
+ * inspector/MemoryInstrumentationImpl.h:
+ (MemoryInstrumentationClientImpl):
+ (WebCore::MemoryInstrumentationClientImpl::countedObjects):
+
+2012-10-19 Adam Barth <abarth@webkit.org>
+
+ [V8] DOMObjectVisitor does nothing
+ https://bugs.webkit.org/show_bug.cgi?id=99812
+
+ Reviewed by Kentaro Hara.
+
+ This code doesn't do anything, even in Debug! We should just remove it.
+
+ * bindings/v8/V8GCController.cpp:
+ (WebCore):
+ (WebCore::V8GCController::gcPrologue):
+ (WebCore::V8GCController::gcEpilogue):
+
+2012-10-19 Adam Barth <abarth@webkit.org>
+
+ [V8] Remove unused typedef from V8GCController.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=99808
+
+ Reviewed by Kentaro Hara.
+
+ This typedef is not used.
+
+ * bindings/v8/V8GCController.cpp:
+
+2012-10-18 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: [Styles] Property considered overridden if it is non-inherited important property in inherited style
+ https://bugs.webkit.org/show_bug.cgi?id=99720
+
+ Reviewed by Yury Semikhatsky.
+
+ Non-inherited properties are now disregarded in inherited styles.
+
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype._refreshStyleRules):
+ (WebInspector.StylesSidebarPane.prototype._markUsedProperties):
+
+2012-10-18 Adam Barth <abarth@webkit.org>
+
+ [V8] GrouperVisitor is secretly two entirely separate objects
+ https://bugs.webkit.org/show_bug.cgi?id=99810
+
+ Reviewed by Kentaro Hara.
+
+ We can separate out the two things that GrouperVisitor is trying to do
+ because they have nothing to do with each other.
+
+ * bindings/v8/V8GCController.cpp:
+ (ObjectVisitor):
+ (WebCore::ObjectVisitor::visitDOMWrapper):
+ (WebCore):
+ (WebCore::V8GCController::gcPrologue):
+
+2012-10-18 Kiran Muppala <cmuppala@apple.com>
+
+ Automatically start plugins created within a user gesture, skipping snapshotting
+ https://bugs.webkit.org/show_bug.cgi?id=99778
+
+ Reviewed by Alexey Proskuryakov.
+
+ If a user gesture is being processed, do not set the display state of
+ HTMLPluginImageElement to WaitingForSnapshot.
+
+ No new tests, since it only affects when plugins switch from snapshot to running
+ state. Does not affect rendering of other elements.
+
+ * html/HTMLPlugInImageElement.cpp:
+ (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
+
+2012-10-18 Kent Tamura <tkent@chromium.org>
+
+ Add shortMonthLabels and shortStandAloneMonthLabels to Localizer
+ https://bugs.webkit.org/show_bug.cgi?id=99787
+
+ Reviewed by Kentaro Hara.
+
+ This is going to be used for input[type=month] UI. This doesn't affect
+ any bahevior yet.
+
+ Tests: Add some tests to Source/WebKit/chromium/tests/, and will add
+ layout tests later.
+
+ * platform/text/Localizer.h:
+ (Localizer): Add shortMonthLabels and shortStandAloneMonthLabels as pure
+ virtual member functions.
+
+ * platform/text/LocaleICU.h:
+ (LocaleICU): Declare shortMonthLabels and shortStandAloneMonthLabels.
+ * platform/text/LocaleICU.cpp:
+ (WebCore::LocaleICU::shortMonthLabels): Added.
+ (WebCore::LocaleICU::shortStandAloneMonthLabels): Added.
+
+ * platform/text/LocaleNone.cpp:
+ (LocaleNone): Declare shortMonthLabels and shortStandAloneMonthLabels.
+ (WebCore::LocaleNone::shortMonthLabels):
+ Added. Always returns English labels.
+ (WebCore::LocaleNone::shortStandAloneMonthLabels):
+ Addes. Just calls shortMonthLabels.
+
+ * platform/text/LocaleWin.h:
+ (LocaleWin): Declare shortMonthLabels and shortStandAloneMonthLabels.
+ * platform/text/LocaleWin.cpp:
+ (WebCore::LocaleWin::shortMonthLabels): Added.
+ (WebCore::LocaleWin::shortStandAloneMonthLabels):
+ Added. Always returns shortMonthLabels.
+
+ * platform/text/mac/LocaleMac.h:
+ (LocaleMac): Declare shortMonthLabels and shortStandAloneMonthLabels.
+ * platform/text/mac/LocaleMac.mm:
+ (WebCore::LocaleMac::shortMonthLabels): Added.
+ (WebCore::LocaleMac::shortStandAloneMonthLabels): Added.
+
+2012-10-18 Kunihiko Sakamoto <ksakamoto@chromium.org>
+
+ Implement value sanitization algorithm for type=datetime
+ https://bugs.webkit.org/show_bug.cgi?id=76893
+
+ Reviewed by Kent Tamura.
+
+ Implement the value sanitization algorithm for type=datetime that adjusts
+ the value to a valid normalized forced-UTC global date and time string.
+ See http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#valid-normalized-forced-utc-global-date-and-time-string
+
+ Test: fast/forms/datetime/datetime-value-sanitization.html
+
+ * html/DateTimeInputType.cpp:
+ (WebCore::DateTimeInputType::sanitizeValue): Implemented.
+ (WebCore):
+ * html/DateTimeInputType.h:
+ (DateTimeInputType): Add sanitizeValue.
+ * platform/DateComponents.cpp:
+ (WebCore::DateComponents::addMinute): Fixed a bug that caused wrong adjustment
+ of timezone offset (e.g. 2012-10-17T01:00+01:00 -> 2012-10-17T01:-60Z).
+
+2012-10-18 Byungwoo Lee <bw80.lee@samsung.com>
+
+ Fix build warning.
+ https://bugs.webkit.org/show_bug.cgi?id=99788
+
+ Reviewed by Kentaro Hara.
+
+ Use UNUSED_PARAM macro for removing -Wunused-parameter.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::currentTransform):
+
+2012-10-18 Benjamin Poulain <bpoulain@apple.com>
+
+ [WK2] WebKit2 does not build without PLUGIN_PROCESS on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=99771
+
+ Reviewed by Anders Carlsson.
+
+ * WebCore.exp.in: The symbol is used by WebCore Test Support, move it
+ to the general section.
+
+2012-10-18 Adam Barth <abarth@webkit.org>
+
+ [V8] fast/dom/gc-9.html fails for document.styleSheets
+ https://bugs.webkit.org/show_bug.cgi?id=99786
+
+ Reviewed by Kentaro Hara.
+
+ V8 needs to know about this IDL attribute as well.
+
+ * css/StyleSheetList.idl:
+
+2012-10-18 Adam Barth <abarth@webkit.org>
+
+ [V8] fast/dom/gc-9.html fails for document.implementation
+ https://bugs.webkit.org/show_bug.cgi?id=99783
+
+ Reviewed by Kentaro Hara.
+
+ In order to correctly manage the lifetime of document.implementation,
+ we need to implement GenerateIsReachable=ImplDocument.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateVisitDOMWrapper):
+ * bindings/scripts/IDLAttributes.txt:
+ * dom/DOMImplementation.idl:
+
+2012-10-18 Chris Fleizach <cfleizach@apple.com>
+
+ AX: Crashes in WebProcess at com.apple.WebCore: -[AccessibilityObjectWrapper remoteAccessibilityParentObject] + 78
+ https://bugs.webkit.org/show_bug.cgi?id=96443
+
+ Reviewed by Beth Dakin.
+
+ Separate out the chain of calls so that the number of times document() is called is reduced and it will be easier
+ to determine which line this crash is happening on.
+
+ * accessibility/mac/WebAccessibilityObjectWrapper.mm:
+ (-[WebAccessibilityObjectWrapper remoteAccessibilityParentObject]):
+
+2012-10-18 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: Refactor IDBDatabaseBackendImpl to use IDBDatabaseMetadata
+ https://bugs.webkit.org/show_bug.cgi?id=99773
+
+ Reviewed by Tony Chang.
+
+ Refactor to begin separating out metadata from stateful backend objects,
+ in preparation for https://bugs.webkit.org/show_bug.cgi?id=99774.
+
+ Also includes some #include dependency cleanup so that the backing store
+ depends less on the stateful backend objects.
+
+ No new tests as this is purely a refactor.
+
+ * Modules/indexeddb/IDBBackingStore.h:
+ (WebCore):
+ (IDBBackingStore):
+ * Modules/indexeddb/IDBCursor.h:
+ * Modules/indexeddb/IDBCursorBackendImpl.h:
+ (WebCore):
+ * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+ (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
+ (WebCore::IDBDatabaseBackendImpl::openInternal):
+ (WebCore::IDBDatabaseBackendImpl::metadata):
+ (WebCore::IDBDatabaseBackendImpl::createObjectStore):
+ (WebCore::IDBDatabaseBackendImpl::setVersion):
+ (WebCore::IDBDatabaseBackendImpl::setVersionInternal):
+ (WebCore::IDBDatabaseBackendImpl::setIntVersionInternal):
+ (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
+ (WebCore::IDBDatabaseBackendImpl::openConnection):
+ (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
+ (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
+ (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
+ (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
+ (WebCore::IDBDatabaseBackendImpl::resetVersion):
+ * Modules/indexeddb/IDBDatabaseBackendImpl.h:
+ (WebCore::IDBDatabaseBackendImpl::id):
+ (IDBDatabaseBackendImpl):
+ * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
+ (WebCore::IDBLevelDBBackingStore::getIDBDatabaseMetaData):
+ (WebCore::IDBLevelDBBackingStore::deleteDatabase):
+ * Modules/indexeddb/IDBLevelDBBackingStore.h:
+ (IDBLevelDBBackingStore):
+ * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
+ * Modules/indexeddb/IDBTransaction.h:
+ (WebCore):
+
+2012-10-18 Peter Kasting <pkasting@google.com>
+
+ [Skia] Set m_hasAlpha correctly in ImageFrame::copyBitmapData.
+ https://bugs.webkit.org/show_bug.cgi?id=99781
+
+ Reviewed by Adam Barth.
+
+ No tests, since the actual effects of this bug are fickle and it's not
+ clear how to extract and check particular subframes of an animated GIF.
+
+ * platform/image-decoders/skia/ImageDecoderSkia.cpp:
+ (WebCore::ImageFrame::copyBitmapData):
+
+2012-10-18 Pan Deng <pan.deng@intel.com>
+
+ [Resource Timing]Implementation of resource timing buffer size restriction functionality
+ https://bugs.webkit.org/show_bug.cgi?id=84885.
+
+ Reviewed by Tony Gentilcore.
+
+ http://www.w3.org/TR/2012/CR-resource-timing-20120522/
+ This patch enable functionality of set buffer size(default is 150 as spec). When buffer is full, resourceTimingBufferFull event will be fired. Incoming entries will be dropped if no more space for them.
+
+ Tests: http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_full_when_populate_entries.html
+ http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_full_when_shrink_buffer_size.html
+ http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_size_restriction.html
+ http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_clear_resource_timing_functionality.html
+ http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_on_shrink_buffer_size.html
+ http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_store_and_clear_during_callback.html
+
+ * page/Performance.cpp:
+ (WebCore):
+ (WebCore::Performance::Performance):
+ (WebCore::Performance::webkitSetResourceTimingBufferSize):
+ (WebCore::Performance::addResourceTiming):
+ (WebCore::Performance::isResourceTimingBufferFull):
+ * page/Performance.h:
+ (Performance):
+
+2012-10-18 Ryosuke Niwa <rniwa@webkit.org>
+
+ REGRESSION(r130411): Copying & pasting the first line of text can move caret to the end of text area
+ https://bugs.webkit.org/show_bug.cgi?id=99663
+
+ Reviewed by Enrica Casucci and Levi Weintraub.
+
+ The bug was caused by positionOnlyToBeUpdated's offset not being shifted correctly in
+ ReplaceSelectionCommand::mergeTextNodesAroundPosition. Suppose we have text nodes t1 and t2 and
+ positionOnlyToBeUpdated had offset k in t2. When t2 is merged into t1, positionOnlyToBeUpdated should be
+ moved to (t1, n + k) where n is the ORIGINAL length of t1 before t2 is merged. But we were using
+ the length after t2 is merged.
+
+ Fixed the bug by saving the original length of t1 and using that in the offset adjustment.
+ Also use the right offset.
+
+ Test: editing/pasteboard/copy-paste-first-line-in-textarea.html
+
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
+
+2012-10-18 Claudio Saavedra <csaavedra@igalia.com>
+
+ [GTK] Invalid read from WebKit::DOMObjectCache::clearByFrame
+ https://bugs.webkit.org/show_bug.cgi?id=82882
+
+ Reviewed by Xan Lopez.
+
+ Based on a patch by Milan Crha <mcrha@redhat.com>
+
+ Prevent an invalid access to a pointer while clearing the DOM
+ object cache.
+ * bindings/gobject/DOMObjectCache.cpp:
+ (WebKit::DOMObjectCache::clearByFrame): Prevent an invalid access.
+
+2012-10-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r131810.
+ http://trac.webkit.org/changeset/131810
+ https://bugs.webkit.org/show_bug.cgi?id=99762
+
+ Broke linux debug webkit_unit_tests (Requested by
+ danakj|gardening on #webkit).
+
+ * WebCore.gypi:
+ * platform/graphics/ImageSource.cpp:
+ (WebCore::ImageSource::setData):
+ * platform/graphics/ImageSource.h:
+ (WebCore):
+ (ImageSource):
+ * platform/graphics/chromium/DeferredImageDecoder.cpp: Removed.
+ * platform/graphics/chromium/DeferredImageDecoder.h: Removed.
+ * platform/graphics/chromium/ImageDecodingStore.cpp: Removed.
+ * platform/graphics/chromium/ImageDecodingStore.h: Removed.
+ * platform/graphics/chromium/ImageFrameGenerator.cpp: Removed.
+ * platform/graphics/chromium/ImageFrameGenerator.h: Removed.
+ * platform/graphics/chromium/LazyDecodingPixelRef.cpp: Removed.
+ * platform/graphics/chromium/LazyDecodingPixelRef.h: Removed.
+ * platform/graphics/chromium/ScaledImageFragment.cpp: Removed.
+ * platform/graphics/chromium/ScaledImageFragment.h: Removed.
+ * platform/graphics/skia/NativeImageSkia.cpp:
+ (WebCore::NativeImageSkia::resizedBitmap):
+ * platform/image-decoders/ImageDecoder.h:
+ (ImageFrame):
+
+2012-10-18 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Do some cleanup in the chromium WebKit API
+ https://bugs.webkit.org/show_bug.cgi?id=99713
+
+ Reviewed by Adam Barth.
+
+ Removing the deprecated version of WebMediaStreamDescriptor::initialize.
+
+ No testing needed since only an unused function is removed.
+
+ * platform/chromium/support/WebMediaStreamDescriptor.cpp:
+
+2012-10-18 Alpha Lam <hclam@chromium.org>
+
+ [chromium] Implement deferred image decoding
+ https://bugs.webkit.org/show_bug.cgi?id=94240
+
+ Reviewed by Stephen White.
+
+ Objectives:
+
+ To record image decoding operations during painting and to defer
+ decoding operations until rasterization.
+
+ Rationale:
+
+ This is a key feature that enables impl-side painting which requires
+ fast recording of drawing operations. The existing decode-on-draw
+ restricts that recording has to block on expensive decoding operations.
+ This change allows recording of image decoding operations during paint
+ time.
+
+ Design:
+
+ Image decoding happens when a BitmapImage is drawn into a
+ GraphicsContext. When per-tile painting is enabled GraphicsContext
+ is backed by SkCanvas in recording mode. This SkCanvas records drawing
+ and image decoding operations to minimize recording time.
+
+ An image decoding operation is recorded as a SkPixelRef object
+ implemented by LazyDecodingPixelRef. This object references raw encoded
+ data, regions to be decoded and scaling information.
+
+ When used in conjunction with per-tile painting this feature defers
+ image decoding until the SkCanvas referencing the image is rasterized.
+
+ Both recording and rasterization happen on the main thread.
+
+ Performance Impact:
+
+ This feature is enabled by WebKit::setDeferredImageDecodingEnabled()
+ and does not have an impact when disabled.
+
+ This feature is disabled by default.
+
+ Upcoming Changes:
+
+ 1. Implement a full-featured image cache in ImageDecodingStore.
+ 2. Allow rasterization and decoding on impl thread.
+
+ Classes Involved:
+
+ BitmapImage
+
+ BitmapImage is the entry point for deferred image decoding. When
+ drawing a BitmapImage into a GraphicsContext it makes a request to
+ create a NativeImageSkia. We substitute the content in NativeImageSkia
+ such that it is lazily decoded.
+
+ DeferredImageDecoder
+
+ This is the platform implementation of a image decoder for Chromium.
+ This is a bridge layer that either delegates calls to the actual
+ ImageDecoder or create a lazily-decoded SkBitmap and delegates calls
+ to ImageDecodingStore.
+
+ ImageDecodingStore
+
+ This object manages all encoded images. It keeps track of encoded
+ data and the corresponding ImageDecoder for doing actual decoding. It
+ is also responsible for generating lazily decoded SkBitmaps. This
+ SkBitmap contains a LazyDecodingPixelRef object which references to an
+ image entry in ImageDecodingStore.
+
+ ScaledImageFragment
+
+ A container for a scaled image fragment. In addition to bitmap pixels
+ it contains information about the ID of the image, scale and clipping.
+
+ ImageFrameGenerator
+
+ This object is responsible for generating decoded pixels. It is also
+ a container for encoded image data and corresponding image decoder.
+
+ LazyDecodingPixelRef
+
+ This object is embedded in a SkBitmap to enable lazy decoding. When
+ SkBitmap needs to access pixels LazyDecodingPixelRef is locked. It
+ contains information to locate an image and scaling info, these
+ information is submitted to ImageDecodingStore to access actual pixels.
+
+ Layout tests. There are about 80 tests in this virtual test suite
+ running this feature in this directory:
+
+ platform/chromium/virtual/deferred/fast/images
+
+ Unit tests. Added DeferredImageDecoderTest to verify deferred
+ image decoding behavior.
+
+ * WebCore.gypi:
+ * platform/graphics/ImageSource.cpp:
+ (WebCore::ImageSource::setData):
+ * platform/graphics/ImageSource.h:
+ (WebCore):
+ (ImageSource):
+ * platform/graphics/chromium/DeferredImageDecoder.cpp: Added.
+ (WebCore):
+ (WebCore::DeferredImageDecoder::DeferredImageDecoder):
+ (WebCore::DeferredImageDecoder::~DeferredImageDecoder):
+ (WebCore::DeferredImageDecoder::create):
+ (WebCore::DeferredImageDecoder::createForTesting):
+ (WebCore::DeferredImageDecoder::filenameExtension):
+ (WebCore::DeferredImageDecoder::frameBufferAtIndex):
+ (WebCore::DeferredImageDecoder::setData):
+ (WebCore::DeferredImageDecoder::isSizeAvailable):
+ (WebCore::DeferredImageDecoder::size):
+ (WebCore::DeferredImageDecoder::frameSizeAtIndex):
+ (WebCore::DeferredImageDecoder::frameCount):
+ (WebCore::DeferredImageDecoder::repetitionCount):
+ (WebCore::DeferredImageDecoder::clearFrameBufferCache):
+ (WebCore::DeferredImageDecoder::frameHasAlphaAtIndex):
+ (WebCore::DeferredImageDecoder::frameBytesAtIndex):
+ * platform/graphics/chromium/DeferredImageDecoder.h: Added.
+ (WebCore):
+ (DeferredImageDecoder):
+ * platform/graphics/chromium/ImageDecodingStore.cpp: Added.
+ (WebCore::ImageDecodingStore::ImageDecodingStore):
+ (WebCore):
+ (WebCore::ImageDecodingStore::~ImageDecodingStore):
+ (WebCore::ImageDecodingStore::instanceOnMainThread):
+ (WebCore::ImageDecodingStore::initializeOnMainThread):
+ (WebCore::ImageDecodingStore::shutdown):
+ (WebCore::ImageDecodingStore::isLazyDecoded):
+ (WebCore::ImageDecodingStore::createLazyDecodedSkBitmap):
+ (WebCore::ImageDecodingStore::resizeLazyDecodedSkBitmap):
+ (WebCore::ImageDecodingStore::setData):
+ (WebCore::ImageDecodingStore::lockPixels):
+ (WebCore::ImageDecodingStore::unlockPixels):
+ (WebCore::ImageDecodingStore::frameGeneratorBeingDestroyed):
+ (WebCore::ImageDecodingStore::calledOnValidThread):
+ (WebCore::ImageDecodingStore::lookupFrameCache):
+ (WebCore::ImageDecodingStore::deleteFrameCache):
+ * platform/graphics/chromium/ImageDecodingStore.h: Added.
+ (WebCore):
+ (ImageDecodingStore):
+ (WebCore::ImageDecodingStore::create):
+ * platform/graphics/chromium/ScaledImageFragment.cpp: Added.
+ (WebCore):
+ (WebCore::ScaledImageFragment::~ScaledImageFragment):
+ (WebCore::ScaledImageFragment::ScaledImageFragment):
+ (WebCore::ScaledImageFragment::isEqual):
+ * platform/graphics/chromium/ScaledImageFragment.h: Added.
+ (WebCore):
+ (ScaledImageFragment):
+ (WebCore::ScaledImageFragment::create):
+ (WebCore::ScaledImageFragment::bitmap):
+ (WebCore::ScaledImageFragment::isComplete):
+ * platform/graphics/chromium/ImageFrameGenerator.cpp: Added.
+ (WebCore):
+ (WebCore::ImageFrameGenerator::ImageFrameGenerator):
+ (WebCore::ImageFrameGenerator::~ImageFrameGenerator):
+ (WebCore::ImageFrameGenerator::decoder):
+ (WebCore::ImageFrameGenerator::setData):
+ * platform/graphics/chromium/ImageFrameGenerator.h: Added.
+ (WebCore):
+ (ImageFrameGenerator):
+ (WebCore::ImageFrameGenerator::create):
+ (WebCore::ImageFrameGenerator::size):
+ (WebCore::ImageFrameGenerator::imageId):
+ * platform/graphics/chromium/LazyDecodingPixelRef.cpp: Added.
+ (WebCore):
+ (WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef):
+ (WebCore::LazyDecodingPixelRef::~LazyDecodingPixelRef):
+ (WebCore::LazyDecodingPixelRef::isScaled):
+ (WebCore::LazyDecodingPixelRef::isClipped):
+ (WebCore::LazyDecodingPixelRef::onLockPixels):
+ (WebCore::LazyDecodingPixelRef::onUnlockPixels):
+ (WebCore::LazyDecodingPixelRef::onLockPixelsAreWritable):
+ * platform/graphics/chromium/LazyDecodingPixelRef.h: Added.
+ (WebCore):
+ (LazyDecodingPixelRef):
+ (WebCore::LazyDecodingPixelRef::frameGenerator):
+ * platform/graphics/skia/NativeImageSkia.cpp:
+ (WebCore::NativeImageSkia::resizedBitmap):
+ * platform/image-decoders/ImageDecoder.h:
+ (ImageFrame):
+ (WebCore::ImageFrame::setSkBitmap):
+ (WebCore::ImageFrame::getSkBitmap):
+
+2012-10-18 Yael Aharon <yael.aharon@intel.com>
+
+ [EFL] GraphicsContext3D::m_renderStyle is not initialized
+ https://bugs.webkit.org/show_bug.cgi?id=99721
+
+ Reviewed by Antonio Gomes.
+
+ Initialize GraphicsContext3D::m_renderStyle.
+
+ No new tests, no new functionality.
+
+ * platform/graphics/efl/GraphicsContext3DEfl.cpp:
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2012-10-18 Max Vujovic <mvujovic@adobe.com>
+
+ [CSS Shaders] Validate types of built-in vertex attributes
+ https://bugs.webkit.org/show_bug.cgi?id=98972
+
+ Reviewed by Dean Jackson.
+
+ Reject custom filters in which the author defined built-in attributes with the wrong type.
+ For example, the GLSL declaration "attribute float a_position" is incorrect because
+ a_position should be a vec4, not a float.
+
+ Test: css3/filters/custom/invalid-custom-filter-attribute-types.html
+
+ * platform/graphics/ANGLEWebKitBridge.h:
+ (WebCore::ANGLEShaderSymbol::isSampler):
+ Add const qualifier to isSampler method.
+ * platform/graphics/filters/CustomFilterValidatedProgram.cpp:
+ (WebCore):
+ (WebCore::builtInAttributeNameToTypeMap):
+ New file static function. Returns a map of the CSS Custom Filters built-in attribute
+ names and their expected types.
+ (WebCore::validateSymbols):
+ New file static function. Loop through all of the symbols. Reject the shader if we find
+ a built-in attribute defined with the wrong type.
+ (WebCore::CustomFilterValidatedProgram::CustomFilterValidatedProgram):
+ Call the new validateSymbols function. If it returns false, exit the constructor early,
+ which rejects the program.
+ Move the loop that checks if any uniform is a sampler into the the validateSymbols
+ function.
+
+2012-10-18 Mike Reed <reed@google.com>
+
+ Handle if we fail to allocate nonPlatformCanvas in ImageBuffer constructor
+ https://bugs.webkit.org/show_bug.cgi?id=99752
+
+ Reviewed by Stephen White.
+
+ Current code does not check if we were able to allocate the pixels, but still returns the canvas.
+ However, the caller explicitly is checking for null on failure, so it will continue (and possibly
+ crash later on).
+ This change brings the nonPlatformCanvas behavior inline with createAcceleratedCanvas and
+ TryCreateBitmapCanvas, both of which are also called by ImageBuffer's constructor.
+
+ No new tests. Existing tests exercise ImageBuffer constructor.
+
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ (WebCore::createNonPlatformCanvas):
+
+2012-10-18 Beth Dakin <bdakin@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=99668
+ REGRESSION: Crash in
+ WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion
+ -and corresponding-
+ <rdar://problem/12491901>
+
+ Reviewed by Simon Fraser.
+
+ http://trac.webkit.org/changeset/130783 changed the lifetime of the
+ ScrollingStateTree's rootStateNode. Before that patch, the root state
+ node was never destroyed. It was just constantly re-used for
+ different RenderLayerBackings. This crash is just one of a few bugs
+ that has occurred because of that change. I have fixed the other bugs
+ individually, but I think that long-term, it is the safest solution
+ to go back to the original ownership model.
+
+ So this patch ensures that the state tree will always have a root
+ state node. Instead of destroying and re-creating the root node when
+ it's scroll ID changes, we just update the ID.
+
+ attachToStateTree() now takes an additional ID representing the ID of
+ the parent node.
+ * page/scrolling/ScrollingCoordinator.h:
+ (WebCore::ScrollingCoordinator::attachToStateTree):
+
+ Add a way to set the scrolling node ID.
+ * page/scrolling/ScrollingStateNode.h:
+ (WebCore::ScrollingStateNode::setScrollingNodeID):
+
+ This code that provided a way to mark all properties as having
+ changed was added in http://trac.webkit.org/changeset/130989 as a way
+ to ensure we would re-set ScrollingThread's nodes when we destroyed
+ and re-created the rootStateNode. Now that we are no longer
+ destroying and re-creating the rootStateNode, this code is no longer
+ necessary.
+ * page/scrolling/ScrollingStateScrollingNode.cpp:
+ * page/scrolling/ScrollingStateScrollingNode.h:
+
+ create m_rootStateNode right in the ScrollingStateTree's constructor.
+ * page/scrolling/ScrollingStateTree.cpp:
+ (WebCore::ScrollingStateTree::ScrollingStateTree):
+
+ Don't let removeNode() destroy m_rootStateNode.
+ (WebCore::ScrollingStateTree::removeNode):
+
+ Also a part of r130989 that is no longer needed.
+ (WebCore::ScrollingStateTree::rootLayerDidChange():
+ * page/scrolling/ScrollingStateTree.h:
+ (WebCore::ScrollingStateTree::rootStateNode):
+ (ScrollingStateTree):
+ (WebCore::ScrollingStateTree::setRootStateNode):
+
+ attachToStateTree() now takes an additional ID representing the ID of
+ the parent node.
+ * page/scrolling/mac/ScrollingCoordinatorMac.h:
+ (ScrollingCoordinatorMac):
+
+ We no longer need ScrollingStateTree::rootLayerDidChange()
+ * page/scrolling/mac/ScrollingCoordinatorMac.mm:
+ (WebCore::ScrollingCoordinatorMac::frameViewRootLayerDidChange):
+
+ Do not destroy and re-create the state node. Just update its ID. When
+ we support child nodes soon, we will create them in this function.
+ (WebCore::ScrollingCoordinatorMac::attachToStateTree):
+
+ No need to null-check the rootStateNode.
+ (WebCore::ScrollingCoordinatorMac::clearStateTree):
+
+ Send 0 as the parent node ID to attachToStateTree() to represent the
+ root node.
+ (WebCore::ScrollingCoordinatorMac::ensureRootStateNodeForFrameView):
+ * rendering/RenderLayerBacking.cpp:
+
+ RenderLayerBacking::attachToScrollingCoordinator() now takes a parent
+ layer.
+ (WebCore::RenderLayerBacking::attachToScrollingCoordinator):
+ * rendering/RenderLayerBacking.h:
+ (RenderLayerBacking):
+
+ Since this is the root, send 0 to represent the parent layer.
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateBacking):
+
+2012-10-18 Yael Aharon <yael.aharon@intel.com>
+
+ [EFL] GraphicsContext3D::m_renderStyle is not initialized
+ https://bugs.webkit.org/show_bug.cgi?id=99721
+
+ Reviewed by Antonio Gomes.
+
+ Initialize GraphicsContext3D::m_renderStyle.
+
+ No new tests, no new functionality.
+
+ * platform/graphics/efl/GraphicsContext3DEfl.cpp:
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2012-10-18 Brian White <bcwhite@chromium.org>
+
+ WebKit Doesn't Recognize Content-Language HTTP Header
+ https://bugs.webkit.org/show_bug.cgi?id=97929
+
+ Reviewed by Alexey Proskuryakov.
+
+ The HTTP "Content-Language" header may be present and include the
+ language of the page contents (as opposed to an embedded meta tag).
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::didBeginDocument):
+
+2012-10-18 Jer Noble <jer.noble@apple.com>
+
+ Crash in WebCore::Document::webkitExitFullscreen + 618
+ https://bugs.webkit.org/show_bug.cgi?id=99496
+
+ Reviewed by Eric Carlson.
+
+ Prospective fix for null-dereference crash in Document::webkitExitFullscreen().
+
+ * dom/Document.cpp:
+ (WebCore::Document::webkitExitFullscreen): Null check page() before calling page()->chrome.
+
+2012-10-18 Pablo Flouret <pablof@motorola.com>
+
+ Implement css3-conditional's @supports rule
+ https://bugs.webkit.org/show_bug.cgi?id=86146
+
+ Reviewed by Antti Koivisto.
+
+ The "@supports" rule is a conditional group rule whose condition tests
+ whether the user agent supports CSS property:value pairs.
+
+ http://dev.w3.org/csswg/css3-conditional/#at-supports
+
+ Test: css3/supports.html
+
+ * Configurations/FeatureDefines.xcconfig:
+ * GNUmakefile.am:
+ * GNUmakefile.features.am:
+ Add an ENABLE_CSS3_CONDITIONAL_RULES flag.
+
+ * css/CSSGrammar.y.in:
+ * css/CSSParser.cpp:
+ (WebCore):
+ (WebCore::CSSParser::detectSupportsToken): Tries to find 'and', 'not' and 'or' tokens.
+ (WebCore::CSSParser::detectAtToken): Enter SupportsMode if @supports is detected.
+ (WebCore::CSSParser::realLex): Try to detect supports tokens when in SupportsMode.
+ * css/CSSParser.h: Added new SupportsMode parsing mode.
+ (CSSParser):
+
+2012-10-18 Marja Hölttä <marja@chromium.org>
+
+ Fix: CachedResourceLoader::requestSVGDocument was passing an URL as charset
+ https://bugs.webkit.org/show_bug.cgi?id=99730
+
+ Reviewed by Jochen Eisinger.
+
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::requestSVGDocument):
+
+2012-10-18 Jer Noble <jer.noble@apple.com>
+
+ Fullscreen movie controls behave incorrectly when clicked (and dragged)
+ https://bugs.webkit.org/show_bug.cgi?id=99610
+
+ Reviewed by Eric Carlson.
+
+ Do not reset the relative drag position to 0,0 at the beginning of every drag. Instead,
+ store the cumulative drag offset and accumulate during each additional drag.
+
+ No new tests; modified the fullscreen/video-controls-drag.html test.
+
+ * html/shadow/MediaControlElements.cpp:
+ (WebCore::MediaControlPanelElement::startDrag): Reset m_lastDragEventLocation.
+ (WebCore::MediaControlPanelElement::continueDrag): Accumulate drag distance in m_cumulativeDragOffset.
+ (WebCore::MediaControlPanelElement::resetPosition): Reset m_cumulativeDragOffset.
+ * html/shadow/MediaControlElements.h:
+
+2012-10-18 Brandon Jones <bajones@google.com>
+
+ Implement OES_element_index_uint / WEBKIT_OES_element_index_uint
+ https://bugs.webkit.org/show_bug.cgi?id=97400
+
+ Reviewed by Kenneth Russell.
+
+ Implemented OES_element_index_uint WebGL extension
+
+ Test: fast/canvas/webgl/oes-element-index-uint.html
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * DerivedSources.pri:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSWebGLRenderingContextCustom.cpp:
+ (WebCore::toJS):
+ * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+ (WebCore::toV8Object):
+ * html/canvas/OESElementIndexUint.cpp: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
+ (WebCore):
+ (WebCore::OESElementIndexUint::OESElementIndexUint):
+ (WebCore::OESElementIndexUint::~OESElementIndexUint):
+ (WebCore::OESElementIndexUint::getName):
+ (WebCore::OESElementIndexUint::create):
+ * html/canvas/OESElementIndexUint.h: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
+ (WebCore):
+ (OESElementIndexUint):
+ * html/canvas/OESElementIndexUint.idl: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
+ * html/canvas/WebGLExtension.h:
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore):
+ (WebCore::WebGLRenderingContext::validateElementArraySize):
+ (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
+ (WebCore::WebGLRenderingContext::validateIndexArrayPrecise):
+ (WebCore::WebGLRenderingContext::validateRenderingState):
+ (WebCore::WebGLRenderingContext::drawElements):
+ (WebCore::WebGLRenderingContext::getExtension):
+ (WebCore::WebGLRenderingContext::getSupportedExtensions):
+ * html/canvas/WebGLRenderingContext.h:
+ (WebCore):
+ (WebGLRenderingContext):
+ * platform/graphics/Extensions3D.h:
+ (Extensions3D):
+ * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+ (WebCore::Extensions3DOpenGL::supportsExtension):
+
+2012-10-18 Jer Noble <jer.noble@apple.com>
+
+ Add diagnostic logging to track per-page media engine usage.
+ https://bugs.webkit.org/show_bug.cgi?id=99615
+ <rdar://problem/12476473>
+
+ Reviewed by Eric Carlson.
+
+ Add diagnostic logging triggered only once-per-page and once-per-page-per-engine.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::logMediaLoadRequest): Encapsulate diagnostic logging into single static method.
+ (WebCore::HTMLMediaElement::mediaLoadingFailed): Call logMediaLoadRequest.
+ (WebCore::HTMLMediaElement::setReadyState): Ditto.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::dispatchDidCommitLoad): Reset the set of seen media engines.
+
+ Add new methods to Page to track per-page media engine diagnostic info, similar to plugin diagnostic info.
+ * page/Page.cpp:
+ (WebCore::Page::hasSeenAnyMediaEngine):
+ (WebCore::Page::hasSeenMediaEngine):
+ (WebCore::Page::sawMediaEngine):
+ (WebCore::Page::resetSeenMediaEngines):
+ * page/Page.h:
+
+ Add new static logging key definitions:
+ * page/DiagnosticLoggingKeys.cpp:
+ (WebCore::DiagnosticLoggingKeys::pageContainsMediaEngineKey):
+ (WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey):
+ * page/DiagnosticLoggingKeys.h:
+
+2012-10-18 Michael Saboff <msaboff@apple.com>
+
+ Add 8-bit path to RenderBlock::handleTrailingSpaces()
+ https://bugs.webkit.org/show_bug.cgi?id=99731
+
+ Reviewed by Dan Bernstein.
+
+ Factored out and added findFirstTrailingSpace() templated helper function that is called with the
+ approriate character pointer type.
+
+ No tests needed, change covered by existing tests.
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::findFirstTrailingSpace):
+ (WebCore::RenderBlock::handleTrailingSpaces):
+
+2012-10-18 Hans Muller <hmuller@adobe.com>
+
+ [CSS Exclusions] Add ExclusionShape::shapeBoundingBox() method
+ https://bugs.webkit.org/show_bug.cgi?id=99216
+
+ Reviewed by Dirk Schulze.
+
+ Added a FloatRect::extend() method which simplifies writing loops that
+ accumulate the bounding box for a sequence of FloatPoints. The new method
+ is used by ExclusionPolygon to initialize the shape's logical and physical
+ bounding boxes. This a clean-up, not a change in functionality. It's already
+ covered by the existing fast/exclusions LayoutTests.
+
+ * platform/graphics/FloatRect.cpp:
+ (WebCore::FloatRect::extend): Extend the FloatRect's bounds to include a FloatPoint.
+ (WebCore):
+ * platform/graphics/FloatRect.h:
+ (FloatRect): Added extend() method.
+ * rendering/ExclusionPolygon.cpp:
+ (WebCore::ExclusionPolygon::ExclusionPolygon): Use FloatRect::extend() to compute the polygon's internal bounding box.
+ * rendering/ExclusionShape.cpp:
+ (WebCore::ExclusionShape::createExclusionShape): Use FloatRect::extend() to compute the polygon's physical bounding box.
+ * rendering/ExclusionShape.h:
+ (WebCore::ExclusionShape::shapeBoundingBox): Return the shape's bounding box in physical coordinates.
+ (ExclusionShape):
+
+2012-10-18 Hans Muller <hmuller@adobe.com>
+
+ [CSS Exclusions] Handle special case "empty" shapes
+ https://bugs.webkit.org/show_bug.cgi?id=99342
+
+ Reviewed by Dirk Schulze.
+
+ Provide expclit coverage of the simple "empty" shape-inside shapes.
+ Shapes will be considered "empty" in the sense that ExclusionShape::getIncludedIntervals()
+ and ExclusionShape::getExcludedIntervals() will always return empty lists of intervals.
+ This patch covers rectangles of zero width or height, circles with 0 radius, ellipses
+ with 0 radiusX or radiusY, polygons with less than 3 vertices.
+
+ Test: fast/exclusions/shape-inside/shape-inside-empty.html
+
+ * rendering/ExclusionPolygon.cpp:
+ (WebCore::ExclusionPolygon::ExclusionPolygon): Initialize the m_empty flag.
+ (WebCore::ExclusionPolygon::getExcludedIntervals): Added short-circuit return when the polygon is empty.
+ (WebCore::ExclusionPolygon::getIncludedIntervals): Added short-circuit return when the polygon is empty.
+ * rendering/ExclusionPolygon.h: Added the isEmpty() method.
+ * rendering/ExclusionRectangle.cpp:
+ (WebCore::ExclusionRectangle::getExcludedIntervals): Added short-circuit return when the rectangle is empty.
+ (WebCore::ExclusionRectangle::getIncludedIntervals): Added short-circuit return when the rectangle is empty.
+ * rendering/ExclusionRectangle.h: Added the isEmpty() method.
+ * rendering/ExclusionShape.h: Added a virtual isEmpty() ExclusionShape method.
+ (ExclusionShape):
+
+2012-10-18 Takashi Sakamoto <tasak@google.com>
+
+ REGRESSION(r131464): Null-pointer crash in StyleResolver::styleForElement
+ https://bugs.webkit.org/show_bug.cgi?id=99587
+
+ Reviewed by Dimitri Glazkov.
+
+ Since contents in datalist are not shown, summary in datalist is not
+ shown either. So the summary has no render style. On the other hand,
+ the summary is implemented by shadow DOM and it has some insertion
+ point. Its child, e.g. title in the below test, is distributed.
+ To solve the child's user-modify, looking at shadow host(=summary)'s
+ style causes null-pointer crash.
+
+ Test: fast/dom/shadow/user-modify-in-datalist-crash.html
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::styleForElement):
+ Added a code to check whether the shadow host has any style or not.
+
+2012-10-17 Philippe Normand <pnormand@igalia.com>
+
+ [GTK] AudioBusGtk sometimes fails to load the HRTF database
+ https://bugs.webkit.org/show_bug.cgi?id=99601
+
+ Reviewed by Martin Robinson.
+
+ AudioBusGtk now first lookup for the uninstalled resource files,
+ if the AUDIO_RESOURCES_PATH environment variable is
+ set. Additionally the audio file reader is now better dealing with
+ errors, returning an empty AudioBus in such cases and issuing
+ warnings on the console output. The cleanup of some member
+ variables was also moved to the destructor.
+
+ * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
+ (AudioFileReader):
+ (WebCore::AudioFileReader::AudioFileReader):
+ (WebCore::AudioFileReader::~AudioFileReader): Clear and free
+ member variables. This was done in createBus before.
+ (WebCore::AudioFileReader::handleMessage): Issue warnings in case
+ of error and exit from the main loop so the pipeline is not
+ forever stuck.
+ (WebCore::AudioFileReader::createBus): Return an empty bus in case
+ of error.
+ * platform/audio/gtk/AudioBusGtk.cpp:
+ (WebCore::AudioBus::loadPlatformResource): Load uninstalled
+ resources first if AUDIO_RESOURCES_PATH is set.
+
+2012-10-18 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: provisional change for merging "doced" state into the "dock side" enum.
+ https://bugs.webkit.org/show_bug.cgi?id=99718
+
+ Reviewed by Vsevolod Vlasov.
+
+ Adds stub method that could be executed from the embedder.
+
+ * inspector/front-end/InspectorFrontendAPI.js:
+ (InspectorFrontendAPI.setDockSide):
+
+2012-10-18 Kent Tamura <tkent@chromium.org>
+
+ Add Localizer::monthFormat and implementations
+ https://bugs.webkit.org/show_bug.cgi?id=99704
+
+ Reviewed by Kentaro Hara.
+
+ Localizer::monthFormat will be used for constructing input[type=month] UI.
+
+ Tests: Add unit tests to Source/WebKit/chromium/tests/.
+
+ * platform/text/Localizer.h:
+ (Localizer): Declare pure virtual monthFormat function.
+
+ * platform/text/LocaleNone.cpp:
+ (LocaleNone): Declare monthFormat.
+ (WebCore::LocaleNone::monthFormat):
+ Added. Always reutrns an ISO-8601 format, "yyyy-MM"
+
+ * platform/text/LocaleICU.h:
+ (LocaleICU): Declare monthFormat.
+ * platform/text/LocaleICU.cpp:
+ (WebCore::getFormatForSkeleton):
+ A helper to get a format for the specified skeleton.
+ The overflow-allocalte-try-again pattern is similar to
+ LocaleICU::decimalSymbol and LocaleICU::decimalTextAttribute.
+ (WebCore::LocaleICU::monthFormat):
+ Added. Calls getFormatForSkeleton with "yyyyMMM".
+
+ * platform/text/mac/LocaleMac.h:
+ (LocaleMac): Declare monthFormat.
+ * platform/text/mac/LocaleMac.mm:
+ (WebCore::LocaleMac::monthFormat):
+ Added. Calls NSDateFormatter::dateFormatFromTemplate with "yyyyMMM".
+
+ * platform/text/LocaleWin.h:
+ (LocaleWin): Declare monthFormat.
+ * platform/text/LocaleWin.cpp:
+ (WebCore::LocaleWin::monthFormat):
+ Get a format by LOCALE_SYEARMONTH, and convert it to an LDML format.
+
+2012-10-18 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: add X-WebKit-CSP header into inspector.html
+ https://bugs.webkit.org/show_bug.cgi?id=99710
+
+ Reviewed by Vsevolod Vlasov.
+
+ A simple sanity measure.
+
+ * inspector/front-end/inspector.html:
+
+2012-10-18 Huang Dongsung <luxtella@company100.net>
+
+ [WK2] Add CustomFilterOperation serialization in ArgumentCoder.
+ https://bugs.webkit.org/show_bug.cgi?id=98733
+
+ Reviewed by Noam Rosenthal.
+
+ Change CustomFilterOperation::parameters() to const function, because
+ this method is a getter and a const instance needs to call this method.
+
+ No new tests because there is no change in behavior.
+
+ * platform/graphics/filters/CustomFilterOperation.h:
+ (WebCore::CustomFilterOperation::parameters):
+
+2012-10-18 Hayato Ito <hayato@chromium.org>
+
+ treeScopeOfParent doesn't return the TreeScope of the parent
+ https://bugs.webkit.org/show_bug.cgi?id=98207
+
+ Reviewed by Hajime Morita.
+
+ A minor clean up. Remove treeScopeOfParent() in Element.cpp.
+
+ No tests needed, this is just a clean up.
+
+ * dom/Element.cpp:
+ (WebCore::Element::removedFrom):
+
+2012-10-18 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: [Styles] Forcibly invoke property names suggestion box for empty prefix
+ https://bugs.webkit.org/show_bug.cgi?id=99711
+
+ Reviewed by Vsevolod Vlasov.
+
+ Suggestions should be returned unconditionally for CSS property names, regardless of the prefix.
+
+ * inspector/front-end/CSSCompletions.js:
+ (WebInspector.CSSCompletions):
+ (WebInspector.CSSCompletions.requestCSSNameCompletions):
+ (WebInspector.CSSCompletions.prototype._firstIndexOfPrefix):
+ * inspector/front-end/CSSKeywordCompletions.js:
+ (WebInspector.CSSKeywordCompletions.forProperty):
+
+2012-10-18 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+
+ Unreviewed, do not make UseV8.cmake executable.
+
+ * UseV8.cmake: Removed property svn:executable.
+
2012-10-18 Tommy Widenflycht <tommyw@google.com>
MediaStream API: Add better RTCPeerConnectionHandler creation logic
diff --git a/Source/WebCore/Configurations/FeatureDefines.xcconfig b/Source/WebCore/Configurations/FeatureDefines.xcconfig
index aba17898d..534cbd4bf 100644
--- a/Source/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebCore/Configurations/FeatureDefines.xcconfig
@@ -48,7 +48,8 @@ ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
ENABLE_CSS_COMPOSITING = ENABLE_CSS_COMPOSITING;
ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
ENABLE_CSS_VARIABLES = ;
-ENABLE_CSS3_TEXT_DECORATION = ;
+ENABLE_CSS3_CONDITIONAL_RULES = ;
+ENABLE_CSS3_TEXT = ;
ENABLE_CUSTOM_SCHEME_HANDLER = ;
ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
@@ -148,4 +149,4 @@ ENABLE_WEB_TIMING = ;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
index f5b04aae8..a0b77c5de 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
@@ -377,6 +377,7 @@ BINDING_IDLS = \
$(WebCore)/html/canvas/Int16Array.idl \
$(WebCore)/html/canvas/Int32Array.idl \
$(WebCore)/html/canvas/Int8Array.idl \
+ $(WebCore)/html/canvas/OESElementIndexUint.idl \
$(WebCore)/html/canvas/OESStandardDerivatives.idl \
$(WebCore)/html/canvas/OESTextureFloat.idl \
$(WebCore)/html/canvas/OESVertexArrayObject.idl \
diff --git a/Source/WebCore/DerivedSources.pri b/Source/WebCore/DerivedSources.pri
index f4235a45d..010a0e657 100644
--- a/Source/WebCore/DerivedSources.pri
+++ b/Source/WebCore/DerivedSources.pri
@@ -301,6 +301,7 @@ IDL_BINDINGS += \
$$PWD/html/canvas/OESStandardDerivatives.idl \
$$PWD/html/canvas/OESTextureFloat.idl \
$$PWD/html/canvas/OESVertexArrayObject.idl \
+ $$PWD/html/canvas/OESElementIndexUint.idl \
$$PWD/html/canvas/WebGLActiveInfo.idl \
$$PWD/html/canvas/WebGLBuffer.idl \
$$PWD/html/canvas/WebGLCompressedTextureS3TC.idl \
diff --git a/Source/WebCore/English.lproj/localizedStrings.js b/Source/WebCore/English.lproj/localizedStrings.js
index 290861b14..a962ec553 100644
--- a/Source/WebCore/English.lproj/localizedStrings.js
+++ b/Source/WebCore/English.lproj/localizedStrings.js
@@ -2,7 +2,6 @@ var localizedStrings = new Object;
localizedStrings[" (%d)"] = " (%d)";
localizedStrings[" (repeated %d times)"] = " (repeated %d times)";
-localizedStrings["1 - %d"] = "1 - %d";
localizedStrings["%.0fB"] = "%.0fB";
localizedStrings["%.0fKB"] = "%.0fKB";
localizedStrings["%.0fMB"] = "%.0fMB";
@@ -10,7 +9,7 @@ localizedStrings["%.0fms"] = "%.0fms";
localizedStrings["%.1f days"] = "%.1f days";
localizedStrings["%.1fhrs"] = "%.1fhrs";
localizedStrings["%.1fmin"] = "%.1fmin";
-localizedStrings["%.2f%%"] = "%.2f%%";
+localizedStrings["%.2f%"] = "%.2f%";
localizedStrings["%.2fKB"] = "%.2fKB";
localizedStrings["%.2fMB"] = "%.2fMB";
localizedStrings["%.2fs"] = "%.2fs";
@@ -25,26 +24,21 @@ localizedStrings["%d error, %d warnings"] = "%d error, %d warnings";
localizedStrings["%d errors"] = "%d errors";
localizedStrings["%d errors, %d warning"] = "%d errors, %d warning";
localizedStrings["%d errors, %d warnings"] = "%d errors, %d warnings";
-localizedStrings["%d of %d matches"] = "%d of %d matches";
-localizedStrings["%d matches"] = "%d matches";
+localizedStrings["%d of %d"] = "%d of %d";
localizedStrings["%d of %d captured records are visible"] = "%d of %d captured records are visible";
localizedStrings["%d warning"] = "%d warning";
localizedStrings["%d warnings"] = "%d warnings";
-localizedStrings["%d × %d pixels (Natural: %d × %d pixels)"] = "%d × %d pixels (Natural: %d × %d pixels)";
-localizedStrings["%d × %d pixels"] = "%d × %d pixels";
+localizedStrings["%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)"] = "%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)";
+localizedStrings["%d \xd7 %d pixels"] = "%d \xd7 %d pixels";
localizedStrings["%d × %d"] = "%d × %d";
localizedStrings["%s (%s)"] = "%s (%s)";
localizedStrings["%s (at %s)"] = "%s (at %s)";
localizedStrings["%s (from cache)"] = "%s (from cache)";
localizedStrings["%s - Details"] = "%s - Details";
-localizedStrings["%s >1000%%"] = "%s >1000%%";
localizedStrings["%s collected"] = "%s collected";
localizedStrings["%s download"] = "%s download";
localizedStrings["%s latency"] = "%s latency";
localizedStrings["%s latency, %s download (%s total)"] = "%s latency, %s download (%s total)";
-localizedStrings["%s%.2f%%"] = "%s%.2f%%";
-localizedStrings["%s%d"] = "%s%d";
-localizedStrings["%s%s"] = "%s%s";
localizedStrings["(anonymous function)"] = "(anonymous function)";
localizedStrings["(data url)"] = "(data url)";
localizedStrings["(from cache)"] = "(from cache)";
@@ -56,11 +50,9 @@ localizedStrings["(program)"] = "(program)";
localizedStrings["(text)"] = "(text)";
localizedStrings["(unable to decode value)"] = "(unable to decode value)";
localizedStrings["(whitespace)"] = "(whitespace)";
-localizedStrings["1 of 1 match"] = "1 of 1 match";
-localizedStrings["1 match"] = "1 match";
localizedStrings["Application Cache"] = "Application Cache";
localizedStrings["Accept suggestion"] = "Accept suggestion";
-localizedStrings["Activate all breakpoints."] = "Activate all breakpoints.";
+localizedStrings["Activate All breakpoints"] = "Activate All breakpoints";
localizedStrings["Activate all breakpoints"] = "Activate all breakpoints";
localizedStrings["Add Attribute"] = "Add Attribute";
localizedStrings["Add attribute"] = "Add attribute";
@@ -69,7 +61,6 @@ localizedStrings["Add breakpoint"] = "Add breakpoint";
localizedStrings["Add Conditional Breakpoint…"] = "Add Conditional Breakpoint…";
localizedStrings["Add conditional breakpoint…"] = "Add conditional breakpoint…";
localizedStrings["Add New"] = "Add New";
-localizedStrings["Add"] = "Add";
localizedStrings["Aggregated Time"] = "Aggregated Time";
localizedStrings["All Nodes"] = "All Nodes";
localizedStrings["All Panels"] = "All Panels";
@@ -104,30 +95,27 @@ localizedStrings["Call Stack"] = "Call Stack";
localizedStrings["Calls"] = "Calls";
localizedStrings["Cannot find corresponding heap snapshot node"] = "Cannot find corresponding heap snapshot node";
localizedStrings["Clear all profiles."] = "Clear all profiles.";
-localizedStrings["Clear Browser Cache."] = "Clear Browser Cache.";
-localizedStrings["Clear browser cache."] = "Clear browser cache.";
-localizedStrings["Clear Browser Cookies."] = "Clear Browser Cookies.";
-localizedStrings["Clear browser cookies."] = "Clear browser cookies.";
+localizedStrings["Clear Browser Cache"] = "Clear Browser Cache";
+localizedStrings["Clear browser cache"] = "Clear browser cache";
+localizedStrings["Clear Browser Cookies"] = "Clear Browser Cookies";
+localizedStrings["Clear browser cookies"] = "Clear browser cookies";
localizedStrings["Clear Console"] = "Clear Console";
localizedStrings["Clear console"] = "Clear console";
localizedStrings["Clear audit results."] = "Clear audit results.";
localizedStrings["Clear console log."] = "Clear console log.";
localizedStrings["Clear"] = "Clear";
-localizedStrings["Click to change color format"] = "Click to change color format";
localizedStrings["Click to open a colorpicker. Shift-click to change color format"] = "Click to open a colorpicker. Shift-click to change color format";
localizedStrings["Closure"] = "Closure";
localizedStrings["Code"] = "Code";
localizedStrings["Collected"] = "Collected";
localizedStrings["Collect CSS Selector Profile"] = "Collect CSS Selector Profile";
localizedStrings["Collect JavaScript CPU Profile"] = "Collect JavaScript CPU Profile";
-localizedStrings["Compared to %s"] = "Compared to %s";
localizedStrings["Computed Style"] = "Computed Style";
localizedStrings["Connecting"] = "Connecting";
localizedStrings["Console"] = "Console";
localizedStrings["Constructor"] = "Constructor";
localizedStrings["Continue to Here"] = "Continue to Here";
localizedStrings["Continue to here"] = "Continue to here";
-localizedStrings["Continue"] = "Continue";
localizedStrings["Copy as HTML"] = "Copy as HTML";
localizedStrings["Copy all as HAR"] = "Copy all as HAR";
localizedStrings["Copy All as HAR"] = "Copy All as HAR";
@@ -140,7 +128,6 @@ localizedStrings["Copy Request Headers"] = "Copy Request Headers";
localizedStrings["Copy response headers"] = "Copy response headers";
localizedStrings["Copy Response Headers"] = "Copy Response Headers";
localizedStrings["Copy XPath"] = "Copy XPath";
-localizedStrings["Count"] = "Count";
localizedStrings["Web SQL"] = "Web SQL";
localizedStrings["DNS Lookup"] = "DNS Lookup";
localizedStrings["DOMContent event fired"] = "DOMContent event fired";
@@ -148,7 +135,7 @@ localizedStrings["DOMContent event"] = "DOMContent event";
localizedStrings["DOM Node Count"] = "DOM Node Count";
localizedStrings["Database no longer has expected version."] = "Database no longer has expected version.";
localizedStrings["Deactivate all breakpoints."] = "Deactivate all breakpoints.";
-localizedStrings["Deactivate all breakpoints"] = "Deactivate all breakpoints";
+localizedStrings["Deactivate All breakpoints"] = "Deactivate All breakpoints";
localizedStrings["Debug"] = "Debug";
localizedStrings["Debugging disabled. Click to enable."] = "Debugging disabled. Click to enable.";
localizedStrings["Debugging enabled. Click to disable."] = "Debugging enabled. Click to disable.";
@@ -197,7 +184,6 @@ localizedStrings["Event"] = "Event";
localizedStrings["Exclude selected function."] = "Exclude selected function.";
localizedStrings["Execute command"] = "Execute command";
localizedStrings["Expand/collapse"] = "Expand/collapse";
-localizedStrings["Expected Content Length"] = "Expected Content Length";
localizedStrings["Expires"] = "Expires";
localizedStrings["File size"] = "File size";
localizedStrings["Fit in window"] = "Fit in window";
@@ -212,7 +198,7 @@ localizedStrings["Font scale factor:"] = "Font scale factor:";
localizedStrings["Fonts"] = "Fonts";
localizedStrings["Form Data"] = "Form Data";
localizedStrings["Program"] = "Program";
-localizedStrings["Unknown: "] = "Unknown: %s";
+localizedStrings["Unknown: %s"] = "Unknown: %s";
localizedStrings["Function Call"] = "Function Call";
localizedStrings["Function"] = "Function";
localizedStrings["GC Event"] = "GC Event";
@@ -228,7 +214,7 @@ localizedStrings["Heap snapshot profiles show memory distribution among your pag
localizedStrings["Heavy (Bottom Up)"] = "Heavy (Bottom Up)";
localizedStrings["Hex Colors"] = "Hex Colors";
localizedStrings["Hide console."] = "Hide console.";
-localizedStrings["Hide the records that are shorter than %s"] = "Hide the records that are shorter than %s";
+localizedStrings["Hide the records that are shorter than %s"] = "Hide the Precords that are shorter than %s";
localizedStrings["Image"] = "Image";
localizedStrings["Images"] = "Images";
localizedStrings["Increment/decrement by %f"] = "Increment/decrement by %f";
@@ -240,7 +226,7 @@ localizedStrings["Inspected worker has terminated. Once it restarts we will atta
localizedStrings["Install Timer"] = "Install Timer";
localizedStrings["Invalid property value."] = "Invalid property value.";
localizedStrings["Key"] = "Key";
-localizedStrings["Keyboard Shortcuts"] = "Keyboard Shortcuts";
+localizedStrings["Shortcuts"] = "Shortcuts";
localizedStrings["Layout"] = "Layout";
localizedStrings["Listeners: %d"] = "Listeners: %d";
localizedStrings["Local Storage"] = "Local Storage";
@@ -254,7 +240,6 @@ localizedStrings["Location"] = "Location";
localizedStrings["Logs"] = "Logs";
localizedStrings["MIME Type"] = "MIME Type";
localizedStrings["MIME type"] = "MIME type";
-localizedStrings["Mark"] = "Mark";
localizedStrings["Matched CSS Rules"] = "Matched CSS Rules";
localizedStrings["Matches"] = "Matches";
localizedStrings["Memory"] = "Memory";
@@ -265,7 +250,6 @@ localizedStrings["New Style Rule"] = "New Style Rule";
localizedStrings["Next/previous call frame"] = "Next/previous call frame";
localizedStrings["Next/previous command"] = "Next/previous command";
localizedStrings["Next/previous line"] = "Next/previous line";
-localizedStrings["Next/previous panel"] = "Next/previous panel";
localizedStrings["Next/previous property"] = "Next/previous property";
localizedStrings["Next/previous suggestion"] = "Next/previous suggestion";
localizedStrings["No Application Cache information available."] = "No Application Cache information available.";
@@ -279,7 +263,7 @@ localizedStrings["Node Removed"] = "Node Removed";
localizedStrings["Nodes: %d"] = "Nodes: %d";
localizedStrings["Not Found"] = "Not Found";
localizedStrings["Not Paused"] = "Not Paused";
-localizedStrings["Objects"] = "Objects";
+localizedStrings["Objects Count"] = "Objects Count";
localizedStrings["Offline"] = "Offline";
localizedStrings["Online"] = "Online";
localizedStrings["Only enable for this session"] = "Only enable for this session";
@@ -310,7 +294,6 @@ localizedStrings["Paused"] = "Paused";
localizedStrings["Paused on exception: '%s'."] = "Paused on exception: '%s'.";
localizedStrings["Pausing"] = "Pausing";
localizedStrings["Preview"] = "Preview";
-localizedStrings["opefile %d"] = "Profile %d";
localizedStrings["Profiles"] = "Profiles";
localizedStrings["Profiling disabled. Click to enable."] = "Profiling disabled. Click to enable.";
localizedStrings["Profiling enabled. Click to disable."] = "Profiling enabled. Click to disable.";
@@ -328,7 +311,7 @@ localizedStrings["Receive Data"] = "Receive Data";
localizedStrings["Receive Response"] = "Receive Response";
localizedStrings["Receiving"] = "Receiving";
localizedStrings["Record"] = "Record";
-localizedStrings["Recording…"] = "Recording…";
+localizedStrings["Recording\u2026"] = "Recording\u2026";
localizedStrings["Redirect"] = "Redirect";
localizedStrings["Refresh"] = "Refresh";
localizedStrings["Region is %s."] = "Region is %s.";
@@ -342,7 +325,7 @@ localizedStrings["Request Headers"] = "Request Headers";
localizedStrings["Request Method"] = "Request Method";
localizedStrings["Request Payload"] = "Request Payload";
localizedStrings["Request URL"] = "Request URL";
-localizedStrings["Resource interpreted as %s but transferred with MIME type %s."] = "Resource interpreted as %s but transferred with MIME type %s.";
+localizedStrings["Resource interpreted as %s but transferred with MIME type %s: \"%s\"."] = "Resource interpreted as %s but transferred with MIME type %s: \"%s\".";
localizedStrings["Resource"] = "Resource";
localizedStrings["Resources"] = "Resources";
localizedStrings["Response"] = "Response";
@@ -362,14 +345,12 @@ localizedStrings["Scope Variables"] = "Scope Variables";
localizedStrings["Screen resolution:"] = "Screen resolution:";
localizedStrings["Script"] = "Script";
localizedStrings["Scripting"] = "Scripting";
-localizedStrings["Scripts Panel"] = "Scripts Panel";
localizedStrings["Scroll into view"] = "Scroll into view";
localizedStrings["Scroll Into View"] = "Scroll Into View";
-localizedStrings["Source Code Panel"] = "Source Code Panel";
+localizedStrings["Sources Panel"] = "Sources Panel";
localizedStrings["Scripts"] = "Scripts";
-localizedStrings["Source Code"] = "Source Code";
+localizedStrings["Source"] = "Source";
localizedStrings["Sources"] = "Sources";
-localizedStrings["Search %s"] = "Search %s";
localizedStrings["Search"] = "Search";
localizedStrings["Secure"] = "Secure";
localizedStrings["Select All"] = "Select All";
@@ -383,11 +364,9 @@ localizedStrings["Send Request"] = "Send Request";
localizedStrings["Sending"] = "Sending";
localizedStrings["Session"] = "Session";
localizedStrings["Show All Nodes (%d More)"] = "Show All Nodes (%d More)";
-localizedStrings["Show absolute counts and sizes."] = "Show absolute counts and sizes.";
localizedStrings["Show absolute times."] = "Show absolute times.";
localizedStrings["Show absolute total and self times."] = "Show absolute total and self times.";
localizedStrings["Show console."] = "Show console.";
-localizedStrings["Show counts and sizes as percentages."] = "Show counts and sizes as percentages.";
localizedStrings["Show function definition"] = "Show function definition";
localizedStrings["Show inherited"] = "Show inherited";
localizedStrings["Show Shadow DOM"] = "Show Shadow DOM";
@@ -431,7 +410,6 @@ localizedStrings["This request has no preview available."] = "This request has n
localizedStrings["This request has no response data available."] = "This request has no response data available.";
localizedStrings["Time"] = "Time";
localizedStrings["Timeline"] = "Timeline";
-localizedStrings["Timelines"] = "Timelines";
localizedStrings["Timeout"] = "Timeout";
localizedStrings["Timer Fired"] = "Timer Fired";
localizedStrings["Timer ID"] = "Timer ID";
@@ -449,7 +427,6 @@ localizedStrings["Value"] = "Value";
localizedStrings["Waiting"] = "Waiting";
localizedStrings["Warnings"] = "Warnings";
localizedStrings["Watch Expressions"] = "Watch Expressions";
-localizedStrings["Welcome to the Profiles panel"] = "Welcome to the Profiles panel";
localizedStrings["With Block"] = "With Block";
localizedStrings["Word Wrap"] = "Word Wrap";
localizedStrings["Word wrap"] = "Word wrap";
@@ -458,12 +435,9 @@ localizedStrings["XHR Load"] = "XHR Load";
localizedStrings["XHR Ready State Change"] = "XHR Ready State Change";
localizedStrings["XHR"] = "XHR";
localizedStrings["Log XMLHttpRequests"] = "Log XMLHttpRequests";
-localizedStrings["You could save bandwidth by having your web server compress this transfer with gzip or zlib."] = "You could save bandwidth by having your web server compress this transfer with gzip or zlib.";
localizedStrings["You need to enable debugging before you can use the Scripts panel."] = "You need to enable debugging before you can use the Scripts panel.";
localizedStrings["You need to enable profiling before you can use the Profiles panel."] = "You need to enable profiling before you can use the Profiles panel.";
localizedStrings["[empty domain]"] = "[empty domain]";
-localizedStrings["\xb1 Count"] = "\xb1 Count";
-localizedStrings["\xb1 Size"] = "\xb1 Size";
localizedStrings["border"] = "border";
localizedStrings["content"] = "content";
localizedStrings["deleted"] = "deleted";
@@ -471,7 +445,6 @@ localizedStrings["empty"] = "empty";
localizedStrings["fit"] = "fit";
localizedStrings["line %d"] = "line %d";
localizedStrings["margin"] = "margin";
-localizedStrings["new"] = "new";
localizedStrings["or"] = "or";
localizedStrings["overset"] = "overset";
localizedStrings["padding"] = "padding";
@@ -533,14 +506,12 @@ localizedStrings["Frames"] = "Frames";
localizedStrings["Text"] = "Text";
localizedStrings["Content"] = "Content";
localizedStrings["URL"] = "URL";
-localizedStrings["Format script."] = "Format script.";
localizedStrings["WebSocket"] = "WebSocket";
localizedStrings["(system)"] = "(system)";
localizedStrings["(compiled code)"] = "(compiled code)";
-localizedStrings["Loading…"] = "Loading…";
-localizedStrings["Parsing…"] = "Parsing…";
-localizedStrings["Snapshotting…"] = "Snapshotting…";
-localizedStrings["Please wait…"] = "Please wait…";
+localizedStrings["Loading\u2026"] = "Loading\u2026";
+localizedStrings["Parsing\u2026"] = "Parsing\u2026";
+localizedStrings["Snapshotting\u2026"] = "Snapshotting\u2026";
localizedStrings["Cancel"] = "Cancel";
localizedStrings["Show %d after"] = "Show %d after";
localizedStrings["Show %d before"] = "Show %d before";
@@ -563,7 +534,6 @@ localizedStrings["Property types:"] = "Property types:";
localizedStrings["element"] = "element";
localizedStrings["property"] = "property";
localizedStrings["Object types:"] = "Object types:";
-localizedStrings["%s() at %s"] = "%s() at %s";
localizedStrings["Copy Stack Trace"] = "Copy Stack Trace";
localizedStrings["Restart Frame"] = "Restart Frame";
localizedStrings["Collect Garbage"] = "Collect Garbage";
@@ -584,20 +554,18 @@ localizedStrings["Open image in new tab"] = "Open image in new tab";
localizedStrings["Color format"] = "Color format";
localizedStrings["Settings"] = "Settings";
localizedStrings["Toggle Element State"] = "Toggle Element State";
-localizedStrings["Load timeline data\u2026"] = "Load Timeline data\u2026";
-localizedStrings["Save timeline data\u2026"] = "Save Timeline data\u2026";
+localizedStrings["Load Timeline data\u2026"] = "Load Timeline data\u2026";
+localizedStrings["Save Timeline data\u2026"] = "Save Timeline data\u2026";
localizedStrings["Load timeline data"] = "Load Timeline data";
localizedStrings["Save timeline data"] = "Save Timeline data";
-localizedStrings["An error occurred reading the file \"%s\""] = "An error occurred while reading the file \"%s\"";
+localizedStrings["An error occurred while reading the file \"%s\""] = "An error occurred while reading the file \"%s\"";
localizedStrings["File \"%s\" is not readable"] = "File \"%s\" is not readable";
localizedStrings["File \"%s\" not found."] = "File \"%s\" not found.";
-localizedStrings["Filter out records shorter than %s"] = "Filter out records shorter than %s";
+localizedStrings["Filter"] = "Filter";
localizedStrings["Show user agent styles"] = "Show user agent styles";
-localizedStrings["Show script folders"] = "Show script folders";
localizedStrings["Request Animation Frame"] = "Request Animation Frame";
localizedStrings["Cancel Animation Frame"] = "Cancel Animation Frame";
localizedStrings["Animation Frame Fired"] = "Animation Frame Fired";
-localizedStrings["Registered at"] = "Registered at";
localizedStrings["Extensions"] = "Extensions";
localizedStrings["Open links in"] = "Open links in";
localizedStrings["a panel chosen automatically"] = "a panel chosen automatically";
@@ -613,17 +581,15 @@ localizedStrings["Automatically attach to new workers and pause them. Enabling t
localizedStrings["Pause on start"] = "Pause on start";
localizedStrings["Dedicated worker inspectors"] = "Dedicated worker inspectors";
localizedStrings["Stamp"] = "Stamp";
-localizedStrings["Enable worker inspection"] = "Enable worker inspection";
localizedStrings["No Watch Expressions"] = "No Watch Expressions";
localizedStrings["Start/stop recording"] = "Start/stop recording";
localizedStrings["Callback ID"] = "Callback ID";
localizedStrings["Timeline Panel"] = "Timeline Panel";
localizedStrings["All objects"] = "All objects";
localizedStrings["Objects allocated before Snapshot %d"] = "Objects allocated before Snapshot %d";
-localizedStrings["Objects allocated between Snapshot %d and Snapshot %d"] = "Objects allocated between Snapshot %d and Snapshot %d";
+localizedStrings["Objects allocated between Snapshots %d and %d"] = "Objects allocated between Snapshots %d and %d";
localizedStrings["Show all matches (%d more)."] = "Show all matches (%d more).";
localizedStrings["Found %d matches in %d files."] = "Found %d matches in %d files.";
-localizedStrings["Stop search"] = "Stop search";
localizedStrings["Search finished."] = "Search finished.";
localizedStrings["Search interrupted."] = "Search interrupted.";
localizedStrings["Add to Watch"] = "Add to Watch";
@@ -641,7 +607,7 @@ localizedStrings["Evaluate in console"] = "Evaluate in console";
localizedStrings["Evaluate in Console"] = "Evaluate in Console";
localizedStrings["Evaluate selection in console"] = "Evaluate selection in console";
localizedStrings["new frame"] = "new frame";
-localizedStrings["Web Inspector - "] = "Web Inspector - ";
+localizedStrings["Web Inspector - %s"] = "Web Inspector - %s";
localizedStrings["Open using %s"] = "Open using %s";
localizedStrings["Open Using %s"] = "Open Using %s";
localizedStrings["Show objects' hidden properties"] = "Show objects' hidden properties";
@@ -656,7 +622,6 @@ localizedStrings["Experiments"] = "Experiments";
localizedStrings["WARNING:"] = "WARNING:";
localizedStrings["These experiments could be dangerous and may require restart."] = "These experiments could be dangerous and may require restart.";
localizedStrings["General"] = "General";
-localizedStrings["Dock to right"] = "Dock to right";
localizedStrings["Object's retaining tree"] = "Object's retaining tree";
localizedStrings["Touch"] = "Touch";
localizedStrings["Close"] = "Close";
@@ -677,16 +642,11 @@ localizedStrings["Show next page."] = "Show next page.";
localizedStrings["Start from key"] = "Start from key";
localizedStrings["Glue asynchronous events to causes"] = "Glue asynchronous events to causes";
localizedStrings["undefined × %d"] = "undefined × %d";
-localizedStrings["Version"] = "Version";
localizedStrings["Key path: "] = "Key path: ";
localizedStrings["autoIncrement"] = "autoIncrement";
localizedStrings["unique"] = "unique";
localizedStrings["multiEntry"] = "multiEntry";
-localizedStrings["Show each event category as a horizontal strip in overview"] = "Show each event category as a horizontal strip in overview";
-localizedStrings["Show each event as a vertical bar in overview"] = "Show each event as a vertical bar in overview";
-localizedStrings["Evaluated snippets"] = "Evaluated snippets";
-localizedStrings["An error happend when a call for method '%s' was requested"] = "An error happened when a call for method '%s' was requested";
-localizedStrings["Run"] = "Run";
+localizedStrings["An error happened when a call for method '%s' was requested"] = "An error happened when a call for method '%s' was requested";
localizedStrings["Rename"] = "Rename";
localizedStrings["Remove"] = "Remove";
localizedStrings["New"] = "New";
@@ -697,7 +657,6 @@ localizedStrings["Binary Frame"] = "Binary Frame";
localizedStrings["Connection Close Frame"] = "Connection Close Frame";
localizedStrings["Ping Frame"] = "Ping Frame";
localizedStrings["Pong Frame"] = "Pong Frame";
-localizedStrings["Time"] = "Time";
localizedStrings["Length"] = "Length";
localizedStrings["Data"] = "Data";
localizedStrings["%s (Opcode %d%s)"] = "%s (Opcode %d%s)";
@@ -708,9 +667,8 @@ localizedStrings["<Down>"] = "<Down>";
localizedStrings["Events"] = "Events";
localizedStrings["Loading\u2026 %d\%"] = "Loading\u2026 %d\%";
localizedStrings["Saving\u2026 %d\%"] = "Saving\u2026 %d\%";
-localizedStrings["Only heap snapshots from files with extension '.whs' can be loaded."] = "Only heap snapshots from files with extension '.whs' can be loaded.";
+localizedStrings["Only heap snapshots from files with extension '.heapsnapshot' can be loaded."] = "Only heap snapshots from files with extension '.heapsnapshot' can be loaded.";
localizedStrings["Can't load profile when other profile is recording."] = "Can't load profile when other profile is recording.";
-localizedStrings["Save profile\u2026"] = "Save profile\u2026";
localizedStrings["'%s' not found."] = "'%s' not found.";
localizedStrings["'%s' is not readable"] = "'%s' is not readable";
localizedStrings["'%s' error %d"] = "'%s' error %d";
@@ -753,3 +711,51 @@ localizedStrings["Collecting content…"] = "Collecting content…";
localizedStrings["Writing file…"] = "Writing file…";
localizedStrings["Debug target terminated"] = "Debug target terminated";
localizedStrings["This remote debugging client is no longer functional. Please re-attach to the new target."] = "This remote debugging client is no longer functional. Please re-attach to the new target.";
+localizedStrings["Snippets"] = "Snippets";
+localizedStrings["Refresh IndexedDB"] = "Refresh IndexedDB";
+localizedStrings["FileSystem"] = "FileSystem";
+localizedStrings["Refresh FileSystem List"] = "Refresh FileSystem List";
+localizedStrings["Take Native Memory Snapshot"] = "Take Native Memory Snapshot";
+localizedStrings["Take native memory snapshot."] = "Take native memory snapshot.";
+localizedStrings["MEMORY DISTRIBUTION"] = "MEMORY DISTRIBUTION";
+localizedStrings["Native memory snapshot profiles show memory distribution among browser subsystems"] = "Native memory snapshot profiles show memory distribution among browser subsystems";
+localizedStrings["Worker asks to call a method '%s' on an unsupported object '%s'."] = "Worker asks to call a method '%s' on an unsupported object '%s'.";
+localizedStrings["Worker asks to call an unsupported method '%s' on the console object."] = "Worker asks to call an unsupported method '%s' on the console object.";
+localizedStrings["String Version"] = "String Version";
+localizedStrings["Integer Version"] = "Integer Version";
+localizedStrings["Search Previous"] = "Search Previous";
+localizedStrings["Search Next"] = "Search Next";
+localizedStrings["Disable JavaScript"] = "Disable JavaScript";
+localizedStrings["Show folders"] = "Show folders";
+localizedStrings["Profiler"] = "Profiler";
+localizedStrings["Painting"] = "Painting";
+localizedStrings["Frame Start"] = "Frame Start";
+localizedStrings["Schedule Style Recalculation"] = "Schedule Style Recalculation";
+localizedStrings["Invalidate Layout"] = "Invalidate Layout";
+localizedStrings["Composite Layers"] = "Composite Layers";
+localizedStrings["Interval Duration"] = "Interval Duration";
+localizedStrings["CPU time"] = "CPU time";
+localizedStrings["Replay XHR"] = "Replay XHR";
+localizedStrings["[ %d - %d ]"] = "[ %d - %d ]";
+localizedStrings["Search sources"] = "Search sources";
+localizedStrings["\u00D7"] = "\u00D7";
+localizedStrings["Find next/previous"] = "Find next/previous";
+localizedStrings["Go to line"] = "Go to line";
+localizedStrings["Local modifications"] = "Local modifications";
+localizedStrings["(%s) Created: %s Updated: %s"] = "(%s) Created: %s Updated: %s";
+localizedStrings["Class filter"] = "Class filter";
+localizedStrings["Are you sure you want to delete the selected entry?"] = "Are you sure you want to delete the selected entry?";
+localizedStrings["Distance"] = "Distance";
+localizedStrings["\u03B1:"] = "\u03B1:";
+localizedStrings["Drag"] = "Drag";
+localizedStrings["Toggle breakpoint"] = "Toggle breakpoint";
+localizedStrings["Capture Canvas Frame"] = "Capture Canvas Frame";
+localizedStrings["Capture Canvas Frame."] = "Capture Canvas Frame.";
+localizedStrings["Trace Log %d"] = "Trace Log %d";
+localizedStrings["CANVAS PROFILE"] = "CANVAS PROFILE";
+localizedStrings["Canvas calls instrumentation"] = "Canvas calls instrumentation";
+localizedStrings["Capturing\u2026"] = "Capturing\u2026";
+localizedStrings["Binary File"] = "Binary File";
+localizedStrings["Modification Time"] = "Modification Time";
+localizedStrings["Directory"] = "Directory";
+localizedStrings["-"] = "-";
diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am
index 0dac43c05..5d63da6d3 100644
--- a/Source/WebCore/GNUmakefile.am
+++ b/Source/WebCore/GNUmakefile.am
@@ -335,14 +335,25 @@ feature_defines_overrides += ENABLE_SPELLCHECK=0
endif # END ENABLE_SPELLCHECK
# ---
+# CSS3 Conditional Rules support
+# ---
+if ENABLE_CSS3_CONDITIONAL_RULES
+feature_defines_overrides += ENABLE_CSS3_CONDITIONAL_RULES=1
+else
+feature_defines_overrides += ENABLE_CSS3_CONDITIONAL_RULES=0
+endif # END ENABLE_CSS3_CONDITIONAL_RULES
+
+# ---
# Unstable features
# If unstable features should not be enabled, their defines should be overriden with a 0 value.
# ---
if !ENABLE_UNSTABLE_FEATURES
feature_defines_unstable += \
- ENABLE_CSS3_TEXT_DECORATION=0 \
+ ENABLE_CSP_NEXT=0 \
+ ENABLE_CSS3_TEXT=0 \
ENABLE_CSS_STICKY_POSITION=0 \
ENABLE_LINK_PREFETCH=0 \
+ ENABLE_MICRODATA=0 \
ENABLE_MUTATION_OBSERVERS=0 \
ENABLE_STYLE_SCOPED=0 \
ENABLE_VIDEO_TRACK=0 \
@@ -730,7 +741,8 @@ EXTRA_DIST += \
Source/WebCore/bindings/scripts/preprocessor.pm \
Source/WebCore/bindings/scripts/preprocess-idls.pl \
Source/WebCore/ChangeLog \
- Source/WebCore/css/CSSGrammar.y \
+ Source/WebCore/css/CSSGrammar.y.in \
+ Source/WebCore/css/CSSGrammar.y.includes \
Source/WebCore/css/CSSPropertyNames.in \
Source/WebCore/css/CSSValueKeywords.in \
Source/WebCore/dom/DOMExceptions.in \
diff --git a/Source/WebCore/GNUmakefile.features.am b/Source/WebCore/GNUmakefile.features.am
index 0e2b5ca08..9c4c9d82c 100644
--- a/Source/WebCore/GNUmakefile.features.am
+++ b/Source/WebCore/GNUmakefile.features.am
@@ -5,8 +5,8 @@ feature_defines_defaults += \
ENABLE_BATTERY_STATUS=0 \
ENABLE_BLOB=1 \
ENABLE_CHANNEL_MESSAGING=1 \
- ENABLE_CSP_NEXT=0 \
- ENABLE_CSS3_TEXT_DECORATION=1 \
+ ENABLE_CSP_NEXT=1 \
+ ENABLE_CSS3_TEXT=1 \
ENABLE_CSS_BOX_DECORATION_BREAK=1 \
ENABLE_CSS_COMPOSITING=0 \
ENABLE_CSS_EXCLUSIONS=1 \
@@ -18,6 +18,7 @@ feature_defines_defaults += \
ENABLE_CSS_SHADERS=0 \
ENABLE_CSS_STICKY_POSITION=1 \
ENABLE_CSS_VARIABLES=0 \
+ ENABLE_CSS3_CONDITIONAL_RULES=0 \
ENABLE_CUSTOM_SCHEME_HANDLER=0 \
ENABLE_DASHBOARD_SUPPORT=0 \
ENABLE_DATALIST_ELEMENT=0 \
@@ -60,7 +61,7 @@ feature_defines_defaults += \
ENABLE_MEDIA_STREAM=1 \
ENABLE_METER_ELEMENT=1 \
ENABLE_MHTML=1 \
- ENABLE_MICRODATA=0 \
+ ENABLE_MICRODATA=1 \
ENABLE_MUTATION_OBSERVERS=1 \
ENABLE_NAVIGATOR_CONTENT_UTILS=0 \
ENABLE_NETSCAPE_PLUGIN_API=1 \
diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am
index ab124b44f..cff98c86e 100644
--- a/Source/WebCore/GNUmakefile.list.am
+++ b/Source/WebCore/GNUmakefile.list.am
@@ -579,6 +579,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSOESTextureFloat.h \
DerivedSources/WebCore/JSOESVertexArrayObject.cpp \
DerivedSources/WebCore/JSOESVertexArrayObject.h \
+ DerivedSources/WebCore/JSOESElementIndexUint.cpp \
+ DerivedSources/WebCore/JSOESElementIndexUint.h \
DerivedSources/WebCore/JSOfflineAudioCompletionEvent.cpp \
DerivedSources/WebCore/JSOfflineAudioCompletionEvent.h \
DerivedSources/WebCore/JSOscillatorNode.cpp \
@@ -1522,6 +1524,7 @@ dom_binding_idls += \
$(WebCore)/html/canvas/OESStandardDerivatives.idl \
$(WebCore)/html/canvas/OESTextureFloat.idl \
$(WebCore)/html/canvas/OESVertexArrayObject.idl \
+ $(WebCore)/html/canvas/OESElementIndexUint.idl \
$(WebCore)/html/canvas/Uint16Array.idl \
$(WebCore)/html/canvas/Uint32Array.idl \
$(WebCore)/html/canvas/Uint8Array.idl \
@@ -2639,6 +2642,8 @@ webcore_sources += \
Source/WebCore/css/SiblingTraversalStrategies.h \
Source/WebCore/css/StyleBuilder.cpp \
Source/WebCore/css/StyleBuilder.h \
+ Source/WebCore/css/StyleInvalidationAnalysis.cpp \
+ Source/WebCore/css/StyleInvalidationAnalysis.h \
Source/WebCore/css/StyleMedia.cpp \
Source/WebCore/css/StyleMedia.h \
Source/WebCore/css/StylePropertySet.cpp \
@@ -3200,6 +3205,8 @@ webcore_sources += \
Source/WebCore/html/canvas/OESTextureFloat.h \
Source/WebCore/html/canvas/OESVertexArrayObject.cpp \
Source/WebCore/html/canvas/OESVertexArrayObject.h \
+ Source/WebCore/html/canvas/OESElementIndexUint.cpp \
+ Source/WebCore/html/canvas/OESElementIndexUint.h \
Source/WebCore/html/canvas/WebGLActiveInfo.h \
Source/WebCore/html/canvas/WebGLBuffer.cpp \
Source/WebCore/html/canvas/WebGLBuffer.h \
@@ -4286,6 +4293,7 @@ webcore_sources += \
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h \
Source/WebCore/platform/graphics/ColorSpace.h \
Source/WebCore/platform/graphics/DashArray.h \
+ Source/WebCore/platform/graphics/DisplayRefreshMonitor.h \
Source/WebCore/platform/graphics/Extensions3D.h \
Source/WebCore/platform/graphics/NativeImagePtr.h \
Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp \
@@ -6164,8 +6172,13 @@ webcore_built_sources += \
DerivedSources/ANGLE/glslang_tab.h
webcore_sources += \
+ Source/ThirdParty/ANGLE/include/EGL/egl.h \
+ Source/ThirdParty/ANGLE/include/EGL/eglplatform.h \
Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h \
+ Source/ThirdParty/ANGLE/include/KHR/khrplatform.h \
Source/ThirdParty/ANGLE/src/common/angleutils.h \
+ Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.cpp \
+ Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.h \
Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h \
Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp \
Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.h \
diff --git a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
index cc197c217..d37493b98 100644
--- a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h
@@ -29,18 +29,19 @@
#if ENABLE(INDEXED_DATABASE)
#include "IDBCursor.h"
-#include "IDBFactoryBackendInterface.h"
-#include "SQLiteDatabase.h"
+#include "IDBKeyPath.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
class IDBKey;
class IDBKeyRange;
class SecurityOrigin;
+struct IDBDatabaseMetadata;
class IDBBackingStore : public RefCounted<IDBBackingStore> {
public:
@@ -49,7 +50,7 @@ public:
virtual ~IDBBackingStore() {};
virtual void getDatabaseNames(Vector<String>& foundNames) = 0;
- virtual bool getIDBDatabaseMetaData(const String& name, String& foundStringVersion, int64_t& foundIntVersion, int64_t& foundId, int64_t& maxObjectStoreId) = 0;
+ virtual bool getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata* foundMetadata) = 0;
virtual bool createIDBDatabaseMetaData(const String& name, const String& stringVersion, int64_t intVersion, int64_t& rowId) = 0;
virtual bool updateIDBDatabaseIntVersion(Transaction*, int64_t rowId, int64_t intVersion) = 0;
virtual bool updateIDBDatabaseMetaData(Transaction*, int64_t rowId, const String& version) = 0;
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.h b/Source/WebCore/Modules/indexeddb/IDBCursor.h
index fe725c9ba..5589c222f 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.h
@@ -30,6 +30,7 @@
#include "IDBKey.h"
#include "IDBTransaction.h"
+#include "ScriptValue.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h
index 3b92f117e..1f74c3391 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h
@@ -32,6 +32,8 @@
#include "IDBBackingStore.h"
#include "IDBCursor.h"
#include "IDBCursorBackendInterface.h"
+#include "IDBTransactionBackendImpl.h"
+#include "SerializedScriptValue.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
@@ -42,8 +44,6 @@ class IDBDatabaseBackendImpl;
class IDBIndexBackendImpl;
class IDBKeyRange;
class IDBObjectStoreBackendImpl;
-class IDBTransactionBackendImpl;
-class SerializedScriptValue;
class IDBCursorBackendImpl : public IDBCursorBackendInterface {
public:
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
index 4e895417d..d5fbd6dd4 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
@@ -133,28 +133,24 @@ const char* NoStringVersion = "";
IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, IDBBackingStore* backingStore, IDBFactoryBackendImpl* factory, const String& uniqueIdentifier)
: m_backingStore(backingStore)
- , m_id(InvalidId)
- , m_name(name)
- , m_version(NoStringVersion)
- , m_intVersion(IDBDatabaseMetadata::NoIntVersion)
- , m_maxObjectStoreId(InvalidId)
+ , m_metadata(name, InvalidId, NoStringVersion, IDBDatabaseMetadata::NoIntVersion, InvalidId)
, m_identifier(uniqueIdentifier)
, m_factory(factory)
, m_transactionCoordinator(IDBTransactionCoordinator::create())
, m_closingConnection(false)
{
- ASSERT(!m_name.isNull());
+ ASSERT(!m_metadata.name.isNull());
}
bool IDBDatabaseBackendImpl::openInternal()
{
- bool success = m_backingStore->getIDBDatabaseMetaData(m_name, m_version, m_intVersion, m_id, m_maxObjectStoreId);
- ASSERT_WITH_MESSAGE(success == (m_id != InvalidId), "success = %s, m_id = %lld", success ? "true" : "false", static_cast<long long>(m_id));
+ bool success = m_backingStore->getIDBDatabaseMetaData(m_metadata.name, &m_metadata);
+ ASSERT_WITH_MESSAGE(success == (m_metadata.id != InvalidId), "success = %s, m_id = %lld", success ? "true" : "false", static_cast<long long>(m_metadata.id));
if (success) {
loadObjectStores();
return true;
}
- return m_backingStore->createIDBDatabaseMetaData(m_name, m_version, m_intVersion, m_id);
+ return m_backingStore->createIDBDatabaseMetaData(m_metadata.name, m_metadata.version, m_metadata.intVersion, m_metadata.id);
}
IDBDatabaseBackendImpl::~IDBDatabaseBackendImpl()
@@ -168,7 +164,8 @@ PassRefPtr<IDBBackingStore> IDBDatabaseBackendImpl::backingStore() const
IDBDatabaseMetadata IDBDatabaseBackendImpl::metadata() const
{
- IDBDatabaseMetadata metadata(m_name, m_id, m_version, m_intVersion, m_maxObjectStoreId);
+ // FIXME: Figure out a way to keep m_metadata.objectStores.get(N).indexes up to date rather than regenerating this every time.
+ IDBDatabaseMetadata metadata(m_metadata);
for (ObjectStoreMap::const_iterator it = m_objectStores.begin(); it != m_objectStores.end(); ++it)
metadata.objectStores.set(it->key, it->value->metadata());
return metadata;
@@ -184,9 +181,9 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::createObjectS
RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr);
ASSERT(transaction->mode() == IDBTransaction::VERSION_CHANGE);
- // FIXME: Fix edge cases around transaction aborts that prevent this from just being ASSERT(id == m_maxObjectStoreId + 1)
- ASSERT(id > m_maxObjectStoreId);
- m_maxObjectStoreId = id;
+ // FIXME: Fix edge cases around transaction aborts that prevent this from just being ASSERT(id == m_metadata.maxObjectStoreId + 1)
+ ASSERT(id > m_metadata.maxObjectStoreId);
+ m_metadata.maxObjectStoreId = id;
RefPtr<IDBDatabaseBackendImpl> database = this;
if (!transaction->scheduleTask(
@@ -275,7 +272,7 @@ void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCal
RefPtr<IDBDatabaseBackendImpl> database = this;
if (!transaction->scheduleTask(
createCallbackTask(&IDBDatabaseBackendImpl::setVersionInternal, database, version, callbacks, transaction),
- createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version, m_intVersion))) {
+ createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_metadata.version, m_metadata.intVersion))) {
// FIXME: Remove one of the following lines.
ASSERT_NOT_REACHED();
ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
@@ -286,9 +283,9 @@ void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRef
{
RefPtr<IDBTransactionBackendImpl> transaction = prpTransaction;
int64_t databaseId = database->id();
- database->m_version = version;
- database->m_intVersion = IDBDatabaseMetadata::NoIntVersion;
- if (!database->m_backingStore->updateIDBDatabaseMetaData(transaction->backingStoreTransaction(), databaseId, database->m_version) || !database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) {
+ database->m_metadata.version = version;
+ database->m_metadata.intVersion = IDBDatabaseMetadata::NoIntVersion;
+ if (!database->m_backingStore->updateIDBDatabaseMetaData(transaction->backingStoreTransaction(), databaseId, database->m_metadata.version) || !database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_metadata.intVersion)) {
RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage.");
callbacks->onError(error);
transaction->abort(error);
@@ -300,10 +297,10 @@ void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRef
void IDBDatabaseBackendImpl::setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
{
int64_t databaseId = database->id();
- int64_t oldVersion = database->m_intVersion;
+ int64_t oldVersion = database->m_metadata.intVersion;
ASSERT(version > oldVersion);
- database->m_intVersion = version;
- if (!database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) {
+ database->m_metadata.intVersion = version;
+ if (!database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_metadata.intVersion)) {
RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage.");
callbacks->onError(error);
transaction->abort(error);
@@ -363,8 +360,8 @@ size_t IDBDatabaseBackendImpl::connectionCount()
void IDBDatabaseBackendImpl::processPendingCalls()
{
if (m_pendingSecondHalfOpenWithVersion) {
- ASSERT(m_pendingSecondHalfOpenWithVersion->version() == m_intVersion);
- ASSERT(m_id != InvalidId);
+ ASSERT(m_pendingSecondHalfOpenWithVersion->version() == m_metadata.intVersion);
+ ASSERT(m_metadata.id != InvalidId);
m_pendingSecondHalfOpenWithVersion->callbacks()->onSuccess(this);
m_pendingSecondHalfOpenWithVersion.release();
// Fall through when complete, as pending deletes may be (partially) unblocked.
@@ -445,11 +442,11 @@ void IDBDatabaseBackendImpl::openConnection(PassRefPtr<IDBCallbacks> callbacks,
m_pendingOpenCalls.append(PendingOpenCall::create(callbacks, databaseCallbacks));
return;
}
- if (m_id == InvalidId && !openInternal()) {
+ if (m_metadata.id == InvalidId && !openInternal()) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
return;
}
- if (m_version == NoStringVersion && m_intVersion == IDBDatabaseMetadata::NoIntVersion) {
+ if (m_metadata.version == NoStringVersion && m_metadata.intVersion == IDBDatabaseMetadata::NoIntVersion) {
// Spec says: If no version is specified and no database exists, set
// database version to 1. We infer that the database didn't exist from
// its lack of either type of version.
@@ -468,7 +465,7 @@ void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVer
for (DatabaseCallbacksSet::const_iterator it = m_databaseCallbacksSet.begin(); it != m_databaseCallbacksSet.end(); ++it) {
// Front end ensures the event is not fired at connections that have closePending set.
if (*it != databaseCallbacks)
- (*it)->onVersionChange(m_intVersion, requestedVersion);
+ (*it)->onVersionChange(m_metadata.intVersion, requestedVersion);
}
// The spec dictates we wait until all the version change events are
// delivered and then check m_databaseCallbacks.empty() before proceeding
@@ -478,7 +475,7 @@ void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVer
// tells us that all the blocked events have been delivered. See
// https://bugs.webkit.org/show_bug.cgi?id=71130
if (connectionCount())
- callbacks->onBlocked(m_intVersion);
+ callbacks->onBlocked(m_metadata.intVersion);
// FIXME: Add test for m_runningVersionChangeTransaction.
if (m_runningVersionChangeTransaction || connectionCount()) {
m_pendingOpenWithVersionCalls.append(PendingOpenWithVersionCall::create(callbacks, databaseCallbacks, requestedVersion));
@@ -493,7 +490,7 @@ void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVer
RefPtr<IDBDatabaseBackendImpl> database = this;
OwnPtr<ScriptExecutionContext::Task> intVersionTask = createCallbackTask(&IDBDatabaseBackendImpl::setIntVersionInternal, database, requestedVersion, callbacks, transaction);
- OwnPtr<ScriptExecutionContext::Task> resetVersionOnAbortTask = createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version, m_intVersion);
+ OwnPtr<ScriptExecutionContext::Task> resetVersionOnAbortTask = createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_metadata.version, m_metadata.intVersion);
if (!transaction->scheduleTask(intVersionTask.release(), resetVersionOnAbortTask.release())) {
// FIXME: Remove one of the following lines.
ASSERT_NOT_REACHED();
@@ -512,23 +509,23 @@ void IDBDatabaseBackendImpl::openConnectionWithVersion(PassRefPtr<IDBCallbacks>
m_pendingOpenWithVersionCalls.append(PendingOpenWithVersionCall::create(callbacks, databaseCallbacks, version));
return;
}
- if (m_id == InvalidId) {
+ if (m_metadata.id == InvalidId) {
if (openInternal())
- ASSERT(m_intVersion == IDBDatabaseMetadata::NoIntVersion);
+ ASSERT(m_metadata.intVersion == IDBDatabaseMetadata::NoIntVersion);
else {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
return;
}
}
- if (version > m_intVersion) {
+ if (version > m_metadata.intVersion) {
runIntVersionChangeTransaction(version, callbacks, databaseCallbacks);
return;
}
- if (version < m_intVersion) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::VER_ERR, String::format("The requested version (%lld) is less than the existing version (%lld).", static_cast<long long>(version), static_cast<long long>(m_intVersion))));
+ if (version < m_metadata.intVersion) {
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::VER_ERR, String::format("The requested version (%lld) is less than the existing version (%lld).", static_cast<long long>(version), static_cast<long long>(m_metadata.intVersion))));
return;
}
- ASSERT(version == m_intVersion);
+ ASSERT(version == m_metadata.intVersion);
m_databaseCallbacksSet.add(databaseCallbacks);
callbacks->onSuccess(this);
}
@@ -553,13 +550,13 @@ void IDBDatabaseBackendImpl::deleteDatabase(PassRefPtr<IDBCallbacks> prpCallback
return;
}
ASSERT(m_backingStore);
- if (!m_backingStore->deleteDatabase(m_name)) {
+ if (!m_backingStore->deleteDatabase(m_metadata.name)) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
return;
}
- m_version = NoStringVersion;
- m_id = InvalidId;
- m_intVersion = IDBDatabaseMetadata::NoIntVersion;
+ m_metadata.version = NoStringVersion;
+ m_metadata.id = InvalidId;
+ m_metadata.intVersion = IDBDatabaseMetadata::NoIntVersion;
m_objectStores.clear();
callbacks->onSuccess();
}
@@ -611,7 +608,7 @@ void IDBDatabaseBackendImpl::loadObjectStores()
Vector<IDBKeyPath> keyPaths;
Vector<bool> autoIncrementFlags;
Vector<int64_t> maxIndexIds;
- m_backingStore->getObjectStores(m_id, ids, names, keyPaths, autoIncrementFlags, maxIndexIds);
+ m_backingStore->getObjectStores(m_metadata.id, ids, names, keyPaths, autoIncrementFlags, maxIndexIds);
ASSERT(names.size() == ids.size());
ASSERT(keyPaths.size() == ids.size());
@@ -638,8 +635,8 @@ void IDBDatabaseBackendImpl::addObjectStoreToMap(ScriptExecutionContext*, PassRe
void IDBDatabaseBackendImpl::resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& previousVersion, int64_t previousIntVersion)
{
- database->m_version = previousVersion;
- database->m_intVersion = previousIntVersion;
+ database->m_metadata.version = previousVersion;
+ database->m_metadata.intVersion = previousIntVersion;
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
index 97b855dae..11a69d0bf 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
@@ -53,7 +53,7 @@ public:
PassRefPtr<IDBBackingStore> backingStore() const;
static const int64_t InvalidId = 0;
- int64_t id() const { return m_id; }
+ int64_t id() const { return m_metadata.id; }
void openConnection(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>);
void openConnectionWithVersion(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, int64_t version);
@@ -94,11 +94,7 @@ private:
static void resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version, int64_t intVersion);
RefPtr<IDBBackingStore> m_backingStore;
- int64_t m_id;
- String m_name;
- String m_version;
- int64_t m_intVersion;
- int64_t m_maxObjectStoreId;
+ IDBDatabaseMetadata m_metadata;
String m_identifier;
// This might not need to be a RefPtr since the factory's lifetime is that of the page group, but it's better to be conservitive than sorry.
diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
index d6fbb6767..e51350d1c 100644
--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
@@ -37,6 +37,7 @@
#include "IDBKeyPath.h"
#include "IDBKeyRange.h"
#include "IDBLevelDBCoding.h"
+#include "IDBMetadata.h"
#include "LevelDBComparator.h"
#include "LevelDBDatabase.h"
#include "LevelDBIterator.h"
@@ -313,25 +314,25 @@ void IDBLevelDBBackingStore::getDatabaseNames(Vector<String>& foundNames)
}
}
-bool IDBLevelDBBackingStore::getIDBDatabaseMetaData(const String& name, String& foundStringVersion, int64_t& foundIntVersion, int64_t& foundId, int64_t& maxObjectStoreId)
+bool IDBLevelDBBackingStore::getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata* metadata)
{
const Vector<char> key = DatabaseNameKey::encode(m_identifier, name);
- bool ok = getInt(m_db.get(), key, foundId);
+ bool ok = getInt(m_db.get(), key, metadata->id);
if (!ok)
return false;
- ok = getString(m_db.get(), DatabaseMetaDataKey::encode(foundId, DatabaseMetaDataKey::UserVersion), foundStringVersion);
+ ok = getString(m_db.get(), DatabaseMetaDataKey::encode(metadata->id, DatabaseMetaDataKey::UserVersion), metadata->version);
if (!ok)
return false;
- ok = getVarInt(m_db.get(), DatabaseMetaDataKey::encode(foundId, DatabaseMetaDataKey::UserIntVersion), foundIntVersion);
+ ok = getVarInt(m_db.get(), DatabaseMetaDataKey::encode(metadata->id, DatabaseMetaDataKey::UserIntVersion), metadata->intVersion);
if (!ok)
return false;
- if (foundIntVersion == IDBDatabaseMetadata::DefaultIntVersion)
- foundIntVersion = IDBDatabaseMetadata::NoIntVersion;
+ if (metadata->intVersion == IDBDatabaseMetadata::DefaultIntVersion)
+ metadata->intVersion = IDBDatabaseMetadata::NoIntVersion;
- maxObjectStoreId = getMaxObjectStoreId(m_db.get(), foundId);
+ metadata->maxObjectStoreId = getMaxObjectStoreId(m_db.get(), metadata->id);
return true;
}
@@ -405,15 +406,12 @@ bool IDBLevelDBBackingStore::deleteDatabase(const String& name)
IDB_TRACE("IDBLevelDBBackingStore::deleteDatabase");
OwnPtr<LevelDBWriteOnlyTransaction> transaction = LevelDBWriteOnlyTransaction::create(m_db.get());
- int64_t databaseId;
- String version;
- int64_t intVersion;
- int64_t maxObjectStoreId;
- if (!getIDBDatabaseMetaData(name, version, intVersion, databaseId, maxObjectStoreId))
+ IDBDatabaseMetadata metadata;
+ if (!getIDBDatabaseMetaData(name, &metadata))
return true;
- const Vector<char> startKey = DatabaseMetaDataKey::encode(databaseId, DatabaseMetaDataKey::OriginName);
- const Vector<char> stopKey = DatabaseMetaDataKey::encode(databaseId + 1, DatabaseMetaDataKey::OriginName);
+ const Vector<char> startKey = DatabaseMetaDataKey::encode(metadata.id, DatabaseMetaDataKey::OriginName);
+ const Vector<char> stopKey = DatabaseMetaDataKey::encode(metadata.id + 1, DatabaseMetaDataKey::OriginName);
OwnPtr<LevelDBIterator> it = m_db->createIterator();
for (it->seek(startKey); it->isValid() && compareKeys(it->key(), stopKey) < 0; it->next())
transaction->remove(it->key());
diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
index caa57f514..0cf3276b3 100644
--- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h
@@ -45,7 +45,7 @@ public:
virtual ~IDBLevelDBBackingStore();
virtual void getDatabaseNames(Vector<String>& foundNames);
- virtual bool getIDBDatabaseMetaData(const String& name, String& foundVersion, int64_t& foundIntVersion, int64_t& foundId, int64_t& maxObjectStoreId);
+ virtual bool getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata*);
virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId);
virtual bool updateIDBDatabaseMetaData(IDBBackingStore::Transaction*, int64_t rowId, const String& version);
virtual bool updateIDBDatabaseIntVersion(IDBBackingStore::Transaction*, int64_t rowId, int64_t intVersion);
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
index 2eacb319c..e3ec15b29 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
@@ -422,6 +422,7 @@ PassRefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context
ASSERT(!ec);
if (ec)
return 0;
+ indexRequest->preventPropagation();
// This is kept alive by being the success handler of the request, which is in turn kept alive by the owning transaction.
RefPtr<IndexPopulator> indexPopulator = IndexPopulator::create(m_backend, m_transaction->backend(), indexRequest, metadata);
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
index 4353db9ff..c6ea13c50 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h
@@ -27,6 +27,7 @@
#define IDBObjectStoreBackendInterface_h
#include "IDBCursor.h"
+#include "IDBTransactionBackendInterface.h"
#include <wtf/Threading.h>
#include <wtf/text/WTFString.h>
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
index 3f6f9cd84..0b502d742 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
@@ -75,6 +75,7 @@ IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> sourc
, m_cursorFinished(false)
, m_pendingCursor(0)
, m_didFireUpgradeNeededEvent(false)
+ , m_preventPropagation(false)
{
if (m_transaction) {
m_transaction->registerRequest(this);
@@ -458,7 +459,7 @@ bool IDBRequest::dispatchEvent(PassRefPtr<Event> event)
Vector<RefPtr<EventTarget> > targets;
targets.append(this);
- if (m_transaction) {
+ if (m_transaction && !m_preventPropagation) {
targets.append(m_transaction);
// If there ever are events that are associated with a database but
// that do not have a transaction, then this will not work and we need
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.h b/Source/WebCore/Modules/indexeddb/IDBRequest.h
index cab065120..899783853 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.h
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.h
@@ -61,6 +61,7 @@ public:
String webkitErrorMessage(ExceptionCode&) const;
PassRefPtr<IDBAny> source() const;
PassRefPtr<IDBTransaction> transaction() const;
+ void preventPropagation() { m_preventPropagation = true; }
// Defined in the IDL
enum ReadyState {
@@ -151,6 +152,7 @@ private:
RefPtr<IDBKey> m_cursorPrimaryKey;
ScriptValue m_cursorValue;
bool m_didFireUpgradeNeededEvent;
+ bool m_preventPropagation;
EventTargetData m_eventTargetData;
};
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
index d673c02d9..89939bf85 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
@@ -35,8 +35,6 @@
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
-#include "IDBMetadata.h"
-#include "IDBTransactionBackendInterface.h"
#include "IDBTransactionCallbacks.h"
#include <wtf/HashSet.h>
#include <wtf/RefCounted.h>
@@ -47,6 +45,8 @@ class IDBCursor;
class IDBDatabase;
class IDBObjectStore;
class IDBOpenDBRequest;
+class IDBTransactionBackendInterface;
+struct IDBObjectStoreMetadata;
class IDBTransaction : public IDBTransactionCallbacks, public EventTarget, public ActiveDOMObject {
public:
diff --git a/Source/WebCore/Modules/mediastream/MediaStream.cpp b/Source/WebCore/Modules/mediastream/MediaStream.cpp
index ce8e2655e..3da312117 100644
--- a/Source/WebCore/Modules/mediastream/MediaStream.cpp
+++ b/Source/WebCore/Modules/mediastream/MediaStream.cpp
@@ -88,7 +88,7 @@ MediaStream::MediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStream
: ContextDestructionObserver(context)
, m_descriptor(streamDescriptor)
{
- m_descriptor->setOwner(this);
+ m_descriptor->setClient(this);
MediaStreamTrackVector audioTrackVector;
size_t numberOfAudioTracks = m_descriptor->numberOfAudioComponents();
@@ -107,7 +107,7 @@ MediaStream::MediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStream
MediaStream::~MediaStream()
{
- m_descriptor->setOwner(0);
+ m_descriptor->setClient(0);
m_audioTracks->detachOwner();
m_videoTracks->detachOwner();
}
diff --git a/Source/WebCore/Modules/mediastream/MediaStream.h b/Source/WebCore/Modules/mediastream/MediaStream.h
index fc8d6679e..642ec0f92 100644
--- a/Source/WebCore/Modules/mediastream/MediaStream.h
+++ b/Source/WebCore/Modules/mediastream/MediaStream.h
@@ -37,7 +37,7 @@
namespace WebCore {
-class MediaStream : public RefCounted<MediaStream>, public MediaStreamDescriptorOwner, public EventTarget, public ContextDestructionObserver {
+class MediaStream : public RefCounted<MediaStream>, public MediaStreamDescriptorClient, public EventTarget, public ContextDestructionObserver {
public:
enum ReadyState {
LIVE = 1,
@@ -58,7 +58,7 @@ public:
virtual bool isLocal() const { return false; }
- // MediaStreamDescriptorOwner
+ // MediaStreamDescriptorClient
virtual void streamEnded() OVERRIDE;
MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); }
@@ -82,7 +82,7 @@ private:
virtual void refEventTarget() OVERRIDE { ref(); }
virtual void derefEventTarget() OVERRIDE { deref(); }
- // MediaStreamDescriptorOwner
+ // MediaStreamDescriptorClient
virtual void addTrack(MediaStreamComponent*) OVERRIDE;
virtual void removeTrack(MediaStreamComponent*) OVERRIDE;
diff --git a/Source/WebCore/Modules/mediastream/PeerConnection00.cpp b/Source/WebCore/Modules/mediastream/PeerConnection00.cpp
index 8556d08c1..89fc607fa 100644
--- a/Source/WebCore/Modules/mediastream/PeerConnection00.cpp
+++ b/Source/WebCore/Modules/mediastream/PeerConnection00.cpp
@@ -412,9 +412,9 @@ void PeerConnection00::didAddRemoteStream(PassRefPtr<MediaStreamDescriptor> stre
void PeerConnection00::didRemoveRemoteStream(MediaStreamDescriptor* streamDescriptor)
{
ASSERT(scriptExecutionContext()->isContextThread());
- ASSERT(streamDescriptor->owner());
+ ASSERT(streamDescriptor->client());
- RefPtr<MediaStream> stream = static_cast<MediaStream*>(streamDescriptor->owner());
+ RefPtr<MediaStream> stream = static_cast<MediaStream*>(streamDescriptor->client());
stream->streamEnded();
if (m_readyState == CLOSED)
diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
index d2f90723e..8583517f8 100644
--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
@@ -483,9 +483,9 @@ void RTCPeerConnection::didAddRemoteStream(PassRefPtr<MediaStreamDescriptor> str
void RTCPeerConnection::didRemoveRemoteStream(MediaStreamDescriptor* streamDescriptor)
{
ASSERT(scriptExecutionContext()->isContextThread());
- ASSERT(streamDescriptor->owner());
+ ASSERT(streamDescriptor->client());
- RefPtr<MediaStream> stream = static_cast<MediaStream*>(streamDescriptor->owner());
+ RefPtr<MediaStream> stream = static_cast<MediaStream*>(streamDescriptor->client());
stream->streamEnded();
if (m_readyState == ReadyStateClosed)
diff --git a/Source/WebCore/Modules/notifications/NotificationCenter.cpp b/Source/WebCore/Modules/notifications/NotificationCenter.cpp
index 326976d71..0ebb54740 100644
--- a/Source/WebCore/Modules/notifications/NotificationCenter.cpp
+++ b/Source/WebCore/Modules/notifications/NotificationCenter.cpp
@@ -55,11 +55,6 @@ NotificationCenter::NotificationCenter(ScriptExecutionContext* context, Notifica
{
}
-Document* NotificationCenter::document() const {
- ScriptExecutionContext* context = scriptExecutionContext();
- return context->isDocument() ? static_cast<Document*>(context) : 0;
-}
-
#if ENABLE(LEGACY_NOTIFICATIONS)
int NotificationCenter::checkPermission()
{
diff --git a/Source/WebCore/Modules/notifications/NotificationCenter.h b/Source/WebCore/Modules/notifications/NotificationCenter.h
index b17de9d5d..3f6d68902 100644
--- a/Source/WebCore/Modules/notifications/NotificationCenter.h
+++ b/Source/WebCore/Modules/notifications/NotificationCenter.h
@@ -85,7 +85,6 @@ public:
int checkPermission();
void requestPermission(PassRefPtr<VoidCallback>);
#endif
- Document* document() const;
virtual void stop() OVERRIDE;
diff --git a/Source/WebCore/Resources/pagepopups/calendarPicker.css b/Source/WebCore/Resources/pagepopups/calendarPicker.css
index 8133d71b0..330ac3dd6 100644
--- a/Source/WebCore/Resources/pagepopups/calendarPicker.css
+++ b/Source/WebCore/Resources/pagepopups/calendarPicker.css
@@ -219,3 +219,8 @@ body {
.cancel-button {
float: right;
}
+
+.preparing .available,
+.preparing .unavailable {
+ -webkit-transition: none;
+}
diff --git a/Source/WebCore/Resources/pagepopups/calendarPicker.js b/Source/WebCore/Resources/pagepopups/calendarPicker.js
index c2d3deb16..f599c96e9 100644
--- a/Source/WebCore/Resources/pagepopups/calendarPicker.js
+++ b/Source/WebCore/Resources/pagepopups/calendarPicker.js
@@ -310,6 +310,9 @@ function openCalendarPicker() {
function CalendarPicker(element, config) {
Picker.call(this, element, config);
this._element.classList.add("calendar-picker");
+ this._element.classList.add("preparing");
+ this._handleWindowResizeBound = this._handleWindowResize.bind(this);
+ window.addEventListener("resize", this._handleWindowResizeBound, false);
// We assume this._config.min is a valid date.
this.minimumDate = (typeof this._config.min !== "undefined") ? parseDateString(this._config.min) : CalendarPicker.MinimumPossibleDate;
// We assume this._config.max is a valid date.
@@ -339,6 +342,10 @@ CalendarPicker.MaximumPossibleDate = new Date(8640000000000000.0);
CalendarPicker.DefaultStepScaleFactor = 86400000;
CalendarPicker.DefaultStepBase = 0.0;
+CalendarPicker.prototype._handleWindowResize = function() {
+ this._element.classList.remove("preparing");
+};
+
CalendarPicker.prototype.cleanup = function() {
document.body.removeEventListener("keydown", this._handleBodyKeyDownBound, false);
};
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
index 9346b471e..0dd49e7a3 100644
--- a/Source/WebCore/Target.pri
+++ b/Source/WebCore/Target.pri
@@ -318,6 +318,7 @@ SOURCES += \
css/SelectorChecker.cpp \
css/ShadowValue.cpp \
css/StyleBuilder.cpp \
+ css/StyleInvalidationAnalysis.cpp \
css/StyleMedia.cpp \
css/StylePropertySet.cpp \
css/StylePropertyShorthand.cpp \
@@ -1490,6 +1491,7 @@ HEADERS += \
css/SiblingTraversalStrategies.h \
css/StyleMedia.h \
css/StyleBuilder.h \
+ css/StyleInvalidationAnalysis.h \
css/StylePropertySet.h \
css/StylePropertyShorthand.h \
css/StyleResolver.h \
@@ -3894,6 +3896,7 @@ enable?(WEBGL) {
html/canvas/OESStandardDerivatives.h \
html/canvas/OESTextureFloat.h \
html/canvas/OESVertexArrayObject.h \
+ html/canvas/OESElementIndexUint.h \
html/canvas/WebGLTexture.h \
html/canvas/WebGLUniformLocation.h \
html/canvas/WebGLVertexArrayObjectOES.h \
@@ -3927,6 +3930,7 @@ enable?(WEBGL) {
html/canvas/OESStandardDerivatives.cpp \
html/canvas/OESTextureFloat.cpp \
html/canvas/OESVertexArrayObject.cpp \
+ html/canvas/OESElementIndexUint.cpp \
html/canvas/WebGLTexture.cpp \
html/canvas/WebGLUniformLocation.cpp \
html/canvas/WebGLVertexArrayObjectOES.cpp
diff --git a/Source/WebCore/UseV8.cmake b/Source/WebCore/UseV8.cmake
index 5cd42c803..5cd42c803 100755..100644
--- a/Source/WebCore/UseV8.cmake
+++ b/Source/WebCore/UseV8.cmake
diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in
index bc6fd9bbc..278d224c9 100644
--- a/Source/WebCore/WebCore.exp.in
+++ b/Source/WebCore/WebCore.exp.in
@@ -400,6 +400,7 @@ __ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE
__ZN7WebCore15setDOMExceptionEPN3JSC9ExecStateEi
__ZN7WebCore15toDOMStringListEPN3JSC9ExecStateENS0_7JSValueE
__ZN7WebCore15visitedLinkHashEPKtj
+__ZN7WebCore15visitedLinkHashERKN3WTF6StringE
__ZN7WebCore16AbstractDatabase14setIsAvailableEb
__ZN7WebCore16ApplicationCache18diskUsageForOriginEPNS_14SecurityOriginE
__ZN7WebCore16ApplicationCache20deleteCacheForOriginEPNS_14SecurityOriginE
@@ -629,6 +630,7 @@ __ZN7WebCore25HistoryPropertyListWriterC2Ev
__ZN7WebCore25ImmutableStylePropertySetD1Ev
__ZN7WebCore25addLanguageChangeObserverEPvPFvS0_E
__ZN7WebCore25computeViewportAttributesENS_17ViewportArgumentsEiiifNS_7IntSizeE
+__ZN7WebCore25jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_
__ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv
__ZN7WebCore26UserTypingGestureIndicator28focusedElementAtGestureStartEv
__ZN7WebCore26stopObservingCookieChangesEv
@@ -702,7 +704,6 @@ __ZN7WebCore4Page22allVisitedStateChangedEPNS_9PageGroupE
__ZN7WebCore4Page23clearUndoRedoOperationsEv
__ZN7WebCore4Page24resumeScriptedAnimationsEv
__ZN7WebCore4Page25suspendScriptedAnimationsEv
-__ZN7WebCore4Page27setJavaScriptURLsAreAllowedEb
__ZN7WebCore4Page31setCustomHTMLTokenizerChunkSizeEi
__ZN7WebCore4Page31setCustomHTMLTokenizerTimeDelayEd
__ZN7WebCore4Page32setMemoryCacheClientCallsEnabledEb
@@ -730,7 +731,7 @@ __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE
__ZN7WebCore50restrictScaleFactorToInitialScaleIfNotUserScalableERNS_18ViewportAttributesE
__ZN7WebCore5Color11transparentE
__ZN7WebCore5Color5whiteE
-__ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_bNS_13ScrollbarModeEbS7_b
+__ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_RKNS_7IntRectEbNS_13ScrollbarModeEbSA_b
__ZN7WebCore5Frame13rangeForPointERKNS_8IntPointE
__ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE
__ZN7WebCore5Frame17setPageZoomFactorEf
@@ -2305,8 +2306,7 @@ __ZN7WebCore28InspectorFrontendClientLocal14frontendLoadedEv
__ZN7WebCore28InspectorFrontendClientLocal15canAttachWindowEv
__ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowEb
__ZN7WebCore28InspectorFrontendClientLocal18isDebuggingEnabledEv
-__ZN7WebCore28InspectorFrontendClientLocal19requestAttachWindowEv
-__ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv
+__ZN7WebCore28InspectorFrontendClientLocal18requestSetDockSideENS_23InspectorFrontendClient8DockSideE
__ZN7WebCore28InspectorFrontendClientLocal19setDebuggingEnabledEb
__ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv
__ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKN3WTF6StringE
@@ -2361,7 +2361,6 @@ __NPN_UTF8FromIdentifier
__ZN7WebCore16ScriptController20windowScriptNPObjectEv
__ZN7WebCore16ScriptController29cleanupScriptObjectsForPluginEPv
__ZN7WebCore17HTMLPlugInElement11getNPObjectEv
-__ZN7WebCore25jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_
__ZNK7WebCore14SecurityOrigin9canAccessEPKS0_
__ZNK7WebCore4KURL7hasPathEv
#endif
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index c9fda66b4..08c5d67f3 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -1162,6 +1162,7 @@
'html/canvas/OESStandardDerivatives.idl',
'html/canvas/OESTextureFloat.idl',
'html/canvas/OESVertexArrayObject.idl',
+ 'html/canvas/OESElementIndexUint.idl',
'html/canvas/Uint16Array.idl',
'html/canvas/Uint32Array.idl',
'html/canvas/Uint8Array.idl',
@@ -2636,6 +2637,8 @@
'css/SiblingTraversalStrategies.h',
'css/StyleBuilder.cpp',
'css/StyleBuilder.h',
+ 'css/StyleInvalidationAnalysis.cpp',
+ 'css/StyleInvalidationAnalysis.h',
'css/StyleMedia.cpp',
'css/StyleMedia.h',
'css/StylePropertySet.cpp',
@@ -4321,6 +4324,8 @@
'html/canvas/OESTextureFloat.h',
'html/canvas/OESVertexArrayObject.cpp',
'html/canvas/OESVertexArrayObject.h',
+ 'html/canvas/OESElementIndexUint.cpp',
+ 'html/canvas/OESElementIndexUint.h',
'html/canvas/WebGLActiveInfo.h',
'html/canvas/WebGLBuffer.cpp',
'html/canvas/WebGLBuffer.h',
@@ -4914,6 +4919,8 @@
'platform/graphics/chromium/CompositorHUDFontAtlas.h',
'platform/graphics/chromium/CrossProcessFontLoading.h',
'platform/graphics/chromium/CrossProcessFontLoading.mm',
+ 'platform/graphics/chromium/DeferredImageDecoder.cpp',
+ 'platform/graphics/chromium/DeferredImageDecoder.h',
'platform/graphics/chromium/DrawingBufferChromium.cpp',
'platform/graphics/chromium/Extensions3DChromium.h',
'platform/graphics/chromium/FontCacheAndroid.cpp',
@@ -4933,10 +4940,18 @@
'platform/graphics/chromium/IconChromiumAndroid.cpp',
'platform/graphics/chromium/ImageBufferDataSkia.h',
'platform/graphics/chromium/ImageChromium.cpp',
+ 'platform/graphics/chromium/ImageDecodingStore.cpp',
+ 'platform/graphics/chromium/ImageDecodingStore.h',
+ 'platform/graphics/chromium/ImageFrameGenerator.cpp',
+ 'platform/graphics/chromium/ImageFrameGenerator.h',
+ 'platform/graphics/chromium/LazyDecodingPixelRef.cpp',
+ 'platform/graphics/chromium/LazyDecodingPixelRef.h',
'platform/graphics/chromium/MediaPlayerPrivateChromium.h',
'platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp',
'platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.h',
'platform/graphics/chromium/PlatformIcon.h',
+ 'platform/graphics/chromium/ScaledImageFragment.cpp',
+ 'platform/graphics/chromium/ScaledImageFragment.h',
'platform/graphics/chromium/SimpleFontDataChromiumWin.cpp',
'platform/graphics/chromium/TransparencyWin.cpp',
'platform/graphics/chromium/TransparencyWin.h',
@@ -7798,6 +7813,8 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESTextureFloat.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESVertexArrayObject.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESVertexArrayObject.h',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESElementIndexUint.cpp',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESElementIndexUint.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSOverflowEvent.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSOverflowEvent.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSPageTransitionEvent.cpp',
diff --git a/Source/WebCore/WebCore.order b/Source/WebCore/WebCore.order
index cec0f748f..503ebd731 100644
--- a/Source/WebCore/WebCore.order
+++ b/Source/WebCore/WebCore.order
@@ -31742,7 +31742,6 @@ __Z3kitPN7WebCore17CSSPrimitiveValueE
-[DOMRange collapse:]
-[DOMText splitText:]
-[DOMRange setStartAfter:]
-__ZN7WebCore4Page27setJavaScriptURLsAreAllowedEb
__ZN3WTF9HashTableIPN7WebCore18CSSParserValueListES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E16lookupForWritingERKS3_
__ZN3WTF9HashTableIPN7WebCore18CSSParserValueListES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E4findIS3_NS_22IdentityHashTranslatorIS3_S3_S7_EEEENS_17HashTableIteratorIS3_S3_S5_S7_S9_S9_EERKT_
__ZN7WebCoreL32max_device_widthMediaFeatureEvalEPNS_8CSSValueEPNS_11RenderStyleEPNS_5FrameENS_18MediaFeaturePrefixE
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index c064b78e7..8e4d8515f 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -37786,6 +37786,14 @@
RelativePath="..\css\StyleBuilder.h"
>
</File>
+ <File
+ RelativePath="..\css\StyleInvalidationAnalysis.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\css\StyleInvalidationAnalysis.h"
+ >
+ </File>
<File
RelativePath="..\css\StyleMedia.cpp"
>
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index d3d4b6944..3689f46b6 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1634,6 +1634,8 @@
52CCA9E815E3F64C0053C77F /* DOMDOMNamedFlowCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 52CCA9E515E3F64C0053C77F /* DOMDOMNamedFlowCollection.h */; };
52CCA9E915E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52CCA9E615E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm */; };
52CCA9EA15E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 52CCA9E715E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h */; };
+ 52F10865162B6DA4009AC81E /* MixedContentChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */; };
+ 52F10866162B6DA8009AC81E /* MixedContentChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F10863162B6D82009AC81E /* MixedContentChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
52F52E1114A0134F00ACC397 /* NSScrollerImpDetails.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */; };
5317612213C516690026E454 /* StyleFlexibleBoxData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5317612013C516690026E454 /* StyleFlexibleBoxData.cpp */; };
5317612313C516690026E454 /* StyleFlexibleBoxData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5317612113C516690026E454 /* StyleFlexibleBoxData.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1756,7 +1758,6 @@
656D373E0ADBA5DE00A4554D /* FrameLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37260ADBA5DE00A4554D /* FrameLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
656D373F0ADBA5DE00A4554D /* ResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37270ADBA5DE00A4554D /* ResourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
656D37410ADBA5DE00A4554D /* MainResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37290ADBA5DE00A4554D /* MainResourceLoader.h */; };
- 52F10866162B6DA8009AC81E /* MixedContentChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F10863162B6D82009AC81E /* MixedContentChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D372B0ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
656D37480ADBA5DE00A4554D /* SubresourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37300ADBA5DE00A4554D /* SubresourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
6571DCC81385E6A400702DD0 /* MemoryPressureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 657EDA071385CB97004E0645 /* MemoryPressureHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1997,6 +1998,10 @@
7E12E91015FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E12E90E15FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp */; };
7E33CD01127F340D00BE8F17 /* PurgePriority.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E33CD00127F340D00BE8F17 /* PurgePriority.h */; settings = {ATTRIBUTES = (Private, ); }; };
7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */; };
+ 7E46F6FA1627A2CA00062223 /* JSOESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */; };
+ 7E46F6FB1627A2CA00062223 /* JSOESElementIndexUint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */; };
+ 7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */; };
+ 7E5D7A77161D3F8F00896C34 /* OESElementIndexUint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */; };
7E99AF510B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */; };
7E99AF530B13846468FB01A5 /* WindowFocusAllowedIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
7EE6845F12D26E3800E79415 /* AuthenticationCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7EE6844C12D26E3800E79415 /* AuthenticationCF.cpp */; };
@@ -3338,7 +3343,6 @@
93D9D53C0DA27E180077216C /* RangeBoundaryPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
93E227E00AF589AD00D48324 /* DocumentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */; };
93E227E10AF589AD00D48324 /* MainResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DC0AF589AD00D48324 /* MainResourceLoader.cpp */; };
- 52F10865162B6DA4009AC81E /* MixedContentChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */; };
93E227E30AF589AD00D48324 /* ResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */; };
93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */; };
93E241FF0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E241FE0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -6153,6 +6157,8 @@
E45322AB140CE267005A0F92 /* SelectorQuery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45322A9140CE267005A0F92 /* SelectorQuery.cpp */; };
E45322AC140CE267005A0F92 /* SelectorQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = E45322AA140CE267005A0F92 /* SelectorQuery.h */; };
E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E462A4A0113E71BE004A4220 /* IntPointHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ E47127CA163438A100ED6F5A /* StyleInvalidationAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */; };
+ E47127CB163438AE00ED6F5A /* StyleInvalidationAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */; };
E4778B7F115A581A00B5D372 /* JSCustomEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4778B7D115A581A00B5D372 /* JSCustomEvent.cpp */; };
E4778B80115A581A00B5D372 /* JSCustomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E4778B7E115A581A00B5D372 /* JSCustomEvent.h */; };
E47B4BE80E71241600038854 /* CachedResourceHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = E47B4BE60E71241600038854 /* CachedResourceHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -8838,6 +8844,8 @@
52CCA9E515E3F64C0053C77F /* DOMDOMNamedFlowCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMNamedFlowCollection.h; sourceTree = "<group>"; };
52CCA9E615E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMDOMNamedFlowCollection.mm; sourceTree = "<group>"; };
52CCA9E715E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMNamedFlowCollectionInternal.h; sourceTree = "<group>"; };
+ 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MixedContentChecker.cpp; sourceTree = "<group>"; };
+ 52F10863162B6D82009AC81E /* MixedContentChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MixedContentChecker.h; sourceTree = "<group>"; };
52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NSScrollerImpDetails.mm; sourceTree = "<group>"; };
5317612013C516690026E454 /* StyleFlexibleBoxData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleFlexibleBoxData.cpp; path = style/StyleFlexibleBoxData.cpp; sourceTree = "<group>"; };
5317612113C516690026E454 /* StyleFlexibleBoxData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleFlexibleBoxData.h; path = style/StyleFlexibleBoxData.h; sourceTree = "<group>"; };
@@ -8968,7 +8976,6 @@
656D37260ADBA5DE00A4554D /* FrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoaderClient.h; sourceTree = "<group>"; };
656D37270ADBA5DE00A4554D /* ResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceLoader.h; sourceTree = "<group>"; };
656D37290ADBA5DE00A4554D /* MainResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MainResourceLoader.h; sourceTree = "<group>"; };
- 52F10863162B6D82009AC81E /* MixedContentChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MixedContentChecker.h; sourceTree = "<group>"; };
656D372B0ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NetscapePlugInStreamLoader.h; sourceTree = "<group>"; };
656D37300ADBA5DE00A4554D /* SubresourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SubresourceLoader.h; sourceTree = "<group>"; };
657EDA061385CB97004E0645 /* MemoryPressureHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryPressureHandler.cpp; sourceTree = "<group>"; };
@@ -9236,6 +9243,10 @@
7E12E90E15FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomFilterMeshGenerator.cpp; path = filters/CustomFilterMeshGenerator.cpp; sourceTree = "<group>"; };
7E33CD00127F340D00BE8F17 /* PurgePriority.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurgePriority.h; sourceTree = "<group>"; };
7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SubresourceLoaderCF.cpp; path = cf/SubresourceLoaderCF.cpp; sourceTree = "<group>"; };
+ 7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESElementIndexUint.cpp; sourceTree = "<group>"; };
+ 7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESElementIndexUint.h; sourceTree = "<group>"; };
+ 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OESElementIndexUint.cpp; path = canvas/OESElementIndexUint.cpp; sourceTree = "<group>"; };
+ 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OESElementIndexUint.h; path = canvas/OESElementIndexUint.h; sourceTree = "<group>"; };
7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFocusAllowedIndicator.cpp; sourceTree = "<group>"; };
7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFocusAllowedIndicator.h; sourceTree = "<group>"; };
7EE6844C12D26E3800E79415 /* AuthenticationCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationCF.cpp; sourceTree = "<group>"; };
@@ -10554,7 +10565,6 @@
93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangeBoundaryPoint.h; sourceTree = "<group>"; };
93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentLoader.cpp; sourceTree = "<group>"; };
93E227DC0AF589AD00D48324 /* MainResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainResourceLoader.cpp; sourceTree = "<group>"; };
- 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MixedContentChecker.cpp; sourceTree = "<group>"; };
93E227DD0AF589AD00D48324 /* NetscapePlugInStreamLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapePlugInStreamLoader.cpp; sourceTree = "<group>"; };
93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoader.cpp; sourceTree = "<group>"; };
93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubresourceLoader.cpp; sourceTree = "<group>"; };
@@ -13554,6 +13564,8 @@
E462A4A0113E71BE004A4220 /* IntPointHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntPointHash.h; sourceTree = "<group>"; };
E4778B7D115A581A00B5D372 /* JSCustomEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomEvent.cpp; sourceTree = "<group>"; };
E4778B7E115A581A00B5D372 /* JSCustomEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomEvent.h; sourceTree = "<group>"; };
+ E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleInvalidationAnalysis.cpp; sourceTree = "<group>"; };
+ E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleInvalidationAnalysis.h; sourceTree = "<group>"; };
E47B4BE60E71241600038854 /* CachedResourceHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedResourceHandle.h; sourceTree = "<group>"; };
E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceHandle.cpp; sourceTree = "<group>"; };
E47E276416036ED200EE2AFB /* DocumentStyleSheetCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentStyleSheetCollection.h; sourceTree = "<group>"; };
@@ -15144,6 +15156,8 @@
49484FAE102CF01E00187DD3 /* canvas */ = {
isa = PBXGroup;
children = (
+ 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */,
+ 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */,
49EECDCC10503C2300099FAB /* ArrayBuffer.idl */,
49EECDC910503C2300099FAB /* ArrayBufferView.idl */,
6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */,
@@ -18493,6 +18507,8 @@
CDB859F9160D493E00E5B07F /* JSMediaKeyEvent.h */,
1059457515B42A0D004D37FD /* JSMicroDataItemValue.cpp */,
1059457915B42A43004D37FD /* JSMicroDataItemValue.h */,
+ 7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */,
+ 7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */,
9001787E12E0370700648462 /* JSOESStandardDerivatives.cpp */,
9001787F12E0370700648462 /* JSOESStandardDerivatives.h */,
6EBF0E7412A9868800DB1709 /* JSOESTextureFloat.cpp */,
@@ -21301,6 +21317,8 @@
5728BD9D1625369600C40B56 /* SiblingTraversalStrategies.h */,
E100EE731546EAC100BA11D1 /* StyleBuilder.cpp */,
E100EE741546EAC100BA11D1 /* StyleBuilder.h */,
+ E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */,
+ E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */,
0FF5026E102BA9660066F39A /* StyleMedia.cpp */,
0FF5026F102BA96A0066F39A /* StyleMedia.h */,
0FF50270102BA96A0066F39A /* StyleMedia.idl */,
@@ -25621,6 +25639,9 @@
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
FD537353137B651800008DCE /* ZeroPole.h in Headers */,
+ 7E5D7A77161D3F8F00896C34 /* OESElementIndexUint.h in Headers */,
+ 7E46F6FB1627A2CA00062223 /* JSOESElementIndexUint.h in Headers */,
+ E47127CB163438AE00ED6F5A /* StyleInvalidationAnalysis.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -28728,6 +28749,9 @@
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
+ 7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */,
+ 7E46F6FA1627A2CA00062223 /* JSOESElementIndexUint.cpp in Sources */,
+ E47127CA163438A100ED6F5A /* StyleInvalidationAnalysis.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp b/Source/WebCore/accessibility/AXObjectCache.cpp
index 8e32eb501..665abc087 100644
--- a/Source/WebCore/accessibility/AXObjectCache.cpp
+++ b/Source/WebCore/accessibility/AXObjectCache.cpp
@@ -316,8 +316,14 @@ AccessibilityObject* AXObjectCache::getOrCreate(Node* node)
if (node->renderer())
return getOrCreate(node->renderer());
+ if (!node->parentElement())
+ return 0;
+
// It's only allowed to create an AccessibilityObject from a Node if it's in a canvas subtree.
- if (!node->parentElement() || !node->parentElement()->isInCanvasSubtree())
+ // Or if it's a hidden element, but we still want to expose it because of other ARIA attributes.
+ bool inCanvasSubtree = node->parentElement()->isInCanvasSubtree();
+ bool isHidden = !node->renderer() && isNodeAriaVisible(node);
+ if (!inCanvasSubtree && !isHidden)
return 0;
RefPtr<AccessibilityObject> newObj = createFromNode(node);
@@ -783,6 +789,17 @@ bool AXObjectCache::nodeIsTextControl(const Node* node)
const AccessibilityObject* axObject = getOrCreate(const_cast<Node*>(node));
return axObject && axObject->isTextControl();
}
+
+bool isNodeAriaVisible(Node* node)
+{
+ if (!node)
+ return false;
+
+ if (!node->isElementNode())
+ return false;
+
+ return equalIgnoringCase(toElement(node)->getAttribute(aria_hiddenAttr), "false");
+}
} // namespace WebCore
diff --git a/Source/WebCore/accessibility/AXObjectCache.h b/Source/WebCore/accessibility/AXObjectCache.h
index 8f0f76567..fdfd5afbf 100644
--- a/Source/WebCore/accessibility/AXObjectCache.h
+++ b/Source/WebCore/accessibility/AXObjectCache.h
@@ -208,7 +208,9 @@ private:
};
bool nodeHasRole(Node*, const String& role);
-
+// This will let you know if aria-hidden was explicitly set to false.
+bool isNodeAriaVisible(Node*);
+
#if !HAVE(ACCESSIBILITY)
inline AXObjectCache::AXObjectCache(const Document* doc) : m_document(const_cast<Document*>(doc)), m_notificationPostTimer(this, 0) { }
inline AXObjectCache::~AXObjectCache() { }
@@ -224,6 +226,7 @@ inline AccessibilityObject* AXObjectCache::rootObject() { return 0; }
inline AccessibilityObject* AXObjectCache::rootObjectForFrame(Frame*) { return 0; }
inline Element* AXObjectCache::rootAXEditableElement(Node*) { return 0; }
inline bool nodeHasRole(Node*, const String&) { return false; }
+inline bool isNodeAriaVisible(Node*) { return true; }
inline const Element* AXObjectCache::rootAXEditableElement(const Node*) { return 0; }
inline void AXObjectCache::attachWrapper(AccessibilityObject*) { }
inline void AXObjectCache::checkedStateChanged(Node*) { }
diff --git a/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp b/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp
index 5e2106bae..22322879a 100644
--- a/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp
+++ b/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp
@@ -66,7 +66,7 @@ PassRefPtr<AccessibilityARIAGrid> AccessibilityARIAGrid::create(RenderObject* re
return adoptRef(obj);
}
-bool AccessibilityARIAGrid::addChild(AccessibilityObject* child, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount)
+bool AccessibilityARIAGrid::addTableCellChild(AccessibilityObject* child, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount)
{
if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole)
return false;
@@ -114,7 +114,7 @@ void AccessibilityARIAGrid::addChildren()
unsigned columnCount = 0;
for (RefPtr<AccessibilityObject> child = firstChild(); child; child = child->nextSibling()) {
- if (!addChild(child.get(), appendedRows, columnCount)) {
+ if (!addTableCellChild(child.get(), appendedRows, columnCount)) {
// in case the render tree doesn't match the expected ARIA hierarchy, look at the children
if (!child->hasChildren())
@@ -125,7 +125,7 @@ void AccessibilityARIAGrid::addChildren()
AccessibilityChildrenVector children = child->children();
size_t length = children.size();
for (size_t i = 0; i < length; ++i)
- addChild(children[i].get(), appendedRows, columnCount);
+ addTableCellChild(children[i].get(), appendedRows, columnCount);
}
}
diff --git a/Source/WebCore/accessibility/AccessibilityARIAGrid.h b/Source/WebCore/accessibility/AccessibilityARIAGrid.h
index 67e8804f3..02da5b19f 100644
--- a/Source/WebCore/accessibility/AccessibilityARIAGrid.h
+++ b/Source/WebCore/accessibility/AccessibilityARIAGrid.h
@@ -58,7 +58,7 @@ private:
virtual bool supportsSelectedRows() { return true; }
virtual bool isMultiSelectable() const { return true; }
- bool addChild(AccessibilityObject*, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount);
+ bool addTableCellChild(AccessibilityObject*, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount);
};
} // namespace WebCore
diff --git a/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp b/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp
index 13ff212f2..9089f66f3 100644
--- a/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp
+++ b/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp
@@ -94,6 +94,21 @@ KURL AccessibilityImageMapLink::url() const
return m_areaElement->href();
}
+
+void AccessibilityImageMapLink::accessibilityText(Vector<AccessibilityText>& textOrder)
+{
+ String description = accessibilityDescription();
+ if (!description.isEmpty())
+ textOrder.append(AccessibilityText(description, AlternativeText));
+
+ const AtomicString& titleText = getAttribute(titleAttr);
+ if (!titleText.isEmpty())
+ textOrder.append(AccessibilityText(titleText, TitleTagText));
+
+ const AtomicString& summary = getAttribute(summaryAttr);
+ if (!summary.isEmpty())
+ textOrder.append(AccessibilityText(summary, SummaryText));
+}
String AccessibilityImageMapLink::accessibilityDescription() const
{
diff --git a/Source/WebCore/accessibility/AccessibilityImageMapLink.h b/Source/WebCore/accessibility/AccessibilityImageMapLink.h
index bc6ce3cb9..0447b6381 100644
--- a/Source/WebCore/accessibility/AccessibilityImageMapLink.h
+++ b/Source/WebCore/accessibility/AccessibilityImageMapLink.h
@@ -73,6 +73,7 @@ private:
RefPtr<HTMLAreaElement> m_areaElement;
RefPtr<HTMLMapElement> m_mapElement;
+ virtual void accessibilityText(Vector<AccessibilityText>&);
virtual bool isImageMapLink() const { return true; }
};
diff --git a/Source/WebCore/accessibility/AccessibilityMediaControls.cpp b/Source/WebCore/accessibility/AccessibilityMediaControls.cpp
index 3d380df1a..887c7e2f4 100644
--- a/Source/WebCore/accessibility/AccessibilityMediaControls.cpp
+++ b/Source/WebCore/accessibility/AccessibilityMediaControls.cpp
@@ -140,6 +140,22 @@ String AccessibilityMediaControl::controlTypeName() const
return String();
}
+void AccessibilityMediaControl::accessibilityText(Vector<AccessibilityText>& textOrder)
+{
+ String description = accessibilityDescription();
+ if (!description.isEmpty())
+ textOrder.append(AccessibilityText(description, AlternativeText));
+
+ String title = this->title();
+ if (!title.isEmpty())
+ textOrder.append(AccessibilityText(title, AlternativeText));
+
+ String helptext = helpText();
+ if (!helptext.isEmpty())
+ textOrder.append(AccessibilityText(helptext, HelpText));
+}
+
+
String AccessibilityMediaControl::title() const
{
DEFINE_STATIC_LOCAL(const String, controlsPanel, (ASCIILiteral("ControlsPanel")));
diff --git a/Source/WebCore/accessibility/AccessibilityMediaControls.h b/Source/WebCore/accessibility/AccessibilityMediaControls.h
index 05c03ee05..30d9d5e39 100644
--- a/Source/WebCore/accessibility/AccessibilityMediaControls.h
+++ b/Source/WebCore/accessibility/AccessibilityMediaControls.h
@@ -54,6 +54,7 @@ protected:
explicit AccessibilityMediaControl(RenderObject*);
MediaControlElementType controlType() const;
String controlTypeName() const;
+ virtual void accessibilityText(Vector<AccessibilityText>&);
};
@@ -107,6 +108,7 @@ public:
private:
explicit AccessibilityMediaTimeDisplay(RenderObject*);
+ virtual bool isMediaControlLabel() const { return true; }
};
diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
index 0f94838e7..49b83ea6d 100644
--- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
@@ -59,6 +59,7 @@
#include "HTMLTextFormControlElement.h"
#include "HitTestRequest.h"
#include "HitTestResult.h"
+#include "LabelableElement.h"
#include "LocalizedStrings.h"
#include "MathMLNames.h"
#include "NodeList.h"
@@ -221,6 +222,26 @@ LayoutRect AccessibilityNodeObject::elementRect() const
{
return boundingBoxRect();
}
+
+LayoutRect AccessibilityNodeObject::boundingBoxRect() const
+{
+ // AccessibilityNodeObjects have no mechanism yet to return a size or position.
+ // For now, let's return the position of the ancestor that does have a position,
+ // and make it the width of that parent, and about the height of a line of text, so that it's clear the object is a child of the parent.
+
+ LayoutRect boundingBox;
+
+ for (AccessibilityObject* positionProvider = parentObject(); positionProvider; positionProvider = positionProvider->parentObject()) {
+ if (positionProvider->isAccessibilityRenderObject()) {
+ LayoutRect parentRect = positionProvider->elementRect();
+ boundingBox.setSize(LayoutSize(parentRect.width(), FractionalLayoutUnit(std::min(10.0f, parentRect.height().toFloat()))));
+ boundingBox.setLocation(parentRect.location());
+ break;
+ }
+ }
+
+ return boundingBox;
+}
void AccessibilityNodeObject::setNode(Node* node)
{
@@ -283,6 +304,32 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole()
return UnknownRole;
}
+void AccessibilityNodeObject::insertChild(AccessibilityObject* child, unsigned index)
+{
+ if (!child)
+ return;
+
+ // If the parent is asking for this child's children, then either it's the first time (and clearing is a no-op),
+ // or its visibility has changed. In the latter case, this child may have a stale child cached.
+ // This can prevent aria-hidden changes from working correctly. Hence, whenever a parent is getting children, ensure data is not stale.
+ child->clearChildren();
+
+ if (child->accessibilityIsIgnored()) {
+ AccessibilityChildrenVector children = child->children();
+ size_t length = children.size();
+ for (size_t i = 0; i < length; ++i)
+ m_children.insert(index + i, children[i]);
+ } else {
+ ASSERT(child->parentObject() == this);
+ m_children.insert(index, child);
+ }
+}
+
+void AccessibilityNodeObject::addChild(AccessibilityObject* child)
+{
+ insertChild(child, m_children.size());
+}
+
void AccessibilityNodeObject::addChildren()
{
// If the need to add more children in addition to existing children arises,
@@ -298,19 +345,8 @@ void AccessibilityNodeObject::addChildren()
if (renderer() && !m_node->hasTagName(canvasTag))
return;
- for (Node* child = m_node->firstChild(); child; child = child->nextSibling()) {
- RefPtr<AccessibilityObject> obj = axObjectCache()->getOrCreate(child);
- obj->clearChildren();
- if (obj->accessibilityIsIgnored()) {
- AccessibilityChildrenVector children = obj->children();
- size_t length = children.size();
- for (size_t i = 0; i < length; ++i)
- m_children.append(children[i]);
- } else {
- ASSERT(obj->parentObject() == this);
- m_children.append(obj);
- }
- }
+ for (Node* child = m_node->firstChild(); child; child = child->nextSibling())
+ addChild(axObjectCache()->getOrCreate(child));
}
bool AccessibilityNodeObject::canHaveChildren() const
@@ -1001,14 +1037,18 @@ bool AccessibilityNodeObject::isGenericFocusableElement() const
HTMLLabelElement* AccessibilityNodeObject::labelForElement(Element* element) const
{
- RefPtr<NodeList> list = element->document()->getElementsByTagName("label");
- unsigned len = list->length();
- for (unsigned i = 0; i < len; i++) {
- if (list->item(i)->hasTagName(labelTag)) {
- HTMLLabelElement* label = static_cast<HTMLLabelElement*>(list->item(i));
- if (label->control() == element)
- return label;
- }
+ if (!element->isHTMLElement() || !toHTMLElement(element)->isLabelable())
+ return 0;
+
+ const AtomicString& id = element->getIdAttribute();
+ if (!id.isEmpty()) {
+ if (HTMLLabelElement* label = element->treeScope()->labelElementForId(id))
+ return label;
+ }
+
+ for (Element* parent = element->parentElement(); parent; parent = parent->parentElement()) {
+ if (parent->hasTagName(labelTag))
+ return static_cast<HTMLLabelElement*>(parent);
}
return 0;
@@ -1074,6 +1114,215 @@ AccessibilityObject* AccessibilityNodeObject::menuButtonForMenu() const
return 0;
}
+void AccessibilityNodeObject::titleElementText(Vector<AccessibilityText>& textOrder)
+{
+ Node* node = this->node();
+ if (!node)
+ return;
+
+ bool isInputTag = node->hasTagName(inputTag);
+ if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl()) {
+ HTMLLabelElement* label = labelForElement(toElement(node));
+ if (label) {
+ AccessibilityObject* labelObject = axObjectCache()->getOrCreate(label);
+ textOrder.append(AccessibilityText(label->innerText(), LabelByElementText, labelObject));
+ return;
+ }
+ }
+
+ AccessibilityObject* titleUIElement = this->titleUIElement();
+ if (titleUIElement)
+ textOrder.append(AccessibilityText(String(), LabelByElementText, titleUIElement));
+}
+
+void AccessibilityNodeObject::alternativeText(Vector<AccessibilityText>& textOrder) const
+{
+ if (isWebArea()) {
+ String webAreaText = alternativeTextForWebArea();
+ if (!webAreaText.isEmpty())
+ textOrder.append(AccessibilityText(webAreaText, AlternativeText));
+ return;
+ }
+
+ ariaLabeledByText(textOrder);
+
+ const AtomicString& ariaLabel = getAttribute(aria_labelAttr);
+ if (!ariaLabel.isEmpty())
+ textOrder.append(AccessibilityText(ariaLabel, AlternativeText));
+
+ if (isImage() || isInputImage() || isNativeImage() || isCanvas()) {
+ // Images should use alt as long as the attribute is present, even if empty.
+ // Otherwise, it should fallback to other methods, like the title attribute.
+ const AtomicString& alt = getAttribute(altAttr);
+ if (!alt.isNull())
+ textOrder.append(AccessibilityText(alt, AlternativeText));
+ }
+
+#if ENABLE(MATHML)
+ Node* node = this->node();
+ if (node && node->isElementNode() && toElement(node)->isMathMLElement())
+ textOrder.append(AccessibilityText(getAttribute(MathMLNames::alttextAttr), AlternativeText));
+#endif
+}
+
+void AccessibilityNodeObject::visibleText(Vector<AccessibilityText>& textOrder) const
+{
+ Node* node = this->node();
+ if (!node)
+ return;
+
+ bool isInputTag = node->hasTagName(inputTag);
+ if (isInputTag) {
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
+ if (input->isTextButton()) {
+ textOrder.append(AccessibilityText(input->valueWithDefault(), VisibleText));
+ return;
+ }
+ }
+
+ // If this node isn't rendered, there's no inner text we can extract from a select element.
+ if (!isAccessibilityRenderObject() && node->hasTagName(selectTag))
+ return;
+
+ bool useTextUnderElement = false;
+
+ switch (roleValue()) {
+ case PopUpButtonRole:
+ case ButtonRole:
+ case ToggleButtonRole:
+ case CheckBoxRole:
+ case ListBoxOptionRole:
+ case MenuButtonRole:
+ case MenuItemRole:
+ case RadioButtonRole:
+ case TabRole:
+ useTextUnderElement = true;
+ break;
+ default:
+ break;
+ }
+
+ // If it's focusable but it's not content editable or a known control type, then it will appear to
+ // the user as a single atomic object, so we should use its text as the default title.
+ if (isHeading() || isLink() || isGenericFocusableElement())
+ useTextUnderElement = true;
+
+ if (useTextUnderElement) {
+ String text = textUnderElement();
+ if (!text.isEmpty())
+ textOrder.append(AccessibilityText(text, ChildrenText));
+ }
+}
+
+void AccessibilityNodeObject::helpText(Vector<AccessibilityText>& textOrder) const
+{
+ const AtomicString& ariaHelp = getAttribute(aria_helpAttr);
+ if (!ariaHelp.isEmpty())
+ textOrder.append(AccessibilityText(ariaHelp, HelpText));
+
+ String describedBy = ariaDescribedByAttribute();
+ if (!describedBy.isEmpty())
+ textOrder.append(AccessibilityText(describedBy, SummaryText));
+
+ // Add help type text that is derived from ancestors.
+ for (Node* curr = node(); curr; curr = curr->parentNode()) {
+ const AtomicString& summary = getAttribute(summaryAttr);
+ if (!summary.isEmpty())
+ textOrder.append(AccessibilityText(summary, SummaryText));
+
+ // The title attribute should be used as help text unless it is already being used as descriptive text.
+ const AtomicString& title = getAttribute(titleAttr);
+ if (!title.isEmpty())
+ textOrder.append(AccessibilityText(title, TitleTagText));
+
+ // Only take help text from an ancestor element if its a group or an unknown role. If help was
+ // added to those kinds of elements, it is likely it was meant for a child element.
+ AccessibilityObject* axObj = axObjectCache()->getOrCreate(curr);
+ if (!axObj)
+ return;
+
+ AccessibilityRole role = axObj->roleValue();
+ if (role != GroupRole && role != UnknownRole)
+ break;
+ }
+}
+
+void AccessibilityNodeObject::accessibilityText(Vector<AccessibilityText>& textOrder)
+{
+ titleElementText(textOrder);
+ alternativeText(textOrder);
+ visibleText(textOrder);
+ helpText(textOrder);
+
+ String placeholder = placeholderValue();
+ if (!placeholder.isEmpty())
+ textOrder.append(AccessibilityText(placeholder, PlaceholderText));
+}
+
+void AccessibilityNodeObject::ariaLabeledByText(Vector<AccessibilityText>& textOrder) const
+{
+ String ariaLabeledBy = ariaLabeledByAttribute();
+ if (!ariaLabeledBy.isEmpty()) {
+ Vector<Element*> elements;
+ ariaLabeledByElements(elements);
+
+ Vector<RefPtr<AccessibilityObject> > axElements;
+ unsigned length = elements.size();
+ for (unsigned k = 0; k < length; k++) {
+ RefPtr<AccessibilityObject> axElement = axObjectCache()->getOrCreate(elements[k]);
+ axElements.append(axElement);
+ }
+
+ textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, axElements));
+ }
+}
+
+String AccessibilityNodeObject::alternativeTextForWebArea() const
+{
+ // The WebArea description should follow this order:
+ // aria-label on the <html>
+ // title on the <html>
+ // <title> inside the <head> (of it was set through JS)
+ // name on the <html>
+ // For iframes:
+ // aria-label on the <iframe>
+ // title on the <iframe>
+ // name on the <iframe>
+
+ Document* document = this->document();
+ if (!document)
+ return String();
+
+ // Check if the HTML element has an aria-label for the webpage.
+ if (Element* documentElement = document->documentElement()) {
+ const AtomicString& ariaLabel = documentElement->getAttribute(aria_labelAttr);
+ if (!ariaLabel.isEmpty())
+ return ariaLabel;
+ }
+
+ Node* owner = document->ownerElement();
+ if (owner) {
+ if (owner->hasTagName(frameTag) || owner->hasTagName(iframeTag)) {
+ const AtomicString& title = static_cast<HTMLFrameElementBase*>(owner)->getAttribute(titleAttr);
+ if (!title.isEmpty())
+ return title;
+ return static_cast<HTMLFrameElementBase*>(owner)->getNameAttribute();
+ }
+ if (owner->isHTMLElement())
+ return toHTMLElement(owner)->getNameAttribute();
+ }
+
+ String documentTitle = document->title();
+ if (!documentTitle.isEmpty())
+ return documentTitle;
+
+ owner = document->body();
+ if (owner && owner->isHTMLElement())
+ return toHTMLElement(owner)->getNameAttribute();
+
+ return String();
+}
+
String AccessibilityNodeObject::accessibilityDescription() const
{
// Static text should not have a description, it should only have a stringValue.
@@ -1186,7 +1435,9 @@ String AccessibilityNodeObject::textUnderElement() const
// If this could be fixed, it'd be more accurate use TextIterator here.
if (node->isElementNode())
return toElement(node)->innerText();
-
+ else if (node->isTextNode())
+ return toText(node)->wholeText();
+
return String();
}
@@ -1341,6 +1592,14 @@ String AccessibilityNodeObject::accessibilityDescriptionForElements(Vector<Eleme
return builder.toString();
}
+String AccessibilityNodeObject::ariaDescribedByAttribute() const
+{
+ Vector<Element*> elements;
+ elementsFromAttribute(elements, aria_describedbyAttr);
+
+ return accessibilityDescriptionForElements(elements);
+}
+
void AccessibilityNodeObject::elementsFromAttribute(Vector<Element*>& elements, const QualifiedName& attribute) const
{
Node* node = this->node();
diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.h b/Source/WebCore/accessibility/AccessibilityNodeObject.h
index d65b1e0ba..e1e161b22 100644
--- a/Source/WebCore/accessibility/AccessibilityNodeObject.h
+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.h
@@ -158,6 +158,9 @@ protected:
virtual AccessibilityRole determineAccessibilityRole();
virtual void addChildren();
+ virtual void addChild(AccessibilityObject*);
+ virtual void insertChild(AccessibilityObject*, unsigned index);
+
virtual bool canHaveChildren() const;
virtual bool accessibilityIsIgnored() const;
AccessibilityRole ariaRoleAttribute() const;
@@ -174,13 +177,23 @@ protected:
void ariaLabeledByElements(Vector<Element*>& elements) const;
String accessibilityDescriptionForElements(Vector<Element*> &elements) const;
void elementsFromAttribute(Vector<Element*>& elements, const QualifiedName&) const;
-
+ virtual LayoutRect boundingBoxRect() const;
+ String ariaDescribedByAttribute() const;
+
Element* menuElementForMenuButton() const;
Element* menuItemElementForMenu() const;
AccessibilityObject* menuButtonForMenu() const;
private:
Node* m_node;
+
+ virtual void accessibilityText(Vector<AccessibilityText>&);
+ void titleElementText(Vector<AccessibilityText>&);
+ void alternativeText(Vector<AccessibilityText>&) const;
+ void visibleText(Vector<AccessibilityText>&) const;
+ void helpText(Vector<AccessibilityText>&) const;
+ String alternativeTextForWebArea() const;
+ void ariaLabeledByText(Vector<AccessibilityText>&) const;
};
inline AccessibilityNodeObject* toAccessibilityNodeObject(AccessibilityObject* object)
diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp
index b9bd9a987..ed071e216 100644
--- a/Source/WebCore/accessibility/AccessibilityObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityObject.cpp
@@ -1776,6 +1776,19 @@ bool AccessibilityObject::ariaPressedIsPresent() const
return !getAttribute(aria_pressedAttr).isEmpty();
}
+TextIteratorBehavior AccessibilityObject::textIteratorBehaviorForTextRange() const
+{
+ TextIteratorBehavior behavior = TextIteratorIgnoresStyleVisibility;
+
+#if PLATFORM(GTK)
+ // We need to emit replaced elements for GTK, and present
+ // them with the 'object replacement character' (0xFFFC).
+ behavior = static_cast<TextIteratorBehavior>(behavior | TextIteratorEmitsObjectReplacementCharacters);
+#endif
+
+ return behavior;
+}
+
AccessibilityRole AccessibilityObject::buttonRoleType() const
{
// If aria-pressed is present, then it should be exposed as a toggle button.
diff --git a/Source/WebCore/accessibility/AccessibilityObject.h b/Source/WebCore/accessibility/AccessibilityObject.h
index be6211681..873a5c6ef 100644
--- a/Source/WebCore/accessibility/AccessibilityObject.h
+++ b/Source/WebCore/accessibility/AccessibilityObject.h
@@ -33,6 +33,7 @@
#include "FloatQuad.h"
#include "FractionalLayoutRect.h"
#include "LayoutTypes.h"
+#include "TextIterator.h"
#include "VisiblePosition.h"
#include "VisibleSelection.h"
#include <wtf/Forward.h>
@@ -201,6 +202,41 @@ enum AccessibilityRole {
WindowRole,
};
+enum AccessibilityTextSource {
+ AlternativeText,
+ ChildrenText,
+ SummaryText,
+ HelpText,
+ VisibleText,
+ TitleTagText,
+ PlaceholderText,
+ LabelByElementText,
+};
+
+struct AccessibilityText {
+ String text;
+ AccessibilityTextSource textSource;
+ Vector<RefPtr<AccessibilityObject> > textElements;
+
+ AccessibilityText(const String& t, const AccessibilityTextSource& s)
+ : text(t)
+ , textSource(s)
+ { }
+
+ AccessibilityText(const String& t, const AccessibilityTextSource& s, const Vector<RefPtr<AccessibilityObject> > elements)
+ : text(t)
+ , textSource(s)
+ , textElements(elements)
+ { }
+
+ AccessibilityText(const String& t, const AccessibilityTextSource& s, const RefPtr<AccessibilityObject> element)
+ : text(t)
+ , textSource(s)
+ {
+ textElements.append(element);
+ }
+};
+
enum AccessibilityOrientation {
AccessibilityOrientationVertical,
AccessibilityOrientationHorizontal,
@@ -371,6 +407,7 @@ public:
virtual bool isSpinButton() const { return roleValue() == SpinButtonRole; }
virtual bool isSpinButtonPart() const { return false; }
virtual bool isMockObject() const { return false; }
+ virtual bool isMediaControlLabel() const { return false; }
bool isTextControl() const { return roleValue() == TextAreaRole || roleValue() == TextFieldRole; }
bool isARIATextControl() const;
bool isTabList() const { return roleValue() == TabListRole; }
@@ -430,9 +467,6 @@ public:
virtual bool canSetSelectedChildrenAttribute() const { return false; }
virtual bool canSetExpandedAttribute() const { return false; }
- // A programmatic way to set a name on an AccessibleObject.
- virtual void setAccessibleName(const AtomicString&) { }
-
virtual Node* node() const { return 0; }
virtual RenderObject* renderer() const { return 0; }
virtual bool accessibilityIsIgnored() const { return true; }
@@ -501,11 +535,28 @@ public:
virtual bool isPresentationalChildOfAriaRole() const { return false; }
virtual bool ariaRoleHasPresentationalChildren() const { return false; }
- void setRoleValue(AccessibilityRole role) { m_role = role; }
- virtual AccessibilityRole roleValue() const { return m_role; }
+ // Accessibility Text
+ virtual void accessibilityText(Vector<AccessibilityText>&) { };
+
+ // A programmatic way to set a name on an AccessibleObject.
+ virtual void setAccessibleName(const AtomicString&) { }
+
+ // Accessibility Text - (To be deprecated).
+ virtual String accessibilityDescription() const { return String(); }
+ virtual String title() const { return String(); }
+ virtual String helpText() const { return String(); }
+
+ // Methods for determining accessibility text.
+ virtual String stringValue() const { return String(); }
+ virtual String textUnderElement() const { return String(); }
+ virtual String text() const { return String(); }
+ virtual int textLength() const { return 0; }
virtual String ariaLabeledByAttribute() const { return String(); }
virtual String ariaDescribedByAttribute() const { return String(); }
- virtual String accessibilityDescription() const { return String(); }
+ const AtomicString& placeholderValue() const;
+
+ void setRoleValue(AccessibilityRole role) { m_role = role; }
+ virtual AccessibilityRole roleValue() const { return m_role; }
virtual AXObjectCache* axObjectCache() const;
AXID axObjectID() const { return m_id; }
@@ -523,18 +574,13 @@ public:
virtual IntPoint clickPoint();
static IntRect boundingBoxForQuads(RenderObject*, const Vector<FloatQuad>&);
+ TextIteratorBehavior textIteratorBehaviorForTextRange() const;
virtual PlainTextRange selectedTextRange() const { return PlainTextRange(); }
unsigned selectionStart() const { return selectedTextRange().start; }
unsigned selectionEnd() const { return selectedTextRange().length; }
virtual KURL url() const { return KURL(); }
virtual VisibleSelection selection() const { return VisibleSelection(); }
- virtual String stringValue() const { return String(); }
- virtual String title() const { return String(); }
- virtual String helpText() const { return String(); }
- virtual String textUnderElement() const { return String(); }
- virtual String text() const { return String(); }
- virtual int textLength() const { return 0; }
virtual String selectedText() const { return String(); }
virtual const AtomicString& accessKey() const { return nullAtom; }
const String& actionVerb() const;
@@ -546,7 +592,6 @@ public:
virtual FrameView* documentFrameView() const;
String language() const;
virtual unsigned hierarchicalLevel() const { return 0; }
- const AtomicString& placeholderValue() const;
virtual void setFocused(bool) { }
virtual void setSelectedText(const String&) { }
@@ -569,6 +614,9 @@ public:
virtual void updateAccessibilityRole() { }
const AccessibilityChildrenVector& children();
virtual void addChildren() { }
+ virtual void addChild(AccessibilityObject*) { }
+ virtual void insertChild(AccessibilityObject*, unsigned) { }
+
virtual bool canHaveChildren() const { return true; }
virtual bool hasChildren() const { return m_haveChildren; }
virtual void updateChildrenIfNecessary();
diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
index 535de5753..687716c54 100644
--- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -79,7 +79,6 @@
#include "RenderedPosition.h"
#include "Text.h"
#include "TextControlInnerElements.h"
-#include "TextIterator.h"
#include "htmlediting.h"
#include "visible_units.h"
#include <wtf/StdLibExtras.h>
@@ -599,19 +598,6 @@ String AccessibilityRenderObject::helpText() const
return String();
}
-static TextIteratorBehavior textIteratorBehaviorForTextRange()
-{
- TextIteratorBehavior behavior = TextIteratorIgnoresStyleVisibility;
-
-#if PLATFORM(GTK)
- // We need to emit replaced elements for GTK, and present
- // them with the 'object replacement character' (0xFFFC).
- behavior = static_cast<TextIteratorBehavior>(behavior | TextIteratorEmitsObjectReplacementCharacters);
-#endif
-
- return behavior;
-}
-
String AccessibilityRenderObject::textUnderElement() const
{
if (!m_renderer)
@@ -725,72 +711,6 @@ HTMLLabelElement* AccessibilityRenderObject::labelElementContainer() const
return 0;
}
-String AccessibilityRenderObject::ariaDescribedByAttribute() const
-{
- Vector<Element*> elements;
- elementsFromAttribute(elements, aria_describedbyAttr);
-
- return accessibilityDescriptionForElements(elements);
-}
-
-String AccessibilityRenderObject::webAreaAccessibilityDescription() const
-{
- // The WebArea description should follow this order:
- // aria-label on the <html>
- // title on the <html>
- // <title> inside the <head> (of it was set through JS)
- // name on the <html>
- // For iframes:
- // aria-label on the <iframe>
- // title on the <iframe>
- // name on the <iframe>
-
- if (!m_renderer)
- return String();
-
- Document* document = m_renderer->document();
-
- // Check if the HTML element has an aria-label for the webpage.
- if (Element* documentElement = document->documentElement()) {
- const AtomicString& ariaLabel = documentElement->getAttribute(aria_labelAttr);
- if (!ariaLabel.isEmpty())
- return ariaLabel;
- }
-
- Node* owner = document->ownerElement();
- if (owner) {
- if (owner->hasTagName(frameTag) || owner->hasTagName(iframeTag)) {
- const AtomicString& title = static_cast<HTMLFrameElementBase*>(owner)->getAttribute(titleAttr);
- if (!title.isEmpty())
- return title;
- return static_cast<HTMLFrameElementBase*>(owner)->getNameAttribute();
- }
- if (owner->isHTMLElement())
- return toHTMLElement(owner)->getNameAttribute();
- }
-
- String documentTitle = document->title();
- if (!documentTitle.isEmpty())
- return documentTitle;
-
- owner = document->body();
- if (owner && owner->isHTMLElement())
- return toHTMLElement(owner)->getNameAttribute();
-
- return String();
-}
-
-String AccessibilityRenderObject::accessibilityDescription() const
-{
- if (!m_renderer)
- return String();
-
- if (isWebArea())
- return webAreaAccessibilityDescription();
-
- return AccessibilityNodeObject::accessibilityDescription();
-}
-
LayoutRect AccessibilityRenderObject::boundingBoxRect() const
{
RenderObject* obj = m_renderer;
@@ -1047,7 +967,7 @@ AccessibilityObject* AccessibilityRenderObject::titleUIElement() const
// if isFieldset is true, the renderer is guaranteed to be a RenderFieldset
if (isFieldset())
- return axObjectCache()->getOrCreate(toRenderFieldset(m_renderer)->findLegend());
+ return axObjectCache()->getOrCreate(toRenderFieldset(m_renderer)->findLegend(RenderFieldset::IncludeFloatingOrOutOfFlow));
Node* element = m_renderer->node();
if (!element)
@@ -1101,10 +1021,17 @@ AccessibilityObjectInclusion AccessibilityRenderObject::accessibilityIsIgnoredBa
{
// The following cases can apply to any element that's a subclass of AccessibilityRenderObject.
- // Ignore invisible elements.
- if (!m_renderer || m_renderer->style()->visibility() != VISIBLE)
+ if (!m_renderer)
return IgnoreObject;
+ if (m_renderer->style()->visibility() != VISIBLE) {
+ // aria-hidden is meant to override visibility as the determinant in AX hierarchy inclusion.
+ if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "false"))
+ return DefaultBehavior;
+
+ return IgnoreObject;
+ }
+
// Anything marked as aria-hidden or a child of something aria-hidden must be hidden.
if (ariaIsHidden())
return IgnoreObject;
@@ -2717,6 +2644,59 @@ void AccessibilityRenderObject::updateAttachmentViewParents()
}
#endif
+// Hidden children are those that are not rendered or visible, but are specifically marked as aria-hidden=false,
+// meaning that they should be exposed to the AX hierarchy.
+void AccessibilityRenderObject::addHiddenChildren()
+{
+ Node* node = this->node();
+ if (!node)
+ return;
+
+ // First do a quick run through to determine if we have any hidden nodes (most often we will not).
+ // If we do have hidden nodes, we need to determine where to insert them so they match DOM order as close as possible.
+ bool shouldInsertHiddenNodes = false;
+ for (Node* child = node->firstChild(); child; child = child->nextSibling()) {
+ if (!child->renderer() && isNodeAriaVisible(child)) {
+ shouldInsertHiddenNodes = true;
+ break;
+ }
+ }
+
+ if (!shouldInsertHiddenNodes)
+ return;
+
+ // Iterate through all of the children, including those that may have already been added, and
+ // try to insert hidden nodes in the correct place in the DOM order.
+ unsigned insertionIndex = 0;
+ for (Node* child = node->firstChild(); child; child = child->nextSibling()) {
+ if (child->renderer()) {
+ // Find out where the last render sibling is located within m_children.
+ AccessibilityObject* childObject = axObjectCache()->get(child->renderer());
+ if (childObject && childObject->accessibilityIsIgnored()) {
+ AccessibilityChildrenVector children = childObject->children();
+ if (children.size())
+ childObject = children.last().get();
+ else
+ childObject = 0;
+ }
+
+ if (childObject)
+ insertionIndex = m_children.find(childObject) + 1;
+ continue;
+ }
+
+ if (!isNodeAriaVisible(child))
+ continue;
+
+ unsigned previousSize = m_children.size();
+ if (insertionIndex > previousSize)
+ insertionIndex = previousSize;
+
+ insertChild(axObjectCache()->getOrCreate(child), insertionIndex);
+ insertionIndex += (m_children.size() - previousSize);
+ }
+}
+
void AccessibilityRenderObject::addChildren()
{
// If the need to add more children in addition to existing children arises,
@@ -2728,24 +2708,10 @@ void AccessibilityRenderObject::addChildren()
if (!canHaveChildren())
return;
- // add all unignored acc children
- for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSibling()) {
- // If the parent is asking for this child's children, then either it's the first time (and clearing is a no-op),
- // or its visibility has changed. In the latter case, this child may have a stale child cached.
- // This can prevent aria-hidden changes from working correctly. Hence, whenever a parent is getting children, ensure data is not stale.
- obj->clearChildren();
-
- if (obj->accessibilityIsIgnored()) {
- AccessibilityChildrenVector children = obj->children();
- unsigned length = children.size();
- for (unsigned i = 0; i < length; ++i)
- m_children.append(children[i]);
- } else {
- ASSERT(obj->parentObject() == this);
- m_children.append(obj);
- }
- }
+ for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSibling())
+ addChild(obj.get());
+ addHiddenChildren();
addAttachmentChildren();
addImageMapChildren();
addTextFieldChildren();
diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.h b/Source/WebCore/accessibility/AccessibilityRenderObject.h
index 539b5e273..b1752d3f1 100644
--- a/Source/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.h
@@ -143,8 +143,6 @@ public:
virtual PlainTextRange selectedTextRange() const;
virtual VisibleSelection selection() const;
virtual String stringValue() const;
- virtual String ariaDescribedByAttribute() const;
- virtual String accessibilityDescription() const;
virtual String helpText() const;
virtual String textUnderElement() const;
virtual String text() const;
@@ -248,6 +246,7 @@ private:
bool isDescendantOfElementType(const QualifiedName& tagName) const;
// This returns true if it's focusable but it's not content editable and it's not a control or ARIA control.
+ void addHiddenChildren();
void addTextFieldChildren();
void addImageMapChildren();
void addCanvasChildren();
@@ -261,8 +260,6 @@ private:
bool elementAttributeValue(const QualifiedName&) const;
void setElementAttributeValue(const QualifiedName&, bool);
- String webAreaAccessibilityDescription() const;
-
virtual ESpeak speakProperty() const;
virtual const AtomicString& ariaLiveRegionStatus() const;
diff --git a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm
index a4394ba20..552f9ff2c 100644
--- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm
+++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm
@@ -1387,10 +1387,18 @@ static id textMarkerRangeFromVisiblePositions(AXObjectCache *cache, VisiblePosit
- (id)remoteAccessibilityParentObject
{
- if (!m_object || !m_object->document() || !m_object->document()->frame())
+ if (!m_object)
+ return nil;
+
+ Document* document = m_object->document();
+ if (!document)
return nil;
- return m_object->document()->frame()->loader()->client()->accessibilityRemoteObject();
+ Frame* frame = document->frame();
+ if (!frame)
+ return nil;
+
+ return frame->loader()->client()->accessibilityRemoteObject();
}
static void convertToVector(NSArray* array, AccessibilityObject::AccessibilityChildrenVector& vector)
@@ -1818,6 +1826,103 @@ static NSString* roleValueToNSString(AccessibilityRole value)
return [self remoteAccessibilityParentObject];
}
+// FIXME: Different kinds of elements are putting the title tag to use in different
+// AX fields. This should be rectified, but in the initial patch I want to achieve
+// parity with existing behavior.
+- (BOOL)titleTagShouldBeUsedInDescriptionField
+{
+ return (m_object->isLink() && !m_object->isImageMapLink()) || m_object->isImage();
+}
+
+// This should be the "visible" text that's actually on the screen if possible.
+// If there's alternative text, that can override the title.
+- (NSString *)accessibilityTitle
+{
+ // Static text objects should not have a title. Its content is communicated in its AXValue.
+ if (m_object->roleValue() == StaticTextRole)
+ return [NSString string];
+
+ Vector<AccessibilityText> textOrder;
+ m_object->accessibilityText(textOrder);
+
+ unsigned length = textOrder.size();
+ for (unsigned k = 0; k < length; k++) {
+ const AccessibilityText& text = textOrder[k];
+
+ // Once we encounter visible text, or the text from our children that should be used foremost.
+ if (text.textSource == VisibleText || text.textSource == ChildrenText)
+ return text.text;
+
+ // If there's an element that labels this object and it's not exposed, then we should use
+ // that text as our title.
+ if (text.textSource == LabelByElementText && !m_object->exposesTitleUIElement())
+ return text.text;
+
+ // FIXME: The title tag is used in certain cases for the title. This usage should
+ // probably be in the description field since it's not "visible".
+ if (text.textSource == TitleTagText && ![self titleTagShouldBeUsedInDescriptionField])
+ return text.text;
+ }
+
+ return [NSString string];
+}
+
+- (NSString *)accessibilityDescription
+{
+ // Static text objects should not have a description. Its content is communicated in its AXValue.
+ // One exception is the media control labels that have a value and a description. Those are set programatically.
+ if (m_object->roleValue() == StaticTextRole && !m_object->isMediaControlLabel())
+ return [NSString string];
+
+ Vector<AccessibilityText> textOrder;
+ m_object->accessibilityText(textOrder);
+
+ unsigned length = textOrder.size();
+ for (unsigned k = 0; k < length; k++) {
+ const AccessibilityText& text = textOrder[k];
+
+ if (text.textSource == AlternativeText)
+ return text.text;
+
+ if (text.textSource == TitleTagText && [self titleTagShouldBeUsedInDescriptionField])
+ return text.text;
+ }
+
+ return [NSString string];
+}
+
+- (NSString *)accessibilityHelpText
+{
+ Vector<AccessibilityText> textOrder;
+ m_object->accessibilityText(textOrder);
+
+ unsigned length = textOrder.size();
+ bool descriptiveTextAvailable = false;
+ for (unsigned k = 0; k < length; k++) {
+ const AccessibilityText& text = textOrder[k];
+
+ if (text.textSource == HelpText || text.textSource == SummaryText)
+ return text.text;
+
+ // If an element does NOT have other descriptive text the title tag should be used as its descriptive text.
+ // But, if those ARE available, then the title tag should be used for help text instead.
+ switch (text.textSource) {
+ case AlternativeText:
+ case VisibleText:
+ case ChildrenText:
+ case LabelByElementText:
+ descriptiveTextAvailable = true;
+ default:
+ break;
+ }
+
+ if (text.textSource == TitleTagText && descriptiveTextAvailable)
+ return text.text;
+ }
+
+ return [NSString string];
+}
+
// FIXME: split up this function in a better way.
// suggestions: Use a hash table that maps attribute names to function calls,
// or maybe pointers to member functions
@@ -1984,7 +2089,8 @@ static NSString* roleValueToNSString(AccessibilityRole value)
if ([[[self attachmentView] accessibilityAttributeNames] containsObject:NSAccessibilityTitleAttribute])
return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityTitleAttribute];
}
- return m_object->title();
+
+ return [self accessibilityTitle];
}
if ([attributeName isEqualToString: NSAccessibilityDescriptionAttribute]) {
@@ -1992,7 +2098,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
if ([[[self attachmentView] accessibilityAttributeNames] containsObject:NSAccessibilityDescriptionAttribute])
return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityDescriptionAttribute];
}
- return m_object->accessibilityDescription();
+ return [self accessibilityDescription];
}
if ([attributeName isEqualToString: NSAccessibilityValueAttribute]) {
@@ -2046,7 +2152,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
return [NSNumber numberWithFloat:m_object->maxValueForRange()];
if ([attributeName isEqualToString: NSAccessibilityHelpAttribute])
- return m_object->helpText();
+ return [self accessibilityHelpText];
if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute])
return [NSNumber numberWithBool: m_object->isFocused()];
diff --git a/Source/WebCore/bindings/ScriptControllerBase.cpp b/Source/WebCore/bindings/ScriptControllerBase.cpp
index 9b006d2c2..cc5246362 100644
--- a/Source/WebCore/bindings/ScriptControllerBase.cpp
+++ b/Source/WebCore/bindings/ScriptControllerBase.cpp
@@ -75,7 +75,6 @@ bool ScriptController::executeIfJavaScriptURL(const KURL& url, ShouldReplaceDocu
return false;
if (!m_frame->page()
- || !m_frame->page()->javaScriptURLsAreAllowed()
|| !m_frame->document()->contentSecurityPolicy()->allowJavaScriptURLs(m_frame->document()->url(), eventHandlerPosition().m_line)
|| m_frame->inViewSourceMode())
return true;
diff --git a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
index 5a99ed670..7cd87d13e 100644
--- a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
+++ b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
@@ -62,9 +62,9 @@ bool RuntimeEnabledFeatures::isScriptedSpeechEnabled = false;
#endif
#if ENABLE(MEDIA_STREAM)
-bool RuntimeEnabledFeatures::isMediaStreamEnabled = false;
+bool RuntimeEnabledFeatures::isMediaStreamEnabled = true;
bool RuntimeEnabledFeatures::isPeerConnectionEnabled = true;
-bool RuntimeEnabledFeatures::isDeprecatedPeerConnectionEnabled = true;
+bool RuntimeEnabledFeatures::isDeprecatedPeerConnectionEnabled = false;
#endif
#if ENABLE(GAMEPAD)
diff --git a/Source/WebCore/bindings/gobject/DOMObjectCache.cpp b/Source/WebCore/bindings/gobject/DOMObjectCache.cpp
index dd7d04971..878875048 100644
--- a/Source/WebCore/bindings/gobject/DOMObjectCache.cpp
+++ b/Source/WebCore/bindings/gobject/DOMObjectCache.cpp
@@ -97,8 +97,17 @@ void DOMObjectCache::clearByFrame(WebCore::Frame* frame)
// If this is the last unref we are going to do,
// disconnect the weak ref. We cannot do it afterwards
// because the object might be dead at that point.
- if (data->timesReturned == 1)
+ if (data->timesReturned == 1) {
g_object_weak_unref(data->object, weakRefNotify, &objectDead);
+ // At this point, the next time the DOMObject is
+ // unref'ed it will be finalized,
+ // DOMObject::finalize() will call
+ // DOMObjectCache::forget(), which will free 'data'.
+ // Toggling 'objectDead' here will ensure we don't
+ // dereference an invalid pointer in the next
+ // iteration.
+ objectDead = TRUE;
+ }
data->timesReturned--;
g_object_unref(data->object);
}
diff --git a/Source/WebCore/bindings/gobject/GNUmakefile.am b/Source/WebCore/bindings/gobject/GNUmakefile.am
index 2328f95e3..88ed16c07 100644
--- a/Source/WebCore/bindings/gobject/GNUmakefile.am
+++ b/Source/WebCore/bindings/gobject/GNUmakefile.am
@@ -173,6 +173,8 @@ webkitgtk_gdom_built_sources += \
DerivedSources/webkit/WebKitDOMHTMLParamElementPrivate.h \
DerivedSources/webkit/WebKitDOMHTMLPreElement.cpp \
DerivedSources/webkit/WebKitDOMHTMLPreElementPrivate.h \
+ DerivedSources/webkit/WebKitDOMHTMLPropertiesCollection.cpp \
+ DerivedSources/webkit/WebKitDOMHTMLPropertiesCollectionPrivate.h \
DerivedSources/webkit/WebKitDOMHTMLQuoteElement.cpp \
DerivedSources/webkit/WebKitDOMHTMLQuoteElementPrivate.h \
DerivedSources/webkit/WebKitDOMHTMLScriptElement.cpp \
@@ -211,6 +213,8 @@ webkitgtk_gdom_built_sources += \
DerivedSources/webkit/WebKitDOMMemoryInfoPrivate.h \
DerivedSources/webkit/WebKitDOMMessagePort.cpp \
DerivedSources/webkit/WebKitDOMMessagePortPrivate.h \
+ DerivedSources/webkit/WebKitDOMMicroDataItemValue.cpp \
+ DerivedSources/webkit/WebKitDOMMicroDataItemValuePrivate.h \
DerivedSources/webkit/WebKitDOMMouseEvent.cpp \
DerivedSources/webkit/WebKitDOMMouseEventPrivate.h \
DerivedSources/webkit/WebKitDOMNamedNodeMap.cpp \
@@ -227,6 +231,8 @@ webkitgtk_gdom_built_sources += \
DerivedSources/webkit/WebKitDOMNodePrivate.h \
DerivedSources/webkit/WebKitDOMProcessingInstruction.cpp \
DerivedSources/webkit/WebKitDOMProcessingInstructionPrivate.h \
+ DerivedSources/webkit/WebKitDOMPropertyNodeList.cpp \
+ DerivedSources/webkit/WebKitDOMPropertyNodeListPrivate.h \
DerivedSources/webkit/WebKitDOMRange.cpp \
DerivedSources/webkit/WebKitDOMRangePrivate.h \
DerivedSources/webkit/WebKitDOMScreen.cpp \
@@ -357,6 +363,7 @@ webkitgtk_built_h_api += \
DerivedSources/webkit/WebKitDOMHTMLParagraphElement.h \
DerivedSources/webkit/WebKitDOMHTMLParamElement.h \
DerivedSources/webkit/WebKitDOMHTMLPreElement.h \
+ DerivedSources/webkit/WebKitDOMHTMLPropertiesCollection.h \
DerivedSources/webkit/WebKitDOMHTMLQuoteElement.h \
DerivedSources/webkit/WebKitDOMHTMLScriptElement.h \
DerivedSources/webkit/WebKitDOMHTMLSelectElement.h \
@@ -383,8 +390,10 @@ webkitgtk_built_h_api += \
DerivedSources/webkit/WebKitDOMHistory.h \
DerivedSources/webkit/WebKitDOMLocation.h \
DerivedSources/webkit/WebKitDOMMemoryInfo.h \
+ DerivedSources/webkit/WebKitDOMMicroDataItemValue.h \
DerivedSources/webkit/WebKitDOMObject.h \
DerivedSources/webkit/WebKitDOMNavigator.h \
+ DerivedSources/webkit/WebKitDOMPropertyNodeList.h \
DerivedSources/webkit/WebKitDOMScreen.h \
DerivedSources/webkit/WebKitDOMWebKitAnimation.h \
DerivedSources/webkit/WebKitDOMWebKitAnimationList.h \
diff --git a/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp b/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
index f4af55d82..c93f3401e 100644
--- a/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
+++ b/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
@@ -39,6 +39,7 @@
#include "JSHTMLImageElement.h"
#include "JSImageData.h"
#include "JSInt32Array.h"
+#include "JSOESElementIndexUint.h"
#include "JSOESStandardDerivatives.h"
#include "JSOESTextureFloat.h"
#include "JSOESVertexArrayObject.h"
@@ -57,6 +58,7 @@
#include "JSWebGLVertexArrayObjectOES.h"
#include "JSWebKitCSSMatrix.h"
#include "NotImplemented.h"
+#include "OESElementIndexUint.h"
#include "OESStandardDerivatives.h"
#include "OESTextureFloat.h"
#include "OESVertexArrayObject.h"
@@ -200,6 +202,8 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExten
return toJS(exec, globalObject, static_cast<OESTextureFloat*>(extension));
case WebGLExtension::OESVertexArrayObjectName:
return toJS(exec, globalObject, static_cast<OESVertexArrayObject*>(extension));
+ case WebGLExtension::OESElementIndexUintName:
+ return toJS(exec, globalObject, static_cast<OESElementIndexUint*>(extension));
case WebGLExtension::WebGLDebugRendererInfoName:
return toJS(exec, globalObject, static_cast<WebGLDebugRendererInfo*>(extension));
case WebGLExtension::WebGLDebugShadersName:
diff --git a/Source/WebCore/bindings/js/PageScriptDebugServer.cpp b/Source/WebCore/bindings/js/PageScriptDebugServer.cpp
index ed743cc9e..ed743cc9e 100755..100644
--- a/Source/WebCore/bindings/js/PageScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/js/PageScriptDebugServer.cpp
diff --git a/Source/WebCore/bindings/objc/DOMEvents.mm b/Source/WebCore/bindings/objc/DOMEvents.mm
index d7ba17f4c..d7ba17f4c 100755..100644
--- a/Source/WebCore/bindings/objc/DOMEvents.mm
+++ b/Source/WebCore/bindings/objc/DOMEvents.mm
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
index 0b405ac3e..acb7a348b 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -239,6 +239,10 @@ sub SkipFunction {
return 1;
}
+ if ($function->signature->name eq "setRangeText" && @{$function->parameters} == 1) {
+ return 1;
+ }
+
if ($codeGenerator->GetSequenceType($functionReturnType)) {
return 1;
}
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 8c9d868de..a90306cd4 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -212,12 +212,14 @@ void V8${implClassName}::visitDOMWrapper(DOMDataStore* store, void* object, v8::
{
${implClassName}* impl = static_cast<${implClassName}*>(object);
END
- if (GetGenerateIsReachable($dataNode) eq "ImplElementRoot" ||
+ if (GetGenerateIsReachable($dataNode) eq "ImplDocument" ||
+ GetGenerateIsReachable($dataNode) eq "ImplElementRoot" ||
GetGenerateIsReachable($dataNode) eq "ImplOwnerRoot" ||
GetGenerateIsReachable($dataNode) eq "ImplOwnerNodeRoot" ||
GetGenerateIsReachable($dataNode) eq "ImplBaseRoot") {
my $methodName;
+ $methodName = "document" if (GetGenerateIsReachable($dataNode) eq "ImplDocument");
$methodName = "element" if (GetGenerateIsReachable($dataNode) eq "ImplElementRoot");
$methodName = "owner" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerRoot");
$methodName = "ownerNode" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerNodeRoot");
@@ -481,11 +483,11 @@ END
if (@enabledPerContextFunctions) {
push(@headerContent, <<END);
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*);
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>);
END
} else {
push(@headerContent, <<END);
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
END
}
@@ -832,17 +834,7 @@ static v8::Handle<v8::Value> ${implClassName}ConstructorGetter(v8::Local<v8::Str
V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
if (!perContextData)
return v8Undefined();
-END
-
- if ($implClassName eq "DOMWindow") {
- push(@implContentDecls, " return perContextData->constructorForType(WrapperTypeInfo::unwrap(data), V8DOMWindow::toNative(info.Holder())->document());\n");
-END
- } elsif ($implClassName eq "WorkerContext") {
- push(@implContentDecls, " return perContextData->constructorForType(WrapperTypeInfo::unwrap(data), V8WorkerContext::toNative(info.Holder()));\n")
- } else {
- push(@implContentDecls, " return perContextData->constructorForType(WrapperTypeInfo::unwrap(data), 0);\n");
- }
- push(@implContentDecls, <<END);
+ return perContextData->constructorForType(WrapperTypeInfo::unwrap(data));
}
END
}
@@ -3065,8 +3057,9 @@ END
void ${className}::installPerContextProperties(v8::Handle<v8::Object> instance, ${nativeType}* impl)
{
v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetPrototype());
+ ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext());
// When building QtWebkit with V8 this variable is unused when none of the features are enabled.
- UNUSED_PARAM(proto);
+ UNUSED_PARAM(context);
END
# Setup the enable-by-settings attrs if we have them
@@ -3074,7 +3067,7 @@ END
my $enableFunction = GetContextEnableFunction($runtimeAttr->signature);
my $conditionalString = $codeGenerator->GenerateConditionalString($runtimeAttr->signature);
push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString;
- push(@implContent, " if (${enableFunction}(impl->document())) {\n");
+ push(@implContent, " if (context && context->isDocument() && ${enableFunction}(static_cast<Document*>(context))) {\n");
push(@implContent, " static const V8DOMConfiguration::BatchedAttribute attrData =\\\n");
GenerateSingleBatchedAttribute($interfaceName, $runtimeAttr, ";", " ");
push(@implContent, <<END);
@@ -3090,15 +3083,16 @@ END
if (@enabledPerContextFunctions) {
push(@implContent, <<END);
-void ${className}::installPerContextPrototypeProperties(v8::Handle<v8::Object> proto, ScriptExecutionContext* context)
+void ${className}::installPerContextPrototypeProperties(v8::Handle<v8::Object> proto)
{
UNUSED_PARAM(proto);
- UNUSED_PARAM(context);
END
# Setup the enable-by-settings functions if we have them
push(@implContent, <<END);
v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate());
UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
+
+ ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext());
END
foreach my $runtimeFunc (@enabledPerContextFunctions) {
@@ -3431,13 +3425,14 @@ END
}
push(@implContent, <<END);
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
END
- if (IsNodeSubType($dataNode) || $interfaceName eq "NotificationCenter") {
+ if (IsNodeSubType($dataNode)) {
push(@implContent, <<END);
- document = impl->document();
+ deprecatedDocument = impl->document();
END
}
@@ -3452,7 +3447,7 @@ END
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/IDLAttributes.txt b/Source/WebCore/bindings/scripts/IDLAttributes.txt
index df3d56d9b..db5884c5f 100644
--- a/Source/WebCore/bindings/scripts/IDLAttributes.txt
+++ b/Source/WebCore/bindings/scripts/IDLAttributes.txt
@@ -53,7 +53,7 @@ DoNotCheckSecurityOnGetter
DoNotCheckSecurityOnSetter
EventTarget
ExtendsDOMGlobalObject
-GenerateIsReachable=ImplElementRoot|ImplBaseRoot
+GenerateIsReachable=ImplDocument|ImplElementRoot|ImplBaseRoot
Immutable
ImplementedAs=*
IndexedGetter
@@ -118,7 +118,7 @@ V8DependentLifetime
V8DoNotCheckSignature
V8EnabledAtRuntime=*
V8EnabledPerContext=*
-V8GenerateIsReachable=ImplElementRoot|ImplOwnerRoot|ImplOwnerNodeRoot|ImplBaseRoot
+V8GenerateIsReachable=ImplDocument|ImplElementRoot|ImplOwnerRoot|ImplOwnerNodeRoot|ImplBaseRoot
V8MeasureAs=*
V8ReadOnly
V8Unforgeable
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
index a2f0a511b..f35ba87f0 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
@@ -150,8 +150,9 @@ v8::Handle<v8::Object> V8Float64Array::wrapSlow(PassRefPtr<Float64Array> impl, v
{
v8::Handle<v8::Object> wrapper;
ASSERT(static_cast<void*>(static_cast<ArrayBufferView*>(impl.get())) == static_cast<void*>(impl.get()));
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -162,7 +163,7 @@ v8::Handle<v8::Object> V8Float64Array::wrapSlow(PassRefPtr<Float64Array> impl, v
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h
index 1824b2753..afb01344e 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h
@@ -48,7 +48,7 @@ public:
static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, Float64Array*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<Float64Array>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
index b5924ffcf..a5b0be2eb 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
@@ -178,8 +178,9 @@ bool V8TestActiveDOMObject::HasInstance(v8::Handle<v8::Value> value)
v8::Handle<v8::Object> V8TestActiveDOMObject::wrapSlow(PassRefPtr<TestActiveDOMObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -190,7 +191,7 @@ v8::Handle<v8::Object> V8TestActiveDOMObject::wrapSlow(PassRefPtr<TestActiveDOMO
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h
index 81498e256..7baeacca9 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h
@@ -48,7 +48,7 @@ public:
static bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType, v8::Local<v8::Value> data);
static bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data);
static void installPerContextProperties(v8::Handle<v8::Object>, TestActiveDOMObject*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestActiveDOMObject>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
index eef443b61..8de0428f7 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
@@ -112,8 +112,9 @@ bool V8TestCustomNamedGetter::HasInstance(v8::Handle<v8::Value> value)
v8::Handle<v8::Object> V8TestCustomNamedGetter::wrapSlow(PassRefPtr<TestCustomNamedGetter> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -124,7 +125,7 @@ v8::Handle<v8::Object> V8TestCustomNamedGetter::wrapSlow(PassRefPtr<TestCustomNa
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h
index d07e7a554..ea334b0e4 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h
@@ -47,7 +47,7 @@ public:
static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, const v8::AccessorInfo&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, TestCustomNamedGetter*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestCustomNamedGetter>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
index 736911aef..b6c70b99c 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
@@ -149,8 +149,9 @@ bool V8TestEventConstructor::HasInstance(v8::Handle<v8::Value> value)
v8::Handle<v8::Object> V8TestEventConstructor::wrapSlow(PassRefPtr<TestEventConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -161,7 +162,7 @@ v8::Handle<v8::Object> V8TestEventConstructor::wrapSlow(PassRefPtr<TestEventCons
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h
index 2399c87fa..9961280f0 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h
@@ -48,7 +48,7 @@ public:
static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, TestEventConstructor*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestEventConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
index 517984d8f..9d9fd61b2 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
@@ -173,8 +173,9 @@ bool V8TestEventTarget::HasInstance(v8::Handle<v8::Value> value)
v8::Handle<v8::Object> V8TestEventTarget::wrapSlow(PassRefPtr<TestEventTarget> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -185,7 +186,7 @@ v8::Handle<v8::Object> V8TestEventTarget::wrapSlow(PassRefPtr<TestEventTarget> i
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h
index 7981adc4b..f9b1f7af1 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h
@@ -49,7 +49,7 @@ public:
static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCount + 0;
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1;
static void installPerContextProperties(v8::Handle<v8::Object>, TestEventTarget*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestEventTarget>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
index 563d084a7..07e880f74 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
@@ -103,8 +103,9 @@ bool V8TestException::HasInstance(v8::Handle<v8::Value> value)
v8::Handle<v8::Object> V8TestException::wrapSlow(PassRefPtr<TestException> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -115,7 +116,7 @@ v8::Handle<v8::Object> V8TestException::wrapSlow(PassRefPtr<TestException> impl,
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestException.h b/Source/WebCore/bindings/scripts/test/V8/V8TestException.h
index ff66cc594..99afe8b16 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestException.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestException.h
@@ -46,7 +46,7 @@ public:
static WrapperTypeInfo info;
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, TestException*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestException>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
index 173c233b3..066da9c7e 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
@@ -342,8 +342,9 @@ ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> objec
v8::Handle<v8::Object> V8TestInterface::wrapSlow(PassRefPtr<TestInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -354,7 +355,7 @@ v8::Handle<v8::Object> V8TestInterface::wrapSlow(PassRefPtr<TestInterface> impl,
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
index 535b7d0db..850c0cb5b 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
@@ -51,7 +51,7 @@ public:
static v8::Handle<v8::Value> namedPropertySetter(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, TestInterface*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
index c3fca0476..53d5f993f 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
@@ -112,8 +112,9 @@ bool V8TestMediaQueryListListener::HasInstance(v8::Handle<v8::Value> value)
v8::Handle<v8::Object> V8TestMediaQueryListListener::wrapSlow(PassRefPtr<TestMediaQueryListListener> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -124,7 +125,7 @@ v8::Handle<v8::Object> V8TestMediaQueryListListener::wrapSlow(PassRefPtr<TestMed
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
index b0a2ef70d..f88598046 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
@@ -46,7 +46,7 @@ public:
static WrapperTypeInfo info;
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, TestMediaQueryListListener*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestMediaQueryListListener>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
index f2ed819df..400fd4ace 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
@@ -152,8 +152,9 @@ ActiveDOMObject* V8TestNamedConstructor::toActiveDOMObject(v8::Handle<v8::Object
v8::Handle<v8::Object> V8TestNamedConstructor::wrapSlow(PassRefPtr<TestNamedConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -164,7 +165,7 @@ v8::Handle<v8::Object> V8TestNamedConstructor::wrapSlow(PassRefPtr<TestNamedCons
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h
index 2fc0099ae..838b11538 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h
@@ -53,7 +53,7 @@ public:
static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, TestNamedConstructor*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestNamedConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
index 470c382c8..89bfedc47 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
@@ -112,9 +112,10 @@ v8::Handle<v8::Object> V8TestNode::wrapSlow(PassRefPtr<TestNode> impl, v8::Handl
{
v8::Handle<v8::Object> wrapper;
ASSERT(static_cast<void*>(static_cast<Node*>(impl.get())) == static_cast<void*>(impl.get()));
- Document* document = 0;
- UNUSED_PARAM(document);
- document = impl->document();
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
+ deprecatedDocument = impl->document();
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -125,7 +126,7 @@ v8::Handle<v8::Object> V8TestNode::wrapSlow(PassRefPtr<TestNode> impl, v8::Handl
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h
index 6b42e5bb5..fd3338839 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h
@@ -47,7 +47,7 @@ public:
static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, TestNode*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestNode>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 4609f1f83..3ae63a605 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -1031,7 +1031,7 @@ static v8::Handle<v8::Value> TestObjConstructorGetter(v8::Local<v8::String> name
V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
if (!perContextData)
return v8Undefined();
- return perContextData->constructorForType(WrapperTypeInfo::unwrap(data), 0);
+ return perContextData->constructorForType(WrapperTypeInfo::unwrap(data));
}
static void TestObjReplaceableAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
@@ -2326,27 +2326,29 @@ bool V8TestObj::HasInstance(v8::Handle<v8::Value> value)
void V8TestObj::installPerContextProperties(v8::Handle<v8::Object> instance, TestObj* impl)
{
v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetPrototype());
+ ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext());
// When building QtWebkit with V8 this variable is unused when none of the features are enabled.
- UNUSED_PARAM(proto);
- if (ContextFeatures::enabledPerContextAttr1Enabled(impl->document())) {
+ UNUSED_PARAM(context);
+ if (context && context->isDocument() && ContextFeatures::enabledPerContextAttr1Enabled(static_cast<Document*>(context))) {
static const V8DOMConfiguration::BatchedAttribute attrData =\
// Attribute 'enabledPerContextAttr1' (Type: 'attribute' ExtAttr: 'V8EnabledPerContext')
{"enabledPerContextAttr1", TestObjV8Internal::enabledPerContextAttr1AttrGetter, TestObjV8Internal::enabledPerContextAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
V8DOMConfiguration::configureAttribute(instance, proto, attrData);
}
- if (ContextFeatures::featureNameEnabled(impl->document())) {
+ if (context && context->isDocument() && ContextFeatures::featureNameEnabled(static_cast<Document*>(context))) {
static const V8DOMConfiguration::BatchedAttribute attrData =\
// Attribute 'enabledPerContextAttr2' (Type: 'attribute' ExtAttr: 'V8EnabledPerContext')
{"enabledPerContextAttr2", TestObjV8Internal::enabledPerContextAttr2AttrGetter, TestObjV8Internal::enabledPerContextAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
V8DOMConfiguration::configureAttribute(instance, proto, attrData);
}
}
-void V8TestObj::installPerContextPrototypeProperties(v8::Handle<v8::Object> proto, ScriptExecutionContext* context)
+void V8TestObj::installPerContextPrototypeProperties(v8::Handle<v8::Object> proto)
{
UNUSED_PARAM(proto);
- UNUSED_PARAM(context);
v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate());
UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
+
+ ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext());
if (context && context->isDocument() && ContextFeatures::enabledPerContextMethod1Enabled(static_cast<Document*>(context))) {
proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction());
}
@@ -2358,8 +2360,9 @@ void V8TestObj::installPerContextPrototypeProperties(v8::Handle<v8::Object> prot
v8::Handle<v8::Object> V8TestObj::wrapSlow(PassRefPtr<TestObj> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -2370,7 +2373,7 @@ v8::Handle<v8::Object> V8TestObj::wrapSlow(PassRefPtr<TestObj> impl, v8::Handle<
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h
index 29c55353d..621e297af 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h
@@ -52,7 +52,7 @@ public:
static void customAttrAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value>, const v8::AccessorInfo&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, TestObj*);
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*);
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>);
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestObj>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
index 153e09d76..9c6f36b80 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
@@ -295,8 +295,9 @@ bool V8TestSerializedScriptValueInterface::HasInstance(v8::Handle<v8::Value> val
v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(PassRefPtr<TestSerializedScriptValueInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper;
- Document* document = 0;
- UNUSED_PARAM(document);
+ // Please don't add any more uses of this variable.
+ Document* deprecatedDocument = 0;
+ UNUSED_PARAM(deprecatedDocument);
v8::Handle<v8::Context> context;
if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) {
@@ -307,7 +308,7 @@ v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(PassRefPtr
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get());
if (!context.IsEmpty())
context->Exit();
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h
index bfe6c99e9..63c222a0b 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h
@@ -49,7 +49,7 @@ public:
static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static void installPerContextProperties(v8::Handle<v8::Object>, TestSerializedScriptValueInterface*) { }
- static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { }
+ static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { }
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestSerializedScriptValueInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
};
diff --git a/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp b/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
index 83ae9b2fd..6a8311fb6 100644
--- a/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
+++ b/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
@@ -180,6 +180,9 @@ static PassRefPtr<IDBKey> createIDBKeyFromScriptValueAndKeyPath(const ScriptValu
IDBParseKeyPath(keyPath, keyPathElements, error);
ASSERT(error == IDBKeyPathParseErrorNone);
+ v8::HandleScope handleScope;
+ v8::Context::Scope scope(V8PerIsolateData::current()->ensureAuxiliaryContext());
+
v8::Handle<v8::Value> v8Value(value.v8Value());
v8::Handle<v8::Value> v8Key(getNthValueOnKeyPath(v8Value, keyPathElements, keyPathElements.size()));
if (v8Key.IsEmpty())
diff --git a/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp b/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp
index b4857b453..b4857b453 100755..100644
--- a/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp
diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
index 8a41b56a7..de65721a3 100644
--- a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -442,9 +442,8 @@ void V8DOMWindowShell::createContext()
bool V8DOMWindowShell::installDOMWindow()
{
- Document* document = m_frame->document();
- DOMWindow* window = document->domWindow();
- v8::Local<v8::Object> windowWrapper = V8ObjectConstructor::newInstance(V8PerContextData::from(m_context.get())->constructorForType(&V8DOMWindow::info, document));
+ DOMWindow* window = m_frame->document()->domWindow();
+ v8::Local<v8::Object> windowWrapper = V8ObjectConstructor::newInstance(V8PerContextData::from(m_context.get())->constructorForType(&V8DOMWindow::info));
if (windowWrapper.IsEmpty())
return false;
diff --git a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
index fbb9fd2c9..c768da892 100644
--- a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -111,18 +111,20 @@ PassRefPtr<NodeFilter> V8DOMWrapper::wrapNativeNodeFilter(v8::Handle<v8::Value>
return NodeFilter::create(V8NodeFilterCondition::create(filter));
}
-v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(Document* document, WrapperTypeInfo* type, void* impl)
+v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(Document* deprecatedDocument, WrapperTypeInfo* type, void* impl)
{
V8PerContextData* perContextData = 0;
+ // Please don't add any more uses of deprecatedDocument. We want to remove it.
+
// If we have a pointer to the frame, we cna get the V8PerContextData
// directly, which is faster than going through V8.
- if (document && document->frame())
- perContextData = perContextDataForCurrentWorld(document->frame());
+ if (deprecatedDocument && deprecatedDocument->frame())
+ perContextData = perContextDataForCurrentWorld(deprecatedDocument->frame());
else
perContextData = V8PerContextData::from(v8::Context::GetCurrent());
- v8::Local<v8::Object> instance = perContextData ? perContextData->createWrapperFromCache(type, document) : V8ObjectConstructor::newInstance(type->getTemplate()->GetFunction());
+ v8::Local<v8::Object> instance = perContextData ? perContextData->createWrapperFromCache(type) : V8ObjectConstructor::newInstance(type->getTemplate()->GetFunction());
// Avoid setting the DOM wrapper for failed allocations.
if (instance.IsEmpty())
diff --git a/Source/WebCore/bindings/v8/V8GCController.cpp b/Source/WebCore/bindings/v8/V8GCController.cpp
index 0b3dade8f..9007dab97 100644
--- a/Source/WebCore/bindings/v8/V8GCController.cpp
+++ b/Source/WebCore/bindings/v8/V8GCController.cpp
@@ -66,77 +66,38 @@
namespace WebCore {
-typedef HashMap<Node*, v8::Object*> DOMNodeMap;
-typedef HashMap<void*, v8::Object*> DOMObjectMap;
-
#ifndef NDEBUG
-class DOMObjectVisitor : public DOMWrapperMap<void>::Visitor {
-public:
- void visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper)
- {
- WrapperTypeInfo* type = V8DOMWrapper::domWrapperType(wrapper);
- UNUSED_PARAM(type);
- UNUSED_PARAM(object);
- }
-};
-
class EnsureWeakDOMNodeVisitor : public DOMWrapperMap<Node>::Visitor {
public:
- void visitDOMWrapper(DOMDataStore* store, Node* object, v8::Persistent<v8::Object> wrapper)
+ void visitDOMWrapper(DOMDataStore*, Node*, v8::Persistent<v8::Object> wrapper)
{
- UNUSED_PARAM(object);
ASSERT(wrapper.IsWeak());
}
};
#endif // NDEBUG
-class SpecialCasePrologueObjectHandler {
-public:
- static bool process(void* object, v8::Persistent<v8::Object> wrapper, WrapperTypeInfo* typeInfo)
- {
- // Additional handling of message port ensuring that entangled ports also
- // have their wrappers entangled. This should ideally be handled when the
- // ports are actually entangled in MessagePort::entangle, but to avoid
- // forking MessagePort.* this is postponed to GC time. Having this postponed
- // has the drawback that the wrappers are "entangled/unentangled" for each
- // GC even though their entaglement most likely is still the same.
- if (V8MessagePort::info.equals(typeInfo)) {
- // Mark each port as in-use if it's entangled. For simplicity's sake, we assume all ports are remotely entangled,
- // since the Chromium port implementation can't tell the difference.
- MessagePort* port1 = static_cast<MessagePort*>(object);
- if (port1->isEntangled() || port1->hasPendingActivity())
- wrapper.ClearWeak();
- return true;
- }
- return false;
- }
-};
-
-class SpecialCasePrologueNodeHandler {
-public:
- static bool process(Node* object, v8::Persistent<v8::Object> wrapper, WrapperTypeInfo* typeInfo)
- {
- UNUSED_PARAM(object);
- UNUSED_PARAM(wrapper);
- UNUSED_PARAM(typeInfo);
- return false;
- }
-};
-
-template<typename T, typename S>
-class GCPrologueVisitor : public DOMWrapperMap<T>::Visitor {
+template<typename T>
+class ActiveDOMObjectPrologueVisitor : public DOMWrapperMap<T>::Visitor {
public:
- void visitDOMWrapper(DOMDataStore* store, T* object, v8::Persistent<v8::Object> wrapper)
+ void visitDOMWrapper(DOMDataStore*, T* object, v8::Persistent<v8::Object> wrapper)
{
WrapperTypeInfo* typeInfo = V8DOMWrapper::domWrapperType(wrapper);
- if (!S::process(object, wrapper, typeInfo)) {
- ActiveDOMObject* activeDOMObject = typeInfo->toActiveDOMObject(wrapper);
- if (activeDOMObject && activeDOMObject->hasPendingActivity())
+ if (V8MessagePort::info.equals(typeInfo)) {
+ // Mark each port as in-use if it's entangled. For simplicity's sake,
+ // we assume all ports are remotely entangled, since the Chromium port
+ // implementation can't tell the difference.
+ MessagePort* port = reinterpret_cast<MessagePort*>(object);
+ if (port->isEntangled() || port->hasPendingActivity())
wrapper.ClearWeak();
+ return;
}
+
+ ActiveDOMObject* activeDOMObject = typeInfo->toActiveDOMObject(wrapper);
+ if (activeDOMObject && activeDOMObject->hasPendingActivity())
+ wrapper.ClearWeak();
}
};
@@ -257,9 +218,17 @@ static GroupId calculateGroupId(Node* node)
return GroupId(root);
}
-class GrouperVisitor : public DOMWrapperMap<Node>::Visitor, public DOMWrapperMap<void>::Visitor {
+class ObjectVisitor : public DOMWrapperMap<void>::Visitor {
public:
- void visitDOMWrapper(DOMDataStore* store, Node* node, v8::Persistent<v8::Object> wrapper)
+ void visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper)
+ {
+ V8DOMWrapper::domWrapperType(wrapper)->visitDOMWrapper(store, object, wrapper);
+ }
+};
+
+class NodeVisitor : public DOMWrapperMap<Node>::Visitor {
+public:
+ void visitDOMWrapper(DOMDataStore*, Node* node, v8::Persistent<v8::Object> wrapper)
{
if (node->hasEventListeners()) {
Vector<v8::Persistent<v8::Value> > listeners;
@@ -282,12 +251,6 @@ public:
m_grouper.append(GrouperItem(groupId, wrapper));
}
- void visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper)
- {
- WrapperTypeInfo* info = V8DOMWrapper::domWrapperType(wrapper);
- info->visitDOMWrapper(store, object, wrapper);
- }
-
void applyGrouping()
{
// Group by sorting by the group id.
@@ -336,32 +299,23 @@ private:
// Create object groups for DOM tree nodes.
void V8GCController::gcPrologue()
{
+ TRACE_EVENT_BEGIN0("v8", "GC");
+
v8::HandleScope scope;
-#if PLATFORM(CHROMIUM)
- TRACE_EVENT_BEGIN0("v8", "GC");
-#endif
+ ActiveDOMObjectPrologueVisitor<void> activeObjectVisitor;
+ visitActiveDOMObjects(&activeObjectVisitor);
+ ActiveDOMObjectPrologueVisitor<Node> activeNodeVisitor;
+ visitActiveDOMNodes(&activeNodeVisitor);
-#ifndef NDEBUG
- DOMObjectVisitor domObjectVisitor;
- visitDOMObjects(&domObjectVisitor);
-#endif
+ NodeVisitor nodeVisitor;
+ visitDOMNodes(&nodeVisitor);
+ visitActiveDOMNodes(&nodeVisitor);
+ nodeVisitor.applyGrouping();
+
+ ObjectVisitor objectVisitor;
+ visitDOMObjects(&objectVisitor);
- // Run through all objects with possible pending activity making their
- // wrappers non weak if there is pending activity.
- GCPrologueVisitor<void, SpecialCasePrologueObjectHandler> prologueObjectVisitor;
- visitActiveDOMObjects(&prologueObjectVisitor);
- GCPrologueVisitor<Node, SpecialCasePrologueNodeHandler> prologueNodeVisitor;
- visitActiveDOMNodes(&prologueNodeVisitor);
-
- // Create object groups.
- GrouperVisitor grouperVisitor;
- visitDOMNodes(&grouperVisitor);
- visitActiveDOMNodes(&grouperVisitor);
- visitDOMObjects(&grouperVisitor);
- grouperVisitor.applyGrouping();
-
- // Clean single element cache for string conversions.
V8PerIsolateData* data = V8PerIsolateData::current();
data->stringCache()->clearOnGC();
}
@@ -445,17 +399,11 @@ void V8GCController::gcEpilogue()
#endif
#ifndef NDEBUG
- // Check all survivals are weak.
- DOMObjectVisitor domObjectVisitor;
- visitDOMObjects(&domObjectVisitor);
-
EnsureWeakDOMNodeVisitor weakDOMNodeVisitor;
visitDOMNodes(&weakDOMNodeVisitor);
#endif
-#if PLATFORM(CHROMIUM)
TRACE_EVENT_END0("v8", "GC");
-#endif
}
void V8GCController::checkMemoryUsage()
diff --git a/Source/WebCore/bindings/v8/V8PerContextData.cpp b/Source/WebCore/bindings/v8/V8PerContextData.cpp
index 15efe5a95..9764620d4 100644
--- a/Source/WebCore/bindings/v8/V8PerContextData.cpp
+++ b/Source/WebCore/bindings/v8/V8PerContextData.cpp
@@ -100,13 +100,13 @@ bool V8PerContextData::init()
#undef V8_STORE_PRIMORDIAL
-v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(WrapperTypeInfo* type, ScriptExecutionContext* context)
+v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(WrapperTypeInfo* type)
{
ASSERT(!m_errorPrototype.isEmpty());
ASSERT(!m_objectPrototype.isEmpty());
v8::Context::Scope scope(m_context);
- v8::Local<v8::Function> function = constructorForType(type, context);
+ v8::Local<v8::Function> function = constructorForType(type);
v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
if (!instance.IsEmpty()) {
m_wrapperBoilerplates.set(type, v8::Persistent<v8::Object>::New(instance));
@@ -115,7 +115,7 @@ v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(WrapperTy
return v8::Local<v8::Object>();
}
-v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(WrapperTypeInfo* type, ScriptExecutionContext* context)
+v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(WrapperTypeInfo* type)
{
ASSERT(!m_errorPrototype.isEmpty());
ASSERT(!m_objectPrototype.isEmpty());
@@ -132,7 +132,7 @@ v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(WrapperType
v8::Local<v8::Value> prototypeValue = function->Get(v8::String::NewSymbol("prototype"));
if (!prototypeValue.IsEmpty() && prototypeValue->IsObject()) {
v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(prototypeValue);
- type->installPerContextPrototypeProperties(prototypeObject, context);
+ type->installPerContextPrototypeProperties(prototypeObject);
if (type->wrapperTypePrototype == WrapperTypeErrorPrototype)
prototypeObject->SetPrototype(m_errorPrototype.get());
}
diff --git a/Source/WebCore/bindings/v8/V8PerContextData.h b/Source/WebCore/bindings/v8/V8PerContextData.h
index 3557ade6d..8c3c437e2 100644
--- a/Source/WebCore/bindings/v8/V8PerContextData.h
+++ b/Source/WebCore/bindings/v8/V8PerContextData.h
@@ -63,18 +63,18 @@ public:
// To create JS Wrapper objects, we create a cache of a 'boiler plate'
// object, and then simply Clone that object each time we need a new one.
// This is faster than going through the full object creation process.
- v8::Local<v8::Object> createWrapperFromCache(WrapperTypeInfo* type, ScriptExecutionContext* context)
+ v8::Local<v8::Object> createWrapperFromCache(WrapperTypeInfo* type)
{
v8::Persistent<v8::Object> boilerplate = m_wrapperBoilerplates.get(type);
- return !boilerplate.IsEmpty() ? boilerplate->Clone() : createWrapperFromCacheSlowCase(type, context);
+ return !boilerplate.IsEmpty() ? boilerplate->Clone() : createWrapperFromCacheSlowCase(type);
}
- v8::Local<v8::Function> constructorForType(WrapperTypeInfo* type, ScriptExecutionContext* context)
+ v8::Local<v8::Function> constructorForType(WrapperTypeInfo* type)
{
v8::Persistent<v8::Function> function = m_constructorMap.get(type);
if (!function.IsEmpty())
return v8::Local<v8::Function>::New(function);
- return constructorForTypeSlowCase(type, context);
+ return constructorForTypeSlowCase(type);
}
V8NPObjectMap* v8NPObjectMap()
@@ -90,8 +90,8 @@ private:
void dispose();
- v8::Local<v8::Object> createWrapperFromCacheSlowCase(WrapperTypeInfo*, ScriptExecutionContext*);
- v8::Local<v8::Function> constructorForTypeSlowCase(WrapperTypeInfo*, ScriptExecutionContext*);
+ v8::Local<v8::Object> createWrapperFromCacheSlowCase(WrapperTypeInfo*);
+ v8::Local<v8::Function> constructorForTypeSlowCase(WrapperTypeInfo*);
// For each possible type of wrapper, we keep a boilerplate object.
// The boilerplate is used to create additional wrappers of the same type.
diff --git a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
index b2e065605..ee27ebf27 100644
--- a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
+++ b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
@@ -175,7 +175,7 @@ bool WorkerContextExecutionProxy::initializeIfNeeded()
if (!m_workerContext->isDedicatedWorkerContext())
contextType = &V8SharedWorkerContext::info;
#endif
- v8::Handle<v8::Function> workerContextConstructor = m_perContextData->constructorForType(contextType, m_workerContext);
+ v8::Handle<v8::Function> workerContextConstructor = m_perContextData->constructorForType(contextType);
v8::Local<v8::Object> jsWorkerContext = V8ObjectConstructor::newInstance(workerContextConstructor);
// Bail out if allocation failed.
if (jsWorkerContext.IsEmpty()) {
diff --git a/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp b/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp
index 3c25ad8c5..3c25ad8c5 100755..100644
--- a/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp
diff --git a/Source/WebCore/bindings/v8/WrapperTypeInfo.h b/Source/WebCore/bindings/v8/WrapperTypeInfo.h
index 3c4befaa8..a4bd4998d 100644
--- a/Source/WebCore/bindings/v8/WrapperTypeInfo.h
+++ b/Source/WebCore/bindings/v8/WrapperTypeInfo.h
@@ -37,7 +37,6 @@ namespace WebCore {
class ActiveDOMObject;
class DOMDataStore;
- class ScriptExecutionContext;
static const int v8DOMWrapperTypeIndex = 0;
static const int v8DOMWrapperObjectIndex = 1;
@@ -49,7 +48,7 @@ namespace WebCore {
typedef void (*DerefObjectFunction)(void*);
typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>);
typedef void (*DOMWrapperVisitorFunction)(DOMDataStore*, void*, v8::Persistent<v8::Object>);
- typedef void (*InstallPerContextPrototypePropertiesFunction)(v8::Handle<v8::Object>, ScriptExecutionContext*);
+ typedef void (*InstallPerContextPrototypePropertiesFunction)(v8::Handle<v8::Object>);
enum WrapperTypePrototype {
WrapperTypeObjectPrototype,
@@ -90,10 +89,10 @@ namespace WebCore {
derefObjectFunction(object);
}
- void installPerContextPrototypeProperties(v8::Handle<v8::Object> proto, ScriptExecutionContext* context)
+ void installPerContextPrototypeProperties(v8::Handle<v8::Object> proto)
{
if (installPerContextPrototypePropertiesFunction)
- installPerContextPrototypePropertiesFunction(proto, context);
+ installPerContextPrototypePropertiesFunction(proto);
}
ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object> object)
diff --git a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp
index 6de9ce8e2..6de9ce8e2 100755..100644
--- a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp
diff --git a/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp b/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
index b49a153e7..b49a153e7 100755..100644
--- a/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
diff --git a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
index 06354969d..4156832d2 100644
--- a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
@@ -47,6 +47,7 @@
#include "V8Int16Array.h"
#include "V8Int32Array.h"
#include "V8Int8Array.h"
+#include "V8OESElementIndexUint.h"
#include "V8OESStandardDerivatives.h"
#include "V8OESTextureFloat.h"
#include "V8OESVertexArrayObject.h"
@@ -191,6 +192,10 @@ static v8::Handle<v8::Value> toV8Object(WebGLExtension* extension, v8::Handle<v8
extensionObject = toV8(static_cast<OESVertexArrayObject*>(extension), contextObject, isolate);
referenceName = "oesVertexArrayObjectName";
break;
+ case WebGLExtension::OESElementIndexUintName:
+ extensionObject = toV8(static_cast<OESElementIndexUint*>(extension), contextObject, isolate);
+ referenceName = "oesElementIndexUintName";
+ break;
case WebGLExtension::WebGLDebugRendererInfoName:
extensionObject = toV8(static_cast<WebGLDebugRendererInfo*>(extension), contextObject, isolate);
referenceName = "webGLDebugRendererInfoName";
diff --git a/Source/WebCore/css/CSSCalculationValue.h b/Source/WebCore/css/CSSCalculationValue.h
index 044cf32a4..044cf32a4 100755..100644
--- a/Source/WebCore/css/CSSCalculationValue.h
+++ b/Source/WebCore/css/CSSCalculationValue.h
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index 7307402bf..586c133ea 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -181,10 +181,10 @@ static const CSSPropertyID computedProperties[] = {
CSSPropertyTabSize,
CSSPropertyTextAlign,
CSSPropertyTextDecoration,
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
CSSPropertyWebkitTextDecorationLine,
CSSPropertyWebkitTextDecorationStyle,
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
CSSPropertyTextIndent,
CSSPropertyTextRendering,
CSSPropertyTextShadow,
@@ -1219,7 +1219,7 @@ static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecorati
return list;
}
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorationStyle textDecorationStyle)
{
switch (textDecorationStyle) {
@@ -1238,7 +1238,7 @@ static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorat
ASSERT_NOT_REACHED();
return cssValuePool().createExplicitInitialValue();
}
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepeat yRepeat)
{
@@ -2026,12 +2026,12 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
return cssValuePool().createValue(style->textAlign());
case CSSPropertyTextDecoration:
return renderTextDecorationFlagsToCSSValue(style->textDecoration());
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextDecorationLine:
return renderTextDecorationFlagsToCSSValue(style->textDecoration());
case CSSPropertyWebkitTextDecorationStyle:
return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle());
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
case CSSPropertyWebkitTextDecorationsInEffect:
return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect());
case CSSPropertyWebkitTextFillColor:
diff --git a/Source/WebCore/css/CSSGrammar.y.in b/Source/WebCore/css/CSSGrammar.y.in
index 733ae8eda..4b894fb95 100644
--- a/Source/WebCore/css/CSSGrammar.y.in
+++ b/Source/WebCore/css/CSSGrammar.y.in
@@ -91,6 +91,9 @@ static inline int cssyyerror(void*, const char*)
%token IMPORT_SYM
%token PAGE_SYM
%token MEDIA_SYM
+#if ENABLE_CSS3_CONDITIONAL_RULES
+%token SUPPORTS_SYM
+#endif
%token FONT_FACE_SYM
%token CHARSET_SYM
%token NAMESPACE_SYM
@@ -126,6 +129,11 @@ static inline int cssyyerror(void*, const char*)
%token MEDIA_ONLY
%token MEDIA_NOT
%token MEDIA_AND
+#if ENABLE_CSS3_CONDITIONAL_RULES
+%token SUPPORTS_NOT
+%token SUPPORTS_AND
+%token SUPPORTS_OR
+#endif
%token <number> REMS
%token <number> QEMS
@@ -189,6 +197,9 @@ static inline int cssyyerror(void*, const char*)
%type <rule> block_rule
%type <rule> block_valid_rule
%type <rule> region
+#if ENABLE_CSS3_CONDITIONAL_RULES
+%type <rule> supports
+#endif
%type <string> maybe_ns_prefix
@@ -209,6 +220,15 @@ static inline int cssyyerror(void*, const char*)
%type <mediaQueryExpList> media_query_exp_list
%type <mediaQueryExpList> maybe_and_media_query_exp_list
+#if ENABLE_CSS3_CONDITIONAL_RULES
+%type <boolean> supports_condition
+%type <boolean> supports_condition_in_parens
+%type <boolean> supports_negation
+%type <boolean> supports_conjunction
+%type <boolean> supports_disjunction
+%type <boolean> supports_declaration_condition
+#endif
+
%type <string> keyframe_name
%type <keyframe> keyframe_rule
%type <keyframeRuleList> keyframes_rule
@@ -379,6 +399,9 @@ valid_rule:
| namespace
| import
| region
+#if ENABLE_CSS3_CONDITIONAL_RULES
+ | supports
+#endif
;
rule:
@@ -416,6 +439,9 @@ block_rule:
| namespace
| import
| media
+#if ENABLE_CSS3_CONDITIONAL_RULES
+ | supports
+#endif
;
at_import_header_end_maybe_space:
@@ -611,6 +637,74 @@ medium:
}
;
+#if ENABLE_CSS3_CONDITIONAL_RULES
+supports:
+ SUPPORTS_SYM maybe_space supports_condition '{' maybe_space block_rule_list save_block {
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ if ($3 && $6 && p->m_styleSheet) {
+ for (unsigned i = 0; i < $6->size(); i++)
+ p->m_styleSheet->parserAppendRule($6->at(i).release());
+ }
+ $$ = 0;
+ }
+ ;
+
+supports_condition:
+ supports_condition_in_parens
+ | supports_negation
+ | supports_conjunction
+ | supports_disjunction
+ ;
+
+supports_negation:
+ SUPPORTS_NOT maybe_space supports_condition_in_parens {
+ $$ = !$3;
+ }
+ ;
+
+supports_conjunction:
+ supports_condition_in_parens SUPPORTS_AND maybe_space supports_condition_in_parens {
+ $$ = $1 && $4;
+ }
+ | supports_conjunction SUPPORTS_AND maybe_space supports_condition_in_parens {
+ $$ = $1 && $4;
+ }
+ ;
+
+supports_disjunction:
+ supports_condition_in_parens SUPPORTS_OR maybe_space supports_condition_in_parens {
+ $$ = $1 || $4;
+ }
+ | supports_disjunction SUPPORTS_OR maybe_space supports_condition_in_parens {
+ $$ = $1 || $4;
+ }
+ ;
+
+supports_condition_in_parens:
+ '(' maybe_space supports_condition ')' maybe_space {
+ $$ = $3;
+ }
+ | supports_declaration_condition
+ ;
+
+supports_declaration_condition:
+ '(' maybe_space property ':' maybe_space expr prio ')' maybe_space {
+ $$ = false;
+ CSSParser* p = static_cast<CSSParser*>(parser);
+ if ($3 && $6) {
+ p->m_valueList = p->sinkFloatingValueList($6);
+ int oldParsedProperties = p->m_parsedProperties->size();
+ $$ = p->parseValue(static_cast<CSSPropertyID>($3), $7);
+ // We just need to know if the declaration is supported as it is written. Rollback any additions.
+ if ($$)
+ p->rollbackLastProperties(p->m_parsedProperties->size() - oldParsedProperties);
+ p->m_valueList = nullptr;
+ }
+ p->markPropertyEnd($7, false);
+ }
+ ;
+#endif
+
before_keyframes_rule:
/* empty */ {
parser->markRuleHeaderStart(CSSRuleSourceData::KEYFRAMES_RULE);
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index f20b61018..af3bab602 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -2121,7 +2121,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
// none | [ underline || overline || line-through || blink ] | inherit
return parseTextDecoration(propId, important);
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextDecorationLine:
// none | [ underline || overline || line-through ] | inherit
return parseTextDecoration(propId, important);
@@ -2131,7 +2131,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy)
validPrimitive = true;
break;
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
case CSSPropertyZoom: // normal | reset | document | <number> | <percentage> | inherit
if (id == CSSValueNormal || id == CSSValueReset || id == CSSValueDocument)
@@ -8033,7 +8033,7 @@ bool CSSParser::parsePerspectiveOrigin(CSSPropertyID propId, CSSPropertyID& prop
void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important)
{
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
// The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set.
if (propId == CSSPropertyTextDecoration && !important && m_currentShorthand == CSSPropertyInvalid) {
for (unsigned i = 0; i < m_parsedProperties->size(); ++i) {
@@ -8041,7 +8041,7 @@ void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSVa
return;
}
}
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
addProperty(propId, value, important);
}
@@ -8059,11 +8059,11 @@ bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important)
while (isValid && value) {
switch (value->id) {
case CSSValueBlink:
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
// Blink value is not accepted by -webkit-text-decoration-line.
isValid = propId != CSSPropertyWebkitTextDecorationLine;
break;
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
case CSSValueUnderline:
case CSSValueOverline:
case CSSValueLineThrough:
@@ -9140,7 +9140,7 @@ inline void CSSParser::detectAtToken(int length, bool hasEscape)
CharacterType* name = tokenStart<CharacterType>();
ASSERT(name[0] == '@' && length >= 2);
- // charset, font-face, import, media, namespace, page,
+ // charset, font-face, import, media, namespace, page, supports,
// -webkit-keyframes, and -webkit-mediaquery are not affected by hasEscape.
switch (toASCIILowerUnchecked(name[1])) {
case 'b':
@@ -9241,6 +9241,15 @@ inline void CSSParser::detectAtToken(int length, bool hasEscape)
}
return;
+#if ENABLE(CSS3_CONDITIONAL_RULES)
+ case 's':
+ if (length == 9 && isEqualToCSSIdentifier(name + 2, "upports")) {
+ m_parsingMode = SupportsMode;
+ m_token = SUPPORTS_SYM;
+ }
+ return;
+#endif
+
case 't':
if (hasEscape)
return;
@@ -9323,6 +9332,25 @@ inline void CSSParser::detectAtToken(int length, bool hasEscape)
}
}
+#if ENABLE(CSS3_CONDITIONAL_RULES)
+template <typename CharacterType>
+inline void CSSParser::detectSupportsToken(int length)
+{
+ ASSERT(m_parsingMode == SupportsMode);
+ CharacterType* name = tokenStart<CharacterType>();
+
+ if (length == 2) {
+ if (isASCIIAlphaCaselessEqual(name[0], 'o') && isASCIIAlphaCaselessEqual(name[1], 'r'))
+ m_token = SUPPORTS_OR;
+ } else if (length == 3) {
+ if (isASCIIAlphaCaselessEqual(name[0], 'a') && isASCIIAlphaCaselessEqual(name[1], 'n') && isASCIIAlphaCaselessEqual(name[2], 'd'))
+ m_token = SUPPORTS_AND;
+ else if (isASCIIAlphaCaselessEqual(name[0], 'n') && isASCIIAlphaCaselessEqual(name[1], 'o') && isASCIIAlphaCaselessEqual(name[2], 't'))
+ m_token = SUPPORTS_NOT;
+ }
+}
+#endif
+
template <typename SrcCharacterType>
int CSSParser::realLex(void* yylvalWithoutType)
{
@@ -9361,6 +9389,14 @@ restartAfterComment:
m_token = IDENT;
if (UNLIKELY(*currentCharacter<SrcCharacterType>() == '(')) {
+#if ENABLE(CSS3_CONDITIONAL_RULES)
+ if (m_parsingMode == SupportsMode && !hasEscape) {
+ detectSupportsToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>());
+ if (m_token != IDENT)
+ break;
+ }
+#endif
+
m_token = FUNCTION;
if (!hasEscape)
detectFunctionTypeToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>());
@@ -9379,6 +9415,10 @@ restartAfterComment:
} else if (UNLIKELY(m_parsingMode != NormalMode) && !hasEscape) {
if (m_parsingMode == MediaQueryMode)
detectMediaQueryToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>());
+#if ENABLE(CSS3_CONDITIONAL_RULES)
+ else if (m_parsingMode == SupportsMode)
+ detectSupportsToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>());
+#endif
else if (m_parsingMode == NthChildMode && isASCIIAlphaCaselessEqual(tokenStart<SrcCharacterType>()[0], 'n')) {
if (result - tokenStart<SrcCharacterType>() == 1) {
// String "n" is IDENT but "n+1" is NTH.
diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h
index 469c12dff..75668cf30 100644
--- a/Source/WebCore/css/CSSParser.h
+++ b/Source/WebCore/css/CSSParser.h
@@ -435,6 +435,10 @@ private:
inline void detectDashToken(int);
template <typename CharacterType>
inline void detectAtToken(int, bool);
+#if ENABLE(CSS3_CONDITIONAL_RULES)
+ template <typename CharacterType>
+ inline void detectSupportsToken(int);
+#endif
template <typename CharacterType>
inline void setRuleHeaderEnd(const CharacterType*);
@@ -483,6 +487,9 @@ private:
enum ParsingMode {
NormalMode,
MediaQueryMode,
+#if ENABLE(CSS3_CONDITIONAL_RULES)
+ SupportsMode,
+#endif
NthChildMode
};
diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h
index 3dd09a660..06c18ba9f 100644
--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h
@@ -2203,7 +2203,7 @@ template<> inline CSSPrimitiveValue::operator ETextDecoration() const
return TDNONE;
}
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
template<> inline CSSPrimitiveValue::operator TextDecorationStyle() const
{
switch (m_value.ident) {
@@ -2222,7 +2222,7 @@ template<> inline CSSPrimitiveValue::operator TextDecorationStyle() const
ASSERT_NOT_REACHED();
return TextDecorationStyleSolid;
}
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e)
: CSSValue(PrimitiveClass)
diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp
index 83e73b99a..b412fdbfa 100644
--- a/Source/WebCore/css/CSSProperty.cpp
+++ b/Source/WebCore/css/CSSProperty.cpp
@@ -348,9 +348,9 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
case CSSPropertyWebkitPrintColorAdjust:
case CSSPropertyWebkitRtlOrdering:
case CSSPropertyWebkitTextCombine:
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextDecorationLine:
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
case CSSPropertyWebkitTextDecorationsInEffect:
case CSSPropertyWebkitTextEmphasis:
case CSSPropertyWebkitTextEmphasisColor:
@@ -648,9 +648,9 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
case CSSPropertyWebkitPerspectiveOrigin:
case CSSPropertyWebkitPerspectiveOriginX:
case CSSPropertyWebkitPerspectiveOriginY:
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextDecorationStyle:
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
case CSSPropertyWebkitTransform:
case CSSPropertyWebkitTransformOrigin:
case CSSPropertyWebkitTransformOriginX:
diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in
index 63fa06d94..8776e04be 100644
--- a/Source/WebCore/css/CSSPropertyNames.in
+++ b/Source/WebCore/css/CSSPropertyNames.in
@@ -354,7 +354,7 @@ z-index
-webkit-rtl-ordering
-webkit-text-combine
-epub-text-combine = -webkit-text-combine
-#if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION
+#if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT
-webkit-text-decoration-line
-webkit-text-decoration-style
#endif
diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in
index c2d128c62..37eafdca9 100644
--- a/Source/WebCore/css/CSSValueKeywords.in
+++ b/Source/WebCore/css/CSSValueKeywords.in
@@ -451,7 +451,7 @@ static
thick
thin
underline
-#if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION
+#if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT
wavy
#endif
-webkit-nowrap
diff --git a/Source/WebCore/css/SelectorChecker.cpp b/Source/WebCore/css/SelectorChecker.cpp
index 7a107c5c1..eb5b9f387 100644
--- a/Source/WebCore/css/SelectorChecker.cpp
+++ b/Source/WebCore/css/SelectorChecker.cpp
@@ -1333,32 +1333,6 @@ bool SelectorChecker::isFrameFocused(const Element* element)
return element->document()->frame() && element->document()->frame()->selection()->isFocusedAndActive();
}
-bool SelectorChecker::determineSelectorScopes(const CSSSelectorList& selectorList, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes)
-{
- for (CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(selector)) {
- CSSSelector* scopeSelector = 0;
- // This picks the widest scope, not the narrowest, to minimize the number of found scopes.
- for (CSSSelector* current = selector; current; current = current->tagHistory()) {
- // Prefer ids over classes.
- if (current->m_match == CSSSelector::Id)
- scopeSelector = current;
- else if (current->m_match == CSSSelector::Class && (!scopeSelector || scopeSelector->m_match != CSSSelector::Id))
- scopeSelector = current;
- CSSSelector::Relation relation = current->relation();
- if (relation != CSSSelector::Descendant && relation != CSSSelector::Child && relation != CSSSelector::SubSelector)
- break;
- }
- if (!scopeSelector)
- return false;
- ASSERT(scopeSelector->m_match == CSSSelector::Class || scopeSelector->m_match == CSSSelector::Id);
- if (scopeSelector->m_match == CSSSelector::Id)
- idScopes.add(scopeSelector->value().impl());
- else
- classScopes.add(scopeSelector->value().impl());
- }
- return true;
-}
-
template
bool SelectorChecker::checkOneSelector(const SelectorChecker::SelectorCheckingContext&, const ShadowDOMSiblingTraversalStrategy&) const;
diff --git a/Source/WebCore/css/SelectorChecker.h b/Source/WebCore/css/SelectorChecker.h
index dccf563e0..9eadada59 100644
--- a/Source/WebCore/css/SelectorChecker.h
+++ b/Source/WebCore/css/SelectorChecker.h
@@ -119,10 +119,6 @@ public:
enum LinkMatchMask { MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink | MatchVisited };
static unsigned determineLinkMatchType(const CSSSelector*);
- // Find the ids or classes selectors are scoped to. The selectors only apply to elements in subtrees where the root element matches the scope.
- static bool determineSelectorScopes(const CSSSelectorList&, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes);
- static bool elementMatchesSelectorScopes(const StyledElement*, const HashSet<AtomicStringImpl*>& idScopes, const HashSet<AtomicStringImpl*>& classScopes);
-
private:
bool checkScrollbarPseudoClass(CSSSelector*) const;
static bool isFrameFocused(const Element*);
@@ -229,20 +225,6 @@ inline bool SelectorChecker::fastCheckRightmostAttributeSelector(const Element*
return true;
}
-inline bool SelectorChecker::elementMatchesSelectorScopes(const StyledElement* element, const HashSet<AtomicStringImpl*>& idScopes, const HashSet<AtomicStringImpl*>& classScopes)
-{
- if (!idScopes.isEmpty() && element->hasID() && idScopes.contains(element->idForStyleResolution().impl()))
- return true;
- if (classScopes.isEmpty() || !element->hasClass())
- return false;
- const SpaceSplitString& classNames = element->classNames();
- for (unsigned i = 0; i < classNames.size(); ++i) {
- if (classScopes.contains(classNames[i].impl()))
- return true;
- }
- return false;
-}
-
}
#endif
diff --git a/Source/WebCore/css/StyleBuilder.cpp b/Source/WebCore/css/StyleBuilder.cpp
index d6284ed2e..5795defc4 100644
--- a/Source/WebCore/css/StyleBuilder.cpp
+++ b/Source/WebCore/css/StyleBuilder.cpp
@@ -1916,10 +1916,10 @@ StyleBuilder::StyleBuilder()
setPropertyHandler(CSSPropertyTabSize, ApplyPropertyDefault<unsigned, &RenderStyle::tabSize, unsigned, &RenderStyle::setTabSize, unsigned, &RenderStyle::initialTabSize>::createHandler());
setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler());
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler());
setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
diff --git a/Source/WebCore/css/StyleInvalidationAnalysis.cpp b/Source/WebCore/css/StyleInvalidationAnalysis.cpp
new file mode 100644
index 000000000..2da6732cd
--- /dev/null
+++ b/Source/WebCore/css/StyleInvalidationAnalysis.cpp
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "StyleInvalidationAnalysis.h"
+
+#include "CSSSelectorList.h"
+#include "Document.h"
+#include "StyleRuleImport.h"
+#include "StyleSheetContents.h"
+#include "StyledElement.h"
+
+namespace WebCore {
+
+StyleInvalidationAnalysis::StyleInvalidationAnalysis(const Vector<StyleSheetContents*>& sheets)
+ : m_dirtiesAllStyle(false)
+{
+ for (unsigned i = 0; i < sheets.size() && !m_dirtiesAllStyle; ++i)
+ analyzeStyleSheet(sheets[i]);
+}
+
+static bool determineSelectorScopes(const CSSSelectorList& selectorList, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes)
+{
+ for (CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(selector)) {
+ CSSSelector* scopeSelector = 0;
+ // This picks the widest scope, not the narrowest, to minimize the number of found scopes.
+ for (CSSSelector* current = selector; current; current = current->tagHistory()) {
+ // Prefer ids over classes.
+ if (current->m_match == CSSSelector::Id)
+ scopeSelector = current;
+ else if (current->m_match == CSSSelector::Class && (!scopeSelector || scopeSelector->m_match != CSSSelector::Id))
+ scopeSelector = current;
+ CSSSelector::Relation relation = current->relation();
+ if (relation != CSSSelector::Descendant && relation != CSSSelector::Child && relation != CSSSelector::SubSelector)
+ break;
+ }
+ if (!scopeSelector)
+ return false;
+ ASSERT(scopeSelector->m_match == CSSSelector::Class || scopeSelector->m_match == CSSSelector::Id);
+ if (scopeSelector->m_match == CSSSelector::Id)
+ idScopes.add(scopeSelector->value().impl());
+ else
+ classScopes.add(scopeSelector->value().impl());
+ }
+ return true;
+}
+
+void StyleInvalidationAnalysis::analyzeStyleSheet(StyleSheetContents* styleSheetContents)
+{
+ ASSERT(!styleSheetContents->isLoading());
+
+ // See if all rules on the sheet are scoped to some specific ids or classes.
+ // Then test if we actually have any of those in the tree at the moment.
+ const Vector<RefPtr<StyleRuleImport> >& importRules = styleSheetContents->importRules();
+ for (unsigned i = 0; i < importRules.size(); ++i) {
+ if (!importRules[i]->styleSheet())
+ continue;
+ analyzeStyleSheet(importRules[i]->styleSheet());
+ if (m_dirtiesAllStyle)
+ return;
+ }
+ const Vector<RefPtr<StyleRuleBase> >& rules = styleSheetContents->childRules();
+ for (unsigned i = 0; i < rules.size(); i++) {
+ StyleRuleBase* rule = rules[i].get();
+ if (!rule->isStyleRule()) {
+ // FIXME: Media rules and maybe some others could be allowed.
+ m_dirtiesAllStyle = true;
+ return;
+ }
+ StyleRule* styleRule = static_cast<StyleRule*>(rule);
+ if (!determineSelectorScopes(styleRule->selectorList(), m_idScopes, m_classScopes)) {
+ m_dirtiesAllStyle = true;
+ return;
+ }
+ }
+}
+
+static bool elementMatchesSelectorScopes(const StyledElement* element, const HashSet<AtomicStringImpl*>& idScopes, const HashSet<AtomicStringImpl*>& classScopes)
+{
+ if (!idScopes.isEmpty() && element->hasID() && idScopes.contains(element->idForStyleResolution().impl()))
+ return true;
+ if (classScopes.isEmpty() || !element->hasClass())
+ return false;
+ const SpaceSplitString& classNames = element->classNames();
+ for (unsigned i = 0; i < classNames.size(); ++i) {
+ if (classScopes.contains(classNames[i].impl()))
+ return true;
+ }
+ return false;
+}
+
+void StyleInvalidationAnalysis::invalidateStyle(Document* document)
+{
+ ASSERT(!m_dirtiesAllStyle);
+ if (m_idScopes.isEmpty() && m_classScopes.isEmpty())
+ return;
+ Node* node = document->firstChild();
+ while (node) {
+ if (!node->isStyledElement()) {
+ node = node->traverseNextNode();
+ continue;
+ }
+ StyledElement* element = static_cast<StyledElement*>(node);
+ if (elementMatchesSelectorScopes(element, m_idScopes, m_classScopes)) {
+ element->setNeedsStyleRecalc();
+ // The whole subtree is now invalidated, we can skip to the next sibling.
+ node = node->traverseNextSibling();
+ continue;
+ }
+ node = node->traverseNextNode();
+ }
+}
+
+}
diff --git a/Source/WebCore/css/StyleInvalidationAnalysis.h b/Source/WebCore/css/StyleInvalidationAnalysis.h
new file mode 100644
index 000000000..7ad2cb935
--- /dev/null
+++ b/Source/WebCore/css/StyleInvalidationAnalysis.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StyleInvalidationAnalysis_h
+#define StyleInvalidationAnalysis_h
+
+#include <wtf/HashSet.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/text/AtomicStringImpl.h>
+
+namespace WebCore {
+
+class Document;
+class StyleSheetContents;
+
+class StyleInvalidationAnalysis {
+public:
+ StyleInvalidationAnalysis(const Vector<StyleSheetContents*>&);
+
+ bool dirtiesAllStyle() const { return m_dirtiesAllStyle; }
+ void invalidateStyle(Document*);
+
+private:
+
+ void analyzeStyleSheet(StyleSheetContents*);
+
+ bool m_dirtiesAllStyle;
+ HashSet<AtomicStringImpl*> m_idScopes;
+ HashSet<AtomicStringImpl*> m_classScopes;
+};
+
+}
+
+#endif
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index 072a0f779..9318b7a16 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -199,12 +199,6 @@ if (isInitial) { \
return;\
}
-#define HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(prop, Prop) \
-HANDLE_INHERIT_AND_INITIAL(prop, Prop) \
-if (primitiveValue) \
- m_style->set##Prop(*primitiveValue);
-
-
static RuleSet* defaultStyle;
static RuleSet* defaultQuirksStyle;
static RuleSet* defaultPrintStyle;
@@ -337,7 +331,7 @@ StyleResolver::StyleResolver(Document* document, bool matchAuthorAndUserStyles)
#endif
addStylesheetsFromSeamlessParents();
- appendAuthorStylesheets(0, styleSheetCollection->authorStyleSheets());
+ appendAuthorStyleSheets(0, styleSheetCollection->activeAuthorStyleSheets());
}
void StyleResolver::addStylesheetsFromSeamlessParents()
@@ -345,14 +339,14 @@ void StyleResolver::addStylesheetsFromSeamlessParents()
// Build a list of stylesheet lists from our ancestors, and walk that
// list in reverse order so that the root-most sheets are appended first.
Document* childDocument = document();
- Vector<const Vector<RefPtr<StyleSheet> >* > ancestorSheets;
+ Vector<const Vector<RefPtr<CSSStyleSheet> >* > ancestorSheets;
while (HTMLIFrameElement* parentIFrame = childDocument->seamlessParentIFrame()) {
Document* parentDocument = parentIFrame->document();
- ancestorSheets.append(&parentDocument->styleSheetCollection()->authorStyleSheets());
+ ancestorSheets.append(&parentDocument->styleSheetCollection()->activeAuthorStyleSheets());
childDocument = parentDocument;
}
for (int i = ancestorSheets.size() - 1; i >= 0; i--)
- appendAuthorStylesheets(0, *ancestorSheets[i]);
+ appendAuthorStyleSheets(0, *ancestorSheets[i]);
}
void StyleResolver::addAuthorRulesAndCollectUserRulesFromSheets(const Vector<RefPtr<CSSStyleSheet> >* userSheets, RuleSet& userStyle)
@@ -405,17 +399,14 @@ void StyleResolver::resetAuthorStyle()
m_authorStyle->disableAutoShrinkToFit();
}
-void StyleResolver::appendAuthorStylesheets(unsigned firstNew, const Vector<RefPtr<StyleSheet> >& stylesheets)
+void StyleResolver::appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet> >& styleSheets)
{
// This handles sheets added to the end of the stylesheet list only. In other cases the style resolver
// needs to be reconstructed. To handle insertions too the rule order numbers would need to be updated.
- unsigned size = stylesheets.size();
+ unsigned size = styleSheets.size();
for (unsigned i = firstNew; i < size; ++i) {
- if (!stylesheets[i]->isCSSStyleSheet())
- continue;
- CSSStyleSheet* cssSheet = static_cast<CSSStyleSheet*>(stylesheets[i].get());
- if (cssSheet->disabled())
- continue;
+ CSSStyleSheet* cssSheet = styleSheets[i].get();
+ ASSERT(!cssSheet->disabled());
if (cssSheet->mediaQueries() && !m_medium->eval(cssSheet->mediaQueries(), this))
continue;
StyleSheetContents* sheet = cssSheet->contents();
@@ -1547,8 +1538,8 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
// be propagated from shadow host to distributed node.
if (m_distributedToInsertionPoint) {
ASSERT(element->parentElement());
- ASSERT(element->parentElement()->renderStyle());
- m_style->setUserModify(element->parentElement()->renderStyle()->userModify());
+ if (RenderStyle* styleOfShadowHost = element->parentElement()->renderStyle())
+ m_style->setUserModify(styleOfShadowHost->userModify());
}
if (element->isLink()) {
@@ -2212,33 +2203,6 @@ bool StyleResolver::checkRegionSelector(CSSSelector* regionSelector, Element* re
return false;
}
-
-bool StyleResolver::determineStylesheetSelectorScopes(StyleSheetContents* stylesheet, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes)
-{
- ASSERT(!stylesheet->isLoading());
-
- const Vector<RefPtr<StyleRuleImport> >& importRules = stylesheet->importRules();
- for (unsigned i = 0; i < importRules.size(); ++i) {
- if (!importRules[i]->styleSheet())
- continue;
- if (!determineStylesheetSelectorScopes(importRules[i]->styleSheet(), idScopes, classScopes))
- return false;
- }
-
- const Vector<RefPtr<StyleRuleBase> >& rules = stylesheet->childRules();
- for (unsigned i = 0; i < rules.size(); i++) {
- StyleRuleBase* rule = rules[i].get();
- if (rule->isStyleRule()) {
- StyleRule* styleRule = static_cast<StyleRule*>(rule);
- if (!SelectorChecker::determineSelectorScopes(styleRule->selectorList(), idScopes, classScopes))
- return false;
- continue;
- }
- // FIXME: Media rules and maybe some others could be allowed.
- return false;
- }
- return true;
-}
// -------------------------------------------------------------------------------------
// this is mostly boring stuff on how to apply a certain rule to the renderstyle...
@@ -2608,13 +2572,10 @@ static void collectCSSOMWrappers(HashMap<StyleRule*, RefPtr<CSSStyleRule> >& wra
static void collectCSSOMWrappers(HashMap<StyleRule*, RefPtr<CSSStyleRule> >& wrapperMap, DocumentStyleSheetCollection* styleSheetCollection)
{
- const Vector<RefPtr<StyleSheet> >& styleSheets = styleSheetCollection->authorStyleSheets();
- for (unsigned i = 0; i < styleSheets.size(); ++i) {
- StyleSheet* styleSheet = styleSheets[i].get();
- if (!styleSheet->isCSSStyleSheet())
- continue;
- collectCSSOMWrappers(wrapperMap, static_cast<CSSStyleSheet*>(styleSheet));
- }
+ const Vector<RefPtr<CSSStyleSheet> >& styleSheets = styleSheetCollection->activeAuthorStyleSheets();
+ for (unsigned i = 0; i < styleSheets.size(); ++i)
+ collectCSSOMWrappers(wrapperMap, styleSheets[i].get());
+
collectCSSOMWrappers(wrapperMap, styleSheetCollection->pageUserSheet());
{
const Vector<RefPtr<CSSStyleSheet> >* pageGroupUserSheets = styleSheetCollection->pageGroupUserSheets();
@@ -3544,9 +3505,13 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
// CSS Text Layout Module Level 3: Vertical writing support
case CSSPropertyWebkitWritingMode: {
- HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(writingMode, WritingMode)
+ HANDLE_INHERIT_AND_INITIAL(writingMode, WritingMode);
+
+ if (primitiveValue)
+ m_style->setWritingMode(*primitiveValue);
+
// FIXME: It is not ok to modify document state while applying style.
- if (!isInherit && !isInitial && m_element && m_element == m_element->document()->documentElement())
+ if (m_element && m_element == m_element->document()->documentElement())
m_element->document()->setWritingModeSetOnDocumentElement(true);
FontDescription fontDescription = m_style->fontDescription();
fontDescription.setOrientation(m_style->isHorizontalWritingMode() ? Horizontal : Vertical);
@@ -3868,10 +3833,10 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
#endif
case CSSPropertyWebkitRtlOrdering:
case CSSPropertyWebkitTextCombine:
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextDecorationLine:
case CSSPropertyWebkitTextDecorationStyle:
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
case CSSPropertyWebkitTextEmphasisColor:
case CSSPropertyWebkitTextEmphasisPosition:
case CSSPropertyWebkitTextEmphasisStyle:
diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h
index 8c9587877..5b514ce55 100644
--- a/Source/WebCore/css/StyleResolver.h
+++ b/Source/WebCore/css/StyleResolver.h
@@ -163,10 +163,7 @@ public:
bool hasParentNode() const { return m_parentNode; }
void resetAuthorStyle();
- void appendAuthorStylesheets(unsigned firstNew, const Vector<RefPtr<StyleSheet> >&);
-
- // Find the ids or classes the selectors on a stylesheet are scoped to. The selectors only apply to elements in subtrees where the root element matches the scope.
- static bool determineStylesheetSelectorScopes(StyleSheetContents*, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes);
+ void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet> >&);
private:
void initForStyleResolve(Element*, RenderStyle* parentStyle = 0, PseudoId = NOPSEUDO);
diff --git a/Source/WebCore/css/StyleSheetList.cpp b/Source/WebCore/css/StyleSheetList.cpp
index 0f8fc2517..228ce718d 100644
--- a/Source/WebCore/css/StyleSheetList.cpp
+++ b/Source/WebCore/css/StyleSheetList.cpp
@@ -45,12 +45,12 @@ inline const Vector<RefPtr<StyleSheet> >& StyleSheetList::styleSheets() const
{
if (!m_document)
return m_detachedStyleSheets;
- return m_document->styleSheetCollection()->authorStyleSheets();
+ return m_document->styleSheetCollection()->styleSheetsForStyleSheetList();
}
void StyleSheetList::detachFromDocument()
{
- m_detachedStyleSheets = m_document->styleSheetCollection()->authorStyleSheets();
+ m_detachedStyleSheets = m_document->styleSheetCollection()->styleSheetsForStyleSheetList();
m_document = 0;
}
diff --git a/Source/WebCore/css/StyleSheetList.idl b/Source/WebCore/css/StyleSheetList.idl
index fc9aea501..362430e4f 100644
--- a/Source/WebCore/css/StyleSheetList.idl
+++ b/Source/WebCore/css/StyleSheetList.idl
@@ -20,10 +20,9 @@
// Introduced in DOM Level 2:
[
- JSGenerateIsReachable=ImplDocument,
+ GenerateIsReachable=ImplDocument,
IndexedGetter,
- NamedGetter,
- V8DependentLifetime
+ NamedGetter
] interface StyleSheetList {
readonly attribute unsigned long length;
StyleSheet item(in [Optional=DefaultIsUndefined] unsigned long index);
diff --git a/Source/WebCore/dom/ContainerNode.cpp b/Source/WebCore/dom/ContainerNode.cpp
index 9b178d82a..06aae46e1 100644
--- a/Source/WebCore/dom/ContainerNode.cpp
+++ b/Source/WebCore/dom/ContainerNode.cpp
@@ -33,6 +33,7 @@
#include "Frame.h"
#include "FrameView.h"
#include "InlineTextBox.h"
+#include "InsertionPoint.h"
#include "InspectorInstrumentation.h"
#include "MemoryCache.h"
#include "MutationEvent.h"
@@ -976,8 +977,10 @@ static void dispatchChildInsertionEvents(Node* child)
static void dispatchChildRemovalEvents(Node* child)
{
- if (child->isInShadowTree())
+ if (child->isInShadowTree()) {
+ InspectorInstrumentation::willRemoveDOMNode(child->document(), child);
return;
+ }
ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
@@ -1030,4 +1033,20 @@ static void updateTreeAfterInsertion(ContainerNode* parent, Node* child, bool sh
dispatchChildInsertionEvents(child);
}
+#ifndef NDEBUG
+bool childAttachedAllowedWhenAttachingChildren(ContainerNode* node)
+{
+ if (node->isShadowRoot())
+ return true;
+
+ if (isInsertionPoint(node))
+ return true;
+
+ if (node->isElementNode() && toElement(node)->shadow())
+ return true;
+
+ return false;
+}
+#endif
+
} // namespace WebCore
diff --git a/Source/WebCore/dom/ContainerNode.h b/Source/WebCore/dom/ContainerNode.h
index 7979c63c8..dd4a9898d 100644
--- a/Source/WebCore/dom/ContainerNode.h
+++ b/Source/WebCore/dom/ContainerNode.h
@@ -126,7 +126,6 @@ public:
void attachAsNode();
void attachChildren();
- void attachChildrenIfNeeded();
void attachChildrenLazily();
void detachChildren();
void detachChildrenIfNeeded();
@@ -175,6 +174,10 @@ private:
Node* m_lastChild;
};
+#ifndef NDEBUG
+bool childAttachedAllowedWhenAttachingChildren(ContainerNode*);
+#endif
+
inline ContainerNode* toContainerNode(Node* node)
{
ASSERT(!node || node->isContainerNode());
@@ -204,13 +207,8 @@ inline void ContainerNode::attachAsNode()
inline void ContainerNode::attachChildren()
{
- for (Node* child = firstChild(); child; child = child->nextSibling())
- child->attach();
-}
-
-inline void ContainerNode::attachChildrenIfNeeded()
-{
for (Node* child = firstChild(); child; child = child->nextSibling()) {
+ ASSERT(!child->attached() || childAttachedAllowedWhenAttachingChildren(this));
if (!child->attached())
child->attach();
}
diff --git a/Source/WebCore/dom/DOMImplementation.idl b/Source/WebCore/dom/DOMImplementation.idl
index e1ff7b973..1b9205420 100644
--- a/Source/WebCore/dom/DOMImplementation.idl
+++ b/Source/WebCore/dom/DOMImplementation.idl
@@ -19,8 +19,7 @@
*/
[
- JSGenerateIsReachable=ImplDocument,
- V8DependentLifetime
+ GenerateIsReachable=ImplDocument,
] interface DOMImplementation {
// DOM Level 1
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index efe89f40f..e85c8f1c0 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -797,7 +797,7 @@ void Document::setCompatibilityMode(CompatibilityMode mode)
{
if (m_compatibilityModeLocked || mode == m_compatibilityMode)
return;
- ASSERT(m_styleSheetCollection->authorStyleSheets().isEmpty());
+ ASSERT(m_styleSheetCollection->activeAuthorStyleSheets().isEmpty());
bool wasInQuirksMode = inQuirksMode();
m_compatibilityMode = mode;
selectorQueryCache()->invalidate();
@@ -1926,6 +1926,7 @@ void Document::updateLayout()
updateStyleIfNeeded();
+ StackStats::LayoutCheckPoint layoutCheckPoint;
// Only do a layout if changes have occurred that make it necessary.
FrameView* v = view();
if (v && renderer() && (v->layoutPending() || renderer()->needsLayout()))
@@ -5241,6 +5242,9 @@ void Document::webkitExitFullscreen()
// 6. Return, and run the remaining steps asynchronously.
// 7. Optionally, perform some animation.
+ if (!page())
+ return;
+
// Only exit out of full screen window mode if there are no remaining elements in the
// full screen stack.
if (!newTop) {
diff --git a/Source/WebCore/dom/DocumentOrderedMap.cpp b/Source/WebCore/dom/DocumentOrderedMap.cpp
index 1297e5102..bbd8b3b16 100644
--- a/Source/WebCore/dom/DocumentOrderedMap.cpp
+++ b/Source/WebCore/dom/DocumentOrderedMap.cpp
@@ -55,6 +55,11 @@ inline bool keyMatchesLowercasedMapName(AtomicStringImpl* key, Element* element)
return element->hasTagName(mapTag) && static_cast<HTMLMapElement*>(element)->getName().lower().impl() == key;
}
+inline bool keyMatchesLabelForAttribute(AtomicStringImpl* key, Element* element)
+{
+ return element->hasTagName(labelTag) && element->getAttribute(forAttr).impl() == key;
+}
+
void DocumentOrderedMap::clear()
{
m_map.clear();
@@ -149,5 +154,9 @@ Element* DocumentOrderedMap::getElementByLowercasedMapName(AtomicStringImpl* key
return get<keyMatchesLowercasedMapName>(key, scope);
}
-} // namespace WebCore
+Element* DocumentOrderedMap::getElementByLabelForAttribute(AtomicStringImpl* key, const TreeScope* scope) const
+{
+ return get<keyMatchesLabelForAttribute>(key, scope);
+}
+} // namespace WebCore
diff --git a/Source/WebCore/dom/DocumentOrderedMap.h b/Source/WebCore/dom/DocumentOrderedMap.h
index 7d12686c3..1f9039e61 100644
--- a/Source/WebCore/dom/DocumentOrderedMap.h
+++ b/Source/WebCore/dom/DocumentOrderedMap.h
@@ -52,6 +52,7 @@ public:
Element* getElementById(AtomicStringImpl*, const TreeScope*) const;
Element* getElementByMapName(AtomicStringImpl*, const TreeScope*) const;
Element* getElementByLowercasedMapName(AtomicStringImpl*, const TreeScope*) const;
+ Element* getElementByLabelForAttribute(AtomicStringImpl*, const TreeScope*) const;
void checkConsistency() const;
@@ -80,4 +81,3 @@ inline bool DocumentOrderedMap::containsMultiple(AtomicStringImpl* id) const
} // namespace WebCore
#endif // DocumentOrderedMap_h
-
diff --git a/Source/WebCore/dom/DocumentStyleSheetCollection.cpp b/Source/WebCore/dom/DocumentStyleSheetCollection.cpp
index 84cb8fce9..bfd1e5f0f 100644
--- a/Source/WebCore/dom/DocumentStyleSheetCollection.cpp
+++ b/Source/WebCore/dom/DocumentStyleSheetCollection.cpp
@@ -41,6 +41,7 @@
#include "SVGStyleElement.h"
#include "SelectorChecker.h"
#include "Settings.h"
+#include "StyleInvalidationAnalysis.h"
#include "StyleResolver.h"
#include "StyleSheetContents.h"
#include "StyleSheetList.h"
@@ -347,34 +348,7 @@ void DocumentStyleSheetCollection::collectActiveStyleSheets(Vector<RefPtr<StyleS
}
}
-bool DocumentStyleSheetCollection::testAddedStyleSheetRequiresStyleRecalc(StyleSheetContents* stylesheet)
-{
- // See if all rules on the sheet are scoped to some specific ids or classes.
- // Then test if we actually have any of those in the tree at the moment.
- HashSet<AtomicStringImpl*> idScopes;
- HashSet<AtomicStringImpl*> classScopes;
- if (!StyleResolver::determineStylesheetSelectorScopes(stylesheet, idScopes, classScopes))
- return true;
- // Invalidate the subtrees that match the scopes.
- Node* node = m_document->firstChild();
- while (node) {
- if (!node->isStyledElement()) {
- node = node->traverseNextNode();
- continue;
- }
- StyledElement* element = static_cast<StyledElement*>(node);
- if (SelectorChecker::elementMatchesSelectorScopes(element, idScopes, classScopes)) {
- element->setNeedsStyleRecalc();
- // The whole subtree is now invalidated, we can skip to the next sibling.
- node = node->traverseNextSibling();
- continue;
- }
- node = node->traverseNextNode();
- }
- return false;
-}
-
-void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, StyleResolverUpdateType& styleResolverUpdateType, bool& requiresFullStyleRecalc)
+void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets, StyleResolverUpdateType& styleResolverUpdateType, bool& requiresFullStyleRecalc)
{
styleResolverUpdateType = Reconstruct;
requiresFullStyleRecalc = true;
@@ -398,16 +372,16 @@ void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag
return;
// Find out which stylesheets are new.
- unsigned oldStylesheetCount = m_authorStyleSheets.size();
+ unsigned oldStylesheetCount = m_activeAuthorStyleSheets.size();
if (newStylesheetCount < oldStylesheetCount)
return;
- Vector<StyleSheet*> addedSheets;
+ Vector<StyleSheetContents*> addedSheets;
unsigned newIndex = 0;
for (unsigned oldIndex = 0; oldIndex < oldStylesheetCount; ++oldIndex) {
if (newIndex >= newStylesheetCount)
return;
- while (m_authorStyleSheets[oldIndex] != newStylesheets[newIndex]) {
- addedSheets.append(newStylesheets[newIndex].get());
+ while (m_activeAuthorStyleSheets[oldIndex] != newStylesheets[newIndex]) {
+ addedSheets.append(newStylesheets[newIndex]->contents());
++newIndex;
if (newIndex == newStylesheetCount)
return;
@@ -416,7 +390,7 @@ void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag
}
bool hasInsertions = !addedSheets.isEmpty();
while (newIndex < newStylesheetCount) {
- addedSheets.append(newStylesheets[newIndex].get());
+ addedSheets.append(newStylesheets[newIndex]->contents());
++newIndex;
}
// If all new sheets were added at the end of the list we can just add them to existing StyleResolver.
@@ -426,28 +400,33 @@ void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag
// If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs.
if (!m_document->body() || m_document->hasNodesWithPlaceholderStyle())
return;
- for (unsigned i = 0; i < addedSheets.size(); ++i) {
- if (!addedSheets[i]->isCSSStyleSheet())
- return;
- if (addedSheets[i]->disabled())
- continue;
- if (testAddedStyleSheetRequiresStyleRecalc(static_cast<CSSStyleSheet*>(addedSheets[i])->contents()))
- return;
- }
+ StyleInvalidationAnalysis invalidationAnalysis(addedSheets);
+ if (invalidationAnalysis.dirtiesAllStyle())
+ return;
+ invalidationAnalysis.invalidateStyle(m_document);
requiresFullStyleRecalc = false;
}
-static bool styleSheetsUseRemUnits(const Vector<RefPtr<StyleSheet> >& sheets)
+static bool styleSheetsUseRemUnits(const Vector<RefPtr<CSSStyleSheet> >& sheets)
{
for (unsigned i = 0; i < sheets.size(); ++i) {
- if (!sheets[i]->isCSSStyleSheet())
- continue;
- if (static_cast<CSSStyleSheet*>(sheets[i].get())->contents()->usesRemUnits())
+ if (sheets[i]->contents()->usesRemUnits())
return true;
}
return false;
}
+static void filterEnabledCSSStyleSheets(Vector<RefPtr<CSSStyleSheet> >& result, const Vector<RefPtr<StyleSheet> >& sheets)
+{
+ for (unsigned i = 0; i < sheets.size(); ++i) {
+ if (!sheets[i]->isCSSStyleSheet())
+ continue;
+ if (sheets[i]->disabled())
+ continue;
+ result.append(static_cast<CSSStyleSheet*>(sheets[i].get()));
+ }
+}
+
bool DocumentStyleSheetCollection::updateActiveStyleSheets(UpdateFlag updateFlag)
{
if (m_document->inStyleRecalc()) {
@@ -462,12 +441,15 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(UpdateFlag updateFlag
if (!m_document->renderer() || !m_document->attached())
return false;
- Vector<RefPtr<StyleSheet> > newStylesheets;
- collectActiveStyleSheets(newStylesheets);
+ Vector<RefPtr<StyleSheet> > activeStyleSheets;
+ collectActiveStyleSheets(activeStyleSheets);
+
+ Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets;
+ filterEnabledCSSStyleSheets(activeCSSStyleSheets, activeStyleSheets);
StyleResolverUpdateType styleResolverUpdateType;
bool requiresFullStyleRecalc;
- analyzeStyleSheetChange(updateFlag, newStylesheets, styleResolverUpdateType, requiresFullStyleRecalc);
+ analyzeStyleSheetChange(updateFlag, activeCSSStyleSheets, styleResolverUpdateType, requiresFullStyleRecalc);
if (styleResolverUpdateType == Reconstruct)
m_document->clearStyleResolver();
@@ -475,16 +457,17 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(UpdateFlag updateFlag
StyleResolver* styleResolver = m_document->styleResolver();
if (styleResolverUpdateType == Reset) {
styleResolver->resetAuthorStyle();
- styleResolver->appendAuthorStylesheets(0, newStylesheets);
+ styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets);
} else {
ASSERT(styleResolverUpdateType == Additive);
- styleResolver->appendAuthorStylesheets(m_authorStyleSheets.size(), newStylesheets);
+ styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), activeCSSStyleSheets);
}
resetCSSFeatureFlags();
}
- m_authorStyleSheets.swap(newStylesheets);
+ m_activeAuthorStyleSheets.swap(activeCSSStyleSheets);
+ m_styleSheetsForStyleSheetList.swap(activeStyleSheets);
- m_usesRemUnits = styleSheetsUseRemUnits(m_authorStyleSheets);
+ m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets);
m_needsUpdateActiveStylesheetsOnStyleRecalc = false;
m_document->notifySeamlessChildDocumentsOfStylesheetUpdate();
@@ -498,7 +481,8 @@ void DocumentStyleSheetCollection::reportMemoryUsage(MemoryObjectInfo* memoryObj
info.addMember(m_pageUserSheet);
info.addMember(m_pageGroupUserSheets);
info.addMember(m_userSheets);
- info.addMember(m_authorStyleSheets);
+ info.addMember(m_activeAuthorStyleSheets);
+ info.addMember(m_styleSheetsForStyleSheetList);
info.addListHashSet(m_styleSheetCandidateNodes);
info.addMember(m_preferredStylesheetSetName);
info.addMember(m_selectedStylesheetSetName);
diff --git a/Source/WebCore/dom/DocumentStyleSheetCollection.h b/Source/WebCore/dom/DocumentStyleSheetCollection.h
index 3fb45f9ed..b67d88866 100644
--- a/Source/WebCore/dom/DocumentStyleSheetCollection.h
+++ b/Source/WebCore/dom/DocumentStyleSheetCollection.h
@@ -49,7 +49,9 @@ public:
DocumentStyleSheetCollection(Document*);
~DocumentStyleSheetCollection();
- const Vector<RefPtr<StyleSheet> >& authorStyleSheets() { return m_authorStyleSheets; }
+ const Vector<RefPtr<StyleSheet> >& styleSheetsForStyleSheetList() { return m_styleSheetsForStyleSheetList; }
+
+ const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() { return m_activeAuthorStyleSheets; }
CSSStyleSheet* pageUserSheet();
const Vector<RefPtr<CSSStyleSheet> >* pageGroupUserSheets() const;
@@ -101,17 +103,17 @@ public:
private:
void collectActiveStyleSheets(Vector<RefPtr<StyleSheet> >&);
- bool testAddedStyleSheetRequiresStyleRecalc(StyleSheetContents*);
enum StyleResolverUpdateType {
Reconstruct,
Reset,
Additive
};
- void analyzeStyleSheetChange(UpdateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, StyleResolverUpdateType&, bool& requiresFullStyleRecalc);
+ void analyzeStyleSheetChange(UpdateFlag, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets, StyleResolverUpdateType&, bool& requiresFullStyleRecalc);
Document* m_document;
- Vector<RefPtr<StyleSheet> > m_authorStyleSheets;
+ Vector<RefPtr<StyleSheet> > m_styleSheetsForStyleSheetList;
+ Vector<RefPtr<CSSStyleSheet> > m_activeAuthorStyleSheets;
// Track the number of currently loading top-level stylesheets needed for rendering.
// Sheets loaded using the @import directive are not included in this count.
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 7cba51f0d..97dc9c9f6 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -48,6 +48,7 @@
#include "HTMLElement.h"
#include "HTMLFormCollection.h"
#include "HTMLFrameOwnerElement.h"
+#include "HTMLLabelElement.h"
#include "HTMLNames.h"
#include "HTMLOptionsCollection.h"
#include "HTMLParserIdioms.h"
@@ -959,17 +960,15 @@ Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertio
if (!nameValue.isNull())
updateName(nullAtom, nameValue);
- return InsertionDone;
-}
+ if (hasTagName(labelTag)) {
+ TreeScope* scope = treeScope();
+ if (scope->shouldCacheLabelsByForAttribute())
+ updateLabel(scope, nullAtom, fastGetAttribute(forAttr));
+ }
-static inline TreeScope* treeScopeOfParent(Node* node, ContainerNode* insertionPoint)
-{
- if (Node* parent = node->parentNode())
- parent->treeScope();
- return insertionPoint->treeScope();
+ return InsertionDone;
}
-
void Element::removedFrom(ContainerNode* insertionPoint)
{
#if ENABLE(FULLSCREEN_API)
@@ -986,11 +985,17 @@ void Element::removedFrom(ContainerNode* insertionPoint)
if (insertionPoint->inDocument()) {
const AtomicString& idValue = getIdAttribute();
if (!idValue.isNull() && inDocument())
- updateId(treeScopeOfParent(this, insertionPoint), idValue, nullAtom);
+ updateId(insertionPoint->treeScope(), idValue, nullAtom);
const AtomicString& nameValue = getNameAttribute();
if (!nameValue.isNull())
updateName(nameValue, nullAtom);
+
+ if (hasTagName(labelTag)) {
+ TreeScope* treeScope = insertionPoint->treeScope();
+ if (treeScope->shouldCacheLabelsByForAttribute())
+ updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom);
+ }
}
ContainerNode::removedFrom(insertionPoint);
@@ -1011,7 +1016,7 @@ void Element::attach()
if (ElementShadow* shadow = this->shadow()) {
parentPusher.push();
shadow->attach();
- attachChildrenIfNeeded();
+ attachChildren();
attachAsNode();
} else {
if (firstChild())
@@ -2133,12 +2138,33 @@ bool Element::hasNamedNodeMap() const
}
#endif
+void Element::updateLabel(TreeScope* scope, const AtomicString& oldForAttributeValue, const AtomicString& newForAttributeValue)
+{
+ ASSERT(hasTagName(labelTag));
+
+ if (!inDocument())
+ return;
+
+ if (oldForAttributeValue == newForAttributeValue)
+ return;
+
+ if (!oldForAttributeValue.isEmpty())
+ scope->removeLabel(oldForAttributeValue, static_cast<HTMLLabelElement*>(this));
+ if (!newForAttributeValue.isEmpty())
+ scope->addLabel(newForAttributeValue, static_cast<HTMLLabelElement*>(this));
+}
+
void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue)
{
if (isIdAttributeName(name))
updateId(oldValue, newValue);
else if (name == HTMLNames::nameAttr)
updateName(oldValue, newValue);
+ else if (name == HTMLNames::forAttr && hasTagName(labelTag)) {
+ TreeScope* scope = treeScope();
+ if (scope->shouldCacheLabelsByForAttribute())
+ updateLabel(scope, oldValue, newValue);
+ }
#if ENABLE(MUTATION_OBSERVERS)
if (OwnPtr<MutationObserverInterestGroup> recipients = MutationObserverInterestGroup::createForAttributesMutation(this, name))
diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h
index 58e297d15..519c50d77 100644
--- a/Source/WebCore/dom/Element.h
+++ b/Source/WebCore/dom/Element.h
@@ -315,6 +315,7 @@ public:
void updateId(const AtomicString& oldId, const AtomicString& newId);
void updateId(TreeScope*, const AtomicString& oldId, const AtomicString& newId);
void updateName(const AtomicString& oldName, const AtomicString& newName);
+ void updateLabel(TreeScope*, const AtomicString& oldForAttributeValue, const AtomicString& newForAttributeValue);
void removeCachedHTMLCollection(HTMLCollection*, CollectionType);
diff --git a/Source/WebCore/dom/QualifiedName.cpp b/Source/WebCore/dom/QualifiedName.cpp
index 783604732..daf11ce0c 100644
--- a/Source/WebCore/dom/QualifiedName.cpp
+++ b/Source/WebCore/dom/QualifiedName.cpp
@@ -135,6 +135,12 @@ void QualifiedName::init()
}
}
+const QualifiedName& nullQName()
+{
+ DEFINE_STATIC_LOCAL(QualifiedName, nullName, (nullAtom, nullAtom, nullAtom));
+ return nullName;
+}
+
const AtomicString& QualifiedName::localNameUpper() const
{
if (!m_impl->m_localNameUpper)
@@ -158,6 +164,12 @@ void QualifiedName::QualifiedNameImpl::reportMemoryUsage(MemoryObjectInfo* memor
info.addMember(m_localNameUpper);
}
+unsigned QualifiedName::QualifiedNameImpl::computeHash() const
+{
+ QualifiedNameComponents components = { m_prefix.impl(), m_localName.impl(), m_namespace.impl() };
+ return hashComponents(components);
+}
+
void createQualifiedName(void* targetAddress, const char* name, unsigned nameLength, const AtomicString& nameNamespace)
{
AtomicString atomicName(name, nameLength, AtomicString::ConstructFromLiteral);
diff --git a/Source/WebCore/dom/QualifiedName.h b/Source/WebCore/dom/QualifiedName.h
index 28fab552c..cb84611a3 100644
--- a/Source/WebCore/dom/QualifiedName.h
+++ b/Source/WebCore/dom/QualifiedName.h
@@ -44,6 +44,9 @@ public:
return adoptRef(new QualifiedNameImpl(prefix, localName, namespaceURI));
}
+ unsigned computeHash() const;
+
+ mutable unsigned m_existingHash;
const AtomicString m_prefix;
const AtomicString m_localName;
const AtomicString m_namespace;
@@ -53,7 +56,8 @@ public:
private:
QualifiedNameImpl(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI)
- : m_prefix(prefix)
+ : m_existingHash(0)
+ , m_prefix(prefix)
, m_localName(localName)
, m_namespace(namespaceURI)
{
@@ -110,6 +114,8 @@ extern const QualifiedName anyName;
inline const QualifiedName& anyQName() { return anyName; }
#endif
+const QualifiedName& nullQName();
+
inline bool operator==(const AtomicString& a, const QualifiedName& q) { return a == q.localName(); }
inline bool operator!=(const AtomicString& a, const QualifiedName& q) { return a != q.localName(); }
inline bool operator==(const QualifiedName& q, const AtomicString& a) { return a == q.localName(); }
@@ -125,8 +131,9 @@ struct QualifiedNameHash {
static unsigned hash(const QualifiedName::QualifiedNameImpl* name)
{
- QualifiedNameComponents c = { name->m_prefix.impl(), name->m_localName.impl(), name->m_namespace.impl() };
- return hashComponents(c);
+ if (!name->m_existingHash)
+ name->m_existingHash = name->computeHash();
+ return name->m_existingHash;
}
static bool equal(const QualifiedName& a, const QualifiedName& b) { return a == b; }
@@ -150,7 +157,7 @@ namespace WTF {
template<> struct HashTraits<WebCore::QualifiedName> : SimpleClassHashTraits<WebCore::QualifiedName> {
static const bool emptyValueIsZero = false;
- static WebCore::QualifiedName emptyValue() { return WebCore::QualifiedName(nullAtom, nullAtom, nullAtom); }
+ static WebCore::QualifiedName emptyValue() { return WebCore::nullQName(); }
};
}
diff --git a/Source/WebCore/dom/ShadowRoot.cpp b/Source/WebCore/dom/ShadowRoot.cpp
index 5180a1c22..0da9f27a9 100644
--- a/Source/WebCore/dom/ShadowRoot.cpp
+++ b/Source/WebCore/dom/ShadowRoot.cpp
@@ -215,7 +215,7 @@ void ShadowRoot::attach()
{
StyleResolver* styleResolver = document()->styleResolver();
styleResolver->pushParentShadowRoot(this);
- attachChildrenIfNeeded();
+ attachChildren();
attachAsNode();
styleResolver->popParentShadowRoot(this);
}
diff --git a/Source/WebCore/dom/TreeScope.cpp b/Source/WebCore/dom/TreeScope.cpp
index afd343fb6..ec723d3da 100644
--- a/Source/WebCore/dom/TreeScope.cpp
+++ b/Source/WebCore/dom/TreeScope.cpp
@@ -36,6 +36,7 @@
#include "Frame.h"
#include "HTMLAnchorElement.h"
#include "HTMLFrameOwnerElement.h"
+#include "HTMLLabelElement.h"
#include "HTMLMapElement.h"
#include "HTMLNames.h"
#include "IdTargetObserverRegistry.h"
@@ -55,6 +56,7 @@ using namespace HTMLNames;
TreeScope::TreeScope(ContainerNode* rootNode)
: m_rootNode(rootNode)
, m_parentTreeScope(0)
+ , m_shouldCacheLabelsByForAttribute(false)
, m_idTargetObserverRegistry(IdTargetObserverRegistry::create())
{
ASSERT(rootNode);
@@ -72,6 +74,7 @@ void TreeScope::destroyTreeScopeData()
{
m_elementsById.clear();
m_imageMapsByName.clear();
+ m_labelsByForAttribute.clear();
}
void TreeScope::setParentTreeScope(TreeScope* newParentScope)
@@ -144,6 +147,36 @@ HTMLMapElement* TreeScope::getImageMap(const String& url) const
return static_cast<HTMLMapElement*>(m_imageMapsByName.getElementByMapName(AtomicString(name).impl(), this));
}
+void TreeScope::addLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element)
+{
+ m_labelsByForAttribute.add(forAttributeValue.impl(), element);
+}
+
+void TreeScope::removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element)
+{
+ m_labelsByForAttribute.remove(forAttributeValue.impl(), element);
+}
+
+HTMLLabelElement* TreeScope::labelElementForId(const AtomicString& forAttributeValue)
+{
+ if (!m_shouldCacheLabelsByForAttribute) {
+ m_shouldCacheLabelsByForAttribute = true;
+ for (Node* node = rootNode(); node; node = node->traverseNextNode()) {
+ if (node->hasTagName(labelTag)) {
+ HTMLLabelElement* label = static_cast<HTMLLabelElement*>(node);
+ const AtomicString& forValue = label->fastGetAttribute(forAttr);
+ if (!forValue.isEmpty())
+ addLabel(forValue, label);
+ }
+ }
+ }
+
+ if (forAttributeValue.isEmpty())
+ return 0;
+
+ return static_cast<HTMLLabelElement*>(m_labelsByForAttribute.getElementByLabelForAttribute(forAttributeValue.impl(), this));
+}
+
DOMSelection* TreeScope::getSelection() const
{
if (!rootNode()->document()->frame())
diff --git a/Source/WebCore/dom/TreeScope.h b/Source/WebCore/dom/TreeScope.h
index d9758b028..9cae54de8 100644
--- a/Source/WebCore/dom/TreeScope.h
+++ b/Source/WebCore/dom/TreeScope.h
@@ -35,6 +35,7 @@ namespace WebCore {
class ContainerNode;
class DOMSelection;
class Element;
+class HTMLLabelElement;
class HTMLMapElement;
class IdTargetObserverRegistry;
class Node;
@@ -62,6 +63,12 @@ public:
void removeImageMap(HTMLMapElement*);
HTMLMapElement* getImageMap(const String& url) const;
+ // For accessibility.
+ bool shouldCacheLabelsByForAttribute() const { return m_shouldCacheLabelsByForAttribute; }
+ void addLabel(const AtomicString& forAttributeValue, HTMLLabelElement*);
+ void removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement*);
+ HTMLLabelElement* labelElementForId(const AtomicString& forAttributeValue);
+
DOMSelection* getSelection() const;
// Find first anchor with the given name.
@@ -94,6 +101,9 @@ private:
DocumentOrderedMap m_elementsById;
DocumentOrderedMap m_imageMapsByName;
+ DocumentOrderedMap m_labelsByForAttribute;
+ bool m_shouldCacheLabelsByForAttribute;
+
OwnPtr<IdTargetObserverRegistry> m_idTargetObserverRegistry;
mutable RefPtr<DOMSelection> m_selection;
diff --git a/Source/WebCore/dom/WheelEvent.cpp b/Source/WebCore/dom/WheelEvent.cpp
index e76c33ace..e76c33ace 100755..100644
--- a/Source/WebCore/dom/WheelEvent.cpp
+++ b/Source/WebCore/dom/WheelEvent.cpp
diff --git a/Source/WebCore/dom/WheelEvent.h b/Source/WebCore/dom/WheelEvent.h
index 13576890d..13576890d 100755..100644
--- a/Source/WebCore/dom/WheelEvent.h
+++ b/Source/WebCore/dom/WheelEvent.h
diff --git a/Source/WebCore/editing/ReplaceSelectionCommand.cpp b/Source/WebCore/editing/ReplaceSelectionCommand.cpp
index 0029335e7..c2b219878 100644
--- a/Source/WebCore/editing/ReplaceSelectionCommand.cpp
+++ b/Source/WebCore/editing/ReplaceSelectionCommand.cpp
@@ -1265,7 +1265,7 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P
if (positionOnlyToBeUpdated.containerNode() == text)
positionOnlyToBeUpdated.moveToOffset(previous->length() + positionOnlyToBeUpdated.offsetInContainerNode());
else if (positionOnlyToBeUpdated.containerNode() == previous)
- positionOnlyToBeUpdated.moveToPosition(text, position.offsetInContainerNode());
+ positionOnlyToBeUpdated.moveToPosition(text, positionOnlyToBeUpdated.offsetInContainerNode());
} else
updatePositionForNodeRemoval(positionOnlyToBeUpdated, previous.get());
@@ -1273,13 +1273,14 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P
}
if (text->nextSibling() && text->nextSibling()->isTextNode()) {
RefPtr<Text> next = toText(text->nextSibling());
- insertTextIntoNode(text, text->length(), next->data());
+ unsigned originalLength = text->length();
+ insertTextIntoNode(text, originalLength, next->data());
if (!positionIsOffsetInAnchor)
updatePositionForNodeRemoval(position, next.get());
if (positionOnlyToBeUpdatedIsOffsetInAnchor && positionOnlyToBeUpdated.containerNode() == next)
- positionOnlyToBeUpdated.moveToPosition(text, text->length() + position.offsetInContainerNode());
+ positionOnlyToBeUpdated.moveToPosition(text, originalLength + positionOnlyToBeUpdated.offsetInContainerNode());
else
updatePositionForNodeRemoval(positionOnlyToBeUpdated, next.get());
diff --git a/Source/WebCore/html/BaseTextInputType.cpp b/Source/WebCore/html/BaseTextInputType.cpp
index dfc823d87..9a9540f70 100644
--- a/Source/WebCore/html/BaseTextInputType.cpp
+++ b/Source/WebCore/html/BaseTextInputType.cpp
@@ -55,4 +55,9 @@ bool BaseTextInputType::supportsPlaceholder() const
return true;
}
+bool BaseTextInputType::supportsSelectionAPI() const
+{
+ return true;
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/html/BaseTextInputType.h b/Source/WebCore/html/BaseTextInputType.h
index b2a56c9a4..9a2efe07f 100644
--- a/Source/WebCore/html/BaseTextInputType.h
+++ b/Source/WebCore/html/BaseTextInputType.h
@@ -45,6 +45,7 @@ private:
virtual bool isTextType() const OVERRIDE;
virtual bool patternMismatch(const String&) const OVERRIDE;
virtual bool supportsPlaceholder() const OVERRIDE;
+ virtual bool supportsSelectionAPI() const OVERRIDE;
};
} // namespace WebCore
diff --git a/Source/WebCore/html/DateTimeInputType.cpp b/Source/WebCore/html/DateTimeInputType.cpp
index 1746a13cf..c4c0473ba 100644
--- a/Source/WebCore/html/DateTimeInputType.cpp
+++ b/Source/WebCore/html/DateTimeInputType.cpp
@@ -160,6 +160,14 @@ void DateTimeInputType::setupLayoutParameters(DateTimeEditElement::LayoutParamet
}
#endif
+String DateTimeInputType::sanitizeValue(const String& proposedValue) const
+{
+ DateComponents date;
+ if (!parseToDateComponents(proposedValue, &date))
+ return String();
+ return date.toString();
+}
+
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/DateTimeInputType.h b/Source/WebCore/html/DateTimeInputType.h
index ee3842019..b0dda1049 100644
--- a/Source/WebCore/html/DateTimeInputType.h
+++ b/Source/WebCore/html/DateTimeInputType.h
@@ -57,6 +57,7 @@ private:
virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE;
virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE;
virtual bool isDateTimeField() const OVERRIDE;
+ virtual String sanitizeValue(const String&) const OVERRIDE;
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
// BaseMultipleFieldsDateAndTimeInputType functions
diff --git a/Source/WebCore/html/EmailInputType.cpp b/Source/WebCore/html/EmailInputType.cpp
index 2395fc82f..cad4a3e0b 100644
--- a/Source/WebCore/html/EmailInputType.cpp
+++ b/Source/WebCore/html/EmailInputType.cpp
@@ -93,6 +93,11 @@ bool EmailInputType::isEmailField() const
return true;
}
+bool EmailInputType::supportsSelectionAPI() const
+{
+ return false;
+}
+
String EmailInputType::sanitizeValue(const String& proposedValue) const
{
String noLineBreakValue = proposedValue.removeCharacters(isHTMLLineBreak);
diff --git a/Source/WebCore/html/EmailInputType.h b/Source/WebCore/html/EmailInputType.h
index e9a7b9ac6..2d45347c7 100644
--- a/Source/WebCore/html/EmailInputType.h
+++ b/Source/WebCore/html/EmailInputType.h
@@ -46,6 +46,7 @@ private:
virtual bool typeMismatch() const OVERRIDE;
virtual String typeMismatchText() const OVERRIDE;
virtual bool isEmailField() const OVERRIDE;
+ virtual bool supportsSelectionAPI() const OVERRIDE;
virtual String sanitizeValue(const String&) const OVERRIDE;
};
diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp
index f9e3ebc38..7b777be13 100644
--- a/Source/WebCore/html/HTMLAnchorElement.cpp
+++ b/Source/WebCore/html/HTMLAnchorElement.cpp
@@ -35,7 +35,6 @@
#include "HTMLParserIdioms.h"
#include "KeyboardEvent.h"
#include "MouseEvent.h"
-#include "Page.h"
#include "PingLoader.h"
#include "RenderImage.h"
#include "SecurityOrigin.h"
@@ -227,12 +226,6 @@ void HTMLAnchorElement::parseAttribute(const Attribute& attribute)
if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "https") || parsedURL.startsWith("//"))
prefetchDNS(document()->completeURL(parsedURL).host());
}
- if (document()->page() && !document()->page()->javaScriptURLsAreAllowed() && protocolIsJavaScript(parsedURL)) {
- clearIsLink();
- // FIXME: This is horribly factored.
- if (Attribute* hrefAttribute = getAttributeItem(hrefAttr))
- hrefAttribute->setValue(nullAtom);
- }
}
invalidateCachedVisitedLinkHash();
} else if (attribute.name() == nameAttr || attribute.name() == titleAttr) {
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index 027f60f5e..c4a8bf675 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -1877,4 +1877,24 @@ void ListAttributeTargetObserver::idTargetChanged()
}
#endif
+void HTMLInputElement::setRangeText(const String& replacement, ExceptionCode& ec)
+{
+ if (!m_inputType->supportsSelectionAPI()) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+
+ HTMLTextFormControlElement::setRangeText(replacement, ec);
+}
+
+void HTMLInputElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode& ec)
+{
+ if (!m_inputType->supportsSelectionAPI()) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+
+ HTMLTextFormControlElement::setRangeText(replacement, start, end, selectionMode, ec);
+}
+
} // namespace
diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h
index 4184dc977..ac013d980 100644
--- a/Source/WebCore/html/HTMLInputElement.h
+++ b/Source/WebCore/html/HTMLInputElement.h
@@ -287,6 +287,9 @@ public:
static Vector<FileChooserFileInfo> filesFromFileInputFormControlState(const FormControlState&);
+ virtual void setRangeText(const String& replacement, ExceptionCode&) OVERRIDE;
+ virtual void setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode&) OVERRIDE;
+
protected:
HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
void createShadowSubtree();
diff --git a/Source/WebCore/html/HTMLInputElement.idl b/Source/WebCore/html/HTMLInputElement.idl
index 3c360477a..4a86fe23f 100644
--- a/Source/WebCore/html/HTMLInputElement.idl
+++ b/Source/WebCore/html/HTMLInputElement.idl
@@ -78,6 +78,13 @@ interface HTMLInputElement : HTMLElement {
[Custom] attribute long selectionStart;
[Custom] attribute long selectionEnd;
[Custom] attribute DOMString selectionDirection;
+
+ void setRangeText(in DOMString replacement) raises(DOMException);
+ void setRangeText(in DOMString replacement,
+ in unsigned long start,
+ in unsigned long end,
+ in [Optional=DefaultIsNullString] DOMString selectionMode) raises(DOMException);
+
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
[Custom] void setSelectionRange(in long start, in long end);
#else
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index ebeee1b40..753242110 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -1516,6 +1516,29 @@ void HTMLMediaElement::mediaPlayerNetworkStateChanged(MediaPlayer*)
endProcessingMediaPlayerCallback();
}
+static void logMediaLoadRequest(Page* page, const String& mediaEngine, const String& errorMessage, bool succeeded)
+{
+ if (!page || !page->settings()->diagnosticLoggingEnabled())
+ return;
+
+ ChromeClient* client = page->chrome()->client();
+
+ if (!succeeded) {
+ client->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), errorMessage, DiagnosticLoggingKeys::failKey());
+ return;
+ }
+
+ client->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadedKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
+
+ if (!page->hasSeenAnyMediaEngine())
+ client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
+
+ if (!page->hasSeenMediaEngine(mediaEngine))
+ client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsMediaEngineKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
+
+ page->sawMediaEngine(mediaEngine);
+}
+
static String stringForNetworkState(MediaPlayer::NetworkState state)
{
switch (state) {
@@ -1567,8 +1590,7 @@ void HTMLMediaElement::mediaLoadingFailed(MediaPlayer::NetworkState error)
mediaControls()->reportedError();
}
- if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled())
- document()->page()->chrome()->client()->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), stringForNetworkState(error), DiagnosticLoggingKeys::failKey());
+ logMediaLoadRequest(document()->page(), String(), stringForNetworkState(error), false);
}
void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
@@ -1698,8 +1720,7 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
if (renderer())
renderer()->updateFromElement();
- if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled())
- document()->page()->chrome()->client()->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadedKey(), m_player->engineDescription(), DiagnosticLoggingKeys::noopKey());
+ logMediaLoadRequest(document()->page(), m_player->engineDescription(), String(), true);
}
bool shouldUpdateDisplayState = false;
diff --git a/Source/WebCore/html/HTMLPlugInImageElement.cpp b/Source/WebCore/html/HTMLPlugInImageElement.cpp
index 7e7c27513..f1720b8d5 100644
--- a/Source/WebCore/html/HTMLPlugInImageElement.cpp
+++ b/Source/WebCore/html/HTMLPlugInImageElement.cpp
@@ -50,7 +50,9 @@ HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Doc
{
setHasCustomCallbacks();
- if (document->page() && document->page()->settings()->plugInSnapshottingEnabled())
+ if (document->page()
+ && document->page()->settings()->plugInSnapshottingEnabled()
+ && !ScriptController::processingUserGesture())
setDisplayState(WaitingForSnapshot);
}
diff --git a/Source/WebCore/html/HTMLTextAreaElement.idl b/Source/WebCore/html/HTMLTextAreaElement.idl
index df8867ace..ce9302676 100644
--- a/Source/WebCore/html/HTMLTextAreaElement.idl
+++ b/Source/WebCore/html/HTMLTextAreaElement.idl
@@ -50,6 +50,13 @@ interface HTMLTextAreaElement : HTMLElement {
attribute long selectionStart;
attribute long selectionEnd;
attribute DOMString selectionDirection;
+
+ void setRangeText(in DOMString replacement) raises(DOMException);
+ void setRangeText(in DOMString replacement,
+ in unsigned long start,
+ in unsigned long end,
+ in [Optional=DefaultIsNullString] DOMString selectionMode) raises(DOMException);
+
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
void setSelectionRange(in long start, in long end);
#else
diff --git a/Source/WebCore/html/HTMLTextFormControlElement.cpp b/Source/WebCore/html/HTMLTextFormControlElement.cpp
index fcde35ae6..7aacfcb67 100644
--- a/Source/WebCore/html/HTMLTextFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLTextFormControlElement.cpp
@@ -229,6 +229,66 @@ static inline bool hasVisibleTextArea(RenderTextControl* textControl, HTMLElemen
return textControl->style()->visibility() != HIDDEN && innerText && innerText->renderer() && innerText->renderBox()->height();
}
+
+void HTMLTextFormControlElement::setRangeText(const String& replacement, ExceptionCode& ec)
+{
+ setRangeText(replacement, selectionStart(), selectionEnd(), String(), ec);
+}
+
+void HTMLTextFormControlElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode& ec)
+{
+ if (start > end) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ String text = innerTextValue();
+ unsigned textLength = text.length();
+ unsigned replacementLength = replacement.length();
+ unsigned newSelectionStart = selectionStart();
+ unsigned newSelectionEnd = selectionEnd();
+
+ start = std::min(start, textLength);
+ end = std::min(end, textLength);
+
+ if (start < end)
+ text.replace(start, end - start, replacement);
+ else
+ text.insert(replacement, start);
+
+ setInnerTextValue(text);
+
+ // FIXME: What should happen to the value (as in value()) if there's no renderer?
+ if (!renderer())
+ return;
+
+ subtreeHasChanged();
+
+ if (equalIgnoringCase(selectionMode, "select")) {
+ newSelectionStart = start;
+ newSelectionEnd = start + replacementLength;
+ } else if (equalIgnoringCase(selectionMode, "start"))
+ newSelectionStart = newSelectionEnd = start;
+ else if (equalIgnoringCase(selectionMode, "end"))
+ newSelectionStart = newSelectionEnd = start + replacementLength;
+ else {
+ // Default is "preserve".
+ long delta = replacementLength - (end - start);
+
+ if (newSelectionStart > end)
+ newSelectionStart += delta;
+ else if (newSelectionStart > start)
+ newSelectionStart = start;
+
+ if (newSelectionEnd > end)
+ newSelectionEnd += delta;
+ else if (newSelectionEnd > start)
+ newSelectionEnd = start + replacementLength;
+ }
+
+ setSelectionRange(newSelectionStart, newSelectionEnd, SelectionHasNoDirection);
+}
+
void HTMLTextFormControlElement::setSelectionRange(int start, int end, const String& directionString)
{
TextFieldSelectionDirection direction = SelectionHasNoDirection;
diff --git a/Source/WebCore/html/HTMLTextFormControlElement.h b/Source/WebCore/html/HTMLTextFormControlElement.h
index f843d6dee..c7e869165 100644
--- a/Source/WebCore/html/HTMLTextFormControlElement.h
+++ b/Source/WebCore/html/HTMLTextFormControlElement.h
@@ -64,6 +64,8 @@ public:
void setSelectionEnd(int);
void setSelectionDirection(const String&);
void select();
+ virtual void setRangeText(const String& replacement, ExceptionCode&);
+ virtual void setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode&);
void setSelectionRange(int start, int end, const String& direction);
void setSelectionRange(int start, int end, TextFieldSelectionDirection = SelectionHasNoDirection);
PassRefPtr<Range> selection() const;
diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp
index 38d79eea8..4195e8ed7 100644
--- a/Source/WebCore/html/InputType.cpp
+++ b/Source/WebCore/html/InputType.cpp
@@ -934,6 +934,11 @@ bool InputType::supportsIndeterminateAppearance() const
return false;
}
+bool InputType::supportsSelectionAPI() const
+{
+ return false;
+}
+
unsigned InputType::height() const
{
return 0;
diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h
index 87a4c12a8..0c2f010b7 100644
--- a/Source/WebCore/html/InputType.h
+++ b/Source/WebCore/html/InputType.h
@@ -306,6 +306,8 @@ public:
virtual bool supportsIndeterminateAppearance() const;
+ virtual bool supportsSelectionAPI() const;
+
// Gets width and height of the input element if the type of the
// element is image. It returns 0 if the element is not image type.
virtual unsigned height() const;
diff --git a/Source/WebCore/html/MonthInputType.cpp b/Source/WebCore/html/MonthInputType.cpp
index b58743878..9bb2f9aef 100644
--- a/Source/WebCore/html/MonthInputType.cpp
+++ b/Source/WebCore/html/MonthInputType.cpp
@@ -154,7 +154,7 @@ String MonthInputType::formatDateTimeFieldsState(const DateTimeFieldsState& date
void MonthInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents& date) const
{
- layoutParameters.dateTimeFormat = monthFormatInLDML();
+ layoutParameters.dateTimeFormat = layoutParameters.localizer.monthFormat();
layoutParameters.fallbackDateTimeFormat = "MM/yyyy";
layoutParameters.minimumYear = fullYear(element()->fastGetAttribute(minAttr));
layoutParameters.maximumYear = fullYear(element()->fastGetAttribute(maxAttr));
diff --git a/Source/WebCore/html/canvas/DataView.cpp b/Source/WebCore/html/canvas/DataView.cpp
index 3e55d3776..3e55d3776 100755..100644
--- a/Source/WebCore/html/canvas/DataView.cpp
+++ b/Source/WebCore/html/canvas/DataView.cpp
diff --git a/Source/WebCore/html/canvas/DataView.idl b/Source/WebCore/html/canvas/DataView.idl
index e4ad072ab..e4ad072ab 100755..100644
--- a/Source/WebCore/html/canvas/DataView.idl
+++ b/Source/WebCore/html/canvas/DataView.idl
diff --git a/Source/WebCore/html/canvas/OESElementIndexUint.cpp b/Source/WebCore/html/canvas/OESElementIndexUint.cpp
new file mode 100644
index 000000000..f9df0bc15
--- /dev/null
+++ b/Source/WebCore/html/canvas/OESElementIndexUint.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEBGL)
+
+#include "OESElementIndexUint.h"
+
+namespace WebCore {
+
+OESElementIndexUint::OESElementIndexUint(WebGLRenderingContext* context)
+ : WebGLExtension(context)
+{
+}
+
+OESElementIndexUint::~OESElementIndexUint()
+{
+}
+
+WebGLExtension::ExtensionName OESElementIndexUint::getName() const
+{
+ return OESElementIndexUintName;
+}
+
+PassOwnPtr<OESElementIndexUint> OESElementIndexUint::create(WebGLRenderingContext* context)
+{
+ return adoptPtr(new OESElementIndexUint(context));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGL)
diff --git a/Source/WebCore/html/canvas/OESElementIndexUint.h b/Source/WebCore/html/canvas/OESElementIndexUint.h
new file mode 100644
index 000000000..c2d42873a
--- /dev/null
+++ b/Source/WebCore/html/canvas/OESElementIndexUint.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef OESElementIndexUint_h
+#define OESElementIndexUint_h
+
+#include "WebGLExtension.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class OESElementIndexUint : public WebGLExtension {
+public:
+ static PassOwnPtr<OESElementIndexUint> create(WebGLRenderingContext*);
+
+ virtual ~OESElementIndexUint();
+ virtual ExtensionName getName() const;
+
+private:
+ OESElementIndexUint(WebGLRenderingContext*);
+};
+
+} // namespace WebCore
+
+#endif // OESElementIndexUint_h
diff --git a/Source/WebCore/html/canvas/OESElementIndexUint.idl b/Source/WebCore/html/canvas/OESElementIndexUint.idl
new file mode 100644
index 000000000..4a5640153
--- /dev/null
+++ b/Source/WebCore/html/canvas/OESElementIndexUint.idl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module html {
+ interface [
+ Conditional=WEBGL,
+ JSGenerateIsReachable=ImplContext,
+ OmitConstructor
+ ] OESElementIndexUint {
+ };
+}
diff --git a/Source/WebCore/html/canvas/WebGLExtension.h b/Source/WebCore/html/canvas/WebGLExtension.h
index 6968a02b4..ffec616ca 100644
--- a/Source/WebCore/html/canvas/WebGLExtension.h
+++ b/Source/WebCore/html/canvas/WebGLExtension.h
@@ -44,6 +44,7 @@ public:
WebGLDebugShadersName,
WebKitWebGLCompressedTextureS3TCName, // WEBKIT_ prefix until extension is official
WebKitWebGLDepthTextureName, // WEBKIT_ prefix until extension is official
+ OESElementIndexUintName,
};
void ref() { m_context->ref(); }
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
index 749d51914..f4c7ae128 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -45,6 +45,7 @@
#include "ImageData.h"
#include "IntSize.h"
#include "NotImplemented.h"
+#include "OESElementIndexUint.h"
#include "OESStandardDerivatives.h"
#include "OESTextureFloat.h"
#include "OESVertexArrayObject.h"
@@ -1690,7 +1691,18 @@ bool WebGLRenderingContext::validateElementArraySize(GC3Dsizei count, GC3Denum t
if (offset < 0)
return false;
- if (type == GraphicsContext3D::UNSIGNED_SHORT) {
+ if (type == GraphicsContext3D::UNSIGNED_INT) {
+ // For an unsigned int array, offset must be divisible by 4 for alignment reasons.
+ if (offset % 4)
+ return false;
+
+ // Make uoffset an element offset.
+ offset /= 4;
+
+ GC3Dsizeiptr n = elementArrayBuffer->byteLength() / 4;
+ if (offset > n || count > n - offset)
+ return false;
+ } else if (type == GraphicsContext3D::UNSIGNED_SHORT) {
// For an unsigned short array, offset must be divisible by 2 for alignment reasons.
if (offset % 2)
return false;
@@ -1709,7 +1721,7 @@ bool WebGLRenderingContext::validateElementArraySize(GC3Dsizei count, GC3Denum t
return true;
}
-bool WebGLRenderingContext::validateIndexArrayConservative(GC3Denum type, int& numElementsRequired)
+bool WebGLRenderingContext::validateIndexArrayConservative(GC3Denum type, unsigned& numElementsRequired)
{
// Performs conservative validation by caching a maximum index of
// the given type per element array buffer. If all of the bound
@@ -1746,6 +1758,15 @@ bool WebGLRenderingContext::validateIndexArrayConservative(GC3Denum type, int& n
maxIndex = max(maxIndex, static_cast<int>(p[i]));
break;
}
+ case GraphicsContext3D::UNSIGNED_INT: {
+ if (!m_oesElementIndexUint)
+ return false;
+ numElements /= sizeof(GC3Duint);
+ const GC3Duint* p = static_cast<const GC3Duint*>(buffer->data());
+ for (GC3Dsizeiptr i = 0; i < numElements; i++)
+ maxIndex = max(maxIndex, static_cast<int>(p[i]));
+ break;
+ }
default:
return false;
}
@@ -1762,10 +1783,10 @@ bool WebGLRenderingContext::validateIndexArrayConservative(GC3Denum type, int& n
return false;
}
-bool WebGLRenderingContext::validateIndexArrayPrecise(GC3Dsizei count, GC3Denum type, GC3Dintptr offset, int& numElementsRequired)
+bool WebGLRenderingContext::validateIndexArrayPrecise(GC3Dsizei count, GC3Denum type, GC3Dintptr offset, unsigned& numElementsRequired)
{
ASSERT(count >= 0 && offset >= 0);
- int lastIndex = -1;
+ unsigned lastIndex = 0;
RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer();
@@ -1783,7 +1804,16 @@ bool WebGLRenderingContext::validateIndexArrayPrecise(GC3Dsizei count, GC3Denum
unsigned long uoffset = offset;
unsigned long n = count;
- if (type == GraphicsContext3D::UNSIGNED_SHORT) {
+ if (type == GraphicsContext3D::UNSIGNED_INT) {
+ // Make uoffset an element offset.
+ uoffset /= sizeof(GC3Duint);
+ const GC3Duint* p = static_cast<const GC3Duint*>(elementArrayBuffer->elementArrayBuffer()->data()) + uoffset;
+ while (n-- > 0) {
+ if (*p > lastIndex)
+ lastIndex = *p;
+ ++p;
+ }
+ } else if (type == GraphicsContext3D::UNSIGNED_SHORT) {
// Make uoffset an element offset.
uoffset /= sizeof(GC3Dushort);
const GC3Dushort* p = static_cast<const GC3Dushort*>(elementArrayBuffer->elementArrayBuffer()->data()) + uoffset;
@@ -1806,7 +1836,7 @@ bool WebGLRenderingContext::validateIndexArrayPrecise(GC3Dsizei count, GC3Denum
return numElementsRequired > 0;
}
-bool WebGLRenderingContext::validateRenderingState(int numElementsRequired)
+bool WebGLRenderingContext::validateRenderingState(unsigned numElementsRequired)
{
if (!m_currentProgram)
return false;
@@ -1823,7 +1853,7 @@ bool WebGLRenderingContext::validateRenderingState(int numElementsRequired)
return true;
// Look in each consumed vertex attrib (by the current program) and find the smallest buffer size
- int smallestNumElements = INT_MAX;
+ unsigned smallestNumElements = UINT_MAX;
int numActiveAttribLocations = m_currentProgram->numActiveAttribLocations();
for (int i = 0; i < numActiveAttribLocations; ++i) {
int loc = m_currentProgram->getActiveAttribLocation(i);
@@ -1834,7 +1864,7 @@ bool WebGLRenderingContext::validateRenderingState(int numElementsRequired)
// For the last element, we will only touch the data for the
// element and nothing beyond it.
int bytesRemaining = static_cast<int>(state.bufferBinding->byteLength() - state.offset);
- int numElements = 0;
+ unsigned numElements = 0;
ASSERT(state.stride > 0);
if (bytesRemaining >= state.bytesPerElement)
numElements = 1 + (bytesRemaining - state.bytesPerElement) / state.stride;
@@ -1934,6 +1964,11 @@ void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denu
case GraphicsContext3D::UNSIGNED_BYTE:
case GraphicsContext3D::UNSIGNED_SHORT:
break;
+ case GraphicsContext3D::UNSIGNED_INT:
+ if (m_oesElementIndexUint)
+ break;
+ synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "drawElements", "invalid type");
+ return;
default:
synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "drawElements", "invalid type");
return;
@@ -1954,7 +1989,7 @@ void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denu
return;
}
- int numElements = 0;
+ unsigned numElements = 0;
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
// Ensure we have a valid rendering state
if (!validateElementArraySize(count, type, static_cast<GC3Dintptr>(offset))) {
@@ -2315,6 +2350,14 @@ WebGLExtension* WebGLRenderingContext::getExtension(const String& name)
}
return m_oesVertexArrayObject.get();
}
+ if (equalIgnoringCase(name, "OES_element_index_uint")
+ && m_context->getExtensions()->supports("GL_OES_element_index_uint")) {
+ if (!m_oesElementIndexUint) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_element_index_uint");
+ m_oesElementIndexUint = OESElementIndexUint::create(this);
+ }
+ return m_oesElementIndexUint.get();
+ }
if (equalIgnoringCase(name, "WEBKIT_WEBGL_lose_context")
// FIXME: remove this after a certain grace period.
|| equalIgnoringCase(name, "WEBKIT_lose_context")) {
@@ -2816,6 +2859,8 @@ Vector<String> WebGLRenderingContext::getSupportedExtensions()
result.append("WEBKIT_EXT_texture_filter_anisotropic");
if (m_context->getExtensions()->supports("GL_OES_vertex_array_object"))
result.append("OES_vertex_array_object");
+ if (m_context->getExtensions()->supports("GL_OES_element_index_uint"))
+ result.append("OES_element_index_uint");
result.append("WEBKIT_WEBGL_lose_context");
if (WebGLCompressedTextureS3TC::supported(this))
result.append("WEBKIT_WEBGL_compressed_texture_s3tc");
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.h b/Source/WebCore/html/canvas/WebGLRenderingContext.h
index 26fc66c5b..86eb829f2 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.h
@@ -49,6 +49,7 @@ class IntSize;
class OESStandardDerivatives;
class OESTextureFloat;
class OESVertexArrayObject;
+class OESElementIndexUint;
class WebGLActiveInfo;
class WebGLBuffer;
class WebGLContextGroup;
@@ -358,12 +359,12 @@ public:
bool validateElementArraySize(GC3Dsizei count, GC3Denum type, GC3Dintptr offset);
// Conservative but quick index validation
- bool validateIndexArrayConservative(GC3Denum type, int& numElementsRequired);
+ bool validateIndexArrayConservative(GC3Denum type, unsigned& numElementsRequired);
// Precise but slow index validation -- only done if conservative checks fail
- bool validateIndexArrayPrecise(GC3Dsizei count, GC3Denum type, GC3Dintptr offset, int& numElementsRequired);
+ bool validateIndexArrayPrecise(GC3Dsizei count, GC3Denum type, GC3Dintptr offset, unsigned& numElementsRequired);
// If numElements <= 0, we only check if each enabled vertex attribute is bound to a buffer.
- bool validateRenderingState(int numElements);
+ bool validateRenderingState(unsigned numElements);
bool validateWebGLObject(const char*, WebGLObject*);
@@ -505,6 +506,7 @@ public:
OwnPtr<OESTextureFloat> m_oesTextureFloat;
OwnPtr<OESStandardDerivatives> m_oesStandardDerivatives;
OwnPtr<OESVertexArrayObject> m_oesVertexArrayObject;
+ OwnPtr<OESElementIndexUint> m_oesElementIndexUint;
OwnPtr<WebGLLoseContext> m_webglLoseContext;
OwnPtr<WebGLDebugRendererInfo> m_webglDebugRendererInfo;
OwnPtr<WebGLDebugShaders> m_webglDebugShaders;
diff --git a/Source/WebCore/html/shadow/ContentDistributor.cpp b/Source/WebCore/html/shadow/ContentDistributor.cpp
index ec367ef2c..6929fdc50 100644
--- a/Source/WebCore/html/shadow/ContentDistributor.cpp
+++ b/Source/WebCore/html/shadow/ContentDistributor.cpp
@@ -58,7 +58,7 @@ void ContentDistributor::distribute(Element* host)
ContentDistribution pool;
for (Node* node = host->firstChild(); node; node = node->nextSibling()) {
- if (!isInsertionPoint(node)) {
+ if (!isHTMLContentElement(node)) {
pool.append(node);
continue;
}
@@ -72,6 +72,7 @@ void ContentDistributor::distribute(Element* host)
pool.append(fallbackNode);
}
}
+
Vector<bool> distributed(pool.size());
distributed.fill(false);
diff --git a/Source/WebCore/html/shadow/DateTimeEditElement.cpp b/Source/WebCore/html/shadow/DateTimeEditElement.cpp
index 338c8633a..1b644d4c9 100644
--- a/Source/WebCore/html/shadow/DateTimeEditElement.cpp
+++ b/Source/WebCore/html/shadow/DateTimeEditElement.cpp
@@ -90,8 +90,10 @@ bool DateTimeEditBuilder::needMillisecondField() const
|| !stepRange().step().remainder(static_cast<int>(msPerSecond)).isZero();
}
-void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int)
+void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int count)
{
+ // In LDML, M and MM are numeric, and MMM, MMMM, and MMMMM are symbolic.
+ const int symbolicMonthThreshold = 3;
Document* const document = m_editElement.document();
switch (fieldType) {
@@ -124,8 +126,19 @@ void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int)
}
case DateTimeFormat::FieldTypeMonth:
- // We always use "MM", two digits month, even if "M", "MMM", "MMMM", or "MMMMM".
- m_editElement.addField(DateTimeMonthFieldElement::create(document, m_editElement, m_parameters.placeholderForMonth));
+ if (count >= symbolicMonthThreshold) {
+ // We always use abbreviations.
+ m_editElement.addField(DateTimeSymbolicMonthFieldElement::create(document, m_editElement, m_parameters.localizer.shortMonthLabels()));
+ } else
+ m_editElement.addField(DateTimeMonthFieldElement::create(document, m_editElement, m_parameters.placeholderForMonth));
+ return;
+
+ case DateTimeFormat::FieldTypeMonthStandAlone:
+ if (count >= symbolicMonthThreshold) {
+ // We always use abbreviations.
+ m_editElement.addField(DateTimeSymbolicMonthFieldElement::create(document, m_editElement, m_parameters.localizer.shortStandAloneMonthLabels()));
+ } else
+ m_editElement.addField(DateTimeMonthFieldElement::create(document, m_editElement, m_parameters.placeholderForMonth));
return;
case DateTimeFormat::FieldTypePeriod:
diff --git a/Source/WebCore/html/shadow/DateTimeFieldElements.cpp b/Source/WebCore/html/shadow/DateTimeFieldElements.cpp
index adcc7227a..b5c9ef1e6 100644
--- a/Source/WebCore/html/shadow/DateTimeFieldElements.cpp
+++ b/Source/WebCore/html/shadow/DateTimeFieldElements.cpp
@@ -381,6 +381,50 @@ void DateTimeSecondFieldElement::setValueAsDateTimeFieldsState(const DateTimeFie
// ----------------------------
+DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement(Document* document, FieldOwner& fieldOwner, const Vector<String>& labels)
+ : DateTimeSymbolicFieldElement(document, fieldOwner, labels)
+{
+}
+
+PassRefPtr<DateTimeSymbolicMonthFieldElement> DateTimeSymbolicMonthFieldElement::create(Document* document, FieldOwner& fieldOwner, const Vector<String>& labels)
+{
+ DEFINE_STATIC_LOCAL(AtomicString, monthPsuedoId, ("-webkit-datetime-edit-month-field"));
+ RefPtr<DateTimeSymbolicMonthFieldElement> field = adoptRef(new DateTimeSymbolicMonthFieldElement(document, fieldOwner, labels));
+ field->initialize(monthPsuedoId, AXMonthFieldText());
+ return field.release();
+}
+
+void DateTimeSymbolicMonthFieldElement::populateDateTimeFieldsState(DateTimeFieldsState& dateTimeFieldsState)
+{
+ if (!hasValue())
+ dateTimeFieldsState.setMonth(DateTimeFieldsState::emptyValue);
+ ASSERT(valueAsInteger() < static_cast<int>(symbolsSize()));
+ dateTimeFieldsState.setMonth(valueAsInteger() + 1);
+}
+
+void DateTimeSymbolicMonthFieldElement::setValueAsDate(const DateComponents& date)
+{
+ setValueAsInteger(date.month());
+}
+
+void DateTimeSymbolicMonthFieldElement::setValueAsDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState, const DateComponents& dateForReadOnlyField)
+{
+ if (!dateTimeFieldsState.hasMonth()) {
+ setEmptyValue(dateForReadOnlyField);
+ return;
+ }
+
+ const unsigned value = dateTimeFieldsState.month() - 1;
+ if (value >= symbolsSize()) {
+ setEmptyValue(dateForReadOnlyField);
+ return;
+ }
+
+ setValueAsInteger(value);
+}
+
+// ----------------------------
+
DateTimeWeekFieldElement::DateTimeWeekFieldElement(Document* document, FieldOwner& fieldOwner)
: DateTimeNumericFieldElement(document, fieldOwner, DateComponents::minimumWeekNumber, DateComponents::maximumWeekNumber, "--")
{
diff --git a/Source/WebCore/html/shadow/DateTimeFieldElements.h b/Source/WebCore/html/shadow/DateTimeFieldElements.h
index 46d51a786..c5b124113 100644
--- a/Source/WebCore/html/shadow/DateTimeFieldElements.h
+++ b/Source/WebCore/html/shadow/DateTimeFieldElements.h
@@ -147,6 +147,21 @@ private:
virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
};
+class DateTimeSymbolicMonthFieldElement : public DateTimeSymbolicFieldElement {
+ WTF_MAKE_NONCOPYABLE(DateTimeSymbolicMonthFieldElement);
+
+public:
+ static PassRefPtr<DateTimeSymbolicMonthFieldElement> create(Document*, FieldOwner&, const Vector<String>&);
+
+private:
+ DateTimeSymbolicMonthFieldElement(Document*, FieldOwner&, const Vector<String>&);
+
+ // DateTimeFieldElement functions.
+ virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL;
+ virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
+ virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
+};
+
class DateTimeWeekFieldElement : public DateTimeNumericFieldElement {
WTF_MAKE_NONCOPYABLE(DateTimeWeekFieldElement);
diff --git a/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h b/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h
index f1eab8eb4..4d926ec02 100644
--- a/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h
+++ b/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h
@@ -38,6 +38,7 @@ class DateTimeSymbolicFieldElement : public DateTimeFieldElement {
protected:
DateTimeSymbolicFieldElement(Document*, FieldOwner&, const Vector<String>&);
+ size_t symbolsSize() const { return m_symbols.size(); }
virtual bool hasValue() const OVERRIDE FINAL;
virtual void setEmptyValue(const DateComponents& dateForReadOnlyField, EventBehavior = DispatchNoEvent) OVERRIDE FINAL;
virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) OVERRIDE FINAL;
diff --git a/Source/WebCore/html/shadow/HTMLContentElement.h b/Source/WebCore/html/shadow/HTMLContentElement.h
index c0452a006..6be48669d 100644
--- a/Source/WebCore/html/shadow/HTMLContentElement.h
+++ b/Source/WebCore/html/shadow/HTMLContentElement.h
@@ -56,6 +56,12 @@ private:
virtual void parseAttribute(const Attribute&) OVERRIDE;
};
+inline bool isHTMLContentElement(const Node* node)
+{
+ ASSERT(node);
+ return node->hasTagName(HTMLNames::contentTag);
+}
+
}
#endif
diff --git a/Source/WebCore/html/shadow/MediaControlElements.cpp b/Source/WebCore/html/shadow/MediaControlElements.cpp
index 7cccd690e..ae3b18b0a 100644
--- a/Source/WebCore/html/shadow/MediaControlElements.cpp
+++ b/Source/WebCore/html/shadow/MediaControlElements.cpp
@@ -156,7 +156,7 @@ void MediaControlPanelElement::startDrag(const LayoutPoint& eventLocation)
if (!frame)
return;
- m_dragStartEventLocation = eventLocation;
+ m_lastDragEventLocation = eventLocation;
frame->eventHandler()->setCapturingMouseEventsNode(this);
@@ -168,8 +168,10 @@ void MediaControlPanelElement::continueDrag(const LayoutPoint& eventLocation)
if (!m_isBeingDragged)
return;
- LayoutSize distanceDragged = eventLocation - m_dragStartEventLocation;
- setPosition(LayoutPoint(distanceDragged.width(), distanceDragged.height()));
+ LayoutSize distanceDragged = eventLocation - m_lastDragEventLocation;
+ m_cumulativeDragOffset.move(distanceDragged);
+ m_lastDragEventLocation = eventLocation;
+ setPosition(m_cumulativeDragOffset);
}
void MediaControlPanelElement::endDrag()
@@ -237,6 +239,9 @@ void MediaControlPanelElement::resetPosition()
ExceptionCode ignored;
classList()->remove("dragged", ignored);
+
+ m_cumulativeDragOffset.setX(0);
+ m_cumulativeDragOffset.setY(0);
}
void MediaControlPanelElement::makeOpaque()
diff --git a/Source/WebCore/html/shadow/MediaControlElements.h b/Source/WebCore/html/shadow/MediaControlElements.h
index effdcee7f..66cb2da6b 100644
--- a/Source/WebCore/html/shadow/MediaControlElements.h
+++ b/Source/WebCore/html/shadow/MediaControlElements.h
@@ -139,7 +139,8 @@ private:
bool m_isBeingDragged;
bool m_isDisplayed;
bool m_opaque;
- LayoutPoint m_dragStartEventLocation;
+ LayoutPoint m_lastDragEventLocation;
+ LayoutPoint m_cumulativeDragOffset;
Timer<MediaControlPanelElement> m_transitionTimer;
};
diff --git a/Source/WebCore/inspector/InspectorClient.h b/Source/WebCore/inspector/InspectorClient.h
index 2d4fb3f26..2a4745a81 100644
--- a/Source/WebCore/inspector/InspectorClient.h
+++ b/Source/WebCore/inspector/InspectorClient.h
@@ -29,6 +29,7 @@
#include "InspectorStateClient.h"
#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
namespace WebCore {
@@ -73,6 +74,7 @@ public:
virtual bool supportsFrameInstrumentation() { return false; }
virtual void getAllocatedObjects(HashSet<const void*>&) { }
+ virtual void dumpUncountedAllocatedObjects(const HashMap<const void*, size_t>&) { }
static bool doDispatchMessageOnFrontendPage(Page* frontendPage, const String& message);
};
diff --git a/Source/WebCore/inspector/InspectorFrontendClient.h b/Source/WebCore/inspector/InspectorFrontendClient.h
index c461fd99c..f7fd85c81 100644
--- a/Source/WebCore/inspector/InspectorFrontendClient.h
+++ b/Source/WebCore/inspector/InspectorFrontendClient.h
@@ -41,6 +41,12 @@ class Event;
class InspectorFrontendClient {
public:
+ enum DockSide {
+ UNDOCKED = 0,
+ DOCKED_TO_RIGHT,
+ DOCKED_TO_BOTTOM
+ };
+
virtual ~InspectorFrontendClient() { }
virtual void windowObjectCleared() = 0;
@@ -54,9 +60,7 @@ public:
virtual void bringToFront() = 0;
virtual void closeWindow() = 0;
- virtual void requestAttachWindow() = 0;
- virtual void requestDetachWindow() = 0;
- virtual void requestSetDockSide(const String&) = 0;
+ virtual void requestSetDockSide(DockSide) = 0;
virtual void changeAttachedWindowHeight(unsigned) = 0;
virtual void openInNewTab(const String& url) = 0;
virtual bool canSave() = 0;
diff --git a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
index 530827353..dbee707c5 100644
--- a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
+++ b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
@@ -148,18 +148,15 @@ void InspectorFrontendClientLocal::frontendLoaded()
m_evaluateOnLoad.clear();
}
-void InspectorFrontendClientLocal::requestAttachWindow()
+void InspectorFrontendClientLocal::requestSetDockSide(DockSide dockSide)
{
- if (!canAttachWindow())
- return;
- attachWindow();
- setAttachedWindow(true);
-}
-
-void InspectorFrontendClientLocal::requestDetachWindow()
-{
- detachWindow();
- setAttachedWindow(false);
+ if (dockSide == UNDOCKED) {
+ detachWindow();
+ setAttachedWindow(false);
+ } else if (canAttachWindow()) {
+ attachWindow();
+ setAttachedWindow(true);
+ }
}
bool InspectorFrontendClientLocal::canAttachWindow()
@@ -214,7 +211,7 @@ void InspectorFrontendClientLocal::moveWindowBy(float x, float y)
void InspectorFrontendClientLocal::setAttachedWindow(bool attached)
{
- evaluateOnLoad(String::format("[\"setAttachedWindow\", %s]", attached ? "true" : "false"));
+ evaluateOnLoad(String::format("[\"setDockSide\", %s]", attached ? "bottom" : "undocked"));
}
void InspectorFrontendClientLocal::restoreAttachedWindowHeight()
diff --git a/Source/WebCore/inspector/InspectorFrontendClientLocal.h b/Source/WebCore/inspector/InspectorFrontendClientLocal.h
index af8493b99..ce36287b1 100644
--- a/Source/WebCore/inspector/InspectorFrontendClientLocal.h
+++ b/Source/WebCore/inspector/InspectorFrontendClientLocal.h
@@ -63,9 +63,7 @@ public:
virtual void moveWindowBy(float x, float y);
- virtual void requestAttachWindow();
- virtual void requestDetachWindow();
- virtual void requestSetDockSide(const String&) { }
+ virtual void requestSetDockSide(DockSide);
virtual void changeAttachedWindowHeight(unsigned);
virtual void openInNewTab(const String& url);
virtual bool canSave() { return false; }
diff --git a/Source/WebCore/inspector/InspectorFrontendHost.cpp b/Source/WebCore/inspector/InspectorFrontendHost.cpp
index e7b02200e..82db0bbfe 100644
--- a/Source/WebCore/inspector/InspectorFrontendHost.cpp
+++ b/Source/WebCore/inspector/InspectorFrontendHost.cpp
@@ -149,22 +149,16 @@ void InspectorFrontendHost::loaded()
m_client->frontendLoaded();
}
-void InspectorFrontendHost::requestAttachWindow()
-{
- if (m_client)
- m_client->requestAttachWindow();
-}
-
-void InspectorFrontendHost::requestDetachWindow()
-{
- if (m_client)
- m_client->requestDetachWindow();
-}
-
void InspectorFrontendHost::requestSetDockSide(const String& side)
{
- if (m_client)
- m_client->requestSetDockSide(side);
+ if (!m_client)
+ return;
+ if (side == "undocked")
+ m_client->requestSetDockSide(InspectorFrontendClient::UNDOCKED);
+ else if (side == "right")
+ m_client->requestSetDockSide(InspectorFrontendClient::DOCKED_TO_RIGHT);
+ else if (side == "bottom")
+ m_client->requestSetDockSide(InspectorFrontendClient::DOCKED_TO_BOTTOM);
}
void InspectorFrontendHost::closeWindow()
@@ -250,6 +244,10 @@ void InspectorFrontendHost::append(const String& url, const String& content)
m_client->append(url, content);
}
+void InspectorFrontendHost::close(const String&)
+{
+}
+
bool InspectorFrontendHost::canInspectWorkers()
{
#if ENABLE(WORKERS)
diff --git a/Source/WebCore/inspector/InspectorFrontendHost.h b/Source/WebCore/inspector/InspectorFrontendHost.h
index d5ae51d80..ea6d10198 100644
--- a/Source/WebCore/inspector/InspectorFrontendHost.h
+++ b/Source/WebCore/inspector/InspectorFrontendHost.h
@@ -57,8 +57,6 @@ public:
void disconnectClient();
void loaded();
- void requestAttachWindow();
- void requestDetachWindow();
void requestSetDockSide(const String&);
void closeWindow();
void bringToFront();
@@ -77,6 +75,7 @@ public:
bool canSave();
void save(const String& url, const String& content, bool forceSaveAs);
void append(const String& url, const String& content);
+ void close(const String& url);
bool canInspectWorkers();
diff --git a/Source/WebCore/inspector/InspectorFrontendHost.idl b/Source/WebCore/inspector/InspectorFrontendHost.idl
index 8ddc9a6fd..728aa0c0e 100644
--- a/Source/WebCore/inspector/InspectorFrontendHost.idl
+++ b/Source/WebCore/inspector/InspectorFrontendHost.idl
@@ -39,8 +39,6 @@
void setZoomFactor(in float zoom);
void inspectedURLChanged(in DOMString newURL);
- void requestAttachWindow();
- void requestDetachWindow();
void requestSetDockSide(in DOMString side);
void setAttachedWindowHeight(in unsigned long height);
void moveWindowBy(in float x, in float y);
@@ -54,6 +52,7 @@
boolean canSave();
void save(in DOMString url, in DOMString content, in boolean forceSaveAs);
void append(in DOMString url, in DOMString content);
+ void close(in DOMString url);
boolean canInspectWorkers();
diff --git a/Source/WebCore/inspector/InspectorMemoryAgent.cpp b/Source/WebCore/inspector/InspectorMemoryAgent.cpp
index badcb795b..fdc72afeb 100644
--- a/Source/WebCore/inspector/InspectorMemoryAgent.cpp
+++ b/Source/WebCore/inspector/InspectorMemoryAgent.cpp
@@ -436,16 +436,16 @@ static void reportJSHeapInfo(WTF::MemoryInstrumentationClient& memoryInstrumenta
HeapInfo info;
ScriptGCEvent::getHeapSize(info);
- memoryInstrumentationClient.countObjectSize(WebCoreMemoryTypes::JSHeapUsed, info.usedJSHeapSize);
- memoryInstrumentationClient.countObjectSize(WebCoreMemoryTypes::JSHeapUnused, info.totalJSHeapSize - info.usedJSHeapSize);
+ memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::JSHeapUsed, info.usedJSHeapSize);
+ memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::JSHeapUnused, info.totalJSHeapSize - info.usedJSHeapSize);
}
static void reportRenderTreeInfo(WTF::MemoryInstrumentationClient& memoryInstrumentationClient, Page* page)
{
ArenaSize arenaSize = page->renderTreeSize();
- memoryInstrumentationClient.countObjectSize(WebCoreMemoryTypes::RenderTreeUsed, arenaSize.treeSize);
- memoryInstrumentationClient.countObjectSize(WebCoreMemoryTypes::RenderTreeUnused, arenaSize.allocated - arenaSize.treeSize);
+ memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::RenderTreeUsed, arenaSize.treeSize);
+ memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::RenderTreeUnused, arenaSize.allocated - arenaSize.treeSize);
}
namespace {
@@ -541,6 +541,8 @@ void InspectorMemoryAgent::getProcessMemoryDistribution(ErrorString*, RefPtr<Ins
memoryInstrumentation.addRootObject(memoryInstrumentation);
memoryInstrumentation.addRootObject(memoryInstrumentationClient);
+ m_inspectorClient->dumpUncountedAllocatedObjects(memoryInstrumentationClient.countedObjects());
+
MemoryUsageStatsGenerator statsGenerator(&memoryInstrumentationClient);
statsGenerator.dump(children.get());
diff --git a/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp b/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp
index e93d66f4f..20d16cb1e 100644
--- a/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp
+++ b/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp
@@ -58,13 +58,22 @@ TypeNameToSizeMap MemoryInstrumentationClientImpl::sizesMap() const
return sizesMap;
}
-void MemoryInstrumentationClientImpl::countObjectSize(MemoryObjectType objectType, size_t size)
+void MemoryInstrumentationClientImpl::countObjectSize(const void* object, MemoryObjectType objectType, size_t size)
{
ASSERT(objectType);
+
TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size);
if (!result.isNewEntry)
result.iterator->value += size;
++m_totalCountedObjects;
+
+ if (!checkInstrumentedObjects())
+ return;
+
+ if (object) {
+ m_countedObjects.add(object, size);
+ checkCountedObject(object);
+ }
}
bool MemoryInstrumentationClientImpl::visited(const void* object)
@@ -91,6 +100,7 @@ void MemoryInstrumentationClientImpl::reportMemoryUsage(MemoryObjectInfo* memory
info.addMember(m_totalSizes);
info.addMember(m_visitedObjects);
info.addMember(m_allocatedObjects);
+ info.addMember(m_countedObjects);
}
void MemoryInstrumentationImpl::processDeferredInstrumentedPointers()
diff --git a/Source/WebCore/inspector/MemoryInstrumentationImpl.h b/Source/WebCore/inspector/MemoryInstrumentationImpl.h
index 8af8d60c5..508f2efe9 100644
--- a/Source/WebCore/inspector/MemoryInstrumentationImpl.h
+++ b/Source/WebCore/inspector/MemoryInstrumentationImpl.h
@@ -48,6 +48,8 @@ typedef HashMap<String, size_t> TypeNameToSizeMap;
class MemoryInstrumentationClientImpl : public WTF::MemoryInstrumentationClient {
public:
+ typedef HashMap<const void*, size_t> ObjectToSizeMap;
+
MemoryInstrumentationClientImpl()
: m_totalCountedObjects(0)
, m_totalObjectsNotInAllocatedSet(0)
@@ -69,13 +71,14 @@ public:
TypeNameToSizeMap sizesMap() const;
VisitedObjects& allocatedObjects() { return m_allocatedObjects; }
+ const ObjectToSizeMap& countedObjects() { return m_countedObjects; }
bool checkInstrumentedObjects() const { return !m_allocatedObjects.isEmpty(); }
size_t visitedObjects() const { return m_visitedObjects.size(); }
size_t totalCountedObjects() const { return m_totalCountedObjects; }
size_t totalObjectsNotInAllocatedSet() const { return m_totalObjectsNotInAllocatedSet; }
- virtual void countObjectSize(MemoryObjectType, size_t) OVERRIDE;
+ virtual void countObjectSize(const void*, MemoryObjectType, size_t) OVERRIDE;
virtual bool visited(const void*) OVERRIDE;
virtual void checkCountedObject(const void*) OVERRIDE;
@@ -86,6 +89,7 @@ private:
TypeToSizeMap m_totalSizes;
VisitedObjects m_visitedObjects;
VisitedObjects m_allocatedObjects;
+ ObjectToSizeMap m_countedObjects;
size_t m_totalCountedObjects;
size_t m_totalObjectsNotInAllocatedSet;
};
diff --git a/Source/WebCore/inspector/front-end/CSSCompletions.js b/Source/WebCore/inspector/front-end/CSSCompletions.js
index 8c606bed3..941e939df 100644
--- a/Source/WebCore/inspector/front-end/CSSCompletions.js
+++ b/Source/WebCore/inspector/front-end/CSSCompletions.js
@@ -34,7 +34,7 @@
* @constructor
* @param {Array.<CSSAgent.CSSPropertyInfo|string>} properties
*/
-WebInspector.CSSCompletions = function(properties, acceptEmptyPrefix)
+WebInspector.CSSCompletions = function(properties)
{
this._values = [];
this._longhands = {};
@@ -64,7 +64,6 @@ WebInspector.CSSCompletions = function(properties, acceptEmptyPrefix)
}
}
this._values.sort();
- this._acceptEmptyPrefix = acceptEmptyPrefix;
}
@@ -78,7 +77,7 @@ WebInspector.CSSCompletions.requestCSSNameCompletions = function()
function propertyNamesCallback(error, properties)
{
if (!error)
- WebInspector.CSSCompletions.cssPropertiesMetainfo = new WebInspector.CSSCompletions(properties, false);
+ WebInspector.CSSCompletions.cssPropertiesMetainfo = new WebInspector.CSSCompletions(properties);
}
CSSAgent.getSupportedCSSProperties(propertyNamesCallback);
}
@@ -246,7 +245,7 @@ WebInspector.CSSCompletions.prototype = {
if (!this._values.length)
return -1;
if (!prefix)
- return this._acceptEmptyPrefix ? 0 : -1;
+ return 0;
var maxIndex = this._values.length - 1;
var minIndex = 0;
diff --git a/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js b/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js
index 9e64dc698..ca04d985f 100644
--- a/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js
+++ b/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js
@@ -39,7 +39,7 @@ WebInspector.CSSKeywordCompletions.forProperty = function(propertyName)
acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._colors);
if (propertyName in WebInspector.CSSKeywordCompletions.InheritedProperties)
acceptedKeywords.push("inherit");
- return new WebInspector.CSSCompletions(acceptedKeywords, true);
+ return new WebInspector.CSSCompletions(acceptedKeywords);
}
WebInspector.CSSKeywordCompletions.isColorAwareProperty = function(propertyName)
diff --git a/Source/WebCore/inspector/front-end/DockController.js b/Source/WebCore/inspector/front-end/DockController.js
index 56694686f..5c48cabfe 100644
--- a/Source/WebCore/inspector/front-end/DockController.js
+++ b/Source/WebCore/inspector/front-end/DockController.js
@@ -40,8 +40,7 @@ WebInspector.DockController = function()
if (Preferences.showDockToRight)
this._dockToggleButton.makeLongClickEnabled(this._createDockOptions.bind(this));
- this._dockSide = WebInspector.queryParamsObject["dockSide"];
- this._innerSetDocked(WebInspector.queryParamsObject["docked"] === "true");
+ this.setDockSide(WebInspector.queryParamsObject["dockSide"]);
}
WebInspector.DockController.State = {
@@ -60,33 +59,18 @@ WebInspector.DockController.prototype = {
},
/**
- * @param {boolean} docked
+ * @param {string} dockSide
*/
- setDocked: function(docked)
+ setDockSide: function(dockSide)
{
- var isDocked = this._state !== WebInspector.DockController.State.Undocked;
- if (docked !== isDocked)
- this._innerSetDocked(docked);
- },
-
- /**
- * @param {boolean} docked
- */
- _innerSetDocked: function(docked)
- {
- if (this._state)
- WebInspector.settings.lastDockState.set(this._state);
+ if (this._dockSide)
+ WebInspector.settings.lastDockState.set(this._dockSide);
- if (!docked) {
- this._state = WebInspector.DockController.State.Undocked;
+ this._dockSide = dockSide;
+ if (dockSide === WebInspector.DockController.State.Undocked)
WebInspector.userMetrics.WindowDocked.record();
- } else if (this._dockSide === "right") {
- this._state = WebInspector.DockController.State.DockedToRight;
- WebInspector.userMetrics.WindowUndocked.record();
- } else {
- this._state = WebInspector.DockController.State.DockedToBottom;
+ else
WebInspector.userMetrics.WindowUndocked.record();
- }
this._updateUI();
},
@@ -102,7 +86,7 @@ WebInspector.DockController.prototype = {
_updateUI: function()
{
var body = document.body;
- switch (this._state) {
+ switch (this._dockSide) {
case WebInspector.DockController.State.DockedToBottom:
body.removeStyleClass("undocked");
body.removeStyleClass("dock-to-right");
@@ -129,17 +113,17 @@ WebInspector.DockController.prototype = {
this._dockToggleButton.disabled = false;
// Choose different last state based on the current one if missing or if is the same.
- var states = [WebInspector.DockController.State.DockedToBottom, WebInspector.DockController.State.Undocked, WebInspector.DockController.State.DockedToRight];
- states.remove(this._state);
+ var sides = [WebInspector.DockController.State.DockedToBottom, WebInspector.DockController.State.Undocked, WebInspector.DockController.State.DockedToRight];
+ sides.remove(this._dockSide);
var lastState = WebInspector.settings.lastDockState.get();
- states.remove(lastState);
- if (states.length === 2) { // last state was not from the list of potential values
- lastState = states[0];
- states.remove(lastState);
+ sides.remove(lastState);
+ if (sides.length === 2) { // last state was not from the list of potential values
+ lastState = sides[0];
+ sides.remove(lastState);
}
this._decorateButtonForTargetState(this._dockToggleButton, lastState);
- this._decorateButtonForTargetState(this._dockToggleButtonOption, states[0]);
+ this._decorateButtonForTargetState(this._dockToggleButtonOption, sides[0]);
},
/**
@@ -174,22 +158,13 @@ WebInspector.DockController.prototype = {
*/
_toggleDockState: function(e)
{
- var state = e.target.state;
- switch (state) {
- case "undock":
- InspectorFrontendHost.requestDetachWindow();
- WebInspector.userMetrics.WindowUndocked.record();
- break;
- case "right":
- case "bottom":
- this._dockSide = state;
- InspectorFrontendHost.requestSetDockSide(this._dockSide);
- if (this._state === WebInspector.DockController.State.Undocked)
- InspectorFrontendHost.requestAttachWindow();
- else
- this._innerSetDocked(true);
- break;
+ var action;
+ switch (e.target.state) {
+ case "bottom": action = "bottom"; break;
+ case "right": action = "right"; break;
+ case "undock": action = "undocked"; break;
}
+ InspectorFrontendHost.requestSetDockSide(action);
},
/**
diff --git a/Source/WebCore/inspector/front-end/FileManager.js b/Source/WebCore/inspector/front-end/FileManager.js
index 6b108d3f0..bb88734e6 100644
--- a/Source/WebCore/inspector/front-end/FileManager.js
+++ b/Source/WebCore/inspector/front-end/FileManager.js
@@ -51,14 +51,6 @@ WebInspector.FileManager.prototype = {
},
/**
- * @return {boolean}
- */
- canAppend: function()
- {
- return InspectorFrontendHost.canSave() && ("append" in InspectorFrontendHost);
- },
-
- /**
* @param {string} url
* @param {string} content
* @param {boolean} forceSaveAs
@@ -105,6 +97,14 @@ WebInspector.FileManager.prototype = {
/**
* @param {string} url
*/
+ close: function(url)
+ {
+ InspectorFrontendHost.close(url);
+ },
+
+ /**
+ * @param {string} url
+ */
appendedToURL: function(url)
{
this.dispatchEventToListeners(WebInspector.FileManager.EventTypes.AppendedToURL, url);
diff --git a/Source/WebCore/inspector/front-end/FileUtils.js b/Source/WebCore/inspector/front-end/FileUtils.js
index 7e95bdfc8..d6a1dec6c 100644
--- a/Source/WebCore/inspector/front-end/FileUtils.js
+++ b/Source/WebCore/inspector/front-end/FileUtils.js
@@ -385,6 +385,7 @@ WebInspector.FileOutputStream.prototype = {
if (this._writeCallbacks.length)
return;
WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._onAppendDone, this);
+ WebInspector.fileManager.close(this._fileName);
},
/**
@@ -395,8 +396,10 @@ WebInspector.FileOutputStream.prototype = {
if (event.data !== this._fileName)
return;
if (!this._writeCallbacks.length) {
- if (this._closed)
+ if (this._closed) {
WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._onAppendDone, this);
+ WebInspector.fileManager.close(this._fileName);
+ }
return;
}
var callback = this._writeCallbacks.shift();
diff --git a/Source/WebCore/inspector/front-end/HandlerRegistry.js b/Source/WebCore/inspector/front-end/HandlerRegistry.js
index 379eb435e..99d1bbfa7 100644
--- a/Source/WebCore/inspector/front-end/HandlerRegistry.js
+++ b/Source/WebCore/inspector/front-end/HandlerRegistry.js
@@ -132,7 +132,9 @@ WebInspector.HandlerRegistry.prototype = {
function doSave(forceSaveAs, content)
{
- WebInspector.fileManager.save(contentProvider.contentURL(), content, forceSaveAs);
+ var url = contentProvider.contentURL();
+ WebInspector.fileManager.save(url, content, forceSaveAs);
+ WebInspector.fileManager.close(url);
}
function save(forceSaveAs)
diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotView.js b/Source/WebCore/inspector/front-end/HeapSnapshotView.js
index a094b458a..ccd3630a6 100644
--- a/Source/WebCore/inspector/front-end/HeapSnapshotView.js
+++ b/Source/WebCore/inspector/front-end/HeapSnapshotView.js
@@ -953,7 +953,7 @@ WebInspector.HeapProfileHeader.prototype = {
*/
canSaveToFile: function()
{
- return !this.fromFile() && this._snapshotProxy && !this._receiver && WebInspector.fileManager.canAppend();
+ return !this.fromFile() && !!this._snapshotProxy && !this._receiver;
},
/**
diff --git a/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js b/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js
index 70b7cfdd7..f1bb82bea 100644
--- a/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js
+++ b/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js
@@ -74,10 +74,15 @@ var InspectorFrontendAPI = {
WebInspector.CPUProfileType.instance.stopRecordingProfile();
},
- setAttachedWindow: function(attached)
+ setAttachedWindow: function(side)
+ {
+
+ },
+
+ setDockSide: function(side)
{
if (WebInspector.dockController)
- WebInspector.dockController.setDocked(attached);
+ WebInspector.dockController.setDockSide(side);
},
showConsole: function()
diff --git a/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js b/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js
index ce3a30aae..e92348a88 100644
--- a/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js
+++ b/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js
@@ -38,6 +38,7 @@ WebInspector.InspectorFrontendHostStub = function()
{
this._attachedWindowHeight = 0;
this.isStub = true;
+ this._fileBuffers = {};
WebInspector.documentCopyEventFired = this.documentCopy.bind(this);
}
@@ -68,18 +69,9 @@ WebInspector.InspectorFrontendHostStub.prototype = {
this._windowVisible = false;
},
- requestAttachWindow: function()
- {
- InspectorFrontendAPI.setAttachedWindow(true);
- },
-
- requestDetachWindow: function()
- {
- InspectorFrontendAPI.setAttachedWindow(false);
- },
-
- requestSetDockSide: function()
+ requestSetDockSide: function(side)
{
+ InspectorFrontendAPI.setDockSide(side);
},
setAttachedWindowHeight: function(height)
@@ -143,23 +135,43 @@ WebInspector.InspectorFrontendHostStub.prototype = {
save: function(url, content, forceSaveAs)
{
- var blob = new Blob([content], { type: "application/octet-stream" });
+ if (this._fileBuffers[url])
+ throw new Error("Concurrent file modification denied.");
- var fr = new FileReader();
- fr.onload = function(e) {
- // Force download
- window.location = this.result;
- }
- fr.readAsDataURL(blob);
+ this._fileBuffers[url] = [content];
+ setTimeout(WebInspector.fileManager.savedURL.bind(WebInspector.fileManager, url), 0);
},
- canAppend: function()
+ append: function(url, content)
{
- return false;
+ var buffer = this._fileBuffers[url];
+ if (!buffer)
+ throw new Error("File is not open for write yet.");
+
+ buffer.push(content);
+ setTimeout(WebInspector.fileManager.appendedToURL.bind(WebInspector.fileManager, url), 0);
},
- append: function(url, content)
+ close: function(url)
{
+ var content = this._fileBuffers[url];
+ delete this._fileBuffers[url];
+
+ if (!content)
+ return;
+
+ var lastSlashIndex = url.lastIndexOf("/");
+ var fileNameSuffix = (lastSlashIndex === -1) ? url : url.substring(lastSlashIndex + 1);
+
+ var blob = new Blob(content, { type: "application/octet-stream" });
+ var objectUrl = window.URL.createObjectURL(blob);
+ window.location = objectUrl + "#" + fileNameSuffix;
+
+ function cleanup()
+ {
+ window.URL.revokeObjectURL(objectUrl);
+ }
+ setTimeout(cleanup, 0);
},
sendMessageToBackend: function(message)
diff --git a/Source/WebCore/inspector/front-end/ResourceScriptMapping.js b/Source/WebCore/inspector/front-end/ResourceScriptMapping.js
index 0e627e69f..db3c2a72f 100644
--- a/Source/WebCore/inspector/front-end/ResourceScriptMapping.js
+++ b/Source/WebCore/inspector/front-end/ResourceScriptMapping.js
@@ -209,7 +209,6 @@ WebInspector.ResourceScriptMapping.prototype = {
var isDynamicScript = this._isDynamicScript(script);
var url = isDynamicScript ? "" : script.sourceURL;
temporaryUISourceCode = new WebInspector.UISourceCode(url, contentProvider, false);
- temporaryUISourceCode.isTemporary = true;
for (var i = 0; i < scripts.length; ++i)
this._temporaryUISourceCodeForScriptId[scripts[i].scriptId] = temporaryUISourceCode;
this._bindUISourceCodeToScripts(temporaryUISourceCode, scripts);
diff --git a/Source/WebCore/inspector/front-end/SASSSourceMapping.js b/Source/WebCore/inspector/front-end/SASSSourceMapping.js
index 9c7cab4e7..a114df901 100644
--- a/Source/WebCore/inspector/front-end/SASSSourceMapping.js
+++ b/Source/WebCore/inspector/front-end/SASSSourceMapping.js
@@ -77,13 +77,13 @@ WebInspector.SASSSourceMapping.prototype = {
if (!content)
return;
var lines = content.split(/\r?\n/);
- var debugInfoRegex = /@media\s\-sass\-debug\-info{filename{font-family:([^}]+)}line{font-family:\\[0]+([^}]*)}}/i;
+ var debugInfoRegex = /@media\s\-sass\-debug\-info{filename{font-family:([^}]+)}line{font-family:\\0000(\d\d)([^}]*)}}/i;
var lineNumbersRegex = /\/\*\s+line\s+([0-9]+),\s+([^*\/]+)/;
for (var lineNumber = 0; lineNumber < lines.length; ++lineNumber) {
var match = debugInfoRegex.exec(lines[lineNumber]);
if (match) {
var url = match[1].replace(/\\(.)/g, "$1");
- var line = parseInt(decodeURI(match[2].replace(/(..)/g, "%$1")), 10);
+ var line = parseInt(decodeURI("%" + match[2]) + match[3], 10);
this._bindUISourceCode(url, line, resource.url, lineNumber);
continue;
}
diff --git a/Source/WebCore/inspector/front-end/ScriptSnippetModel.js b/Source/WebCore/inspector/front-end/ScriptSnippetModel.js
index 10e9a7bc0..a6707c693 100644
--- a/Source/WebCore/inspector/front-end/ScriptSnippetModel.js
+++ b/Source/WebCore/inspector/front-end/ScriptSnippetModel.js
@@ -289,7 +289,7 @@ WebInspector.ScriptSnippetModel.prototype = {
var result = [];
for (var scriptId in this._uiSourceCodeForScriptId) {
var uiSourceCode = this._uiSourceCodeForScriptId[scriptId];
- if (!uiSourceCode.isSnippet)
+ if (uiSourceCode.isTemporary)
result.push(uiSourceCode);
}
return result;
@@ -322,10 +322,9 @@ WebInspector.ScriptSnippetModel.prototype = {
_createUISourceCodeForScript: function(script)
{
var uiSourceCode = new WebInspector.UISourceCode(script.sourceURL, script, false);
+ uiSourceCode.isSnippet = true;
+ this._workspace.project().addTemporaryUISourceCode(uiSourceCode);
uiSourceCode.setSourceMapping(this._snippetScriptMapping);
- // FIXME: Should be added to workspace as temporary.
- uiSourceCode.isTemporary = true;
- uiSourceCode.isSnippetEvaluation = true;
this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode;
this._scriptForUISourceCode.put(uiSourceCode, script);
script.setSourceMapping(this._snippetScriptMapping);
diff --git a/Source/WebCore/inspector/front-end/ScriptsNavigator.js b/Source/WebCore/inspector/front-end/ScriptsNavigator.js
index 662f90217..8477230dd 100644
--- a/Source/WebCore/inspector/front-end/ScriptsNavigator.js
+++ b/Source/WebCore/inspector/front-end/ScriptsNavigator.js
@@ -84,7 +84,7 @@ WebInspector.ScriptsNavigator.prototype = {
{
if (uiSourceCode.isContentScript)
return this._contentScriptsView;
- else if (uiSourceCode.isSnippet || uiSourceCode.isSnippetEvaluation)
+ else if (uiSourceCode.isSnippet)
return this._snippetsView;
else
return this._scriptsView;
@@ -123,7 +123,7 @@ WebInspector.ScriptsNavigator.prototype = {
this._snippetsNavigatorViewForUISourceCode(uiSourceCode).revealUISourceCode(uiSourceCode);
if (uiSourceCode.isContentScript)
this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.ContentScriptsTab);
- else if (uiSourceCode.isSnippet || uiSourceCode.isSnippetEvaluation)
+ else if (uiSourceCode.isSnippet)
this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.SnippetsTab);
else
this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.ScriptsTab);
diff --git a/Source/WebCore/inspector/front-end/ScriptsPanel.js b/Source/WebCore/inspector/front-end/ScriptsPanel.js
index 1e944181d..a27a45bb1 100644
--- a/Source/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/Source/WebCore/inspector/front-end/ScriptsPanel.js
@@ -442,7 +442,7 @@ WebInspector.ScriptsPanel.prototype = {
var sourceFrame;
switch (uiSourceCode.contentType()) {
case WebInspector.resourceTypes.Script:
- if (uiSourceCode.isSnippet)
+ if (uiSourceCode.isSnippet && !uiSourceCode.isTemporary)
sourceFrame = new WebInspector.SnippetJavaScriptSourceFrame(this, uiSourceCode);
else
sourceFrame = new WebInspector.JavaScriptSourceFrame(this, uiSourceCode);
diff --git a/Source/WebCore/inspector/front-end/SettingsScreen.js b/Source/WebCore/inspector/front-end/SettingsScreen.js
index f57e3e802..fe5aab03c 100644
--- a/Source/WebCore/inspector/front-end/SettingsScreen.js
+++ b/Source/WebCore/inspector/front-end/SettingsScreen.js
@@ -365,7 +365,7 @@ WebInspector.UserAgentSettingsTab.prototype = {
var checkboxElement = labelElement.createChild("input");
checkboxElement.type = "checkbox";
checkboxElement.checked = !!userAgent;
- labelElement.appendChild(document.createTextNode("User Agent"));
+ labelElement.appendChild(document.createTextNode(WebInspector.UIString("User Agent")));
p.appendChild(this._createUserAgentSelectRowElement(checkboxElement));
return p;
},
diff --git a/Source/WebCore/inspector/front-end/StylesSidebarPane.js b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
index af07068fb..f6d356e97 100644
--- a/Source/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/Source/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -400,7 +400,7 @@ WebInspector.StylesSidebarPane.prototype = {
continue;
if (section.computedStyle)
section.styleRule.style = nodeComputedStyle;
- var styleRule = { section: section, style: section.styleRule.style, computedStyle: section.computedStyle, rule: section.rule, editable: !!(section.styleRule.style && section.styleRule.style.id), isAttribute: section.styleRule.isAttribute };
+ var styleRule = { section: section, style: section.styleRule.style, computedStyle: section.computedStyle, rule: section.rule, editable: !!(section.styleRule.style && section.styleRule.style.id), isAttribute: section.styleRule.isAttribute, isInherited: section.styleRule.isInherited };
styleRules.push(styleRule);
}
return styleRules;
@@ -511,7 +511,11 @@ WebInspector.StylesSidebarPane.prototype = {
var property = allProperties[j];
if (!property.isLive || !property.parsedOk)
continue;
+
var canonicalName = WebInspector.StylesSidebarPane.canonicalPropertyName(property.name);
+ // Do not pick non-inherited properties from inherited styles.
+ if (styleRule.isInherited && !WebInspector.CSSKeywordCompletions.InheritedProperties[canonicalName])
+ continue;
if (foundImportantProperties.hasOwnProperty(canonicalName))
continue;
diff --git a/Source/WebCore/inspector/front-end/StylesSourceMapping.js b/Source/WebCore/inspector/front-end/StylesSourceMapping.js
index 8b7d052a1..4de7509dc 100644
--- a/Source/WebCore/inspector/front-end/StylesSourceMapping.js
+++ b/Source/WebCore/inspector/front-end/StylesSourceMapping.js
@@ -136,17 +136,17 @@ WebInspector.StyleFile.prototype = {
*/
_commitIncrementalEdit: function(majorChange)
{
- /**
- * @param {?string} error
- */
- function callback(error)
- {
- if (error)
- WebInspector.showErrorMessage(error);
- }
-
this._clearIncrementalUpdateTimer();
- WebInspector.styleContentBinding.setStyleContent(this._uiSourceCode, this._uiSourceCode.workingCopy(), majorChange, callback);
+ WebInspector.styleContentBinding.setStyleContent(this._uiSourceCode, this._uiSourceCode.workingCopy(), majorChange, this._styleContentSet.bind(this));
+ },
+
+ /**
+ * @param {?string} error
+ */
+ _styleContentSet: function(error)
+ {
+ if (error)
+ WebInspector.showErrorMessage(error);
},
_clearIncrementalUpdateTimer: function()
diff --git a/Source/WebCore/inspector/front-end/UISourceCode.js b/Source/WebCore/inspector/front-end/UISourceCode.js
index 9bfd340d1..8613dff82 100644
--- a/Source/WebCore/inspector/front-end/UISourceCode.js
+++ b/Source/WebCore/inspector/front-end/UISourceCode.js
@@ -192,8 +192,10 @@ WebInspector.UISourceCode.prototype = {
delete this._workingCopy;
this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyCommitted, {oldWorkingCopy: oldWorkingCopy, workingCopy: this.workingCopy()});
WebInspector.workspace.dispatchEventToListeners(WebInspector.Workspace.Events.UISourceCodeContentCommitted, { uiSourceCode: this, content: this._content });
- if (this._url && WebInspector.fileManager.isURLSaved(this._url))
+ if (this._url && WebInspector.fileManager.isURLSaved(this._url)) {
WebInspector.fileManager.save(this._url, this._content, false);
+ WebInspector.fileManager.close(this._url);
+ }
},
/**
diff --git a/Source/WebCore/inspector/front-end/Workspace.js b/Source/WebCore/inspector/front-end/Workspace.js
index 6fcca5a1a..c5515e82b 100644
--- a/Source/WebCore/inspector/front-end/Workspace.js
+++ b/Source/WebCore/inspector/front-end/Workspace.js
@@ -89,6 +89,7 @@ WebInspector.Project.prototype = {
*/
addTemporaryUISourceCode: function(uiSourceCode)
{
+ uiSourceCode.isTemporary = true;
this._workspace.dispatchEventToListeners(WebInspector.UISourceCodeProvider.Events.TemporaryUISourceCodeAdded, uiSourceCode);
},
diff --git a/Source/WebCore/inspector/front-end/externs.js b/Source/WebCore/inspector/front-end/externs.js
index ba5bbc9fe..a06ce9e26 100644
--- a/Source/WebCore/inspector/front-end/externs.js
+++ b/Source/WebCore/inspector/front-end/externs.js
@@ -123,8 +123,6 @@ InspectorFrontendHostAPI.prototype.platform = function() {}
InspectorFrontendHostAPI.prototype.port = function() {}
InspectorFrontendHostAPI.prototype.bringToFront = function() {}
InspectorFrontendHostAPI.prototype.closeWindow = function() {}
-InspectorFrontendHostAPI.prototype.requestAttachWindow = function() {}
-InspectorFrontendHostAPI.prototype.requestDetachWindow = function() {}
InspectorFrontendHostAPI.prototype.requestSetDockSide = function(dockSide) {}
InspectorFrontendHostAPI.prototype.setAttachedWindowHeight = function(height) {}
InspectorFrontendHostAPI.prototype.moveWindowBy = function(x, y) {}
@@ -138,7 +136,7 @@ InspectorFrontendHostAPI.prototype.copyText = function(text) {}
InspectorFrontendHostAPI.prototype.openInNewTab = function(url) {}
InspectorFrontendHostAPI.prototype.canSave = function() {}
InspectorFrontendHostAPI.prototype.save = function(url, content, forceSaveAs) {}
-InspectorFrontendHostAPI.prototype.canAppend = function() {}
+InspectorFrontendHostAPI.prototype.close = function(url) {}
InspectorFrontendHostAPI.prototype.append = function(url, content) {}
InspectorFrontendHostAPI.prototype.sendMessageToBackend = function(message) {}
InspectorFrontendHostAPI.prototype.recordActionTaken = function(actionCode) {}
diff --git a/Source/WebCore/inspector/front-end/inspector.html b/Source/WebCore/inspector/front-end/inspector.html
index d1961b9e3..eda8ddf0c 100644
--- a/Source/WebCore/inspector/front-end/inspector.html
+++ b/Source/WebCore/inspector/front-end/inspector.html
@@ -29,6 +29,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <meta http-equiv="X-WebKit-CSP" content="object-src 'none'; script-src 'self' 'unsafe-eval'">
<link rel="stylesheet" type="text/css" href="dialog.css">
<link rel="stylesheet" type="text/css" href="inspector.css">
<link rel="stylesheet" type="text/css" href="inspectorCommon.css">
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index a84c508eb..9c3966cab 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -70,6 +70,7 @@
#include "HTMLFormElement.h"
#include "HTMLNames.h"
#include "HTMLObjectElement.h"
+#include "HTMLParserIdioms.h"
#include "HTTPParsers.h"
#include "HistoryItem.h"
#include "InspectorController.h"
@@ -666,6 +667,15 @@ void FrameLoader::didBeginDocument(bool dispatch)
String reportOnlyContentSecurityPolicy = m_documentLoader->response().httpHeaderField("X-WebKit-CSP-Report-Only");
if (!reportOnlyContentSecurityPolicy.isEmpty())
m_frame->document()->contentSecurityPolicy()->didReceiveHeader(reportOnlyContentSecurityPolicy, ContentSecurityPolicy::ReportOnly);
+
+ String headerContentLanguage = m_documentLoader->response().httpHeaderField("Content-Language");
+ if (!headerContentLanguage.isEmpty()) {
+ size_t commaIndex = headerContentLanguage.find(',');
+ headerContentLanguage.truncate(commaIndex); // notFound == -1 == don't truncate
+ headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTMLSpace);
+ if (!headerContentLanguage.isEmpty())
+ m_frame->document()->setContentLanguage(headerContentLanguage);
+ }
}
history()->restoreDocumentState();
@@ -1689,6 +1699,9 @@ void FrameLoader::commitProvisionalLoad()
prepareForCachedPageRestore();
cachedPage->restore(m_frame->page());
+ // The page should be removed from the cache immediately after a restoration in order for the PageCache to be consistent.
+ pageCache()->remove(history()->currentItem());
+
dispatchDidCommitLoad();
// If we have a title let the WebView know about it.
@@ -1697,8 +1710,11 @@ void FrameLoader::commitProvisionalLoad()
m_client->dispatchDidReceiveTitle(title);
checkCompleted();
- } else
+ } else {
+ if (cachedPage)
+ pageCache()->remove(history()->currentItem());
didOpenURL();
+ }
LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()->uniqueName().string().utf8().data(),
m_frame->document() ? m_frame->document()->url().string().utf8().data() : "");
@@ -1726,8 +1742,6 @@ void FrameLoader::commitProvisionalLoad()
// Could be an issue with a giant local file.
notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, response, 0, static_cast<int>(response.expectedContentLength()), 0, error);
}
-
- pageCache()->remove(history()->currentItem());
// FIXME: Why only this frame and not parent frames?
checkLoadCompleteForThisFrame();
@@ -3192,8 +3206,10 @@ void FrameLoader::dispatchDidCommitLoad()
m_client->dispatchDidCommitLoad();
- if (isLoadingMainFrame())
+ if (isLoadingMainFrame()) {
m_frame->page()->resetSeenPlugins();
+ m_frame->page()->resetSeenMediaEngines();
+ }
InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get());
}
diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp
index 8551a52d9..fb6d0e35c 100644
--- a/Source/WebCore/loader/HistoryController.cpp
+++ b/Source/WebCore/loader/HistoryController.cpp
@@ -60,7 +60,7 @@ namespace WebCore {
static inline void addVisitedLink(Page* page, const KURL& url)
{
#if USE(PLATFORM_STRATEGIES)
- platformStrategies()->visitedLinkStrategy()->addVisitedLink(page, visitedLinkHash(url.string().characters(), url.string().length()));
+ platformStrategies()->visitedLinkStrategy()->addVisitedLink(page, visitedLinkHash(url.string()));
#else
page->group().addVisitedLink(url);
#endif
diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp
index 50975794e..e57017126 100644
--- a/Source/WebCore/loader/SubresourceLoader.cpp
+++ b/Source/WebCore/loader/SubresourceLoader.cpp
@@ -128,17 +128,24 @@ void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou
{
// Store the previous URL because the call to ResourceLoader::willSendRequest will modify it.
KURL previousURL = request().url();
-
- ResourceLoader::willSendRequest(newRequest, redirectResponse);
- if (!previousURL.isNull() && !newRequest.isNull() && previousURL != newRequest.url()) {
- if (m_documentLoader->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) {
- if (m_resource->type() != CachedResource::ImageResource || !m_documentLoader->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) {
- m_resource->willSendRequest(newRequest, redirectResponse);
- return;
- }
+
+ ASSERT(!newRequest.isNull());
+ if (!previousURL.isNull() && previousURL != newRequest.url()) {
+ if (!m_documentLoader->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) {
+ cancel();
+ return;
+ }
+ if (m_resource->type() == CachedResource::ImageResource && m_documentLoader->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) {
+ cancel();
+ return;
}
- cancel();
+ m_resource->willSendRequest(newRequest, redirectResponse);
}
+
+ if (newRequest.isNull() || reachedTerminalState())
+ return;
+
+ ResourceLoader::willSendRequest(newRequest, redirectResponse);
}
void SubresourceLoader::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent)
@@ -207,12 +214,11 @@ void SubresourceLoader::didReceiveData(const char* data, int length, long long e
// Reference the object in this method since the additional processing can do
// anything including removing the last reference to this object; one example of this is 3266216.
RefPtr<SubresourceLoader> protect(this);
- ResourceLoader::didReceiveData(data, length, encodedDataLength, allAtOnce);
-
- if (m_loadingMultipartContent)
- return;
-
- sendDataToResource(data, length);
+ addData(data, length, allAtOnce);
+ if (!m_loadingMultipartContent)
+ sendDataToResource(data, length);
+ if (shouldSendResourceLoadCallbacks() && m_frame)
+ frameLoader()->notifier()->didReceiveData(this, data, length, static_cast<int>(encodedDataLength));
}
bool SubresourceLoader::checkForHTTPStatusCodeError()
diff --git a/Source/WebCore/loader/cache/CachedResource.cpp b/Source/WebCore/loader/cache/CachedResource.cpp
index 703c42836..703c42836 100755..100644
--- a/Source/WebCore/loader/cache/CachedResource.cpp
+++ b/Source/WebCore/loader/cache/CachedResource.cpp
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
index 7c420c066..1ffca4fc1 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
@@ -229,7 +229,7 @@ CachedResourceHandle<CachedXSLStyleSheet> CachedResourceLoader::requestXSLStyleS
#if ENABLE(SVG)
CachedResourceHandle<CachedSVGDocument> CachedResourceLoader::requestSVGDocument(ResourceRequest& request)
{
- return static_cast<CachedSVGDocument*>(requestResource(CachedResource::SVGDocumentResource, request, request.url(), defaultCachedResourceOptions()).get());
+ return static_cast<CachedSVGDocument*>(requestResource(CachedResource::SVGDocumentResource, request, String(), defaultCachedResourceOptions()).get());
}
#endif
diff --git a/Source/WebCore/page/DOMWindowPagePopup.cpp b/Source/WebCore/page/DOMWindowPagePopup.cpp
index 09e3c16c0..62ba2c396 100644
--- a/Source/WebCore/page/DOMWindowPagePopup.cpp
+++ b/Source/WebCore/page/DOMWindowPagePopup.cpp
@@ -67,5 +67,11 @@ void DOMWindowPagePopup::install(DOMWindow* window, PagePopupClient* popupClient
provideTo(window, supplementName(), adoptPtr(new DOMWindowPagePopup(popupClient)));
}
+void DOMWindowPagePopup::uninstall(DOMWindow* window)
+{
+ ASSERT(window);
+ window->removeSupplement(supplementName());
+}
+
}
#endif
diff --git a/Source/WebCore/page/DOMWindowPagePopup.h b/Source/WebCore/page/DOMWindowPagePopup.h
index 4f806d981..855997475 100644
--- a/Source/WebCore/page/DOMWindowPagePopup.h
+++ b/Source/WebCore/page/DOMWindowPagePopup.h
@@ -44,6 +44,7 @@ class DOMWindowPagePopup : public Supplement<DOMWindow> {
public:
static PagePopupController* pagePopupController(DOMWindow*);
static void install(DOMWindow*, PagePopupClient*);
+ static void uninstall(DOMWindow*);
~DOMWindowPagePopup();
private:
diff --git a/Source/WebCore/page/DiagnosticLoggingKeys.cpp b/Source/WebCore/page/DiagnosticLoggingKeys.cpp
index ca54547b0..8f3b4d603 100644
--- a/Source/WebCore/page/DiagnosticLoggingKeys.cpp
+++ b/Source/WebCore/page/DiagnosticLoggingKeys.cpp
@@ -64,6 +64,18 @@ const String& DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey()
return key;
}
+const String& DiagnosticLoggingKeys::pageContainsMediaEngineKey()
+{
+ DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsMediaEngine")));
+ return key;
+}
+
+const String& DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey()
+{
+ DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsAtLeastOneMediaEngine")));
+ return key;
+}
+
const String& DiagnosticLoggingKeys::passKey()
{
DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pass")));
diff --git a/Source/WebCore/page/DiagnosticLoggingKeys.h b/Source/WebCore/page/DiagnosticLoggingKeys.h
index 951806e57..52e8964c9 100644
--- a/Source/WebCore/page/DiagnosticLoggingKeys.h
+++ b/Source/WebCore/page/DiagnosticLoggingKeys.h
@@ -39,7 +39,9 @@ public:
static const String& pluginLoadingFailedKey();
static const String& pageContainsPluginKey();
static const String& pageContainsAtLeastOnePluginKey();
-
+ static const String& pageContainsMediaEngineKey();
+ static const String& pageContainsAtLeastOneMediaEngineKey();
+
// Success keys
static const String& passKey();
static const String& failKey();
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
index 19254c8c4..ed25477ed 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
@@ -777,11 +777,10 @@ PassRefPtr<Range> Frame::rangeForPoint(const IntPoint& framePoint)
return 0;
}
-void Frame::createView(const IntSize& viewportSize,
- const Color& backgroundColor, bool transparent,
- const IntSize& fixedLayoutSize, bool useFixedLayout,
- ScrollbarMode horizontalScrollbarMode, bool horizontalLock,
- ScrollbarMode verticalScrollbarMode, bool verticalLock)
+void Frame::createView(const IntSize& viewportSize, const Color& backgroundColor, bool transparent,
+ const IntSize& fixedLayoutSize, const IntRect& fixedVisibleContentRect ,
+ bool useFixedLayout, ScrollbarMode horizontalScrollbarMode, bool horizontalLock,
+ ScrollbarMode verticalScrollbarMode, bool verticalLock)
{
ASSERT(this);
ASSERT(m_page);
@@ -797,6 +796,7 @@ void Frame::createView(const IntSize& viewportSize,
if (isMainFrame) {
frameView = FrameView::create(this, viewportSize);
frameView->setFixedLayoutSize(fixedLayoutSize);
+ frameView->setFixedVisibleContentRect(fixedVisibleContentRect);
frameView->setUseFixedLayout(useFixedLayout);
} else
frameView = FrameView::create(this);
diff --git a/Source/WebCore/page/Frame.h b/Source/WebCore/page/Frame.h
index 0a07c4220..23a59ebdc 100644
--- a/Source/WebCore/page/Frame.h
+++ b/Source/WebCore/page/Frame.h
@@ -88,8 +88,9 @@ namespace WebCore {
void init();
void setView(PassRefPtr<FrameView>);
- void createView(const IntSize&, const Color&, bool, const IntSize&, bool,
- ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
+ void createView(const IntSize&, const Color&, bool,
+ const IntSize& fixedLayoutSize = IntSize(), const IntRect& fixedVisibleContentRect = IntRect(),
+ bool useFixedLayout = false, ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
ScrollbarMode = ScrollbarAuto, bool verticalLock = false);
~Frame();
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 1be0c54c2..2d312a31a 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -2500,8 +2500,14 @@ void FrameView::performPostLayoutTasks()
}
#if USE(ACCELERATED_COMPOSITING)
- if (TiledBacking* tiledBacking = this->tiledBacking())
- tiledBacking->setTileCoverage(canHaveScrollbars() ? TiledBacking::CoverageForScrolling : TiledBacking::CoverageForVisibleArea);
+ if (TiledBacking* tiledBacking = this->tiledBacking()) {
+ if (page) {
+ if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) {
+ bool shouldLimitTileCoverage = !canHaveScrollbars() || scrollingCoordinator->shouldUpdateScrollLayerPositionOnMainThread();
+ tiledBacking->setTileCoverage(shouldLimitTileCoverage ? TiledBacking::CoverageForVisibleArea : TiledBacking::CoverageForScrolling);
+ }
+ }
+ }
#endif
scrollToAnchor();
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp
index 484a1eb99..7009ab566 100644
--- a/Source/WebCore/page/Page.cpp
+++ b/Source/WebCore/page/Page.cpp
@@ -147,7 +147,6 @@ Page::Page(PageClients& pageClients)
, m_pageScaleFactor(1)
, m_deviceScaleFactor(1)
, m_suppressScrollbarAnimations(false)
- , m_javaScriptURLsAreAllowed(true)
, m_didLoadUserStyleSheet(false)
, m_userStyleSheetModificationTime(0)
, m_group(0)
@@ -1002,16 +1001,6 @@ void Page::setMemoryCacheClientCallsEnabled(bool enabled)
frame->loader()->tellClientAboutPastMemoryCacheLoads();
}
-void Page::setJavaScriptURLsAreAllowed(bool areAllowed)
-{
- m_javaScriptURLsAreAllowed = areAllowed;
-}
-
-bool Page::javaScriptURLsAreAllowed() const
-{
- return m_javaScriptURLsAreAllowed;
-}
-
void Page::setMinimumTimerInterval(double minimumTimerInterval)
{
double oldTimerInterval = m_minimumTimerInterval;
@@ -1260,6 +1249,26 @@ void Page::resetSeenPlugins()
m_seenPlugins.clear();
}
+bool Page::hasSeenAnyMediaEngine() const
+{
+ return !m_seenMediaEngines.isEmpty();
+}
+
+bool Page::hasSeenMediaEngine(const String& engineDescription) const
+{
+ return m_seenMediaEngines.contains(engineDescription);
+}
+
+void Page::sawMediaEngine(const String& engineDescription)
+{
+ m_seenMediaEngines.add(engineDescription);
+}
+
+void Page::resetSeenMediaEngines()
+{
+ m_seenMediaEngines.clear();
+}
+
void Page::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Page);
diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h
index 062c74c7e..c16b57bc5 100644
--- a/Source/WebCore/page/Page.h
+++ b/Source/WebCore/page/Page.h
@@ -308,9 +308,6 @@ namespace WebCore {
void setMemoryCacheClientCallsEnabled(bool);
bool areMemoryCacheClientCallsEnabled() const { return m_areMemoryCacheClientCallsEnabled; }
- void setJavaScriptURLsAreAllowed(bool);
- bool javaScriptURLsAreAllowed() const;
-
// Don't allow more than a certain number of frames in a page.
// This seems like a reasonable upper bound, and otherwise mutually
// recursive frameset pages can quickly bring the program to its knees
@@ -352,6 +349,11 @@ namespace WebCore {
void sawPlugin(const String& serviceType);
void resetSeenPlugins();
+ bool hasSeenMediaEngine(const String& engineName) const;
+ bool hasSeenAnyMediaEngine() const;
+ void sawMediaEngine(const String& engineName);
+ void resetSeenMediaEngines();
+
void reportMemoryUsage(MemoryObjectInfo*) const;
private:
@@ -426,8 +428,6 @@ namespace WebCore {
Pagination m_pagination;
- bool m_javaScriptURLsAreAllowed;
-
String m_userStyleSheetPath;
mutable String m_userStyleSheet;
mutable bool m_didLoadUserStyleSheet;
@@ -473,6 +473,7 @@ namespace WebCore {
bool m_scriptedAnimationsSuspended;
HashSet<String> m_seenPlugins;
+ HashSet<String> m_seenMediaEngines;
};
} // namespace WebCore
diff --git a/Source/WebCore/page/PageGroup.cpp b/Source/WebCore/page/PageGroup.cpp
index 314ed1419..77928ce64 100644
--- a/Source/WebCore/page/PageGroup.cpp
+++ b/Source/WebCore/page/PageGroup.cpp
@@ -210,7 +210,7 @@ void PageGroup::addVisitedLink(const KURL& url)
if (!shouldTrackVisitedLinks)
return;
ASSERT(!url.isEmpty());
- addVisitedLink(visitedLinkHash(url.string().characters(), url.string().length()));
+ addVisitedLink(visitedLinkHash(url.string()));
}
void PageGroup::addVisitedLink(const UChar* characters, size_t length)
diff --git a/Source/WebCore/page/Performance.cpp b/Source/WebCore/page/Performance.cpp
index 149175ca6..24987ced8 100644
--- a/Source/WebCore/page/Performance.cpp
+++ b/Source/WebCore/page/Performance.cpp
@@ -49,8 +49,15 @@
namespace WebCore {
+#if ENABLE(RESOURCE_TIMING)
+static const size_t defaultResourceTimingBufferSize = 150;
+#endif
+
Performance::Performance(Frame* frame)
: DOMWindowProperty(frame)
+#if ENABLE(RESOURCE_TIMING)
+ , m_resourceTimingBufferSize(defaultResourceTimingBufferSize)
+#endif
{
}
@@ -143,19 +150,29 @@ void Performance::webkitClearResourceTimings()
m_resourceTimingBuffer.clear();
}
-void Performance::webkitSetResourceTimingBufferSize(unsigned int)
+void Performance::webkitSetResourceTimingBufferSize(unsigned size)
{
- // FIXME: Implement this.
+ m_resourceTimingBufferSize = size;
+ if (isResourceTimingBufferFull())
+ dispatchEvent(Event::create(eventNames().webkitresourcetimingbufferfullEvent, false, false));
}
void Performance::addResourceTiming(const ResourceRequest& request, const ResourceResponse& response, double finishTime, Document* requestingDocument)
{
- if (!response.resourceLoadTiming())
+ if (!response.resourceLoadTiming() || isResourceTimingBufferFull())
return;
RefPtr<PerformanceEntry> entry = PerformanceResourceTiming::create(request, response, finishTime, requestingDocument);
- // FIXME: Need to enforce buffer limits.
+
m_resourceTimingBuffer.append(entry);
+
+ if (isResourceTimingBufferFull())
+ dispatchEvent(Event::create(eventNames().webkitresourcetimingbufferfullEvent, false, false));
+}
+
+bool Performance::isResourceTimingBufferFull()
+{
+ return m_resourceTimingBuffer.size() >= m_resourceTimingBufferSize;
}
#endif // ENABLE(RESOURCE_TIMING)
diff --git a/Source/WebCore/page/Performance.h b/Source/WebCore/page/Performance.h
index fe09d902c..8d949f24c 100644
--- a/Source/WebCore/page/Performance.h
+++ b/Source/WebCore/page/Performance.h
@@ -100,6 +100,7 @@ private:
virtual void derefEventTarget() { deref(); }
virtual EventTargetData* eventTargetData();
virtual EventTargetData* ensureEventTargetData();
+ bool isResourceTimingBufferFull();
EventTargetData m_eventTargetData;
@@ -108,6 +109,7 @@ private:
#if ENABLE(RESOURCE_TIMING)
Vector<RefPtr<PerformanceEntry> > m_resourceTimingBuffer;
+ unsigned m_resourceTimingBufferSize;
#endif
#if ENABLE(USER_TIMING)
diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
index c2fd8b386..382cfd07f 100644
--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
@@ -258,7 +258,7 @@ void ScrollingCoordinator::handleWheelEventPhase(PlatformWheelEventPhase phase)
}
#endif
-bool ScrollingCoordinator::hasNonLayerFixedObjects(FrameView* frameView)
+bool ScrollingCoordinator::hasNonLayerFixedObjects(FrameView* frameView) const
{
const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects = frameView->viewportConstrainedObjects();
if (!viewportConstrainedObjects)
@@ -279,7 +279,7 @@ bool ScrollingCoordinator::hasNonLayerFixedObjects(FrameView* frameView)
#endif
}
-void ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread()
+MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() const
{
FrameView* frameView = m_page->mainFrame()->view();
@@ -296,7 +296,12 @@ void ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread()
if (m_page->mainFrame()->document()->isImageDocument())
mainThreadScrollingReasons |= IsImageDocument;
- setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReasons);
+ return mainThreadScrollingReasons;
+}
+
+void ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread()
+{
+ setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReasons());
}
void ScrollingCoordinator::setForceMainThreadScrollLayerPositionUpdates(bool forceMainThreadScrollLayerPositionUpdates)
diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h
index 2396da881..2fa15fe2f 100644
--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h
+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h
@@ -109,7 +109,7 @@ public:
virtual bool requestScrollPositionUpdate(FrameView*, const IntPoint&) { return false; }
virtual bool handleWheelEvent(FrameView*, const PlatformWheelEvent&) { return true; }
virtual void updateMainFrameScrollPositionAndScrollLayerPosition() { }
- virtual ScrollingNodeID attachToStateTree(ScrollingNodeID nodeID) { return nodeID; }
+ virtual ScrollingNodeID attachToStateTree(ScrollingNodeID newNodeID, ScrollingNodeID /*parentID*/) { return newNodeID; }
virtual void detachFromStateTree(ScrollingNodeID) { }
virtual void clearStateTree() { }
@@ -127,6 +127,9 @@ public:
IsImageDocument = 1 << 4
};
+ MainThreadScrollingReasons mainThreadScrollingReasons() const;
+ bool shouldUpdateScrollLayerPositionOnMainThread() const { return mainThreadScrollingReasons() != 0; }
+
// These virtual functions are currently unique to Chromium's WebLayer approach. Their meaningful
// implementations are in ScrollingCoordinatorChromium.
virtual void frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer*) { }
@@ -148,7 +151,7 @@ private:
virtual void recomputeWheelEventHandlerCountForFrameView(FrameView*) { }
virtual void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons) { }
- bool hasNonLayerFixedObjects(FrameView*);
+ bool hasNonLayerFixedObjects(FrameView*) const;
void updateShouldUpdateScrollLayerPositionOnMainThread();
bool m_forceMainThreadScrollLayerPositionUpdates;
diff --git a/Source/WebCore/page/scrolling/ScrollingStateNode.h b/Source/WebCore/page/scrolling/ScrollingStateNode.h
index 5a801d23a..eb8c389c6 100644
--- a/Source/WebCore/page/scrolling/ScrollingStateNode.h
+++ b/Source/WebCore/page/scrolling/ScrollingStateNode.h
@@ -71,6 +71,7 @@ public:
void setScrollingStateTree(ScrollingStateTree* tree) { m_scrollingStateTree = tree; }
ScrollingNodeID scrollingNodeID() const { return m_nodeID; }
+ void setScrollingNodeID(ScrollingNodeID nodeID) { m_nodeID = nodeID; }
ScrollingStateNode* parent() const { return m_parent; }
void setParent(ScrollingStateNode* parent) { m_parent = parent; }
diff --git a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
index 06ea4730f..ba3583075 100644
--- a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
@@ -77,12 +77,6 @@ ScrollingStateScrollingNode::~ScrollingStateScrollingNode()
{
}
-void ScrollingStateScrollingNode::setHasChangedProperties()
-{
- m_changedProperties = All;
- ScrollingStateNode::setHasChangedProperties();
-}
-
PassOwnPtr<ScrollingStateNode> ScrollingStateScrollingNode::cloneAndResetNode()
{
OwnPtr<ScrollingStateScrollingNode> clone = adoptPtr(new ScrollingStateScrollingNode(this));
diff --git a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
index ba9f6475e..714d92683 100644
--- a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
+++ b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
@@ -56,7 +56,6 @@ public:
VerticalScrollbarMode = 1 << 10,
ScrollOrigin = 1 << 11,
RequestedScrollPosition = 1 << 12,
- All = (1 << 13) - 1 // This will need to be updated if we add or remove anything the ChangedProperties.
};
virtual bool isScrollingStateScrollingNode() OVERRIDE { return true; }
@@ -66,7 +65,6 @@ public:
virtual bool hasChangedProperties() const OVERRIDE { return m_changedProperties; }
virtual unsigned changedProperties() const OVERRIDE { return m_changedProperties; }
virtual void resetChangedProperties() OVERRIDE { m_changedProperties = 0; }
- virtual void setHasChangedProperties();
const IntRect& viewportRect() const { return m_viewportRect; }
void setViewportRect(const IntRect&);
diff --git a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp b/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
index 850841e9a..84bc5db05 100644
--- a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
@@ -36,7 +36,8 @@ PassOwnPtr<ScrollingStateTree> ScrollingStateTree::create()
}
ScrollingStateTree::ScrollingStateTree()
- : m_hasChangedProperties(false)
+ : m_rootStateNode(ScrollingStateScrollingNode::create(this, 0))
+ , m_hasChangedProperties(false)
{
}
@@ -63,13 +64,6 @@ PassOwnPtr<ScrollingStateTree> ScrollingStateTree::commit()
void ScrollingStateTree::removeNode(ScrollingStateNode* node)
{
ASSERT(m_rootStateNode);
-
- if (node == m_rootStateNode) {
- didRemoveNode(m_rootStateNode->scrollingNodeID());
- m_rootStateNode = 0;
- return;
- }
-
m_rootStateNode->removeChild(node);
}
@@ -78,16 +72,6 @@ void ScrollingStateTree::didRemoveNode(ScrollingNodeID nodeID)
m_nodesRemovedSinceLastCommit.append(nodeID);
}
-void ScrollingStateTree::rootLayerDidChange()
-{
- // If the root layer has changed, then destroyed and re-created the root state node. That means that the
- // cached properties in ScrollingStateScrollingNode are no longer reflective of the properties we have
- // cached over in the ScrollingTree. To resolve this, we will mark all of the properties as having changed
- // so that the ScrollingTree will be in synch with the state tree.
- setHasChangedProperties(true);
- rootStateNode()->setHasChangedProperties();
-}
-
} // namespace WebCore
#endif // ENABLE(THREADED_SCROLLING)
diff --git a/Source/WebCore/page/scrolling/ScrollingStateTree.h b/Source/WebCore/page/scrolling/ScrollingStateTree.h
index fc5b73542..98659fcae 100644
--- a/Source/WebCore/page/scrolling/ScrollingStateTree.h
+++ b/Source/WebCore/page/scrolling/ScrollingStateTree.h
@@ -55,7 +55,6 @@ public:
~ScrollingStateTree();
ScrollingStateScrollingNode* rootStateNode() const { return m_rootStateNode.get(); }
- void setRootStateNode(PassOwnPtr<ScrollingStateScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; }
// Copies the current tree state and clears the changed properties mask in the original.
PassOwnPtr<ScrollingStateTree> commit();
@@ -64,14 +63,14 @@ public:
void didRemoveNode(ScrollingNodeID);
const Vector<ScrollingNodeID>& removedNodes() const { return m_nodesRemovedSinceLastCommit; }
- void rootLayerDidChange();
-
void setHasChangedProperties(bool changedProperties) { m_hasChangedProperties = changedProperties; }
bool hasChangedProperties() const { return m_hasChangedProperties; }
private:
ScrollingStateTree();
+ void setRootStateNode(PassOwnPtr<ScrollingStateScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; }
+
PassOwnPtr<ScrollingStateTree> clone();
OwnPtr<ScrollingStateScrollingNode> m_rootStateNode;
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
index c0d617fa9..de0d9a5c7 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
+++ b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
@@ -66,7 +66,7 @@ public:
// These functions are used to indicate that a layer should be (or should not longer be) represented by a node
// in the scrolling tree.
- virtual ScrollingNodeID attachToStateTree(ScrollingNodeID);
+ virtual ScrollingNodeID attachToStateTree(ScrollingNodeID newNodeID, ScrollingNodeID parentID);
virtual void detachFromStateTree(ScrollingNodeID);
// This function wipes out the current tree.
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
index bb8185120..5a03ef31d 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
+++ b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
@@ -147,7 +147,6 @@ void ScrollingCoordinatorMac::frameViewRootLayerDidChange(FrameView* frameView)
// If the root layer does not have a ScrollingStateNode, then we should create one.
ensureRootStateNodeForFrameView(frameView);
ASSERT(m_scrollingStateTree->rootStateNode());
- m_scrollingStateTree->rootLayerDidChange();
ScrollingCoordinator::frameViewRootLayerDidChange(frameView);
@@ -234,22 +233,26 @@ void ScrollingCoordinatorMac::updateMainFrameScrollPositionAndScrollLayerPositio
scrollLayer->setPosition(-frameView->scrollPosition());
}
-ScrollingNodeID ScrollingCoordinatorMac::attachToStateTree(ScrollingNodeID scrollLayerID)
+ScrollingNodeID ScrollingCoordinatorMac::attachToStateTree(ScrollingNodeID newNodeID, ScrollingNodeID parentID)
{
- ASSERT(scrollLayerID);
+ ASSERT(newNodeID);
- ScrollingStateScrollingNode* existingNode = stateNodeForID(scrollLayerID);
+ ScrollingStateScrollingNode* existingNode = stateNodeForID(newNodeID);
if (existingNode && existingNode == m_scrollingStateTree->rootStateNode())
- return scrollLayerID;
+ return newNodeID;
- clearStateTree();
+ // If there is no parent, this is the root node. Right now, we only support the root node.
+ // FIXME: In the future, we should append child nodes in the appropriate spot in the state
+ // tree.
+ if (!parentID) {
+ // If we're resetting the root node, we should clear the HashMap and destroy the current children.
+ clearStateTree();
- // FIXME: In the future, this function will have to take a parent ID so that it can
- // append the node in the appropriate spot in the state tree. For now we always assume
- // this is the root node.
- m_scrollingStateTree->setRootStateNode(ScrollingStateScrollingNode::create(m_scrollingStateTree.get(), scrollLayerID));
- m_stateNodeMap.set(scrollLayerID, m_scrollingStateTree->rootStateNode());
- return scrollLayerID;
+ m_scrollingStateTree->rootStateNode()->setScrollingNodeID(newNodeID);
+ m_stateNodeMap.set(newNodeID, m_scrollingStateTree->rootStateNode());
+ }
+
+ return newNodeID;
}
void ScrollingCoordinatorMac::detachFromStateTree(ScrollingNodeID scrollLayerID)
@@ -275,8 +278,7 @@ void ScrollingCoordinatorMac::detachFromStateTree(ScrollingNodeID scrollLayerID)
void ScrollingCoordinatorMac::clearStateTree()
{
m_stateNodeMap.clear();
- if (ScrollingStateScrollingNode* node = m_scrollingStateTree->rootStateNode())
- m_scrollingStateTree->removeNode(node);
+ m_scrollingStateTree->removeNode(m_scrollingStateTree->rootStateNode());
}
ScrollingStateScrollingNode* ScrollingCoordinatorMac::stateNodeForID(ScrollingNodeID scrollLayerID)
@@ -294,7 +296,7 @@ ScrollingStateScrollingNode* ScrollingCoordinatorMac::stateNodeForID(ScrollingNo
void ScrollingCoordinatorMac::ensureRootStateNodeForFrameView(FrameView* frameView)
{
- attachToStateTree(frameView->scrollLayerID());
+ attachToStateTree(frameView->scrollLayerID(), 0);
}
void ScrollingCoordinatorMac::setScrollLayerForNode(GraphicsLayer* scrollLayer, ScrollingStateNode* node)
diff --git a/Source/WebCore/platform/CalculationValue.cpp b/Source/WebCore/platform/CalculationValue.cpp
index 57413fbfe..57413fbfe 100755..100644
--- a/Source/WebCore/platform/CalculationValue.cpp
+++ b/Source/WebCore/platform/CalculationValue.cpp
diff --git a/Source/WebCore/platform/DateComponents.cpp b/Source/WebCore/platform/DateComponents.cpp
index 320d723cb..c7bc6ca52 100644
--- a/Source/WebCore/platform/DateComponents.cpp
+++ b/Source/WebCore/platform/DateComponents.cpp
@@ -247,8 +247,8 @@ bool DateComponents::addMinute(int minute)
if (minute > 59) {
carry = minute / 60;
minute = minute % 60;
- } else if (m_minute < 0) {
- carry = (59 - m_minute) / 60;
+ } else if (minute < 0) {
+ carry = (59 - minute) / 60;
minute += carry * 60;
carry = -carry;
ASSERT(minute >= 0 && minute <= 59);
diff --git a/Source/WebCore/platform/LinkHash.cpp b/Source/WebCore/platform/LinkHash.cpp
index 3615e0eea..a0ea795ea 100644
--- a/Source/WebCore/platform/LinkHash.cpp
+++ b/Source/WebCore/platform/LinkHash.cpp
@@ -194,11 +194,21 @@ static inline bool needsTrailingSlash(const UChar* characters, unsigned length)
return pos == length;
}
-static ALWAYS_INLINE LinkHash visitedLinkHashInline(const UChar* url, unsigned length)
+template <typename CharacterType>
+static ALWAYS_INLINE LinkHash visitedLinkHashInline(const CharacterType* url, unsigned length)
{
return AlreadyHashed::avoidDeletedValue(StringHasher::computeHash(url, length));
}
+LinkHash visitedLinkHash(const String& url)
+{
+ unsigned length = url.length();
+
+ if (length && url.is8Bit())
+ return visitedLinkHashInline(url.characters8(), length);
+ return visitedLinkHashInline(url.characters(), length);
+}
+
LinkHash visitedLinkHash(const UChar* url, unsigned length)
{
return visitedLinkHashInline(url, length);
diff --git a/Source/WebCore/platform/LinkHash.h b/Source/WebCore/platform/LinkHash.h
index dc494d2dd..78eaa3a43 100644
--- a/Source/WebCore/platform/LinkHash.h
+++ b/Source/WebCore/platform/LinkHash.h
@@ -53,7 +53,8 @@ struct LinkHashHash {
}
};
-// Returns the has of the string that will be used for visited link coloring.
+// Returns the hash of the string that will be used for visited link coloring.
+LinkHash visitedLinkHash(const String& url);
LinkHash visitedLinkHash(const UChar* url, unsigned length);
// Resolves the potentially relative URL "attributeURL" relative to the given
diff --git a/Source/WebCore/platform/LocalizedStrings.cpp b/Source/WebCore/platform/LocalizedStrings.cpp
index 5a7ddf8ba..abf1bca5e 100644
--- a/Source/WebCore/platform/LocalizedStrings.cpp
+++ b/Source/WebCore/platform/LocalizedStrings.cpp
@@ -882,6 +882,10 @@ String localizedMediaControlElementHelpText(const String& name)
if (name == "HideClosedCaptionsButton")
return WEB_UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
+ // The description of this button is descriptive enough that it doesn't require help text.
+ if (name == "EnterFullscreenButton")
+ return String();
+
ASSERT_NOT_REACHED();
return String();
}
diff --git a/Source/WebCore/platform/LocalizedStrings.h b/Source/WebCore/platform/LocalizedStrings.h
index 83432cf79..8c56fe1d5 100644
--- a/Source/WebCore/platform/LocalizedStrings.h
+++ b/Source/WebCore/platform/LocalizedStrings.h
@@ -192,12 +192,7 @@ namespace WebCore {
// "datetime-local" input UI instead "----".
String placeholderForYearField();
- // monthFormatInLDML() returns month and year format in LDML, Unicode
- // technical standard 35, Locale Data Markup Language, e.g. "MM-yyyyy"
- // for "month" input type.
- String monthFormatInLDML();
-
- // monthFormatInLDML() returns week and year format in LDML, Unicode
+ // weekFormatInLDML() returns week and year format in LDML, Unicode
// technical standard 35, Locale Data Markup Language, e.g. "WW-yyyyy"
// for "week" input type.
String weekFormatInLDML();
diff --git a/Source/WebCore/platform/MIMETypeRegistry.cpp b/Source/WebCore/platform/MIMETypeRegistry.cpp
index 440b4299a..440b4299a 100755..100644
--- a/Source/WebCore/platform/MIMETypeRegistry.cpp
+++ b/Source/WebCore/platform/MIMETypeRegistry.cpp
diff --git a/Source/WebCore/platform/Supplementable.h b/Source/WebCore/platform/Supplementable.h
index 4199ac509..0a278fca3 100644
--- a/Source/WebCore/platform/Supplementable.h
+++ b/Source/WebCore/platform/Supplementable.h
@@ -64,6 +64,11 @@ public:
m_supplements.set(key, supplement);
}
+ void removeSupplement(const AtomicString& key)
+ {
+ m_supplements.remove(key);
+ }
+
Supplement<T>* requireSupplement(const AtomicString& key)
{
return m_supplements.get(key);
diff --git a/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp b/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
index 540c979a5..3eab85b29 100644
--- a/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
+++ b/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
@@ -74,6 +74,7 @@ private:
GRefPtr<GstElement> m_decodebin;
GRefPtr<GstElement> m_deInterleave;
GRefPtr<GMainLoop> m_loop;
+ bool m_errorOccurred;
};
static GstCaps* getGStreamerAudioCaps(int channels, float sampleRate)
@@ -131,6 +132,7 @@ AudioFileReader::AudioFileReader(const char* filePath)
, m_dataSize(0)
, m_filePath(filePath)
, m_channelSize(0)
+ , m_errorOccurred(false)
{
}
@@ -139,11 +141,34 @@ AudioFileReader::AudioFileReader(const void* data, size_t dataSize)
, m_dataSize(dataSize)
, m_filePath(0)
, m_channelSize(0)
+ , m_errorOccurred(false)
{
}
AudioFileReader::~AudioFileReader()
{
+ if (m_pipeline) {
+ GRefPtr<GstBus> bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline));
+ g_signal_handlers_disconnect_by_func(bus.get(), reinterpret_cast<gpointer>(messageCallback), this);
+ gst_element_set_state(m_pipeline, GST_STATE_NULL);
+ gst_object_unref(GST_OBJECT(m_pipeline));
+ }
+
+ if (m_decodebin) {
+ g_signal_handlers_disconnect_by_func(m_decodebin.get(), reinterpret_cast<gpointer>(onGStreamerDecodebinPadAddedCallback), this);
+ m_decodebin.clear();
+ }
+
+ if (m_deInterleave) {
+ g_signal_handlers_disconnect_by_func(m_deInterleave.get(), reinterpret_cast<gpointer>(onGStreamerDeinterleavePadAddedCallback), this);
+ g_signal_handlers_disconnect_by_func(m_deInterleave.get(), reinterpret_cast<gpointer>(onGStreamerDeinterleaveReadyCallback), this);
+ m_deInterleave.clear();
+ }
+
+ gst_buffer_list_iterator_free(m_frontLeftBuffersIterator);
+ gst_buffer_list_iterator_free(m_frontRightBuffersIterator);
+ gst_buffer_list_unref(m_frontLeftBuffers);
+ gst_buffer_list_unref(m_frontRightBuffers);
}
GstFlowReturn AudioFileReader::handleBuffer(GstAppSink* sink)
@@ -211,11 +236,13 @@ gboolean AudioFileReader::handleMessage(GstMessage* message)
break;
case GST_MESSAGE_WARNING:
gst_message_parse_warning(message, &error.outPtr(), &debug.outPtr());
- g_warning("Warning: %d, %s", error->code, error->message);
+ g_warning("Warning: %d, %s. Debug output: %s", error->code, error->message, debug.get());
break;
case GST_MESSAGE_ERROR:
gst_message_parse_error(message, &error.outPtr(), &debug.outPtr());
- ASSERT_WITH_MESSAGE(0, "Fatal error: %d, %s", error->code, error->message);
+ g_warning("Error: %d, %s. Debug output: %s", error->code, error->message, debug.get());
+ m_errorOccurred = true;
+ g_main_loop_quit(m_loop.get());
break;
default:
break;
@@ -351,31 +378,17 @@ PassOwnPtr<AudioBus> AudioFileReader::createBus(float sampleRate, bool mixToMono
g_main_loop_run(m_loop.get());
g_main_context_pop_thread_default(context.get());
- GRefPtr<GstBus> bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline));
- g_signal_handlers_disconnect_by_func(bus.get(), reinterpret_cast<gpointer>(messageCallback), this);
-
- g_signal_handlers_disconnect_by_func(m_decodebin.get(), reinterpret_cast<gpointer>(onGStreamerDecodebinPadAddedCallback), this);
- g_signal_handlers_disconnect_by_func(m_deInterleave.get(), reinterpret_cast<gpointer>(onGStreamerDeinterleavePadAddedCallback), this);
- g_signal_handlers_disconnect_by_func(m_deInterleave.get(), reinterpret_cast<gpointer>(onGStreamerDeinterleaveReadyCallback), this);
-
unsigned channels = mixToMono ? 1 : 2;
OwnPtr<AudioBus> audioBus = adoptPtr(new AudioBus(channels, m_channelSize, true));
audioBus->setSampleRate(m_sampleRate);
+ if (m_errorOccurred)
+ return audioBus.release();
+
copyGstreamerBuffersToAudioChannel(m_frontLeftBuffers, audioBus->channel(0));
if (!mixToMono)
copyGstreamerBuffersToAudioChannel(m_frontRightBuffers, audioBus->channel(1));
- gst_buffer_list_iterator_free(m_frontLeftBuffersIterator);
- gst_buffer_list_iterator_free(m_frontRightBuffersIterator);
- gst_buffer_list_unref(m_frontLeftBuffers);
- gst_buffer_list_unref(m_frontRightBuffers);
-
- gst_element_set_state(m_pipeline, GST_STATE_NULL);
- gst_object_unref(GST_OBJECT(m_pipeline));
-
- m_decodebin.clear();
- m_deInterleave.clear();
return audioBus.release();
}
diff --git a/Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp b/Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp
index 310f39c1c..6fc787f50 100644
--- a/Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp
+++ b/Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp
@@ -28,7 +28,6 @@
#include <wtf/gobject/GOwnPtr.h>
#include <wtf/text/CString.h>
-#include <gio/gio.h>
#include <glib.h>
namespace WebCore {
@@ -36,14 +35,12 @@ namespace WebCore {
PassOwnPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, float sampleRate)
{
GOwnPtr<gchar> filename(g_strdup_printf("%s.wav", name));
- GOwnPtr<gchar> absoluteFilename(g_build_filename(sharedResourcesPath().data(), "resources", "audio", filename.get(), NULL));
-
- GFile* file = g_file_new_for_path(filename.get());
- if (!g_file_query_exists(file, 0)) {
- // Uninstalled case, assume we're in the WebKit root directory.
- const char* environmentPath = getenv("AUDIO_RESOURCES_PATH");
+ const char* environmentPath = getenv("AUDIO_RESOURCES_PATH");
+ GOwnPtr<gchar> absoluteFilename;
+ if (environmentPath)
absoluteFilename.set(g_build_filename(environmentPath, filename.get(), NULL));
- }
+ else
+ absoluteFilename.set(g_build_filename(sharedResourcesPath().data(), "resources", "audio", filename.get(), NULL));
return createBusFromAudioFile(absoluteFilename.get(), false, sampleRate);
}
diff --git a/Source/WebCore/platform/chromium/LinkHashChromium.cpp b/Source/WebCore/platform/chromium/LinkHashChromium.cpp
index b051bf4ba..3dc07abf2 100644
--- a/Source/WebCore/platform/chromium/LinkHashChromium.cpp
+++ b/Source/WebCore/platform/chromium/LinkHashChromium.cpp
@@ -51,6 +51,11 @@ LinkHash visitedLinkHash(const UChar* url, unsigned length)
return WebKit::Platform::current()->visitedLinkHash(buffer.data(), buffer.length());
}
+LinkHash visitedLinkHash(const String& url)
+{
+ return (url.characters(), url.length());
+}
+
LinkHash visitedLinkHash(const KURL& base, const AtomicString& attributeURL)
{
// Resolve the relative URL using googleurl and pass the absolute URL up to
diff --git a/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp b/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp
index 36cce7439..96bad7b1e 100644
--- a/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp
+++ b/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp
@@ -125,20 +125,6 @@ WebMediaStreamDescriptor::operator WebCore::MediaStreamDescriptor*() const
return m_private.get();
}
-// FIXME: Cleanup when the chromium code has switched to the split sources implementation.
-void WebMediaStreamDescriptor::initialize(const WebString& label, const WebVector<WebMediaStreamSource>& sources)
-{
- MediaStreamSourceVector audio, video;
- for (size_t i = 0; i < sources.size(); ++i) {
- MediaStreamSource* curr = sources[i];
- if (curr->type() == MediaStreamSource::TypeAudio)
- audio.append(curr);
- else if (curr->type() == MediaStreamSource::TypeVideo)
- video.append(curr);
- }
- m_private = MediaStreamDescriptor::create(label, audio, video);
-}
-
void WebMediaStreamDescriptor::initialize(const WebString& label, const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources)
{
MediaStreamSourceVector audio, video;
diff --git a/Source/WebCore/platform/chromium/support/WebThreadSafeData.cpp b/Source/WebCore/platform/chromium/support/WebThreadSafeData.cpp
index 8e11209b4..8e11209b4 100755..100644
--- a/Source/WebCore/platform/chromium/support/WebThreadSafeData.cpp
+++ b/Source/WebCore/platform/chromium/support/WebThreadSafeData.cpp
diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
index 22ffac004..9a034bd91 100644
--- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
+++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
@@ -95,21 +95,32 @@ static bool getSymbolInfo(ShHandle compiler, ShShaderInfo symbolType, Vector<ANG
// is a subset of Latin-1 as specified by the OpenGL ES Shading Language, Section 3.1 and
// WebGL, Section "Characters Outside the GLSL Source Character Set".
- // If the variable is an array, add symbols for each array element
- if (symbol.size > 1) {
+ String name = String(nameBuffer.data());
+ String mappedName = String(mappedNameBuffer.data());
+
+ // ANGLE returns array names in the format "array[0]".
+ // The only way to know if a symbol is an array is to check if it ends with "[0]".
+ // We can't check the size because regular symbols and arrays of length 1 both have a size of 1.
+ symbol.isArray = name.endsWith("[0]") && mappedName.endsWith("[0]");
+ if (symbol.isArray) {
+ // Add a symbol for the array name without the "[0]" suffix.
+ name.truncate(name.length() - 3);
+ mappedName.truncate(mappedName.length() - 3);
+ }
+
+ symbol.name = name;
+ symbol.mappedName = mappedName;
+ symbols.append(symbol);
+
+ if (symbol.isArray) {
+ // Add symbols for each array element.
+ symbol.isArray = false;
for (int i = 0; i < symbol.size; i++) {
- String name = nameBuffer.data();
- String mappedName = mappedNameBuffer.data();
- name.replace(name.length() - 2, 1, String::number(i));
- mappedName.replace(mappedName.length() - 2, 1, String::number(i));
- symbol.name = name;
- symbol.mappedName = mappedName;
+ String arrayBrackets = "[" + String::number(i) + "]";
+ symbol.name = name + arrayBrackets;
+ symbol.mappedName = mappedName + arrayBrackets;
symbols.append(symbol);
}
- } else {
- symbol.name = String(nameBuffer.data());
- symbol.mappedName = String(mappedNameBuffer.data());
- symbols.append(symbol);
}
}
return true;
@@ -173,6 +184,12 @@ bool ANGLEWebKitBridge::compileShaderSource(const char* shaderSource, ANGLEShade
const char* const shaderSourceStrings[] = { shaderSource };
+#if !PLATFORM(CHROMIUM)
+ // Chromium does not use the ANGLE bundled in WebKit source, and thus
+ // does not yet have the symbol SH_CLAMP_INDIRECT_ARRAY_BOUNDS.
+ extraCompileOptions |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS;
+#endif
+
bool validateSuccess = ShCompile(compiler, shaderSourceStrings, 1, SH_OBJECT_CODE | SH_ATTRIBUTES_UNIFORMS | extraCompileOptions);
if (!validateSuccess) {
int logSize = getValidationResultValue(compiler, SH_INFO_LOG_LENGTH);
diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
index 178d3bddc..52f71dd3f 100644
--- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
+++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
@@ -53,8 +53,9 @@ struct ANGLEShaderSymbol {
String mappedName;
ShDataType dataType;
int size;
+ bool isArray;
- bool isSampler()
+ bool isSampler() const
{
return symbolType == SHADER_SYMBOL_TYPE_UNIFORM
&& (dataType == SH_SAMPLER_2D
diff --git a/Source/WebCore/platform/graphics/Extensions3D.h b/Source/WebCore/platform/graphics/Extensions3D.h
index 48b26ce12..2f4c12c03 100644
--- a/Source/WebCore/platform/graphics/Extensions3D.h
+++ b/Source/WebCore/platform/graphics/Extensions3D.h
@@ -56,6 +56,7 @@ public:
// GL_OES_standard_derivatives
// GL_OES_rgb8_rgba8
// GL_OES_vertex_array_object
+ // GL_OES_element_index_uint
// GL_ANGLE_translated_shader_source
// GL_ARB_texture_rectangle (only the subset required to
// implement IOSurface binding; it's recommended to support
diff --git a/Source/WebCore/platform/graphics/FloatRect.cpp b/Source/WebCore/platform/graphics/FloatRect.cpp
index f31c6ccdf..7ced95afd 100644
--- a/Source/WebCore/platform/graphics/FloatRect.cpp
+++ b/Source/WebCore/platform/graphics/FloatRect.cpp
@@ -134,6 +134,16 @@ void FloatRect::uniteIfNonZero(const FloatRect& other)
uniteEvenIfEmpty(other);
}
+void FloatRect::extend(const FloatPoint& p)
+{
+ float minX = min(x(), p.x());
+ float minY = min(y(), p.y());
+ float maxX = max(this->maxX(), p.x());
+ float maxY = max(this->maxY(), p.y());
+
+ setLocationAndSizeFromEdges(minX, minY, maxX, maxY);
+}
+
void FloatRect::scale(float sx, float sy)
{
m_location.setX(x() * sx);
diff --git a/Source/WebCore/platform/graphics/FloatRect.h b/Source/WebCore/platform/graphics/FloatRect.h
index 161e2780f..9e09ac922 100644
--- a/Source/WebCore/platform/graphics/FloatRect.h
+++ b/Source/WebCore/platform/graphics/FloatRect.h
@@ -164,6 +164,7 @@ public:
void unite(const FloatRect&);
void uniteEvenIfEmpty(const FloatRect&);
void uniteIfNonZero(const FloatRect&);
+ void extend(const FloatPoint&);
// Note, this doesn't match what IntRect::contains(IntPoint&) does; the int version
// is really checking for containment of 1x1 rect, but that doesn't make sense with floats.
diff --git a/Source/WebCore/platform/graphics/ImageSource.cpp b/Source/WebCore/platform/graphics/ImageSource.cpp
index 82dfde1c9..abfa5988b 100644
--- a/Source/WebCore/platform/graphics/ImageSource.cpp
+++ b/Source/WebCore/platform/graphics/ImageSource.cpp
@@ -35,6 +35,10 @@
#include "NotImplemented.h"
#include "PlatformMemoryInstrumentation.h"
+#if PLATFORM(CHROMIUM)
+#include "DeferredImageDecoder.h"
+#endif
+
namespace WebCore {
#if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
@@ -79,7 +83,7 @@ void ImageSource::setData(SharedBuffer* data, bool allDataReceived)
// If insufficient bytes are available to determine the image type, no decoder plugin will be
// made.
if (!m_decoder) {
- m_decoder = static_cast<NativeImageSourcePtr>(ImageDecoder::create(*data, m_alphaOption, m_gammaAndColorProfileOption));
+ m_decoder = static_cast<NativeImageDecoderPtr>(NativeImageDecoder::create(*data, m_alphaOption, m_gammaAndColorProfileOption));
#if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
if (m_decoder && s_maxPixelsPerDecodedImage)
m_decoder->setMaxNumPixels(s_maxPixelsPerDecodedImage);
diff --git a/Source/WebCore/platform/graphics/ImageSource.h b/Source/WebCore/platform/graphics/ImageSource.h
index 0d8a01e26..66a8a0a51 100644
--- a/Source/WebCore/platform/graphics/ImageSource.h
+++ b/Source/WebCore/platform/graphics/ImageSource.h
@@ -47,10 +47,20 @@ class IntSize;
class SharedBuffer;
#if USE(CG)
-typedef CGImageSourceRef NativeImageSourcePtr;
-#else
+typedef CGImageSourceRef NativeImageDecoderPtr;
+#elif !PLATFORM(CHROMIUM)
class ImageDecoder;
-typedef ImageDecoder* NativeImageSourcePtr;
+typedef ImageDecoder* NativeImageDecoderPtr;
+#endif
+
+#if PLATFORM(CHROMIUM)
+class DeferredImageDecoder;
+typedef DeferredImageDecoder NativeImageDecoder;
+typedef DeferredImageDecoder* NativeImageDecoderPtr;
+#elif USE(CG)
+#define NativeImageDecoder ImageDecoder
+#else
+typedef ImageDecoder NativeImageDecoder;
#endif
// Right now GIFs are the only recognized image format that supports animation.
@@ -158,7 +168,7 @@ public:
void reportMemoryUsage(MemoryObjectInfo*) const;
private:
- NativeImageSourcePtr m_decoder;
+ NativeImageDecoderPtr m_decoder;
#if !USE(CG)
AlphaOption m_alphaOption;
diff --git a/Source/WebCore/platform/graphics/TiledBacking.h b/Source/WebCore/platform/graphics/TiledBacking.h
index 1c74f09a2..4108f122b 100644
--- a/Source/WebCore/platform/graphics/TiledBacking.h
+++ b/Source/WebCore/platform/graphics/TiledBacking.h
@@ -34,7 +34,9 @@ class TiledBacking {
public:
virtual ~TiledBacking() { }
- virtual void visibleRectChanged(const IntRect&) = 0;
+ virtual void setVisibleRect(const IntRect&) = 0;
+ virtual IntRect visibleRect() const = 0;
+
virtual void setIsInWindow(bool) = 0;
enum {
diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
index d3df7fe0f..a74bb1cd0 100644
--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
@@ -38,6 +38,7 @@
#include "ScaleTransformOperation.h"
#include "SystemTime.h"
#include "TextStream.h"
+#include "TiledBacking.h"
#include "TransformState.h"
#include "TranslateTransformOperation.h"
#include <QuartzCore/CATransform3D.h>
@@ -905,7 +906,7 @@ void GraphicsLayerCA::flushCompositingStateForThisLayerOnly()
{
float pageScaleFactor;
FloatPoint offset = computePositionRelativeToBase(pageScaleFactor);
- commitLayerChangesBeforeSublayers(pageScaleFactor, offset);
+ commitLayerChangesBeforeSublayers(pageScaleFactor, offset, m_visibleRect);
commitLayerChangesAfterSublayers();
}
@@ -914,7 +915,7 @@ TiledBacking* GraphicsLayerCA::tiledBacking()
return m_layer->tiledBacking();
}
-void GraphicsLayerCA::computeVisibleRect(TransformState& state)
+FloatRect GraphicsLayerCA::computeVisibleRect(TransformState& state) const
{
bool preserve3D = preserves3D() || (parent() ? parent()->preserves3D() : false);
TransformState::TransformAccumulation accumulation = preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform;
@@ -954,13 +955,19 @@ void GraphicsLayerCA::computeVisibleRect(TransformState& state)
state.setQuad(clipRectForSelf);
}
- m_visibleRect = clipRectForSelf;
+ return clipRectForSelf;
}
void GraphicsLayerCA::recursiveCommitChanges(const TransformState& state, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale)
{
TransformState localState = state;
- computeVisibleRect(localState);
+
+ FloatRect visibleRect = computeVisibleRect(localState);
+ FloatRect oldVisibleRect = m_visibleRect;
+ if (visibleRect != m_visibleRect) {
+ m_uncommittedChanges |= VisibleRectChanged;
+ m_visibleRect = visibleRect;
+ }
#ifdef VISIBLE_TILE_WASH
// Use having a transform as a key to making the tile wash layer. If every layer gets a wash,
@@ -995,10 +1002,12 @@ void GraphicsLayerCA::recursiveCommitChanges(const TransformState& state, float
if (affectedByPageScale)
baseRelativePosition += m_position;
- commitLayerChangesBeforeSublayers(pageScaleFactor, baseRelativePosition);
+ commitLayerChangesBeforeSublayers(pageScaleFactor, baseRelativePosition, oldVisibleRect);
- if (m_maskLayer)
- static_cast<GraphicsLayerCA*>(m_maskLayer)->commitLayerChangesBeforeSublayers(pageScaleFactor, baseRelativePosition);
+ if (m_maskLayer) {
+ GraphicsLayerCA* maskLayerCA = static_cast<GraphicsLayerCA*>(m_maskLayer);
+ maskLayerCA->commitLayerChangesBeforeSublayers(pageScaleFactor, baseRelativePosition, maskLayerCA->visibleRect());
+ }
const Vector<GraphicsLayer*>& childLayers = children();
size_t numChildren = childLayers.size();
@@ -1055,7 +1064,7 @@ float GraphicsLayerCA::platformCALayerDeviceScaleFactor()
return deviceScaleFactor();
}
-void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, const FloatPoint& positionRelativeToBase)
+void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect)
{
if (!m_uncommittedChanges)
return;
@@ -1064,6 +1073,12 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c
if (m_uncommittedChanges & (Preserves3DChanged | ReplicatedLayerChanged))
updateStructuralLayer(pageScaleFactor, positionRelativeToBase);
+ if (m_uncommittedChanges & GeometryChanged)
+ updateGeometry(pageScaleFactor, positionRelativeToBase);
+
+ if (m_uncommittedChanges & DrawsContentChanged)
+ updateLayerDrawsContent(pageScaleFactor, positionRelativeToBase);
+
if (m_uncommittedChanges & NameChanged)
updateLayerNames();
@@ -1079,12 +1094,6 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c
if (m_uncommittedChanges & BackgroundColorChanged) // Needs to happen before ChildrenChanged, and after updating image or video
updateLayerBackgroundColor();
- if (m_uncommittedChanges & ChildrenChanged)
- updateSublayerList();
-
- if (m_uncommittedChanges & GeometryChanged)
- updateGeometry(pageScaleFactor, positionRelativeToBase);
-
if (m_uncommittedChanges & TransformChanged)
updateTransform();
@@ -1094,9 +1103,6 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c
if (m_uncommittedChanges & MasksToBoundsChanged)
updateMasksToBounds();
- if (m_uncommittedChanges & DrawsContentChanged)
- updateLayerDrawsContent(pageScaleFactor, positionRelativeToBase);
-
if (m_uncommittedChanges & ContentsVisibilityChanged)
updateContentsVisibility();
@@ -1122,6 +1128,9 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c
if (m_uncommittedChanges & ContentsScaleChanged)
updateContentsScale(pageScaleFactor, positionRelativeToBase);
+ if (m_uncommittedChanges & VisibleRectChanged)
+ updateVisibleRect(oldVisibleRect);
+
if (m_uncommittedChanges & DirtyRectsChanged)
repaintLayerDirtyRects();
@@ -1136,6 +1145,12 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c
if (m_uncommittedChanges & AcceleratesDrawingChanged)
updateAcceleratesDrawing();
+
+ if (m_uncommittedChanges & ChildrenChanged) {
+ updateSublayerList();
+ // Sublayers may set this flag again, so clear it to avoid always updating sublayers in commitLayerChangesAfterSublayers().
+ m_uncommittedChanges &= ~ChildrenChanged;
+ }
}
void GraphicsLayerCA::commitLayerChangesAfterSublayers()
@@ -1143,6 +1158,9 @@ void GraphicsLayerCA::commitLayerChangesAfterSublayers()
if (!m_uncommittedChanges)
return;
+ if (m_uncommittedChanges & ChildrenChanged)
+ updateSublayerList();
+
if (m_uncommittedChanges & ReplicatedLayerChanged)
updateReplicatedLayers();
@@ -1402,8 +1420,19 @@ void GraphicsLayerCA::updateStructuralLayer(float pageScaleFactor, const FloatPo
ensureStructuralLayer(structuralLayerPurpose(), pageScaleFactor, positionRelativeToBase);
}
-void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, float pageScaleFactor, const FloatPoint& positionRelativeToBase)
+void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, float /*pageScaleFactor*/, const FloatPoint& /*positionRelativeToBase*/)
{
+ const LayerChangeFlags structuralLayerChangeFlags = NameChanged
+ | GeometryChanged
+ | TransformChanged
+ | ChildrenTransformChanged
+ | ChildrenChanged
+ | BackfaceVisibilityChanged
+#if ENABLE(CSS_FILTERS)
+ | FiltersChanged
+#endif
+ | OpacityChanged;
+
if (purpose == NoStructuralLayer) {
if (m_structuralLayer) {
// Replace the transformLayer in the parent with this layer.
@@ -1419,17 +1448,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, floa
// Release the structural layer.
m_structuralLayer = 0;
- // Update the properties of m_layer now that we no longer have a structural layer.
- updateGeometry(pageScaleFactor, positionRelativeToBase);
- updateTransform();
- updateChildrenTransform();
-
-#if ENABLE(CSS_FILTERS)
- updateFilters();
-#endif
-
- updateSublayerList();
- updateOpacityOnLayer();
+ m_uncommittedChanges |= structuralLayerChangeFlags;
}
return;
}
@@ -1457,19 +1476,12 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, floa
if (!structuralLayerChanged)
return;
- updateLayerNames();
+ m_uncommittedChanges |= structuralLayerChangeFlags;
+
+ // We've changed the layer that our parent added to its sublayer list, so tell it to update
+ // sublayers again in its commitLayerChangesAfterSublayers().
+ static_cast<GraphicsLayerCA*>(parent())->noteSublayersChanged();
- // Update the properties of the structural layer.
- updateGeometry(pageScaleFactor, positionRelativeToBase);
- updateTransform();
- updateChildrenTransform();
- updateBackfaceVisibility();
-#if ENABLE(CSS_FILTERS)
- // Filters cause flattening, so we should never have a layer for preserve-3d.
- if (purpose != StructuralLayerForPreserves3D)
- updateFilters();
-#endif
-
// Set properties of m_layer to their default values, since these are expressed on on the structural layer.
FloatPoint point(m_size.width() / 2.0f, m_size.height() / 2.0f);
FloatPoint3D anchorPoint(0.5f, 0.5f, 0);
@@ -1488,17 +1500,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, floa
}
}
- // Move this layer to be a child of the transform layer.
- // If m_layer doesn't have a parent, it means it's the root layer and
- // is likely hosted by something that is not expecting to be changed
- ASSERT(m_layer->superlayer());
- m_layer->superlayer()->replaceSublayer(m_layer.get(), m_structuralLayer.get());
- m_structuralLayer->appendSublayer(m_layer.get());
-
moveOrCopyAnimations(Move, m_layer.get(), m_structuralLayer.get());
-
- updateSublayerList();
- updateOpacityOnLayer();
}
GraphicsLayerCA::StructuralLayerPurpose GraphicsLayerCA::structuralLayerPurpose() const
@@ -1535,7 +1537,78 @@ void GraphicsLayerCA::updateAcceleratesDrawing()
{
m_layer->setAcceleratesDrawing(m_acceleratesDrawing);
}
+
+FloatRect GraphicsLayerCA::adjustTiledLayerVisibleRect(TiledBacking* tiledBacking, const FloatRect& oldVisibleRect, const FloatSize& oldSize) const
+{
+ // If the old visible rect is empty, we have no information about how the visible area is changing
+ // (maybe the layer was just created), so don't attempt to expand. Also don't attempt to expand
+ // if the size changed.
+ if (oldVisibleRect.isEmpty() || m_size != oldSize)
+ return m_visibleRect;
+
+ const float paddingMultiplier = 2;
+
+ float leftEdgeDelta = paddingMultiplier * (m_visibleRect.x() - oldVisibleRect.x());
+ float rightEdgeDelta = paddingMultiplier * (m_visibleRect.maxX() - oldVisibleRect.maxX());
+
+ float topEdgeDelta = paddingMultiplier * (m_visibleRect.y() - oldVisibleRect.y());
+ float bottomEdgeDelta = paddingMultiplier * (m_visibleRect.maxY() - oldVisibleRect.maxY());
+ FloatRect existingTileBackingRect = tiledBacking->visibleRect();
+ FloatRect expandedRect = m_visibleRect;
+
+ // More exposed on left side.
+ if (leftEdgeDelta < 0) {
+ float newLeft = expandedRect.x() + leftEdgeDelta;
+ // Pad to the left, but don't reduce padding that's already in the backing store (since we're still exposing to the left).
+ if (newLeft < existingTileBackingRect.x())
+ expandedRect.shiftXEdgeTo(newLeft);
+ else
+ expandedRect.shiftXEdgeTo(existingTileBackingRect.x());
+ }
+
+ // More exposed on right.
+ if (rightEdgeDelta > 0) {
+ float newRight = expandedRect.maxX() + rightEdgeDelta;
+ // Pad to the right, but don't reduce padding that's already in the backing store (since we're still exposing to the right).
+ if (newRight > existingTileBackingRect.maxX())
+ expandedRect.setWidth(newRight - expandedRect.x());
+ else
+ expandedRect.setWidth(existingTileBackingRect.maxX() - expandedRect.x());
+ }
+
+ // More exposed at top.
+ if (topEdgeDelta < 0) {
+ float newTop = expandedRect.y() + topEdgeDelta;
+ if (newTop < existingTileBackingRect.y())
+ expandedRect.shiftYEdgeTo(newTop);
+ else
+ expandedRect.shiftYEdgeTo(existingTileBackingRect.y());
+ }
+
+ // More exposed on bottom.
+ if (bottomEdgeDelta > 0) {
+ float newBottom = expandedRect.maxY() + bottomEdgeDelta;
+ if (newBottom > existingTileBackingRect.maxY())
+ expandedRect.setHeight(newBottom - expandedRect.y());
+ else
+ expandedRect.setHeight(existingTileBackingRect.maxY() - expandedRect.y());
+ }
+
+ return expandedRect;
+}
+
+void GraphicsLayerCA::updateVisibleRect(const FloatRect& oldVisibleRect)
+{
+ if (m_layer->layerType() != PlatformCALayer::LayerTypeTileCacheLayer)
+ return;
+
+ FloatRect tileArea = adjustTiledLayerVisibleRect(tiledBacking(), oldVisibleRect, m_sizeAtLastVisibleRectUpdate);
+ tiledBacking()->setVisibleRect(enclosingIntRect(tileArea));
+
+ m_sizeAtLastVisibleRectUpdate = m_size;
+}
+
void GraphicsLayerCA::updateLayerBackgroundColor()
{
if (m_isPageTileCacheLayer) {
@@ -2495,13 +2568,13 @@ bool GraphicsLayerCA::requiresTiledLayer(float pageScaleFactor) const
return m_size.width() * pageScaleFactor > cMaxPixelDimension || m_size.height() * pageScaleFactor > cMaxPixelDimension;
}
-void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer, float pageScaleFactor, const FloatPoint& positionRelativeToBase)
+void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer, float /*pageScaleFactor*/, const FloatPoint& /*positionRelativeToBase*/)
{
ASSERT(m_layer->layerType() != PlatformCALayer::LayerTypePageTileCacheLayer);
ASSERT(useTiledLayer != m_usingTiledLayer);
RefPtr<PlatformCALayer> oldLayer = m_layer;
- m_layer = PlatformCALayer::create(useTiledLayer ? PlatformCALayer::LayerTypeWebTiledLayer : PlatformCALayer::LayerTypeWebLayer, this);
+ m_layer = PlatformCALayer::create(useTiledLayer ? PlatformCALayer::LayerTypeTileCacheLayer : PlatformCALayer::LayerTypeWebLayer, this);
m_usingTiledLayer = useTiledLayer;
m_layer->adoptSublayers(oldLayer.get());
@@ -2517,19 +2590,20 @@ void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer, float pageScale
if (oldLayer->superlayer())
oldLayer->superlayer()->replaceSublayer(oldLayer.get(), m_layer.get());
- updateGeometry(pageScaleFactor, positionRelativeToBase);
- updateTransform();
- updateChildrenTransform();
- updateMasksToBounds();
+ m_uncommittedChanges |= ChildrenChanged
+ | GeometryChanged
+ | TransformChanged
+ | ChildrenTransformChanged
+ | MasksToBoundsChanged
+ | ContentsOpaqueChanged
+ | BackfaceVisibilityChanged
+ | BackgroundColorChanged
+ | ContentsScaleChanged
+ | AcceleratesDrawingChanged
#if ENABLE(CSS_FILTERS)
- updateFilters();
+ | FiltersChanged
#endif
- updateContentsOpaque();
- updateBackfaceVisibility();
- updateLayerBackgroundColor();
- updateContentsScale(pageScaleFactor, positionRelativeToBase);
- updateAcceleratesDrawing();
- updateOpacityOnLayer();
+ | OpacityChanged;
#ifndef NDEBUG
String name = String::format("%sCALayer(%p) GraphicsLayer(%p) ", (m_layer->layerType() == PlatformCALayer::LayerTypeWebTiledLayer) ? "Tiled " : "", m_layer->platformLayer(), this) + m_name;
diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
index b8da5776a..c6b210e5b 100644
--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
@@ -211,7 +211,7 @@ private:
return m_runningAnimations.find(animationName) != m_runningAnimations.end();
}
- void commitLayerChangesBeforeSublayers(float pageScaleFactor, const FloatPoint& positionRelativeToBase);
+ void commitLayerChangesBeforeSublayers(float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect);
void commitLayerChangesAfterSublayers();
FloatPoint computePositionRelativeToBase(float& pageScale) const;
@@ -233,7 +233,10 @@ private:
void computePixelAlignment(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase,
FloatPoint& position, FloatSize&, FloatPoint3D& anchorPoint, FloatSize& alignmentOffset) const;
- void computeVisibleRect(TransformState&);
+ FloatRect computeVisibleRect(TransformState&) const;
+ const FloatRect& visibleRect() const { return m_visibleRect; }
+
+ FloatRect adjustTiledLayerVisibleRect(TiledBacking*, const FloatRect& oldVisibleRect, const FloatSize& oldSize) const;
// Used to track the path down the tree for replica layers.
struct ReplicaState {
@@ -323,6 +326,7 @@ private:
void updateLayerAnimations();
void updateContentsNeedsDisplay();
void updateAcceleratesDrawing();
+ void updateVisibleRect(const FloatRect& oldVisibleRect);
void updateContentsScale(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase);
enum StructuralLayerPurpose {
@@ -372,8 +376,9 @@ private:
AcceleratesDrawingChanged = 1 << 22,
ContentsScaleChanged = 1 << 23,
ContentsVisibilityChanged = 1 << 24,
+ VisibleRectChanged = 1 << 25,
#if ENABLE(CSS_FILTERS)
- FiltersChanged = 1 << 25,
+ FiltersChanged = 1 << 26,
#endif
};
typedef unsigned LayerChangeFlags;
@@ -396,6 +401,7 @@ private:
RefPtr<PlatformCALayer> m_visibleTileWashLayer;
#endif
FloatRect m_visibleRect;
+ FloatSize m_sizeAtLastVisibleRectUpdate;
enum ContentsLayerPurpose {
NoContentsLayer = 0,
diff --git a/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm b/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
index 915a60be6..1659c4dca 100644
--- a/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
+++ b/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
@@ -330,6 +330,7 @@ void PlatformCALayer::removeAllSublayers()
void PlatformCALayer::appendSublayer(PlatformCALayer* layer)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS
+ ASSERT(m_layer != layer->m_layer);
[m_layer.get() addSublayer:layer->m_layer.get()];
END_BLOCK_OBJC_EXCEPTIONS
}
@@ -337,6 +338,7 @@ void PlatformCALayer::appendSublayer(PlatformCALayer* layer)
void PlatformCALayer::insertSublayer(PlatformCALayer* layer, size_t index)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS
+ ASSERT(m_layer != layer->m_layer);
[m_layer.get() insertSublayer:layer->m_layer.get() atIndex:index];
END_BLOCK_OBJC_EXCEPTIONS
}
@@ -344,6 +346,7 @@ void PlatformCALayer::insertSublayer(PlatformCALayer* layer, size_t index)
void PlatformCALayer::replaceSublayer(PlatformCALayer* reference, PlatformCALayer* layer)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS
+ ASSERT(m_layer != layer->m_layer);
[m_layer.get() replaceSublayer:reference->m_layer.get() with:layer->m_layer.get()];
END_BLOCK_OBJC_EXCEPTIONS
}
diff --git a/Source/WebCore/platform/graphics/ca/mac/TileCache.h b/Source/WebCore/platform/graphics/ca/mac/TileCache.h
index 76387e8aa..17e98ee3c 100644
--- a/Source/WebCore/platform/graphics/ca/mac/TileCache.h
+++ b/Source/WebCore/platform/graphics/ca/mac/TileCache.h
@@ -73,7 +73,7 @@ public:
void setTileDebugBorderWidth(float);
void setTileDebugBorderColor(CGColorRef);
- IntRect visibleRect() const { return m_visibleRect; }
+ virtual IntRect visibleRect() const OVERRIDE { return m_visibleRect; }
unsigned blankPixelCount() const;
static unsigned blankPixelCountForTiles(const WebTileLayerList&, IntRect, IntPoint);
@@ -82,7 +82,7 @@ private:
TileCache(WebTileCacheLayer*, const IntSize& tileSize);
// TiledBacking member functions.
- virtual void visibleRectChanged(const IntRect&) OVERRIDE;
+ virtual void setVisibleRect(const IntRect&) OVERRIDE;
virtual void setIsInWindow(bool) OVERRIDE;
virtual void setTileCoverage(TileCoverage) OVERRIDE;
virtual TileCoverage tileCoverage() const OVERRIDE { return m_tileCoverage; }
diff --git a/Source/WebCore/platform/graphics/ca/mac/TileCache.mm b/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
index b12b14d11..619244da9 100644
--- a/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
+++ b/Source/WebCore/platform/graphics/ca/mac/TileCache.mm
@@ -220,7 +220,7 @@ void TileCache::setTilesOpaque(bool opaque)
}
}
-void TileCache::visibleRectChanged(const IntRect& visibleRect)
+void TileCache::setVisibleRect(const IntRect& visibleRect)
{
if (m_visibleRect == visibleRect)
return;
@@ -315,10 +315,10 @@ IntRect TileCache::tileCoverageRect() const
// Inflate the coverage rect so that it covers 2x of the visible width and 3x of the visible height.
// These values were chosen because it's more common to have tall pages and to scroll vertically,
// so we keep more tiles above and below the current area.
- if (m_tileCoverage && CoverageForHorizontalScrolling)
+ if (m_tileCoverage & CoverageForHorizontalScrolling)
tileCoverageRect.inflateX(tileCoverageRect.width() / 2);
- if (m_tileCoverage && CoverageForVerticalScrolling)
+ if (m_tileCoverage & CoverageForVerticalScrolling)
tileCoverageRect.inflateY(tileCoverageRect.height());
}
diff --git a/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.cpp b/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.cpp
new file mode 100644
index 000000000..7574196e7
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.cpp
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DeferredImageDecoder.h"
+
+#include "ImageDecodingStore.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+DeferredImageDecoder::DeferredImageDecoder(ImageDecoder* actualDecoder)
+ : m_allDataReceived(false)
+ , m_actualDecoder(adoptPtr(actualDecoder))
+{
+}
+
+DeferredImageDecoder::~DeferredImageDecoder()
+{
+ // FIXME: Remove the corresponding entry in ImageDecodingStore if image
+ // is defer-decoded.
+}
+
+DeferredImageDecoder* DeferredImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorOption)
+{
+ ImageDecoder* actualDecoder = ImageDecoder::create(data, alphaOption, gammaAndColorOption);
+ return actualDecoder ? new DeferredImageDecoder(actualDecoder) : 0;
+}
+
+PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::createForTesting(PassOwnPtr<ImageDecoder> decoder)
+{
+ return adoptPtr(new DeferredImageDecoder(decoder.leakPtr()));
+}
+
+String DeferredImageDecoder::filenameExtension() const
+{
+ return m_actualDecoder ? m_actualDecoder->filenameExtension() : m_filenameExtension;
+}
+
+ImageFrame* DeferredImageDecoder::frameBufferAtIndex(size_t index)
+{
+ // Only defer image decoding if this is a single frame image. The reason is
+ // because a multiframe is usually animated GIF. Animation is handled by
+ // BitmapImage which uses some metadata functions that do synchronous image
+ // decoding.
+ if (ImageDecodingStore::instanceOnMainThread()
+ && m_actualDecoder
+ && m_actualDecoder->repetitionCount() == cAnimationNone
+ && m_actualDecoder->isSizeAvailable()) {
+
+ m_size = m_actualDecoder->size();
+ m_filenameExtension = m_actualDecoder->filenameExtension();
+
+ SkBitmap lazyDecodedSkBitmap = ImageDecodingStore::instanceOnMainThread()->createLazyDecodedSkBitmap(m_actualDecoder.release());
+ m_lazyDecodedFrame.setSkBitmap(lazyDecodedSkBitmap);
+ ImageDecodingStore::instanceOnMainThread()->setData(m_lazyDecodedFrame.getSkBitmap(), m_data.release(), m_allDataReceived);
+
+ // Don't mark the frame as completely decoded until the underlying
+ // decoder has really decoded it. Until then, our data and metadata may
+ // be incorrect, so callers can't rely on them.
+ m_lazyDecodedFrame.setStatus(ImageFrame::FramePartial);
+ }
+
+ return m_actualDecoder ? m_actualDecoder->frameBufferAtIndex(index) : &m_lazyDecodedFrame;
+}
+
+void DeferredImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
+{
+ if (m_actualDecoder) {
+ // Keep a reference to data until image decoding is deferred.
+ // When image decoding is deferred then ownership of m_data is
+ // transferred to ImageDecodingStore.
+ m_data = data;
+ m_allDataReceived = allDataReceived;
+ m_actualDecoder->setData(data, allDataReceived);
+ } else {
+ ASSERT(!m_data);
+ ImageDecodingStore::instanceOnMainThread()->setData(m_lazyDecodedFrame.getSkBitmap(), data, allDataReceived);
+ }
+}
+
+bool DeferredImageDecoder::isSizeAvailable()
+{
+ // m_actualDecoder is 0 only if image decoding is deferred and that
+ // means image header decoded successfully and size is available.
+ return m_actualDecoder ? m_actualDecoder->isSizeAvailable() : true;
+}
+
+IntSize DeferredImageDecoder::size() const
+{
+ return m_actualDecoder ? m_actualDecoder->size() : m_size;
+}
+
+IntSize DeferredImageDecoder::frameSizeAtIndex(size_t index) const
+{
+ return m_actualDecoder ? m_actualDecoder->frameSizeAtIndex(index) : m_size;
+}
+
+size_t DeferredImageDecoder::frameCount()
+{
+ return m_actualDecoder ? m_actualDecoder->frameCount() : 1;
+}
+
+int DeferredImageDecoder::repetitionCount() const
+{
+ return m_actualDecoder ? m_actualDecoder->repetitionCount() : cAnimationNone;
+}
+
+void DeferredImageDecoder::clearFrameBufferCache(size_t clearBeforeFrame)
+{
+ // If image decoding is deferred then frame buffer cache is managed by
+ // the compositor and this call is ignored.
+ if (m_actualDecoder)
+ m_actualDecoder->clearFrameBufferCache(clearBeforeFrame);
+}
+
+bool DeferredImageDecoder::frameHasAlphaAtIndex(size_t index) const
+{
+ // FIXME: Synchronize this state with ImageDecodingStore when image is
+ // actually decoded. Return true here is correct in terms of rendering but
+ // may not go through some optimized rendering code path.
+ return m_actualDecoder ? m_actualDecoder->frameHasAlphaAtIndex(index) : true;
+}
+
+unsigned DeferredImageDecoder::frameBytesAtIndex(size_t index) const
+{
+ // If frame decoding is deferred then it is not managed by MemoryCache
+ // so return 0 here.
+ return m_actualDecoder ? m_actualDecoder->frameBytesAtIndex(index) : 0;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.h b/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.h
new file mode 100644
index 000000000..6b33fe35e
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DeferredImageDecoder_h
+#define DeferredImageDecoder_h
+
+#include "ImageDecoder.h"
+#include "ImageSource.h"
+#include "IntSize.h"
+#include "SkBitmap.h"
+
+namespace WebCore {
+
+class SharedBuffer;
+
+class DeferredImageDecoder {
+public:
+ ~DeferredImageDecoder();
+ static DeferredImageDecoder* create(const SharedBuffer& data, ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
+
+ static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDecoder>);
+
+ String filenameExtension() const;
+
+ ImageFrame* frameBufferAtIndex(size_t index);
+
+ void setData(SharedBuffer* data, bool allDataReceived);
+
+ bool isSizeAvailable();
+ IntSize size() const;
+ IntSize frameSizeAtIndex(size_t index) const;
+ size_t frameCount();
+ int repetitionCount() const;
+ void clearFrameBufferCache(size_t);
+ bool frameHasAlphaAtIndex(size_t index) const;
+ unsigned frameBytesAtIndex(size_t index) const;
+
+private:
+ explicit DeferredImageDecoder(ImageDecoder* actualDecoder);
+
+ RefPtr<SharedBuffer> m_data;
+ bool m_allDataReceived;
+ OwnPtr<ImageDecoder> m_actualDecoder;
+
+ String m_filenameExtension;
+ IntSize m_size;
+
+ ImageFrame m_lazyDecodedFrame;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.cpp b/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.cpp
new file mode 100644
index 000000000..02790df90
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.cpp
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ImageDecodingStore.h"
+
+#include "ImageDecoder.h"
+#include "ImageFrameGenerator.h"
+#include "LazyDecodingPixelRef.h"
+#include "ScaledImageFragment.h"
+#include "SkRect.h"
+#include "SkSize.h"
+
+#include "skia/ext/image_operations.h"
+
+#include <wtf/MainThread.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+namespace {
+
+// URI label for a lazily decoded SkPixelRef.
+const char labelLazyDecoded[] = "lazy";
+
+ImageDecodingStore* s_instanceOnMainThread = 0;
+
+static void setInstanceOnMainThread(ImageDecodingStore* imageDecodingStore)
+{
+ delete s_instanceOnMainThread;
+ s_instanceOnMainThread = imageDecodingStore;
+}
+} // namespace
+
+ImageDecodingStore::ImageDecodingStore()
+{
+}
+
+ImageDecodingStore::~ImageDecodingStore()
+{
+}
+
+ImageDecodingStore* ImageDecodingStore::instanceOnMainThread()
+{
+ ASSERT(isMainThread());
+ return s_instanceOnMainThread;
+}
+
+void ImageDecodingStore::initializeOnMainThread()
+{
+ ASSERT(isMainThread());
+ setInstanceOnMainThread(ImageDecodingStore::create().leakPtr());
+}
+
+void ImageDecodingStore::shutdown()
+{
+ ASSERT(isMainThread());
+ setInstanceOnMainThread(0);
+}
+
+bool ImageDecodingStore::isLazyDecoded(const SkBitmap& bitmap)
+{
+ return bitmap.pixelRef()
+ && bitmap.pixelRef()->getURI()
+ && !memcmp(bitmap.pixelRef()->getURI(), labelLazyDecoded, sizeof(labelLazyDecoded));
+}
+
+SkBitmap ImageDecodingStore::createLazyDecodedSkBitmap(PassOwnPtr<ImageDecoder> decoder)
+{
+ ASSERT(calledOnValidThread());
+
+ SkISize fullSize = SkISize::Make(decoder->size().width(), decoder->size().height());
+ ASSERT(!fullSize.isEmpty());
+
+ SkIRect fullRect = SkIRect::MakeSize(fullSize);
+
+ // Creates a lazily decoded SkPixelRef that references the entire image without scaling.
+ SkBitmap bitmap;
+ bitmap.setConfig(SkBitmap::kARGB_8888_Config, fullSize.width(), fullSize.height());
+ bitmap.setPixelRef(new LazyDecodingPixelRef(ImageFrameGenerator::create(decoder), fullSize, fullRect))->unref();
+
+ // Use URI to identify this is a lazily decoded SkPixelRef of type LazyDecodingPixelRef.
+ // FIXME: Give the actual URI is more useful.
+ bitmap.pixelRef()->setURI(labelLazyDecoded);
+
+ // Inform the bitmap that we will never change the pixels. This is a performance hint
+ // subsystems that may try to cache this bitmap (e.g. pictures, pipes, gpu, pdf, etc.)
+ bitmap.setImmutable();
+
+ // FIXME: Setting bitmap.setIsOpaque() is big performance gain if possible. We can
+ // do so safely if the image is fully loaded and it is a JPEG image, or image was
+ // decoded before.
+
+ return bitmap;
+}
+
+SkBitmap ImageDecodingStore::resizeLazyDecodedSkBitmap(const SkBitmap& bitmap, const SkISize& scaledSize, const SkIRect& scaledSubset)
+{
+ ASSERT(calledOnValidThread());
+
+ LazyDecodingPixelRef* pixelRef = static_cast<LazyDecodingPixelRef*>(bitmap.pixelRef());
+ ASSERT(!pixelRef->isScaled(pixelRef->frameGenerator()->fullSize()) && !pixelRef->isClipped());
+
+ int rowBytes = 0;
+ rowBytes = SkBitmap::ComputeRowBytes(SkBitmap::kARGB_8888_Config, scaledSize.width());
+
+ SkBitmap resizedBitmap;
+ resizedBitmap.setConfig(SkBitmap::kARGB_8888_Config, scaledSubset.width(), scaledSubset.height(), rowBytes);
+ resizedBitmap.setPixelRef(new LazyDecodingPixelRef(pixelRef->frameGenerator(), scaledSize, scaledSubset))->unref();
+
+ // See comments in createLazyDecodedSkBitmap().
+ resizedBitmap.setImmutable();
+ return resizedBitmap;
+}
+
+void ImageDecodingStore::setData(const SkBitmap& bitmap, PassRefPtr<SharedBuffer> data, bool allDataReceived)
+{
+ ASSERT(calledOnValidThread());
+ if (isLazyDecoded(bitmap))
+ static_cast<LazyDecodingPixelRef*>(bitmap.pixelRef())->frameGenerator()->setData(data, allDataReceived);
+}
+
+void* ImageDecodingStore::lockPixels(PassRefPtr<ImageFrameGenerator> frameGenerator, const SkISize& scaledSize, const SkIRect& scaledSubset)
+{
+ ASSERT(calledOnValidThread());
+ ASSERT(m_lockedSkBitmap.isNull());
+
+ SkISize fullSize = frameGenerator->fullSize();
+
+ // The cache only saves the full size image at the moment.
+ ScaledImageFragment* frameCache = lookupFrameCache(frameGenerator->imageId(), fullSize);
+ SkBitmap bitmap;
+
+ if (!frameCache) {
+ // FIXME: Pixels are owned by the ImageDecoder in the generator. Find
+ // a way to transfer ownership to our cache.
+ ImageFrame* frame = frameGenerator->decoder()->frameBufferAtIndex(0);
+
+ // Saves the frame in cache if this is complete.
+ if (frame->status() == ImageFrame::FrameComplete) {
+ m_frameCache.append(ScaledImageFragment::create(frameGenerator->imageId(), fullSize, frame->getSkBitmap(), true));
+ } else if (frame->status() == ImageFrame::FrameEmpty) {
+ // FIXME: If this is a decoding error. Report this to BitmapImage.
+ return 0;
+ }
+
+ bitmap = frame->getSkBitmap();
+ } else {
+ ASSERT(frameCache->isComplete());
+ bitmap = frameCache->bitmap();
+ }
+
+ if (fullSize != scaledSize) {
+ // Image scaling is done on-the-fly and scaled image is destroyed
+ // after use.
+ // FIXME: Resize just the requested fragment.
+ m_lockedSkBitmap = skia::ImageOperations::Resize(bitmap, skia::ImageOperations::RESIZE_LANCZOS3, scaledSize.width(), scaledSize.height());
+ } else
+ m_lockedSkBitmap = bitmap;
+ m_lockedSkBitmap.lockPixels();
+ return m_lockedSkBitmap.getAddr(scaledSubset.x(), scaledSubset.y());
+}
+
+void ImageDecodingStore::unlockPixels()
+{
+ ASSERT(calledOnValidThread());
+
+ m_lockedSkBitmap.unlockPixels();
+ m_lockedSkBitmap.reset();
+}
+
+void ImageDecodingStore::frameGeneratorBeingDestroyed(ImageFrameGenerator* frameGenerator)
+{
+ ASSERT(calledOnValidThread());
+
+ deleteFrameCache(frameGenerator->imageId());
+}
+
+bool ImageDecodingStore::calledOnValidThread() const
+{
+ return this == instanceOnMainThread() && isMainThread();
+}
+
+ScaledImageFragment* ImageDecodingStore::lookupFrameCache(int imageId, const SkISize& scaledSize) const
+{
+ for (size_t i = 0; i < m_frameCache.size(); ++i) {
+ if (m_frameCache[i]->isEqual(imageId, scaledSize))
+ return m_frameCache[i].get();
+ }
+ return 0;
+}
+
+void ImageDecodingStore::deleteFrameCache(int imageId)
+{
+ for (size_t i = 0; i < m_frameCache.size(); ++i) {
+ if (m_frameCache[i]->isEqual(imageId)) {
+ m_frameCache.remove(i);
+ return;
+ }
+ }
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.h b/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.h
new file mode 100644
index 000000000..a6a5d9294
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ImageDecodingStore_h
+#define ImageDecodingStore_h
+
+#include "SkBitmap.h"
+#include "SkRect.h"
+#include "SkSize.h"
+
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class ImageDecoder;
+class ImageFrameGenerator;
+class ScaledImageFragment;
+class SharedBuffer;
+
+// This class can only be instantiated on main thread. There will be an
+// instance on impl thread in the future but that part of implementation
+// is incomplete. See bug: https://bugs.webkit.org/show_bug.cgi?id=94240
+// for details.
+class ImageDecodingStore {
+public:
+ static PassOwnPtr<ImageDecodingStore> create() { return adoptPtr(new ImageDecodingStore); }
+ ~ImageDecodingStore();
+
+ static ImageDecodingStore* instanceOnMainThread();
+ static void initializeOnMainThread();
+ static void shutdown();
+ static bool isLazyDecoded(const SkBitmap&);
+
+ SkBitmap createLazyDecodedSkBitmap(PassOwnPtr<ImageDecoder>);
+ SkBitmap resizeLazyDecodedSkBitmap(const SkBitmap&, const SkISize& scaledSize, const SkIRect& scaledSubset);
+
+ void setData(const SkBitmap&, PassRefPtr<SharedBuffer>, bool allDataReceived);
+
+ // You may only lock one set of pixels at a time; overlapping lock calls are not allowed.
+ void* lockPixels(PassRefPtr<ImageFrameGenerator>, const SkISize& scaledSize, const SkIRect& scaledSubset);
+ void unlockPixels();
+
+ void frameGeneratorBeingDestroyed(ImageFrameGenerator*);
+
+private:
+ ImageDecodingStore();
+ bool calledOnValidThread() const;
+ void createFrameGenerator(PassOwnPtr<ImageDecoder>);
+ ScaledImageFragment* lookupFrameCache(int imageId, const SkISize& scaledSize) const;
+ void deleteFrameCache(int imageId);
+
+ Vector<OwnPtr<ScaledImageFragment> > m_frameCache;
+
+ SkBitmap m_lockedSkBitmap;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp b/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp
new file mode 100644
index 000000000..4c2f29915
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "ImageFrameGenerator.h"
+
+#include "ImageDecoder.h"
+#include "ImageDecodingStore.h"
+#include "SharedBuffer.h"
+
+namespace {
+
+// An unique ID for an image file.
+int s_nextImageId = 0;
+
+} // namespace
+
+namespace WebCore {
+
+ImageFrameGenerator::ImageFrameGenerator(PassOwnPtr<ImageDecoder> decoder)
+ : m_decoder(decoder)
+{
+ m_fullSize = SkISize::Make(m_decoder->size().width(), m_decoder->size().height());
+ m_imageId = s_nextImageId++;
+}
+
+ImageFrameGenerator::~ImageFrameGenerator()
+{
+ if (ImageDecodingStore::instanceOnMainThread())
+ ImageDecodingStore::instanceOnMainThread()->frameGeneratorBeingDestroyed(this);
+}
+
+ImageDecoder* ImageFrameGenerator::decoder()
+{
+ return m_decoder.get();
+}
+
+void ImageFrameGenerator::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
+{
+ m_data = data;
+ if (m_decoder)
+ m_decoder->setData(m_data.get(), allDataReceived);
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.h b/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.h
new file mode 100644
index 000000000..67d326b7a
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ImageFrameGenerator_h
+#define ImageFrameGenerator_h
+
+#include "SkTypes.h"
+#include "SkSize.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class ImageDecoder;
+class SharedBuffer;
+
+class ImageFrameGenerator : public RefCounted<ImageFrameGenerator> {
+public:
+ static PassRefPtr<ImageFrameGenerator> create(PassOwnPtr<ImageDecoder> decoder)
+ {
+ return adoptRef(new ImageFrameGenerator(decoder));
+ }
+
+ explicit ImageFrameGenerator(PassOwnPtr<ImageDecoder>);
+ ~ImageFrameGenerator();
+
+ // Creates the image decoder if needed.
+ ImageDecoder* decoder();
+ void setData(PassRefPtr<SharedBuffer>, bool allDataReceived);
+
+ const SkISize& fullSize() const { return m_fullSize; }
+ int imageId() const { return m_imageId; }
+
+private:
+ OwnPtr<ImageDecoder> m_decoder;
+ RefPtr<SharedBuffer> m_data;
+ SkISize m_fullSize;
+ int m_imageId;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp b/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp
new file mode 100644
index 000000000..56dd091e0
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "LazyDecodingPixelRef.h"
+
+#include "ImageDecoder.h"
+#include "ImageDecodingStore.h"
+#include "ImageFrameGenerator.h"
+#include <wtf/MainThread.h>
+
+namespace WebCore {
+
+LazyDecodingPixelRef::LazyDecodingPixelRef(PassRefPtr<ImageFrameGenerator> frameGenerator, const SkISize& scaledSize, const SkIRect& scaledSubset)
+ : SkPixelRef(0)
+ , m_frameGenerator(frameGenerator)
+ , m_scaledSize(scaledSize)
+ , m_scaledSubset(scaledSubset)
+{
+}
+
+LazyDecodingPixelRef::~LazyDecodingPixelRef()
+{
+}
+
+bool LazyDecodingPixelRef::isScaled(const SkISize& fullSize) const
+{
+ return fullSize != m_scaledSize;
+}
+
+bool LazyDecodingPixelRef::isClipped() const
+{
+ return m_scaledSize.width() != m_scaledSubset.width() || m_scaledSize.height() != m_scaledSubset.height();
+}
+
+void* LazyDecodingPixelRef::onLockPixels(SkColorTable**)
+{
+ ASSERT(isMainThread());
+ return ImageDecodingStore::instanceOnMainThread()->lockPixels(m_frameGenerator, m_scaledSize, m_scaledSubset);
+}
+
+void LazyDecodingPixelRef::onUnlockPixels()
+{
+ ASSERT(isMainThread());
+ ImageDecodingStore::instanceOnMainThread()->unlockPixels();
+}
+
+bool LazyDecodingPixelRef::onLockPixelsAreWritable() const
+{
+ return false;
+}
+
+} // namespace WebKit
diff --git a/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h b/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h
new file mode 100644
index 000000000..0ab9ccc4c
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LazyDecodingPixelRef_h
+#define LazyDecodingPixelRef_h
+
+#include "SkFlattenableBuffers.h"
+#include "SkPixelRef.h"
+#include "SkRect.h"
+#include "SkSize.h"
+
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class ImageFrameGenerator;
+
+class LazyDecodingPixelRef : public SkPixelRef {
+public:
+ LazyDecodingPixelRef(PassRefPtr<ImageFrameGenerator>, const SkISize& scaledSize, const SkIRect& scaledSubset);
+ virtual ~LazyDecodingPixelRef();
+
+ SK_DECLARE_UNFLATTENABLE_OBJECT()
+
+ PassRefPtr<ImageFrameGenerator> frameGenerator() const { return m_frameGenerator; }
+ bool isScaled(const SkISize& fullSize) const;
+ bool isClipped() const;
+
+protected:
+ // SkPixelRef implementation.
+ virtual void* onLockPixels(SkColorTable**);
+ virtual void onUnlockPixels();
+ virtual bool onLockPixelsAreWritable() const;
+
+private:
+ RefPtr<ImageFrameGenerator> m_frameGenerator;
+ SkISize m_scaledSize;
+ SkIRect m_scaledSubset;
+};
+
+} // namespace WebCore
+
+#endif // LazyDecodingPixelRef_h_
diff --git a/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.cpp b/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.cpp
new file mode 100644
index 000000000..974e6ff84
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "ScaledImageFragment.h"
+
+namespace WebCore {
+
+ScaledImageFragment::~ScaledImageFragment()
+{
+}
+
+ScaledImageFragment::ScaledImageFragment(int imageId, const SkISize& scaledSize, const SkBitmap& bitmap, const bool isComplete)
+ : m_imageId(imageId)
+ , m_scaledSize(scaledSize)
+ , m_bitmap(bitmap)
+ , m_isComplete(isComplete)
+{
+}
+
+bool ScaledImageFragment::isEqual(int imageId, const SkISize& scaledSize) const
+{
+ return imageId == m_imageId && scaledSize == m_scaledSize;
+}
+
+bool ScaledImageFragment::isEqual(int imageId) const
+{
+ return imageId == m_imageId;
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.h b/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.h
new file mode 100644
index 000000000..5b7ffc960
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScaledImageFragment_h
+#define ScaledImageFragment_h
+
+#include "SkBitmap.h"
+#include "SkRect.h"
+#include "SkSize.h"
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+// ScaledImageFragment is a scaled version of a image. It is identified
+// by two things:
+// 1. Image ID. The original image that this fragment comes from.
+// 2. Scaled image size.
+class ScaledImageFragment {
+public:
+ static PassOwnPtr<ScaledImageFragment> create(int imageId, const SkISize& scaledSize, const SkBitmap& bitmap, bool isComplete)
+ {
+ return adoptPtr(new ScaledImageFragment(imageId, scaledSize, bitmap, isComplete));
+ }
+
+ ScaledImageFragment(int imageId, const SkISize&, const SkBitmap&, bool isComplete);
+ ~ScaledImageFragment();
+
+ const SkBitmap& bitmap() const { return m_bitmap; }
+ SkBitmap& bitmap() { return m_bitmap; }
+
+ bool isEqual(int imageId, const SkISize& scaledSize) const;
+ bool isEqual(int imageId) const;
+ bool isComplete() const { return m_isComplete; }
+
+private:
+ int m_imageId;
+ SkISize m_scaledSize;
+ SkBitmap m_bitmap;
+ bool m_isComplete;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp b/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
index 64f3b702a..65f2d63b8 100644
--- a/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
+++ b/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
@@ -48,6 +48,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi
, m_currentHeight(0)
, m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT)
, m_attrs(attrs)
+ , m_renderStyle(renderStyle)
, m_texture(0)
, m_compositorTexture(0)
, m_fbo(0)
diff --git a/Source/WebCore/platform/graphics/filters/CustomFilterOperation.h b/Source/WebCore/platform/graphics/filters/CustomFilterOperation.h
index 788b3f016..0d64d2368 100644
--- a/Source/WebCore/platform/graphics/filters/CustomFilterOperation.h
+++ b/Source/WebCore/platform/graphics/filters/CustomFilterOperation.h
@@ -69,7 +69,7 @@ public:
CustomFilterProgram* program() const { return m_program.get(); }
- const CustomFilterParameterList& parameters() { return m_parameters; }
+ const CustomFilterParameterList& parameters() const { return m_parameters; }
unsigned meshRows() const { return m_meshRows; }
unsigned meshColumns() const { return m_meshColumns; }
diff --git a/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp b/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp
index 85ddda5a2..26e8b7e5f 100644
--- a/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp
+++ b/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp
@@ -37,12 +37,70 @@
#include "CustomFilterGlobalContext.h"
#include "CustomFilterProgramInfo.h"
#include "NotImplemented.h"
+#include <wtf/HashMap.h>
#include <wtf/text/StringBuilder.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
#define SHADER(Src) (#Src)
+// FIXME: Reuse this type when we validate the types of built-in uniforms.
+// https://bugs.webkit.org/show_bug.cgi?id=98974
+typedef HashMap<String, ShDataType> SymbolNameToTypeMap;
+
+static SymbolNameToTypeMap* builtInAttributeNameToTypeMap()
+{
+ static SymbolNameToTypeMap* nameToTypeMap = 0;
+ if (!nameToTypeMap) {
+ nameToTypeMap = new SymbolNameToTypeMap;
+ nameToTypeMap->set("a_meshCoord", SH_FLOAT_VEC2);
+ nameToTypeMap->set("a_position", SH_FLOAT_VEC4);
+ nameToTypeMap->set("a_texCoord", SH_FLOAT_VEC2);
+ nameToTypeMap->set("a_triangleCoord", SH_FLOAT_VEC3);
+ }
+ return nameToTypeMap;
+}
+
+static bool validateSymbols(const Vector<ANGLEShaderSymbol>& symbols)
+{
+ for (size_t i = 0; i < symbols.size(); ++i) {
+ const ANGLEShaderSymbol& symbol = symbols[i];
+ switch (symbol.symbolType) {
+ case SHADER_SYMBOL_TYPE_ATTRIBUTE: {
+ SymbolNameToTypeMap* attributeNameToTypeMap = builtInAttributeNameToTypeMap();
+ SymbolNameToTypeMap::iterator builtInAttribute = attributeNameToTypeMap->find(symbol.name);
+ if (builtInAttribute != attributeNameToTypeMap->end() && symbol.dataType != builtInAttribute->value) {
+ // The author defined one of the built-in attributes with the wrong type.
+ return false;
+ }
+
+ // FIXME: Return false when the attribute is not one of the built-in attributes.
+ // https://bugs.webkit.org/show_bug.cgi?id=98973
+ break;
+ }
+ case SHADER_SYMBOL_TYPE_UNIFORM:
+ if (symbol.isSampler()) {
+ // FIXME: For now, we restrict shaders with any sampler defined.
+ // When we implement texture parameters, we will allow shaders whose samplers are bound to valid textures.
+ // We must not allow OpenGL to give unbound samplers a default value of 0 because that references the element texture,
+ // which should be inaccessible to the author's shader code.
+ // https://bugs.webkit.org/show_bug.cgi?id=96230
+ return false;
+ }
+
+ // FIXME: Validate the types of built-in uniforms.
+ // https://bugs.webkit.org/show_bug.cgi?id=98974
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+
+ return true;
+}
+
String CustomFilterValidatedProgram::defaultVertexShaderString()
{
DEFINE_STATIC_LOCAL(String, vertexShaderString, (ASCIILiteral(SHADER(
@@ -95,16 +153,10 @@ CustomFilterValidatedProgram::CustomFilterValidatedProgram(CustomFilterGlobalCon
return;
}
- // Validate the author's samplers.
- for (Vector<ANGLEShaderSymbol>::iterator it = symbols.begin(); it != symbols.end(); ++it) {
- if (it->isSampler()) {
- // FIXME: For now, we restrict shaders with any sampler defined.
- // When we implement texture parameters, we will allow shaders whose samplers are bound to valid textures.
- // We must not allow OpenGL to give unbound samplers a default value of 0 because that references the DOM element texture,
- // which should be inaccessible to the author's shader code.
- // https://bugs.webkit.org/show_bug.cgi?id=96230
- return;
- }
+ if (!validateSymbols(symbols)) {
+ // FIXME: Report validation errors.
+ // https://bugs.webkit.org/show_bug.cgi?id=74416
+ return;
}
// We need to add texture access, blending, and compositing code to shaders that are referenced from the CSS mix function.
diff --git a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp
index 796b37c95..e0686166d 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp
+++ b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp
@@ -234,8 +234,8 @@ bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer)
return false;
m_totalWidth = roundf(m_totalWidth);
- if (glyphBuffer)
- fillGlyphBuffer(glyphBuffer);
+ if (glyphBuffer && !fillGlyphBuffer(glyphBuffer))
+ return false;
return true;
}
@@ -432,7 +432,7 @@ void HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun(GlyphBuffer* glyphBuffer, Ha
}
}
-void HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer)
+bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer)
{
unsigned numRuns = m_harfbuzzRuns.size();
if (m_run.rtl()) {
@@ -450,6 +450,7 @@ void HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer)
fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, firstOffsetOfNextRun);
}
}
+ return glyphBuffer->size();
}
int HarfBuzzShaper::offsetForPosition(float targetX)
diff --git a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h
index c88ef2465..c3c402ba4 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h
+++ b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h
@@ -103,7 +103,7 @@ private:
bool collectHarfBuzzRuns();
bool shapeHarfBuzzRuns();
- void fillGlyphBuffer(GlyphBuffer*);
+ bool fillGlyphBuffer(GlyphBuffer*);
void fillGlyphBufferFromHarfBuzzRun(GlyphBuffer*, HarfBuzzRun*, FloatPoint& firstOffsetOfNextRun);
void setGlyphPositionsForHarfBuzzRun(HarfBuzzRun*, hb_buffer_t*);
diff --git a/Source/WebCore/platform/graphics/mac/FontMac.mm b/Source/WebCore/platform/graphics/mac/FontMac.mm
index b515f81d5..b7c0861d1 100644
--- a/Source/WebCore/platform/graphics/mac/FontMac.mm
+++ b/Source/WebCore/platform/graphics/mac/FontMac.mm
@@ -139,6 +139,9 @@ static void showGlyphsWithAdvances(const FloatPoint& point, const SimpleFontData
void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point) const
{
+ if (!font->platformData().size())
+ return;
+
CGContextRef cgContext = context->platformContext();
bool shouldSmoothFonts = true;
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
index b560bd48e..6ccf4b26c 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
@@ -157,6 +157,10 @@ bool Extensions3DOpenGL::supportsExtension(const String& name)
if (name == "GL_OES_standard_derivatives")
return true;
+ // Desktop GL always supports UNSIGNED_INT indices
+ if (name == "GL_OES_element_index_uint")
+ return true;
+
if (name == "GL_EXT_texture_filter_anisotropic")
return m_availableExtensions.contains("GL_EXT_texture_filter_anisotropic");
diff --git a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index 82c367d29..697fde224 100644
--- a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -104,9 +104,9 @@ static SkCanvas* createAcceleratedCanvas(const IntSize& size, ImageBufferData* d
static SkCanvas* createNonPlatformCanvas(const IntSize& size)
{
- SkCanvas* canvas = new SkCanvas();
- canvas->setDevice(new SkDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height()))->unref();
- return canvas;
+ SkAutoTUnref<SkDevice> device(new SkDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height()));
+ SkPixelRef* pixelRef = device->accessBitmap(false).pixelRef();
+ return pixelRef ? new SkCanvas(device) : 0;
}
ImageBuffer::ImageBuffer(const IntSize& size, float resolutionScale, ColorSpace, RenderingMode renderingMode, DeferralMode deferralMode, bool& success)
diff --git a/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp b/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
index 1862a2afc..d084ec8f4 100644
--- a/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
@@ -40,6 +40,11 @@
#include "SkPixelRef.h"
#include "SkiaUtils.h"
+#if PLATFORM(CHROMIUM)
+#include "ImageDecodingStore.h"
+#include "TraceEvent.h"
+#endif
+
namespace WebCore {
NativeImageSkia::NativeImageSkia()
@@ -73,6 +78,11 @@ bool NativeImageSkia::hasResizedBitmap(const SkISize& scaledImageSize, const SkI
SkBitmap NativeImageSkia::resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const
{
+#if PLATFORM(CHROMIUM)
+ if (ImageDecodingStore::isLazyDecoded(m_image))
+ return ImageDecodingStore::instanceOnMainThread()->resizeLazyDecodedSkBitmap(m_image, scaledImageSize, scaledImageSubset);
+#endif
+
if (!hasResizedBitmap(scaledImageSize, scaledImageSubset)) {
bool shouldCache = isDataComplete()
&& shouldCacheResampling(scaledImageSize, scaledImageSubset);
diff --git a/Source/WebCore/platform/graphics/skia/PatternSkia.cpp b/Source/WebCore/platform/graphics/skia/PatternSkia.cpp
index 78d1a39da..2ae4dd681 100644
--- a/Source/WebCore/platform/graphics/skia/PatternSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/PatternSkia.cpp
@@ -100,6 +100,7 @@ PlatformPatternPtr Pattern::platformPattern(const AffineTransform& patternTransf
bm2.eraseARGB(0x00, 0x00, 0x00, 0x00);
SkCanvas canvas(bm2);
canvas.drawBitmap(image->bitmap(), 0, 0);
+ bm2.setImmutable();
m_pattern = SkShader::CreateBitmapShader(bm2, tileModeX, tileModeY);
// Clamp to int, since that's what the adjust function takes.
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapper.h b/Source/WebCore/platform/graphics/texmap/TextureMapper.h
index 86a55df49..282bf2ca4 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapper.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapper.h
@@ -56,6 +56,11 @@ public:
SupportsAlpha = 0x01
};
+ enum UpdateContentsFlag {
+ UpdateCanModifyOriginalImageData,
+ UpdateCannotModifyOriginalImageData
+ };
+
typedef unsigned Flags;
BitmapTexture()
@@ -67,8 +72,8 @@ public:
virtual bool isBackedByOpenGL() const { return false; }
virtual IntSize size() const = 0;
- virtual void updateContents(Image*, const IntRect&, const IntPoint& offset) = 0;
- virtual void updateContents(const void*, const IntRect& target, const IntPoint& offset, int bytesPerLine) = 0;
+ virtual void updateContents(Image*, const IntRect&, const IntPoint& offset, UpdateContentsFlag) = 0;
+ virtual void updateContents(const void*, const IntRect& target, const IntPoint& offset, int bytesPerLine, UpdateContentsFlag) = 0;
virtual bool isValid() const = 0;
inline Flags flags() const { return m_flags; }
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp
index 995cc79da..112fb42de 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp
@@ -73,7 +73,7 @@ void TextureMapperSurfaceBackingStore::setSurface(PassRefPtr<GraphicsSurface> su
}
#endif
-void TextureMapperTile::updateContents(TextureMapper* textureMapper, Image* image, const IntRect& dirtyRect)
+void TextureMapperTile::updateContents(TextureMapper* textureMapper, Image* image, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
{
IntRect targetRect = enclosingIntRect(m_rect);
targetRect.intersect(dirtyRect);
@@ -91,7 +91,7 @@ void TextureMapperTile::updateContents(TextureMapper* textureMapper, Image* imag
m_texture->reset(targetRect.size(), image->currentFrameHasAlpha() ? BitmapTexture::SupportsAlpha : 0);
}
- m_texture->updateContents(image, targetRect, sourceOffset);
+ m_texture->updateContents(image, targetRect, sourceOffset, updateContentsFlag);
}
void TextureMapperTile::paint(TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, BitmapTexture* mask, const unsigned exposedEdges)
@@ -110,7 +110,7 @@ void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapp
if (!m_image)
return;
- updateContents(textureMapper, m_image.get());
+ updateContents(textureMapper, m_image.get(), BitmapTexture::UpdateCannotModifyOriginalImageData);
m_image.clear();
}
@@ -204,11 +204,11 @@ void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatSiz
m_tiles.remove(tileIndicesToRemove[i]);
}
-void TextureMapperTiledBackingStore::updateContents(TextureMapper* textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect)
+void TextureMapperTiledBackingStore::updateContents(TextureMapper* textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
{
createOrDestroyTilesIfNeeded(totalSize, textureMapper->maxTextureSize(), image->currentFrameHasAlpha());
for (size_t i = 0; i < m_tiles.size(); ++i)
- m_tiles[i].updateContents(textureMapper, image, dirtyRect);
+ m_tiles[i].updateContents(textureMapper, image, dirtyRect, updateContentsFlag);
}
PassRefPtr<BitmapTexture> TextureMapperTiledBackingStore::texture() const
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h
index 93de3da06..c45430e32 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h
@@ -77,7 +77,7 @@ public:
inline void setTexture(BitmapTexture* texture) { m_texture = texture; }
inline void setRect(const FloatRect& rect) { m_rect = rect; }
- void updateContents(TextureMapper*, Image*, const IntRect&);
+ void updateContents(TextureMapper*, Image*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData);
virtual void paint(TextureMapper*, const TransformationMatrix&, float, BitmapTexture*, const unsigned exposedEdges);
virtual ~TextureMapperTile() { }
@@ -97,8 +97,8 @@ public:
virtual ~TextureMapperTiledBackingStore() { }
virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float, BitmapTexture*);
virtual PassRefPtr<BitmapTexture> texture() const;
- void updateContents(TextureMapper*, Image*, const FloatSize&, const IntRect&);
- void updateContents(TextureMapper* textureMapper, Image* image) { updateContents(textureMapper, image, image->size(), image->rect()); }
+ void updateContents(TextureMapper*, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
+ void updateContents(TextureMapper* textureMapper, Image* image, BitmapTexture::UpdateContentsFlag updateContentsFlag) { updateContents(textureMapper, image, image->size(), image->rect(), updateContentsFlag); }
inline FloatRect rect() const { return FloatRect(FloatPoint::zero(), m_size); }
static PassRefPtr<TextureMapperTiledBackingStore> create() { return adoptRef(new TextureMapperTiledBackingStore); }
void setContentsToImage(Image* image) { m_image = image; }
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
index 19feae868..d4015a7c7 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
@@ -342,7 +342,7 @@ void TextureMapperGL::drawRepaintCounter(int value, int pointSize, const FloatPo
RefPtr<BitmapTexture> texture = acquireTextureFromPool(size);
const uchar* bits = image.bits();
- texture->updateContents(bits, sourceRect, IntPoint::zero(), image.bytesPerLine());
+ texture->updateContents(bits, sourceRect, IntPoint::zero(), image.bytesPerLine(), BitmapTexture::UpdateCanModifyOriginalImageData);
drawTexture(*texture, targetRect, modelViewMatrix, 1.0f, 0, AllEdges);
#else
UNUSED_PARAM(value);
@@ -636,38 +636,44 @@ void BitmapTextureGL::didReset()
m_context3D->texImage2DDirect(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, m_textureSize.width(), m_textureSize.height(), 0, format, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, 0);
}
-
-void BitmapTextureGL::updateContents(const void* data, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine)
+void BitmapTextureGL::updateContents(const void* srcData, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag updateContentsFlag)
{
Platform3DObject glFormat = GraphicsContext3D::RGBA;
m_context3D->bindTexture(GraphicsContext3D::TEXTURE_2D, m_id);
const unsigned bytesPerPixel = 4;
+ char* data = reinterpret_cast<char*>(const_cast<void*>(srcData));
+ Vector<char> temporaryData;
+
+ // prepare temporaryData if necessary
+ if ((!driverSupportsBGRASwizzling() && updateContentsFlag == UpdateCannotModifyOriginalImageData)
+ || !driverSupportsSubImage()) {
+ temporaryData.resize(targetRect.width() * targetRect.height() * bytesPerPixel);
+ data = temporaryData.data();
+ const char* bits = static_cast<const char*>(srcData);
+ const char* src = bits + sourceOffset.y() * bytesPerLine + sourceOffset.x() * bytesPerPixel;
+ char* dst = data;
+ const int targetBytesPerLine = targetRect.width() * bytesPerPixel;
+ for (int y = 0; y < targetRect.height(); ++y) {
+ memcpy(dst, src, targetBytesPerLine);
+ src += bytesPerLine;
+ dst += targetBytesPerLine;
+ }
+ }
+
if (driverSupportsBGRASwizzling())
glFormat = GraphicsContext3D::BGRA;
else
- swizzleBGRAToRGBA(reinterpret_cast<uint32_t*>(const_cast<void*>(data)), IntRect(sourceOffset, targetRect.size()), bytesPerLine / bytesPerPixel);
+ swizzleBGRAToRGBA(reinterpret_cast<uint32_t*>(data), IntRect(sourceOffset, targetRect.size()), bytesPerLine / bytesPerPixel);
if (bytesPerLine == targetRect.width() * bytesPerPixel && sourceOffset == IntPoint::zero()) {
- m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, (const char*)data);
+ m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, data);
return;
}
// For ES drivers that don't support sub-images.
if (!driverSupportsSubImage()) {
- const char* bits = static_cast<const char*>(data);
- const char* src = bits + sourceOffset.y() * bytesPerLine + sourceOffset.x() * bytesPerPixel;
- Vector<char> temporaryData(targetRect.width() * targetRect.height() * bytesPerPixel);
- char* dst = temporaryData.data();
-
- const int targetBytesPerLine = targetRect.width() * bytesPerPixel;
- for (int y = 0; y < targetRect.height(); ++y) {
- memcpy(dst, src, targetBytesPerLine);
- src += bytesPerLine;
- dst += targetBytesPerLine;
- }
-
- m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, temporaryData.data());
+ m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, data);
return;
}
@@ -676,14 +682,14 @@ void BitmapTextureGL::updateContents(const void* data, const IntRect& targetRect
m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, bytesPerLine / bytesPerPixel);
m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, sourceOffset.y());
m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, sourceOffset.x());
- m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, (const char*)data);
+ m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, data);
m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, 0);
m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, 0);
m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
#endif
}
-void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset)
+void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag)
{
if (!image)
return;
@@ -704,7 +710,7 @@ void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, co
bytesPerLine = cairo_image_surface_get_stride(surface);
#endif
- updateContents(imageData, targetRect, offset, bytesPerLine);
+ updateContents(imageData, targetRect, offset, bytesPerLine, updateContentsFlag);
}
#if ENABLE(CSS_FILTERS)
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
index 64bffafe5..cb59e4fc4 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
@@ -139,8 +139,8 @@ public:
virtual uint32_t id() const { return m_id; }
uint32_t textureTarget() const { return GraphicsContext3D::TEXTURE_2D; }
IntSize textureSize() const { return m_textureSize; }
- void updateContents(Image*, const IntRect&, const IntPoint&);
- virtual void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine);
+ void updateContents(Image*, const IntRect&, const IntPoint&, UpdateContentsFlag);
+ virtual void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag);
virtual bool isBackedByOpenGL() const { return true; }
#if ENABLE(CSS_FILTERS)
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
index 7802b3f0e..843433253 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
@@ -29,7 +29,7 @@
#if USE(TEXTURE_MAPPER)
namespace WebCore {
-void BitmapTextureImageBuffer::updateContents(const void* data, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine)
+void BitmapTextureImageBuffer::updateContents(const void* data, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag)
{
#if PLATFORM(QT)
QImage image(reinterpret_cast<const uchar*>(data), targetRect.width(), targetRect.height(), bytesPerLine, NativeImageQt::defaultFormatForAlphaEnabledImages());
@@ -59,7 +59,7 @@ void BitmapTextureImageBuffer::didReset()
m_image = ImageBuffer::create(contentSize());
}
-void BitmapTextureImageBuffer::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset)
+void BitmapTextureImageBuffer::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag)
{
m_image->context()->drawImage(image, ColorSpaceDeviceRGB, targetRect, IntRect(offset, targetRect.size()), CompositeCopy);
}
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
index fe9774a32..2e7e2326b 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
@@ -34,8 +34,8 @@ public:
virtual void didReset();
virtual bool isValid() const { return m_image; }
inline GraphicsContext* graphicsContext() { return m_image ? m_image->context() : 0; }
- virtual void updateContents(Image*, const IntRect&, const IntPoint&);
- virtual void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine);
+ virtual void updateContents(Image*, const IntRect&, const IntPoint&, UpdateContentsFlag);
+ virtual void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag);
#if ENABLE(CSS_FILTERS)
PassRefPtr<BitmapTexture> applyFilters(TextureMapper*, const BitmapTexture&, const FilterOperations&);
#endif
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
index b9544609e..21bd7b235 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
@@ -136,7 +136,7 @@ void TextureMapperLayer::updateBackingStore(TextureMapper* textureMapper, Graphi
RefPtr<Image> image = imageBuffer->copyImage(DontCopyBackingStore);
TextureMapperTiledBackingStore* backingStore = static_cast<TextureMapperTiledBackingStore*>(m_backingStore.get());
- backingStore->updateContents(textureMapper, image.get(), m_size, dirtyRect);
+ backingStore->updateContents(textureMapper, image.get(), m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData);
backingStore->setShowDebugBorders(layer->showDebugBorders());
backingStore->setDebugBorder(m_debugBorderColor, m_debugBorderWidth);
diff --git a/Source/WebCore/platform/image-decoders/ImageDecoder.h b/Source/WebCore/platform/image-decoders/ImageDecoder.h
index fc82a5c25..9f697a84a 100644
--- a/Source/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/ImageDecoder.h
@@ -148,6 +148,18 @@ namespace WebCore {
void reportMemoryUsage(MemoryObjectInfo*) const;
+#if PLATFORM(CHROMIUM)
+ void setSkBitmap(const SkBitmap& bitmap)
+ {
+ m_bitmap = NativeImageSkia(bitmap, 1);
+ }
+
+ const SkBitmap& getSkBitmap() const
+ {
+ return m_bitmap.bitmap();
+ }
+#endif
+
private:
int width() const;
int height() const;
diff --git a/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp b/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
index 14c119fb4..c7f1578ea 100644
--- a/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
+++ b/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
@@ -81,6 +81,7 @@ bool ImageFrame::copyBitmapData(const ImageFrame& other)
if (this == &other)
return true;
+ m_hasAlpha = other.m_hasAlpha;
m_bitmap.bitmap().reset();
const NativeImageSkia& otherBitmap = other.m_bitmap;
return otherBitmap.bitmap().copyTo(&m_bitmap.bitmap(), otherBitmap.bitmap().config());
diff --git a/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp b/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp
index f4f9822de..dea2c4796 100644
--- a/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp
+++ b/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp
@@ -49,25 +49,25 @@ MediaStreamCenter::~MediaStreamCenter()
void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescriptor)
{
- MediaStreamDescriptorOwner* owner = streamDescriptor->owner();
- if (owner)
- owner->streamEnded();
+ MediaStreamDescriptorClient* client = streamDescriptor->client();
+ if (client)
+ client->streamEnded();
else
streamDescriptor->setEnded();
}
void MediaStreamCenter::addMediaStreamTrack(MediaStreamDescriptor* streamDescriptor, MediaStreamComponent* component)
{
- MediaStreamDescriptorOwner* owner = streamDescriptor->owner();
- if (owner)
- owner->addTrack(component);
+ MediaStreamDescriptorClient* client = streamDescriptor->client();
+ if (client)
+ client->addTrack(component);
}
void MediaStreamCenter::removeMediaStreamTrack(MediaStreamDescriptor* streamDescriptor, MediaStreamComponent* component)
{
- MediaStreamDescriptorOwner* owner = streamDescriptor->owner();
- if (owner)
- owner->removeTrack(component);
+ MediaStreamDescriptorClient* client = streamDescriptor->client();
+ if (client)
+ client->removeTrack(component);
}
} // namespace WebCore
diff --git a/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h b/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h
index c6061052d..1241e3389 100644
--- a/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h
+++ b/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h
@@ -40,9 +40,9 @@
namespace WebCore {
-class MediaStreamDescriptorOwner {
+class MediaStreamDescriptorClient {
public:
- virtual ~MediaStreamDescriptorOwner() { }
+ virtual ~MediaStreamDescriptorClient() { }
virtual void streamEnded() = 0;
virtual void addTrack(MediaStreamComponent*) = 0;
@@ -61,8 +61,8 @@ public:
return adoptRef(new MediaStreamDescriptor(label, audioSources, videoSources));
}
- MediaStreamDescriptorOwner* owner() const { return m_owner; }
- void setOwner(MediaStreamDescriptorOwner* owner) { m_owner = owner; }
+ MediaStreamDescriptorClient* client() const { return m_client; }
+ void setClient(MediaStreamDescriptorClient* client) { m_client = client; }
String label() const { return m_label; }
@@ -80,7 +80,7 @@ public:
private:
MediaStreamDescriptor(const String& label, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
- : m_owner(0)
+ : m_client(0)
, m_label(label)
, m_ended(false)
{
@@ -91,7 +91,7 @@ private:
m_videoComponents.append(MediaStreamComponent::create(videoSources[i]));
}
- MediaStreamDescriptorOwner* m_owner;
+ MediaStreamDescriptorClient* m_client;
String m_label;
Vector<RefPtr<MediaStreamComponent> > m_audioComponents;
Vector<RefPtr<MediaStreamComponent> > m_videoComponents;
diff --git a/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp b/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp
index 2c2acbe86..25b2573ac 100644
--- a/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp
+++ b/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp
@@ -30,6 +30,7 @@
#include "config.h"
#include "ResourceHandle.h"
+#include "BlobRegistry.h"
#include "CachedResourceLoader.h"
#include "Frame.h"
#include "FrameNetworkingContext.h"
@@ -150,6 +151,12 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame)
void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data)
{
+#if ENABLE(BLOB)
+ if (request.url().protocolIs("blob")) {
+ blobRegistry().loadResourceSynchronously(request, error, response, data);
+ return;
+ }
+#endif
WebCoreSynchronousLoader syncLoader(error, response, data);
RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false));
diff --git a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp
index 96e23a98a..62d8696ed 100644
--- a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp
+++ b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp
@@ -126,6 +126,16 @@ unsigned initializeMaximumHTTPConnectionCountPerHost()
String ResourceRequest::urlStringForSoup() const
{
+ // WebKit does not support fragment identifiers in data URLs, but soup does.
+ // Before passing the URL to soup, we should make sure to urlencode any '#'
+ // characters, so that soup does not interpret them as fragment identifiers.
+ // See http://wkbug.com/68089
+ if (m_url.protocolIsData()) {
+ String urlString = m_url.string();
+ urlString.replace("#", "%23");
+ return urlString;
+ }
+
KURL url = m_url;
url.removeFragmentIdentifier();
return url.string();
diff --git a/Source/WebCore/platform/text/LocaleICU.cpp b/Source/WebCore/platform/text/LocaleICU.cpp
index ce5f0afc4..e1a1eb17b 100644
--- a/Source/WebCore/platform/text/LocaleICU.cpp
+++ b/Source/WebCore/platform/text/LocaleICU.cpp
@@ -33,6 +33,7 @@
#include "LocalizedStrings.h"
#include <limits>
+#include <unicode/udatpg.h>
#include <unicode/uloc.h>
#include <wtf/DateMath.h>
#include <wtf/PassOwnPtr.h>
@@ -398,6 +399,36 @@ String LocaleICU::dateFormat()
return m_dateFormat;
}
+static String getFormatForSkeleton(const char* locale, const String& skeleton)
+{
+ String format = ASCIILiteral("yyyy-MM");
+ UErrorCode status = U_ZERO_ERROR;
+ UDateTimePatternGenerator* patternGenerator = udatpg_open(locale, &status);
+ if (!patternGenerator)
+ return format;
+ status = U_ZERO_ERROR;
+ int32_t length = udatpg_getBestPattern(patternGenerator, skeleton.characters(), skeleton.length(), 0, 0, &status);
+ if (status == U_BUFFER_OVERFLOW_ERROR && length) {
+ Vector<UChar> buffer(length);
+ status = U_ZERO_ERROR;
+ udatpg_getBestPattern(patternGenerator, skeleton.characters(), skeleton.length(), buffer.data(), length, &status);
+ if (U_SUCCESS(status))
+ format = String::adopt(buffer);
+ }
+ udatpg_close(patternGenerator);
+ return format;
+}
+
+String LocaleICU::monthFormat()
+{
+ if (!m_monthFormat.isNull())
+ return m_monthFormat;
+ // Gets a format for "MMM", not "MM" because Windows API always provides
+ // formats for "MMM".
+ m_monthFormat = getFormatForSkeleton(m_locale.data(), ASCIILiteral("yyyyMMM"));
+ return m_monthFormat;
+}
+
String LocaleICU::timeFormat()
{
initializeDateTimeFormat();
@@ -410,6 +441,36 @@ String LocaleICU::shortTimeFormat()
return m_localizedShortTimeFormatText;
}
+const Vector<String>& LocaleICU::shortMonthLabels()
+{
+ if (!m_shortMonthLabels.isEmpty())
+ return m_shortMonthLabels;
+ if (initializeShortDateFormat()) {
+ if (OwnPtr<Vector<String> > labels = createLabelVector(m_shortDateFormat, UDAT_SHORT_MONTHS, UCAL_JANUARY, 12)) {
+ m_shortMonthLabels = *labels;
+ return m_shortMonthLabels;
+ }
+ }
+ m_shortMonthLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::monthName));
+ for (unsigned i = 0; i < WTF_ARRAY_LENGTH(WTF::monthName); ++i)
+ m_shortMonthLabels.append(WTF::monthName[i]);
+ return m_shortMonthLabels;
+}
+
+const Vector<String>& LocaleICU::shortStandAloneMonthLabels()
+{
+ if (!m_shortStandAloneMonthLabels.isEmpty())
+ return m_shortStandAloneMonthLabels;
+ if (initializeShortDateFormat()) {
+ if (OwnPtr<Vector<String> > labels = createLabelVector(m_shortDateFormat, UDAT_STANDALONE_SHORT_MONTHS, UCAL_JANUARY, 12)) {
+ m_shortStandAloneMonthLabels = *labels;
+ return m_shortStandAloneMonthLabels;
+ }
+ }
+ m_shortStandAloneMonthLabels = shortMonthLabels();
+ return m_shortStandAloneMonthLabels;
+}
+
const Vector<String>& LocaleICU::timeAMPMLabels()
{
initializeDateTimeFormat();
diff --git a/Source/WebCore/platform/text/LocaleICU.h b/Source/WebCore/platform/text/LocaleICU.h
index a4b8122cb..6c62f92fc 100644
--- a/Source/WebCore/platform/text/LocaleICU.h
+++ b/Source/WebCore/platform/text/LocaleICU.h
@@ -62,8 +62,11 @@ public:
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
virtual String dateFormat() OVERRIDE;
+ virtual String monthFormat() OVERRIDE;
virtual String timeFormat() OVERRIDE;
virtual String shortTimeFormat() OVERRIDE;
+ virtual const Vector<String>& shortMonthLabels() OVERRIDE;
+ virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE;
virtual const Vector<String>& timeAMPMLabels() OVERRIDE;
#endif
@@ -107,8 +110,11 @@ private:
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
String m_dateFormat;
+ String m_monthFormat;
UDateFormat* m_mediumTimeFormat;
UDateFormat* m_shortTimeFormat;
+ Vector<String> m_shortMonthLabels;
+ Vector<String> m_shortStandAloneMonthLabels;
Vector<String> m_timeAMPMLabels;
bool m_didCreateTimeFormat;
#endif
diff --git a/Source/WebCore/platform/text/LocaleNone.cpp b/Source/WebCore/platform/text/LocaleNone.cpp
index 0ddaf3036..2535d896a 100644
--- a/Source/WebCore/platform/text/LocaleNone.cpp
+++ b/Source/WebCore/platform/text/LocaleNone.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "Localizer.h"
+#include <wtf/DateMath.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -42,7 +43,12 @@ private:
#endif
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
virtual String dateFormat() OVERRIDE;
+ virtual String monthFormat() OVERRIDE;
+ virtual const Vector<String>& shortMonthLabels() OVERRIDE;
+ virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE;
#endif
+
+ Vector<String> m_shortMonthLabels;
};
PassOwnPtr<Localizer> Localizer::create(const AtomicString&)
@@ -80,6 +86,26 @@ String LocaleNone::dateFormat()
{
return ASCIILiteral("dd/MM/yyyyy");
}
+
+String LocaleNone::monthFormat()
+{
+ return ASCIILiteral("yyyy-MM");
+}
+
+const Vector<String>& LocaleNone::shortMonthLabels()
+{
+ if (!m_shortMonthLabels.isEmpty())
+ return m_shortMonthLabels;
+ m_shortMonthLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::monthName));
+ for (unsigned i = 0; i < WTF_ARRAY_LENGTH(WTF::monthName); ++i)
+ m_shortMonthLabels.append(WTF::monthName[i]);
+ return m_shortMonthLabels;
+}
+
+const Vector<String>& LocaleNone::shortStandAloneMonthLabels()
+{
+ return shortMonthLabels();
+}
#endif
} // namespace WebCore
diff --git a/Source/WebCore/platform/text/LocaleWin.cpp b/Source/WebCore/platform/text/LocaleWin.cpp
index 097b09302..584a6a06f 100644
--- a/Source/WebCore/platform/text/LocaleWin.cpp
+++ b/Source/WebCore/platform/text/LocaleWin.cpp
@@ -713,6 +713,14 @@ String LocaleWin::dateFormat(const String& windowsFormat)
return convertWindowsDateFormatToLDML(parseDateFormat(windowsFormat));
}
+String LocaleWin::monthFormat()
+{
+ if (!m_monthFormat.isNull())
+ return m_monthFormat;
+ m_monthFormat = convertWindowsDateFormatToLDML(parseDateFormat(getLocaleInfoString(LOCALE_SYEARMONTH)));
+ return m_monthFormat;
+}
+
String LocaleWin::timeFormat()
{
if (m_localizedTimeFormatText.isEmpty())
@@ -727,6 +735,18 @@ String LocaleWin::shortTimeFormat()
return timeFormat();
}
+const Vector<String>& LocaleWin::shortMonthLabels()
+{
+ ensureShortMonthLabels();
+ return m_shortMonthLabels;
+}
+
+const Vector<String>& LocaleWin::shortStandAloneMonthLabels()
+{
+ // Windows doesn't provide a way to get stand-alone month labels.
+ return shortMonthLabels();
+}
+
const Vector<String>& LocaleWin::timeAMPMLabels()
{
if (m_timeAMPMLabels.isEmpty()) {
diff --git a/Source/WebCore/platform/text/LocaleWin.h b/Source/WebCore/platform/text/LocaleWin.h
index 21ad7bf5f..a2b15d3f0 100644
--- a/Source/WebCore/platform/text/LocaleWin.h
+++ b/Source/WebCore/platform/text/LocaleWin.h
@@ -57,8 +57,11 @@ public:
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
virtual String dateFormat() OVERRIDE;
+ virtual String monthFormat() OVERRIDE;
virtual String timeFormat() OVERRIDE;
virtual String shortTimeFormat() OVERRIDE;
+ virtual const Vector<String>& shortMonthLabels() OVERRIDE;
+ virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE;
virtual const Vector<String>& timeAMPMLabels() OVERRIDE;
#endif
@@ -98,6 +101,7 @@ private:
Vector<String> m_monthLabels;
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
String m_dateFormat;
+ String m_monthFormat;
#endif
#if ENABLE(CALENDAR_PICKER)
Vector<String> m_weekDayShortLabels;
diff --git a/Source/WebCore/platform/text/Localizer.h b/Source/WebCore/platform/text/Localizer.h
index 2ed277c95..6f527195e 100644
--- a/Source/WebCore/platform/text/Localizer.h
+++ b/Source/WebCore/platform/text/Localizer.h
@@ -62,6 +62,9 @@ public:
// [1] LDML http://unicode.org/reports/tr35/#Date_Format_Patterns
virtual String dateFormat() = 0;
+ // Returns a year-month format in Unicode TR35 LDML.
+ virtual String monthFormat() = 0;
+
// Returns time format in Unicode TR35 LDML[1] containing hour, minute, and
// second with optional period(AM/PM), e.g. "h:mm:ss a"
// [1] LDML http://unicode.org/reports/tr35/#Date_Format_Patterns
@@ -80,6 +83,14 @@ public:
// field.
String dateTimeFormatWithoutSeconds();
+ // Returns a vector of string of which size is 12. The first item is a
+ // localized string of Jan and the last item is a localized string of
+ // Dec. These strings should be short.
+ virtual const Vector<String>& shortMonthLabels() = 0;
+
+ // Stand-alone month version of shortMonthLabels.
+ virtual const Vector<String>& shortStandAloneMonthLabels() = 0;
+
// Returns localized period field(AM/PM) strings.
virtual const Vector<String>& timeAMPMLabels();
#endif
diff --git a/Source/WebCore/platform/text/cf/StringCF.cpp b/Source/WebCore/platform/text/cf/StringCF.cpp
index 8c9774982..d7cda7962 100644
--- a/Source/WebCore/platform/text/cf/StringCF.cpp
+++ b/Source/WebCore/platform/text/cf/StringCF.cpp
@@ -37,6 +37,14 @@ String::String(CFStringRef str)
if (size == 0)
m_impl = StringImpl::empty();
else {
+ Vector<LChar, 1024> lcharBuffer(size);
+ CFIndex usedBufLen;
+ CFIndex convertedsize = CFStringGetBytes(str, CFRangeMake(0, size), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), size, &usedBufLen);
+ if ((convertedsize == size) && (usedBufLen == size)) {
+ m_impl = StringImpl::create(lcharBuffer.data(), size);
+ return;
+ }
+
Vector<UChar, 1024> buffer(size);
CFStringGetCharacters(str, CFRangeMake(0, size), (UniChar*)buffer.data());
m_impl = StringImpl::create(buffer.data(), size);
diff --git a/Source/WebCore/platform/text/mac/LocaleMac.h b/Source/WebCore/platform/text/mac/LocaleMac.h
index ac029ea03..a3f22beb1 100644
--- a/Source/WebCore/platform/text/mac/LocaleMac.h
+++ b/Source/WebCore/platform/text/mac/LocaleMac.h
@@ -62,8 +62,11 @@ public:
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
virtual String dateFormat() OVERRIDE;
+ virtual String monthFormat() OVERRIDE;
virtual String timeFormat() OVERRIDE;
virtual String shortTimeFormat() OVERRIDE;
+ virtual const Vector<String>& shortMonthLabels() OVERRIDE;
+ virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE;
virtual const Vector<String>& timeAMPMLabels() OVERRIDE;
#endif
@@ -84,8 +87,11 @@ private:
RetainPtr<NSDateFormatter> shortTimeFormatter();
String m_dateFormat;
+ String m_monthFormat;
String m_localizedTimeFormatText;
String m_localizedShortTimeFormatText;
+ Vector<String> m_shortMonthLabels;
+ Vector<String> m_shortStandAloneMonthLabels;
Vector<String> m_timeAMPMLabels;
#endif
bool m_didInitializeNumberData;
diff --git a/Source/WebCore/platform/text/mac/LocaleMac.mm b/Source/WebCore/platform/text/mac/LocaleMac.mm
index a20254e12..6c365df26 100644
--- a/Source/WebCore/platform/text/mac/LocaleMac.mm
+++ b/Source/WebCore/platform/text/mac/LocaleMac.mm
@@ -246,6 +246,16 @@ String LocaleMac::dateFormat()
return m_dateFormat;
}
+String LocaleMac::monthFormat()
+{
+ if (!m_monthFormat.isNull())
+ return m_monthFormat;
+ // Gets a format for "MMM", not "MM" because Windows API always provides
+ // formats for "MMM".
+ m_monthFormat = [NSDateFormatter dateFormatFromTemplate:@"yyyyMMM" options:0 locale:m_locale.get()];
+ return m_monthFormat;
+}
+
String LocaleMac::timeFormat()
{
if (!m_localizedTimeFormatText.isNull())
@@ -262,6 +272,37 @@ String LocaleMac::shortTimeFormat()
return m_localizedShortTimeFormatText;
}
+const Vector<String>& LocaleMac::shortMonthLabels()
+{
+ if (!m_shortMonthLabels.isEmpty())
+ return m_shortMonthLabels;
+ m_shortMonthLabels.reserveCapacity(12);
+ NSArray *array = [shortDateFormatter().get() shortMonthSymbols];
+ if ([array count] == 12) {
+ for (unsigned i = 0; i < 12; ++i)
+ m_shortMonthLabels.append([array objectAtIndex:i]);
+ return m_shortMonthLabels;
+ }
+ for (unsigned i = 0; i < WTF_ARRAY_LENGTH(WTF::monthName); ++i)
+ m_shortMonthLabels.append(WTF::monthName[i]);
+ return m_shortMonthLabels;
+}
+
+const Vector<String>& LocaleMac::shortStandAloneMonthLabels()
+{
+ if (!m_shortStandAloneMonthLabels.isEmpty())
+ return m_shortStandAloneMonthLabels;
+ NSArray *array = [shortDateFormatter().get() shortStandaloneMonthSymbols];
+ if ([array count] == 12) {
+ m_shortStandAloneMonthLabels.reserveCapacity(12);
+ for (unsigned i = 0; i < 12; ++i)
+ m_shortStandAloneMonthLabels.append([array objectAtIndex:i]);
+ return m_shortStandAloneMonthLabels;
+ }
+ m_shortStandAloneMonthLabels = shortMonthLabels();
+ return m_shortStandAloneMonthLabels;
+}
+
const Vector<String>& LocaleMac::timeAMPMLabels()
{
if (!m_timeAMPMLabels.isEmpty())
diff --git a/Source/WebCore/rendering/ExclusionPolygon.cpp b/Source/WebCore/rendering/ExclusionPolygon.cpp
index e704abfce..ba20dc2e6 100644
--- a/Source/WebCore/rendering/ExclusionPolygon.cpp
+++ b/Source/WebCore/rendering/ExclusionPolygon.cpp
@@ -57,26 +57,17 @@ ExclusionPolygon::ExclusionPolygon(PassOwnPtr<Vector<FloatPoint> > vertices, Win
, m_vertices(vertices)
, m_fillRule(fillRule)
{
- // FIXME: Handle polygons defined with less than 3 non-colinear vertices.
-
unsigned nVertices = numberOfVertices();
m_edges.resize(nVertices);
+ m_empty = nVertices < 3;
Vector<ExclusionPolygonEdge*> sortedEdgesMinY(nVertices);
- const FloatPoint& vertex0 = vertexAt(0);
- float minX = vertex0.x();
- float minY = vertex0.y();
- float maxX = minX;
- float maxY = minY;
+ if (nVertices)
+ m_boundingBox.setLocation(vertexAt(0));
for (unsigned i = 0; i < nVertices; i++) {
const FloatPoint& vertex = vertexAt(i);
-
- minX = std::min(vertex.x(), minX);
- maxX = std::max(vertex.x(), maxX);
- minY = std::min(vertex.y(), minY);
- maxY = std::max(vertex.y(), maxY);
-
+ m_boundingBox.extend(vertex);
m_edges[i].polygon = this;
m_edges[i].index1 = i;
m_edges[i].index2 = (i + 1) % nVertices;
@@ -84,11 +75,6 @@ ExclusionPolygon::ExclusionPolygon(PassOwnPtr<Vector<FloatPoint> > vertices, Win
sortedEdgesMinY[i] = &m_edges[i];
}
- m_boundingBox.setX(minX);
- m_boundingBox.setY(minY);
- m_boundingBox.setWidth(maxX - minX);
- m_boundingBox.setHeight(maxY - minY);
-
std::sort(sortedEdgesMinY.begin(), sortedEdgesMinY.end(), WebCore::compareEdgeMinY);
for (unsigned i = 0; i < m_edges.size(); i++) {
@@ -257,6 +243,9 @@ void ExclusionPolygon::computeEdgeIntersections(float y1, float y2, Vector<Exclu
void ExclusionPolygon::getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList& result) const
{
+ if (isEmpty())
+ return;
+
float y1 = minYForLogicalLine(logicalTop, logicalBottom);
float y2 = maxYForLogicalLine(logicalTop, logicalBottom);
@@ -281,6 +270,9 @@ void ExclusionPolygon::getExcludedIntervals(float logicalTop, float logicalBotto
void ExclusionPolygon::getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList& result) const
{
+ if (isEmpty())
+ return;
+
float y1 = minYForLogicalLine(logicalTop, logicalBottom);
float y2 = maxYForLogicalLine(logicalTop, logicalBottom);
diff --git a/Source/WebCore/rendering/ExclusionPolygon.h b/Source/WebCore/rendering/ExclusionPolygon.h
index 6397d0ee7..57e35520d 100644
--- a/Source/WebCore/rendering/ExclusionPolygon.h
+++ b/Source/WebCore/rendering/ExclusionPolygon.h
@@ -62,6 +62,7 @@ public:
virtual FloatRect shapeLogicalBoundingBox() const OVERRIDE { return internalToLogicalBoundingBox(m_boundingBox); }
virtual void getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const OVERRIDE;
virtual void getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const OVERRIDE;
+ virtual bool isEmpty() const OVERRIDE { return m_empty; }
private:
float rightVertexY(unsigned) const;
@@ -76,6 +77,7 @@ private:
FloatRect m_boundingBox;
Vector<ExclusionPolygonEdge> m_edges;
EdgeIntervalTree m_edgeTree;
+ bool m_empty;
};
// EdgeIntervalTree nodes store minY, maxY, and a ("UserData") pointer to an ExclusionPolygonEdge. Edge vertex
diff --git a/Source/WebCore/rendering/ExclusionRectangle.cpp b/Source/WebCore/rendering/ExclusionRectangle.cpp
index 3bdde0aee..0ccf6224a 100644
--- a/Source/WebCore/rendering/ExclusionRectangle.cpp
+++ b/Source/WebCore/rendering/ExclusionRectangle.cpp
@@ -42,6 +42,9 @@ static inline float ellipseXIntercept(float y, float rx, float ry)
void ExclusionRectangle::getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList& result) const
{
+ if (isEmpty())
+ return;
+
float y1 = minYForLogicalLine(logicalTop, logicalBottom);
float y2 = maxYForLogicalLine(logicalTop, logicalBottom);
@@ -70,6 +73,9 @@ void ExclusionRectangle::getExcludedIntervals(float logicalTop, float logicalBot
void ExclusionRectangle::getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList& result) const
{
+ if (isEmpty())
+ return;
+
float y1 = minYForLogicalLine(logicalTop, logicalBottom);
float y2 = maxYForLogicalLine(logicalTop, logicalBottom);
diff --git a/Source/WebCore/rendering/ExclusionRectangle.h b/Source/WebCore/rendering/ExclusionRectangle.h
index 5ca289d86..0078264dd 100644
--- a/Source/WebCore/rendering/ExclusionRectangle.h
+++ b/Source/WebCore/rendering/ExclusionRectangle.h
@@ -53,6 +53,7 @@ public:
virtual FloatRect shapeLogicalBoundingBox() const OVERRIDE { return internalToLogicalBoundingBox(FloatRect(m_x, m_y, m_width, m_height)); }
virtual void getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const OVERRIDE;
virtual void getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const OVERRIDE;
+ virtual bool isEmpty() const OVERRIDE { return m_width <= 0 || m_height <= 0; }
private:
float m_x;
diff --git a/Source/WebCore/rendering/ExclusionShape.cpp b/Source/WebCore/rendering/ExclusionShape.cpp
index c3ec8acaa..f5d85b2ec 100644
--- a/Source/WebCore/rendering/ExclusionShape.cpp
+++ b/Source/WebCore/rendering/ExclusionShape.cpp
@@ -82,18 +82,21 @@ PassOwnPtr<ExclusionShape> ExclusionShape::createExclusionShape(const BasicShape
case BasicShape::BASIC_SHAPE_RECTANGLE: {
const BasicShapeRectangle* rectangle = static_cast<const BasicShapeRectangle*>(basicShape);
- float x = floatValueForLength(rectangle->x(), boxWidth);
- float y = floatValueForLength(rectangle->y(), boxHeight);
- float width = floatValueForLength(rectangle->width(), boxWidth);
- float height = floatValueForLength(rectangle->height(), boxHeight);
+ FloatRect bounds(
+ floatValueForLength(rectangle->x(), boxWidth),
+ floatValueForLength(rectangle->y(), boxHeight),
+ floatValueForLength(rectangle->width(), boxWidth),
+ floatValueForLength(rectangle->height(), boxHeight));
Length radiusXLength = rectangle->cornerRadiusX();
Length radiusYLength = rectangle->cornerRadiusY();
- float radiusX = radiusXLength.isUndefined() ? 0 : floatValueForLength(radiusXLength, boxWidth);
- float radiusY = radiusYLength.isUndefined() ? 0 : floatValueForLength(radiusYLength, boxHeight);
+ FloatSize cornerRadii(
+ radiusXLength.isUndefined() ? 0 : floatValueForLength(radiusXLength, boxWidth),
+ radiusYLength.isUndefined() ? 0 : floatValueForLength(radiusYLength, boxHeight));
exclusionShape = horizontalWritingMode
- ? createExclusionRectangle(FloatRect(x, y, width, height), FloatSize(radiusX, radiusY))
- : createExclusionRectangle(FloatRect(y, x, height, width), FloatSize(radiusY, radiusX));
+ ? createExclusionRectangle(bounds, cornerRadii)
+ : createExclusionRectangle(bounds.transposedRect(), cornerRadii.transposedSize());
+ exclusionShape->m_boundingBox = bounds;
break;
}
@@ -106,6 +109,7 @@ PassOwnPtr<ExclusionShape> ExclusionShape::createExclusionShape(const BasicShape
exclusionShape = horizontalWritingMode
? createExclusionCircle(FloatPoint(centerX, centerY), radius)
: createExclusionCircle(FloatPoint(centerY, centerX), radius);
+ exclusionShape->m_boundingBox = FloatRect(centerX - radius, centerY - radius, radius * 2, radius * 2);
break;
}
@@ -119,6 +123,7 @@ PassOwnPtr<ExclusionShape> ExclusionShape::createExclusionShape(const BasicShape
exclusionShape = horizontalWritingMode
? createExclusionEllipse(FloatPoint(centerX, centerY), FloatSize(radiusX, radiusY))
: createExclusionEllipse(FloatPoint(centerY, centerX), FloatSize(radiusY, radiusX));
+ exclusionShape->m_boundingBox = FloatRect(centerX - radiusX, centerY - radiusY, radiusX * 2, radiusY * 2);
break;
}
@@ -127,14 +132,20 @@ PassOwnPtr<ExclusionShape> ExclusionShape::createExclusionShape(const BasicShape
const Vector<Length>& values = polygon->values();
size_t valuesSize = values.size();
ASSERT(!(valuesSize % 2));
+ FloatRect boundingBox;
Vector<FloatPoint>* vertices = new Vector<FloatPoint>(valuesSize / 2);
for (unsigned i = 0; i < valuesSize; i += 2) {
FloatPoint vertex(
floatValueForLength(values.at(i), boxWidth),
floatValueForLength(values.at(i + 1), boxHeight));
(*vertices)[i / 2] = horizontalWritingMode ? vertex : vertex.transposedPoint();
+ if (!i)
+ boundingBox.setLocation(vertex);
+ else
+ boundingBox.extend(vertex);
}
exclusionShape = createExclusionPolygon(adoptPtr(vertices), polygon->windRule());
+ exclusionShape->m_boundingBox = boundingBox;
break;
}
diff --git a/Source/WebCore/rendering/ExclusionShape.h b/Source/WebCore/rendering/ExclusionShape.h
index bb1edc6d1..a75ab70e8 100644
--- a/Source/WebCore/rendering/ExclusionShape.h
+++ b/Source/WebCore/rendering/ExclusionShape.h
@@ -64,8 +64,10 @@ public:
virtual ~ExclusionShape() { }
virtual FloatRect shapeLogicalBoundingBox() const = 0;
+ virtual FloatRect shapeBoundingBox() const { return m_boundingBox; }
virtual void getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const = 0;
virtual void getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const = 0;
+ virtual bool isEmpty() const = 0;
protected:
float minYForLogicalLine(float logicalTop, float logicalBottom) const { return (m_writingMode == RightToLeftWritingMode) ? m_logicalBoxHeight - logicalBottom : logicalTop; }
@@ -76,6 +78,7 @@ private:
WritingMode m_writingMode;
float m_logicalBoxWidth;
float m_logicalBoxHeight;
+ FloatRect m_boundingBox;
};
} // namespace WebCore
diff --git a/Source/WebCore/rendering/InlineIterator.h b/Source/WebCore/rendering/InlineIterator.h
index bef9a9815..bef9a9815 100755..100644
--- a/Source/WebCore/rendering/InlineIterator.h
+++ b/Source/WebCore/rendering/InlineIterator.h
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index 796156a60..6e1087d35 100755..100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -1373,6 +1373,7 @@ void RenderBlock::updateScrollInfoAfterLayout()
void RenderBlock::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
OverflowEventDispatcher dispatcher(this);
// Update our first letter info now.
@@ -6093,11 +6094,9 @@ void RenderBlock::computeBlockPreferredLogicalWidths()
LayoutUnit childMinPreferredLogicalWidth, childMaxPreferredLogicalWidth;
if (child->isBox() && child->isHorizontalWritingMode() != isHorizontalWritingMode()) {
RenderBox* childBox = toRenderBox(child);
- LayoutUnit oldHeight = childBox->logicalHeight();
- childBox->setLogicalHeight(childBox->borderAndPaddingLogicalHeight());
- childBox->updateLogicalHeight();
- childMinPreferredLogicalWidth = childMaxPreferredLogicalWidth = childBox->logicalHeight();
- childBox->setLogicalHeight(oldHeight);
+ LogicalExtentComputedValues computedValues;
+ childBox->computeLogicalHeight(childBox->borderAndPaddingLogicalHeight(), 0, computedValues);
+ childMinPreferredLogicalWidth = childMaxPreferredLogicalWidth = computedValues.m_extent;
} else {
childMinPreferredLogicalWidth = child->minPreferredLogicalWidth();
childMaxPreferredLogicalWidth = child->maxPreferredLogicalWidth();
diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
index 21fd552f7..1cfd1e098 100755..100644
--- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -177,13 +177,15 @@ inline void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(RenderBlock::Floa
return;
if (newFloat->type() == RenderBlock::FloatingObject::FloatLeft) {
- m_left = m_block->pixelSnappedLogicalRightForFloat(newFloat);
+ float newLeft = m_block->pixelSnappedLogicalRightForFloat(newFloat);
if (m_isFirstLine && m_block->style()->isLeftToRightDirection())
- m_left += floorToInt(m_block->textIndentOffset());
+ newLeft += floorToInt(m_block->textIndentOffset());
+ m_left = max<float>(m_left, newLeft);
} else {
- m_right = m_block->pixelSnappedLogicalLeftForFloat(newFloat);
+ float newRight = m_block->pixelSnappedLogicalLeftForFloat(newFloat);
if (m_isFirstLine && !m_block->style()->isLeftToRightDirection())
- m_right -= floorToInt(m_block->textIndentOffset());
+ newRight -= floorToInt(m_block->textIndentOffset());
+ m_right = min<float>(m_right, newRight);
}
computeAvailableWidthFromLeftAndRight();
@@ -1021,6 +1023,20 @@ static void setStaticPositions(RenderBlock* block, RenderBox* child)
child->layer()->setStaticBlockPosition(blockHeight);
}
+template <typename CharacterType>
+static inline int findFirstTrailingSpace(RenderText* lastText, const CharacterType* characters, int start, int stop)
+{
+ int firstSpace = stop;
+ while (firstSpace > start) {
+ UChar current = characters[firstSpace - 1];
+ if (!isCollapsibleSpace(current, lastText))
+ break;
+ firstSpace--;
+ }
+
+ return firstSpace;
+}
+
inline BidiRun* RenderBlock::handleTrailingSpaces(BidiRunList<BidiRun>& bidiRuns, BidiContext* currentContext)
{
if (!bidiRuns.runCount()
@@ -1034,14 +1050,12 @@ inline BidiRun* RenderBlock::handleTrailingSpaces(BidiRunList<BidiRun>& bidiRuns
return 0;
RenderText* lastText = toRenderText(lastObject);
- const UChar* characters = lastText->characters();
- int firstSpace = trailingSpaceRun->stop();
- while (firstSpace > trailingSpaceRun->start()) {
- UChar current = characters[firstSpace - 1];
- if (!isCollapsibleSpace(current, lastText))
- break;
- firstSpace--;
- }
+ int firstSpace;
+ if (lastText->is8Bit())
+ firstSpace = findFirstTrailingSpace(lastText, lastText->characters8(), trailingSpaceRun->start(), trailingSpaceRun->stop());
+ else
+ firstSpace = findFirstTrailingSpace(lastText, lastText->characters16(), trailingSpaceRun->start(), trailingSpaceRun->stop());
+
if (firstSpace == trailingSpaceRun->stop())
return 0;
@@ -2390,6 +2404,14 @@ InlineIterator RenderBlock::LineBreaker::nextLineBreak(InlineBidiResolver& resol
trailingObjects.clear();
lineInfo.setPreviousLineBrokeCleanly(true);
+ // A <br> with clearance always needs a linebox in case the lines below it get dirtied later and
+ // need to check for floats to clear - so if we're ignoring spaces, stop ignoring them and add a
+ // run for this object.
+ if (ignoringSpaces && currentStyle->clear() != CNONE) {
+ addMidpoint(lineMidpointState, InlineIterator(0, current.m_obj, 0)); // Stop ignoring spaces.
+ addMidpoint(lineMidpointState, InlineIterator(0, current.m_obj, 0)); // Start ignoring again.
+ }
+
if (!lineInfo.isEmpty())
m_clear = currentStyle->clear();
}
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index c56d7a9ea..779277d14 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -314,6 +314,7 @@ void RenderBox::updateFromStyle()
void RenderBox::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
RenderObject* child = firstChild();
@@ -2212,10 +2213,9 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
} else if (cb->isRenderView() || isOutOfFlowPositionedWithSpecifiedHeight) {
// Don't allow this to affect the block' height() member variable, since this
// can get called while the block is still laying out its kids.
- LayoutUnit oldHeight = cb->logicalHeight();
- cb->updateLogicalHeight();
- availableHeight = cb->contentLogicalHeight();
- cb->setLogicalHeight(oldHeight);
+ LogicalExtentComputedValues computedValues;
+ cb->computeLogicalHeight(cb->logicalHeight(), 0, computedValues);
+ availableHeight = computedValues.m_extent - cb->borderAndPaddingLogicalHeight() - cb->scrollbarLogicalHeight();
}
if (availableHeight == -1)
@@ -2311,10 +2311,10 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType sizeType, Lengt
if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() && !(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) {
ASSERT(cb->isRenderBlock());
RenderBlock* block = toRenderBlock(cb);
- LayoutUnit oldHeight = block->height();
- block->updateLogicalHeight();
- LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(block->contentHeight());
- block->setHeight(oldHeight);
+ LogicalExtentComputedValues computedValues;
+ block->computeLogicalHeight(block->logicalHeight(), 0, computedValues);
+ LayoutUnit newContentHeight = computedValues.m_extent - block->borderAndPaddingLogicalHeight() - block->scrollbarLogicalHeight();
+ LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(newContentHeight);
return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, newHeight));
}
@@ -2386,11 +2386,10 @@ LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h) const
// https://bugs.webkit.org/show_bug.cgi?id=46500
if (isRenderBlock() && isOutOfFlowPositioned() && style()->height().isAuto() && !(style()->top().isAuto() || style()->bottom().isAuto())) {
RenderBlock* block = const_cast<RenderBlock*>(toRenderBlock(this));
- LayoutUnit oldHeight = block->logicalHeight();
- block->updateLogicalHeight();
- LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(block->contentLogicalHeight());
- block->setLogicalHeight(oldHeight);
- return adjustContentBoxLogicalHeightForBoxSizing(newHeight);
+ LogicalExtentComputedValues computedValues;
+ block->computeLogicalHeight(block->logicalHeight(), 0, computedValues);
+ LayoutUnit newContentHeight = computedValues.m_extent - block->borderAndPaddingLogicalHeight() - block->scrollbarLogicalHeight();
+ return adjustContentBoxLogicalHeightForBoxSizing(newContentHeight);
}
// FIXME: This is wrong if the containingBlock has a perpendicular writing mode.
diff --git a/Source/WebCore/rendering/RenderDialog.cpp b/Source/WebCore/rendering/RenderDialog.cpp
index 4fb940925..b2498ae4c 100644
--- a/Source/WebCore/rendering/RenderDialog.cpp
+++ b/Source/WebCore/rendering/RenderDialog.cpp
@@ -36,6 +36,7 @@ namespace WebCore {
void RenderDialog::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
LayoutRepainter repainter(*this, true);
LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
diff --git a/Source/WebCore/rendering/RenderEmbeddedObject.cpp b/Source/WebCore/rendering/RenderEmbeddedObject.cpp
index 1007dfb39..1e12c7c90 100644
--- a/Source/WebCore/rendering/RenderEmbeddedObject.cpp
+++ b/Source/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -228,6 +228,7 @@ bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul
void RenderEmbeddedObject::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
updateLogicalWidth();
diff --git a/Source/WebCore/rendering/RenderFieldset.cpp b/Source/WebCore/rendering/RenderFieldset.cpp
index c180c8536..d663c3b5b 100644
--- a/Source/WebCore/rendering/RenderFieldset.cpp
+++ b/Source/WebCore/rendering/RenderFieldset.cpp
@@ -123,10 +123,13 @@ RenderObject* RenderFieldset::layoutSpecialExcludedChild(bool relayoutChildren)
return legend;
}
-RenderBox* RenderFieldset::findLegend() const
+RenderBox* RenderFieldset::findLegend(FindLegendOption option) const
{
for (RenderObject* legend = firstChild(); legend; legend = legend->nextSibling()) {
- if (!legend->isFloatingOrOutOfFlowPositioned() && legend->node() && (legend->node()->hasTagName(legendTag)))
+ if (option == IgnoreFloatingOrOutOfFlow && legend->isFloatingOrOutOfFlowPositioned())
+ continue;
+
+ if (legend->node() && (legend->node()->hasTagName(legendTag)))
return toRenderBox(legend);
}
return 0;
diff --git a/Source/WebCore/rendering/RenderFieldset.h b/Source/WebCore/rendering/RenderFieldset.h
index 12dbda502..74ad92b6e 100644
--- a/Source/WebCore/rendering/RenderFieldset.h
+++ b/Source/WebCore/rendering/RenderFieldset.h
@@ -32,7 +32,8 @@ class RenderFieldset : public RenderBlock {
public:
explicit RenderFieldset(Node*);
- RenderBox* findLegend() const;
+ enum FindLegendOption { IgnoreFloatingOrOutOfFlow, IncludeFloatingOrOutOfFlow };
+ RenderBox* findLegend(FindLegendOption = IgnoreFloatingOrOutOfFlow) const;
private:
virtual const char* renderName() const { return "RenderFieldSet"; }
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp
index baf7747b9..86e655e89 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp
@@ -664,6 +664,7 @@ LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox*
Length flexBasis = flexBasisForChild(child);
if (flexBasis.isAuto()) {
LayoutUnit mainAxisExtent = hasOrthogonalFlow(child) ? child->logicalHeight() : child->maxPreferredLogicalWidth();
+ ASSERT(mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child) >= 0);
return mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child);
}
return std::max(LayoutUnit(0), computeMainAxisExtentForChild(child, MainOrPreferredSize, flexBasis));
diff --git a/Source/WebCore/rendering/RenderFlowThread.cpp b/Source/WebCore/rendering/RenderFlowThread.cpp
index 94f8ba694..d054d2457 100644
--- a/Source/WebCore/rendering/RenderFlowThread.cpp
+++ b/Source/WebCore/rendering/RenderFlowThread.cpp
@@ -132,6 +132,7 @@ private:
void RenderFlowThread::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
m_pageLogicalHeightChanged = m_regionsInvalidated && everHadLayout();
if (m_regionsInvalidated) {
m_regionsInvalidated = false;
diff --git a/Source/WebCore/rendering/RenderFrameSet.cpp b/Source/WebCore/rendering/RenderFrameSet.cpp
index 4086cdc67..543c2d353 100644
--- a/Source/WebCore/rendering/RenderFrameSet.cpp
+++ b/Source/WebCore/rendering/RenderFrameSet.cpp
@@ -459,6 +459,7 @@ FrameEdgeInfo RenderFrameSet::edgeInfo() const
void RenderFrameSet::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout();
diff --git a/Source/WebCore/rendering/RenderIFrame.cpp b/Source/WebCore/rendering/RenderIFrame.cpp
index 6649d5610..2fcd58a77 100644
--- a/Source/WebCore/rendering/RenderIFrame.cpp
+++ b/Source/WebCore/rendering/RenderIFrame.cpp
@@ -147,6 +147,7 @@ void RenderIFrame::layoutSeamlessly()
void RenderIFrame::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
if (isSeamless()) {
diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp
index e94fa3ebd..25a62f50b 100644
--- a/Source/WebCore/rendering/RenderImage.cpp
+++ b/Source/WebCore/rendering/RenderImage.cpp
@@ -533,6 +533,7 @@ void RenderImage::updateAltText()
void RenderImage::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
RenderReplaced::layout();
// Propagate container size to image resource.
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 62606f196..32471d88b 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -619,6 +619,8 @@ TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr
makeMatrixRenderable(currTransform, canRender3DTransforms());
return currTransform;
}
+#else
+ UNUSED_PARAM(applyOrigin);
#endif
return *m_transform;
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 6e3aa530e..8c147e141 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -125,7 +125,10 @@ RenderLayerBacking::RenderLayerBacking(RenderLayer* layer)
if (TiledBacking* tiledBacking = m_graphicsLayer->tiledBacking()) {
Frame* frame = renderer()->frame();
tiledBacking->setIsInWindow(page->isOnscreen());
- tiledBacking->setTileCoverage(frame->view()->canHaveScrollbars() ? TiledBacking::CoverageForScrolling : TiledBacking::CoverageForVisibleArea);
+ if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) {
+ bool shouldLimitTileCoverage = !frame->view()->canHaveScrollbars() || scrollingCoordinator->shouldUpdateScrollLayerPositionOnMainThread();
+ tiledBacking->setTileCoverage(shouldLimitTileCoverage ? TiledBacking::CoverageForVisibleArea : TiledBacking::CoverageForScrolling);
+ }
tiledBacking->setScrollingPerformanceLoggingEnabled(frame->settings() && frame->settings()->scrollingPerformanceLoggingEnabled());
}
}
@@ -965,7 +968,7 @@ bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers)
return layerChanged;
}
-void RenderLayerBacking::attachToScrollingCoordinator()
+void RenderLayerBacking::attachToScrollingCoordinator(RenderLayerBacking* parent)
{
// If m_scrollLayerID non-zero, then this backing is already attached to the ScrollingCoordinator.
if (m_scrollLayerID)
@@ -978,8 +981,9 @@ void RenderLayerBacking::attachToScrollingCoordinator()
ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator();
if (!scrollingCoordinator)
return;
-
- m_scrollLayerID = scrollingCoordinator->attachToStateTree(scrollingCoordinator->uniqueScrollLayerID());
+
+ ScrollingNodeID parentID = parent ? parent->scrollLayerID() : 0;
+ m_scrollLayerID = scrollingCoordinator->attachToStateTree(scrollingCoordinator->uniqueScrollLayerID(), parentID);
}
void RenderLayerBacking::detachFromScrollingCoordinator()
diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h
index 565b308c4..9468fe9d3 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.h
+++ b/Source/WebCore/rendering/RenderLayerBacking.h
@@ -88,7 +88,7 @@ public:
GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); }
GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLayer.get(); }
- void attachToScrollingCoordinator();
+ void attachToScrollingCoordinator(RenderLayerBacking* parent);
uint64_t scrollLayerID() const { return m_scrollLayerID; }
bool hasMaskLayer() const { return m_maskLayer != 0; }
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index bfc851713..55664c228 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -283,6 +283,9 @@ void RenderLayerCompositor::flushPendingLayerChanges(bool isFlushRoot)
if (!isFlushRoot && rootLayerAttachment() == RootLayerAttachedViaEnclosingFrame)
return;
+ if (rootLayerAttachment() == RootLayerUnattached)
+ return;
+
AnimationUpdateBlock animationUpdateBlock(m_renderView->frameView()->frame()->animation());
ASSERT(!m_flushingLayers);
@@ -510,7 +513,7 @@ bool RenderLayerCompositor::updateBacking(RenderLayer* layer, CompositingChangeR
// At this time, the ScrollingCooridnator only supports the top-level frame.
if (layer->isRootLayer() && !m_renderView->document()->ownerElement()) {
- layer->backing()->attachToScrollingCoordinator();
+ layer->backing()->attachToScrollingCoordinator(0);
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
scrollingCoordinator->frameViewRootLayerDidChange(m_renderView->frameView());
}
@@ -1097,7 +1100,7 @@ void RenderLayerCompositor::frameViewDidScroll()
if (TiledBacking* tiledBacking = frameView->tiledBacking()) {
IntRect visibleContentRect = frameView->visibleContentRect(false /* exclude scrollbars */);
visibleContentRect.move(toSize(frameView->scrollOrigin()));
- tiledBacking->visibleRectChanged(visibleContentRect);
+ tiledBacking->setVisibleRect(visibleContentRect);
}
if (!m_scrollLayer)
diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp
index f67ae82eb..2af9635d4 100644
--- a/Source/WebCore/rendering/RenderListBox.cpp
+++ b/Source/WebCore/rendering/RenderListBox.cpp
@@ -172,6 +172,7 @@ void RenderListBox::selectionChanged()
void RenderListBox::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
RenderBlock::layout();
if (m_vBar) {
diff --git a/Source/WebCore/rendering/RenderListItem.cpp b/Source/WebCore/rendering/RenderListItem.cpp
index 89d99b3e2..84a579460 100644
--- a/Source/WebCore/rendering/RenderListItem.cpp
+++ b/Source/WebCore/rendering/RenderListItem.cpp
@@ -286,6 +286,7 @@ void RenderListItem::computePreferredLogicalWidths()
void RenderListItem::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
updateMarkerLocation();
diff --git a/Source/WebCore/rendering/RenderListMarker.cpp b/Source/WebCore/rendering/RenderListMarker.cpp
index a5b0e4cdb..b7cbaa038 100644
--- a/Source/WebCore/rendering/RenderListMarker.cpp
+++ b/Source/WebCore/rendering/RenderListMarker.cpp
@@ -1302,6 +1302,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
void RenderListMarker::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
if (isImage()) {
diff --git a/Source/WebCore/rendering/RenderMedia.cpp b/Source/WebCore/rendering/RenderMedia.cpp
index 9af648b02..385fb5068 100644
--- a/Source/WebCore/rendering/RenderMedia.cpp
+++ b/Source/WebCore/rendering/RenderMedia.cpp
@@ -57,6 +57,7 @@ HTMLMediaElement* RenderMedia::mediaElement() const
void RenderMedia::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
LayoutSize oldSize = contentBoxRect().size();
RenderImage::layout();
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index e3aa404a1..318a1497e 100755..100644
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -2582,6 +2582,7 @@ void RenderObject::scheduleRelayout()
void RenderObject::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
RenderObject* child = firstChild();
while (child) {
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index d1994fca5..1d5e767d4 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -39,6 +39,7 @@
#include "TextAffinity.h"
#include "TransformationMatrix.h"
#include <wtf/HashSet.h>
+#include <wtf/StackStats.h>
#include <wtf/UnusedParam.h>
namespace WebCore {
diff --git a/Source/WebCore/rendering/RenderRegion.cpp b/Source/WebCore/rendering/RenderRegion.cpp
index 11d5aff74..6f3f2e98d 100644
--- a/Source/WebCore/rendering/RenderRegion.cpp
+++ b/Source/WebCore/rendering/RenderRegion.cpp
@@ -208,6 +208,7 @@ void RenderRegion::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
void RenderRegion::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
RenderReplaced::layout();
if (m_flowThread && isValid()) {
LayoutRect oldRegionRect(flowThreadPortionRect());
diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp
index de87251fb..2cc54930e 100644
--- a/Source/WebCore/rendering/RenderReplaced.cpp
+++ b/Source/WebCore/rendering/RenderReplaced.cpp
@@ -79,6 +79,7 @@ void RenderReplaced::styleDidChange(StyleDifference diff, const RenderStyle* old
void RenderReplaced::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
diff --git a/Source/WebCore/rendering/RenderReplica.cpp b/Source/WebCore/rendering/RenderReplica.cpp
index 0879282a6..ad3acf0ba 100644
--- a/Source/WebCore/rendering/RenderReplica.cpp
+++ b/Source/WebCore/rendering/RenderReplica.cpp
@@ -48,6 +48,7 @@ RenderReplica::~RenderReplica()
void RenderReplica::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
setFrameRect(parentBox()->borderBoxRect());
updateLayerTransform();
setNeedsLayout(false);
diff --git a/Source/WebCore/rendering/RenderRubyRun.cpp b/Source/WebCore/rendering/RenderRubyRun.cpp
index 65d764a9b..8481546f3 100644
--- a/Source/WebCore/rendering/RenderRubyRun.cpp
+++ b/Source/WebCore/rendering/RenderRubyRun.cpp
@@ -217,6 +217,7 @@ RenderRubyRun* RenderRubyRun::staticCreateRubyRun(const RenderObject* parentRuby
RenderObject* RenderRubyRun::layoutSpecialExcludedChild(bool relayoutChildren)
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
// Don't bother positioning the RenderRubyRun yet.
RenderRubyText* rt = rubyText();
if (!rt)
diff --git a/Source/WebCore/rendering/RenderScrollbarPart.cpp b/Source/WebCore/rendering/RenderScrollbarPart.cpp
index f2ca8c640..3eeb1d89f 100644
--- a/Source/WebCore/rendering/RenderScrollbarPart.cpp
+++ b/Source/WebCore/rendering/RenderScrollbarPart.cpp
@@ -48,6 +48,7 @@ RenderScrollbarPart::~RenderScrollbarPart()
void RenderScrollbarPart::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
setLocation(LayoutPoint()); // We don't worry about positioning ourselves. We're just determining our minimum width/height.
if (m_scrollbar->orientation() == HorizontalScrollbar)
layoutHorizontalPart();
diff --git a/Source/WebCore/rendering/RenderSlider.cpp b/Source/WebCore/rendering/RenderSlider.cpp
index 2691106dc..87c4b744c 100644
--- a/Source/WebCore/rendering/RenderSlider.cpp
+++ b/Source/WebCore/rendering/RenderSlider.cpp
@@ -102,6 +102,7 @@ void RenderSlider::computePreferredLogicalWidths()
void RenderSlider::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
// FIXME: Find a way to cascade appearance.
// http://webkit.org/b/62535
RenderBox* thumbBox = sliderThumbElementOf(node())->renderBox();
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index ee7c8b807..f9bf44609 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -341,6 +341,7 @@ void RenderTable::distributeExtraLogicalHeight(int extraLogicalHeight)
void RenderTable::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
if (simplifiedLayout())
diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp
index b3a0457ea..683321aa7 100644
--- a/Source/WebCore/rendering/RenderTableCell.cpp
+++ b/Source/WebCore/rendering/RenderTableCell.cpp
@@ -241,6 +241,7 @@ void RenderTableCell::setCellLogicalWidth(int tableLayoutLogicalWidth)
void RenderTableCell::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
updateFirstLetter();
layoutBlock(cellWidthChanged());
setCellWidthChanged(false);
diff --git a/Source/WebCore/rendering/RenderTableRow.cpp b/Source/WebCore/rendering/RenderTableRow.cpp
index c86f14c2c..c3aaf8586 100644
--- a/Source/WebCore/rendering/RenderTableRow.cpp
+++ b/Source/WebCore/rendering/RenderTableRow.cpp
@@ -151,6 +151,7 @@ void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild)
void RenderTableRow::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
// Table rows do not add translation.
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index 7dce60249..341c90512 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -354,6 +354,7 @@ int RenderTableSection::calcRowLogicalHeight()
void RenderTableSection::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
ASSERT(!needsCellRecalc());
ASSERT(!table()->needsSectionRecalc());
diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
index 1484a2786..967fb2acc 100644
--- a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -96,6 +96,8 @@ LayoutUnit RenderTextControlSingleLine::computeHeightLimit() const
void RenderTextControlSingleLine::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
+
// FIXME: We should remove the height-related hacks in layout() and
// styleDidChange(). We need them because
// - Center the inner elements vertically if the input height is taller than
diff --git a/Source/WebCore/rendering/RenderTextTrackCue.cpp b/Source/WebCore/rendering/RenderTextTrackCue.cpp
index ef8edda64..4e9dc1552 100644
--- a/Source/WebCore/rendering/RenderTextTrackCue.cpp
+++ b/Source/WebCore/rendering/RenderTextTrackCue.cpp
@@ -41,6 +41,7 @@ RenderTextTrackCue::RenderTextTrackCue(TextTrackCueBox* node)
void RenderTextTrackCue::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
RenderBlock::layout();
LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
diff --git a/Source/WebCore/rendering/RenderVideo.cpp b/Source/WebCore/rendering/RenderVideo.cpp
index 37f2f0844..02c313ba2 100644
--- a/Source/WebCore/rendering/RenderVideo.cpp
+++ b/Source/WebCore/rendering/RenderVideo.cpp
@@ -225,6 +225,7 @@ void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
void RenderVideo::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
RenderMedia::layout();
updatePlayer();
}
diff --git a/Source/WebCore/rendering/RenderView.cpp b/Source/WebCore/rendering/RenderView.cpp
index ef27b370f..d40e53dcf 100644
--- a/Source/WebCore/rendering/RenderView.cpp
+++ b/Source/WebCore/rendering/RenderView.cpp
@@ -156,6 +156,7 @@ void RenderView::checkLayoutState(const LayoutState& state)
void RenderView::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
if (!document()->paginated())
setPageLogicalHeight(0);
diff --git a/Source/WebCore/rendering/RenderWidget.cpp b/Source/WebCore/rendering/RenderWidget.cpp
index 402bac4fc..977751a73 100644
--- a/Source/WebCore/rendering/RenderWidget.cpp
+++ b/Source/WebCore/rendering/RenderWidget.cpp
@@ -211,6 +211,7 @@ void RenderWidget::setWidget(PassRefPtr<Widget> widget)
void RenderWidget::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
setNeedsLayout(false);
diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp
index 387fd20cb..6db4bb91c 100644
--- a/Source/WebCore/rendering/style/RenderStyle.cpp
+++ b/Source/WebCore/rendering/style/RenderStyle.cpp
@@ -664,9 +664,9 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
|| rareInheritedData->userSelect != other->rareInheritedData->userSelect
|| rareNonInheritedData->userDrag != other->rareNonInheritedData->userDrag
|| rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
|| rareNonInheritedData->m_textDecorationStyle != other->rareNonInheritedData->m_textDecorationStyle
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
|| rareInheritedData->textFillColor != other->rareInheritedData->textFillColor
|| rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor
|| rareInheritedData->textEmphasisColor != other->rareInheritedData->textEmphasisColor
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index 7715e130d..6a589714e 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -617,9 +617,9 @@ public:
ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); }
ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); }
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
int wordSpacing() const;
int letterSpacing() const;
@@ -1148,9 +1148,9 @@ public:
void addToTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations |= v; }
void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; }
void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); }
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
void setDirection(TextDirection v) { inherited_flags._direction = v; }
void setLineHeight(Length specifiedLineHeight);
bool setZoom(float);
@@ -1607,9 +1607,9 @@ public:
static Length initialLineHeight() { return Length(-100.0, Percent); }
static ETextAlign initialTextAlign() { return TASTART; }
static ETextDecoration initialTextDecoration() { return TDNONE; }
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
static float initialZoom() { return 1.0f; }
static int initialOutlineOffset() { return 0; }
static float initialOpacity() { return 1.0f; }
diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h
index a6702253c..c2701f9e7 100644
--- a/Source/WebCore/rendering/style/RenderStyleConstants.h
+++ b/Source/WebCore/rendering/style/RenderStyleConstants.h
@@ -336,7 +336,7 @@ enum ETextDecoration {
inline ETextDecoration operator|(ETextDecoration a, ETextDecoration b) { return ETextDecoration(int(a) | int(b)); }
inline ETextDecoration& operator|=(ETextDecoration& a, ETextDecoration b) { return a = a | b; }
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
enum TextDecorationStyle {
TextDecorationStyleSolid,
TextDecorationStyleDouble,
@@ -344,7 +344,7 @@ enum TextDecorationStyle {
TextDecorationStyleDashed,
TextDecorationStyleWavy
};
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
enum EPageBreak {
PBAUTO, PBALWAYS, PBAVOID
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
index 9ddd890dc..6c898960d 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
@@ -76,9 +76,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
, m_appearance(RenderStyle::initialAppearance())
, m_borderFit(RenderStyle::initialBorderFit())
, m_textCombine(RenderStyle::initialTextCombine())
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
, m_textDecorationStyle(RenderStyle::initialTextDecorationStyle())
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
, m_wrapFlow(RenderStyle::initialWrapFlow())
, m_wrapThrough(RenderStyle::initialWrapThrough())
#if USE(ACCELERATED_COMPOSITING)
@@ -155,9 +155,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
, m_appearance(o.m_appearance)
, m_borderFit(o.m_borderFit)
, m_textCombine(o.m_textCombine)
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
, m_textDecorationStyle(o.m_textDecorationStyle)
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
, m_wrapFlow(o.m_wrapFlow)
, m_wrapThrough(o.m_wrapThrough)
#if USE(ACCELERATED_COMPOSITING)
@@ -240,9 +240,9 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
&& m_appearance == o.m_appearance
&& m_borderFit == o.m_borderFit
&& m_textCombine == o.m_textCombine
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
&& m_textDecorationStyle == o.m_textDecorationStyle
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
&& m_wrapFlow == o.m_wrapFlow
&& m_wrapThrough == o.m_wrapThrough
#if USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
index 9a0f44ba6..e3784d4af 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
@@ -178,9 +178,9 @@ public:
unsigned m_borderFit : 1; // EBorderFit
unsigned m_textCombine : 1; // CSS3 text-combine properties
-#if ENABLE(CSS3_TEXT_DECORATION)
+#if ENABLE(CSS3_TEXT)
unsigned m_textDecorationStyle : 3; // TextDecorationStyle
-#endif // CSS3_TEXT_DECORATION
+#endif // CSS3_TEXT
unsigned m_wrapFlow: 3; // WrapFlow
unsigned m_wrapThrough: 1; // WrapThrough
diff --git a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
index 380275396..d5e5d0c7a 100644
--- a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
@@ -51,6 +51,7 @@ RenderSVGContainer::~RenderSVGContainer()
void RenderSVGContainer::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
// RenderSVGRoot disables layoutState for the SVG rendering tree.
diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
index 3b39a8335..2915ede4f 100644
--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
@@ -123,6 +123,7 @@ void RenderSVGForeignObject::computeLogicalHeight(LayoutUnit, LayoutUnit logical
void RenderSVGForeignObject::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.
diff --git a/Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp b/Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp
index 46c3e2b64..31d5da5ca 100644
--- a/Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp
@@ -64,6 +64,7 @@ void RenderSVGGradientStop::styleDidChange(StyleDifference diff, const RenderSty
void RenderSVGGradientStop::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
setNeedsLayout(false);
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp
index 895b25449..4d37e13d7 100644
--- a/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp
@@ -34,6 +34,7 @@ RenderSVGHiddenContainer::RenderSVGHiddenContainer(SVGStyledElement* element)
void RenderSVGHiddenContainer::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
SVGRenderSupport::layoutChildren(this, selfNeedsLayout());
setNeedsLayout(false);
diff --git a/Source/WebCore/rendering/svg/RenderSVGImage.cpp b/Source/WebCore/rendering/svg/RenderSVGImage.cpp
index 56be5cd41..5487b5e16 100644
--- a/Source/WebCore/rendering/svg/RenderSVGImage.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGImage.cpp
@@ -79,6 +79,7 @@ bool RenderSVGImage::updateImageViewport()
void RenderSVGImage::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
diff --git a/Source/WebCore/rendering/svg/RenderSVGPath.cpp b/Source/WebCore/rendering/svg/RenderSVGPath.cpp
index cf658359d..cf658359d 100755..100644
--- a/Source/WebCore/rendering/svg/RenderSVGPath.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGPath.cpp
diff --git a/Source/WebCore/rendering/svg/RenderSVGRect.cpp b/Source/WebCore/rendering/svg/RenderSVGRect.cpp
index c7f9c5b7b..c7f9c5b7b 100755..100644
--- a/Source/WebCore/rendering/svg/RenderSVGRect.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGRect.cpp
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
index 51858e5bd..310e586b9 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
@@ -54,6 +54,7 @@ RenderSVGResourceContainer::~RenderSVGResourceContainer()
void RenderSVGResourceContainer::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
// Invalidate all resources if our layout changed.
if (everHadLayout() && selfNeedsLayout())
RenderSVGRoot::addResourceForClientInvalidation(this);
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp
index 784559e21..7aaef0e9e 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp
@@ -48,6 +48,7 @@ RenderSVGResourceMarker::~RenderSVGResourceMarker()
void RenderSVGResourceMarker::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
// Invalidate all resources if our layout changed.
if (everHadLayout() && selfNeedsLayout())
RenderSVGRoot::addResourceForClientInvalidation(this);
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp b/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
index 3a1882acf..b3c0b0bd1 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
@@ -126,8 +126,9 @@ bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle*
return false;
// Compute pattern space transformation.
+ const IntSize tileImageSize = tileImage->logicalSize();
patternData->transform.translate(tileBoundaries.x(), tileBoundaries.y());
- patternData->transform.scale(tileBoundaries.width() / clampedAbsoluteTileBoundaries.width(), tileBoundaries.height() / clampedAbsoluteTileBoundaries.height());
+ patternData->transform.scale(tileBoundaries.width() / tileImageSize.width(), tileBoundaries.height() / tileImageSize.height());
AffineTransform patternTransform = m_attributes.patternTransform();
if (!patternTransform.isIdentity())
diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
index c47a7bb4e..797b70ea7 100644
--- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
@@ -218,6 +218,7 @@ LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight() const
void RenderSVGRoot::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
m_resourcesNeedingToInvalidateClients.clear();
diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.cpp b/Source/WebCore/rendering/svg/RenderSVGShape.cpp
index 62a8c99ba..5dceac3ef 100755..100644
--- a/Source/WebCore/rendering/svg/RenderSVGShape.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGShape.cpp
@@ -144,6 +144,7 @@ bool RenderSVGShape::strokeContains(const FloatPoint& point, bool requiresStroke
void RenderSVGShape::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp
index fd8bea043..200cd497c 100644
--- a/Source/WebCore/rendering/svg/RenderSVGText.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp
@@ -347,6 +347,7 @@ static inline void updateFontInAllDescendants(RenderObject* start, SVGTextLayout
void RenderSVGText::layout()
{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
diff --git a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
index 12352ae72..12352ae72 100755..100644
--- a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
+++ b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
diff --git a/Source/WebCore/svg/SVGElement.h b/Source/WebCore/svg/SVGElement.h
index c3e6b61f7..bd45f536a 100644
--- a/Source/WebCore/svg/SVGElement.h
+++ b/Source/WebCore/svg/SVGElement.h
@@ -159,8 +159,10 @@ private:
struct SVGAttributeHashTranslator {
static unsigned hash(const QualifiedName& key)
{
- if (key.hasPrefix())
- return DefaultHash<QualifiedName>::Hash::hash(QualifiedName(nullAtom, key.localName(), key.namespaceURI()));
+ if (key.hasPrefix()) {
+ QualifiedNameComponents components = { nullAtom.impl(), key.localName().impl(), key.namespaceURI().impl() };
+ return hashComponents(components);
+ }
return DefaultHash<QualifiedName>::Hash::hash(key);
}
static bool equal(const QualifiedName& a, const QualifiedName& b) { return a.matches(b); }
diff --git a/Source/WebCore/svg/SVGURIReference.cpp b/Source/WebCore/svg/SVGURIReference.cpp
index 1736312fc..1736312fc 100755..100644
--- a/Source/WebCore/svg/SVGURIReference.cpp
+++ b/Source/WebCore/svg/SVGURIReference.cpp
diff --git a/Source/WebCore/svg/SVGURIReference.h b/Source/WebCore/svg/SVGURIReference.h
index 1b6e8e9ec..1b6e8e9ec 100755..100644
--- a/Source/WebCore/svg/SVGURIReference.h
+++ b/Source/WebCore/svg/SVGURIReference.h
diff --git a/Source/WebCore/svg/SVGUseElement.cpp b/Source/WebCore/svg/SVGUseElement.cpp
index d19ea195d..d19ea195d 100755..100644
--- a/Source/WebCore/svg/SVGUseElement.cpp
+++ b/Source/WebCore/svg/SVGUseElement.cpp
diff --git a/Source/WebCore/svg/SVGUseElement.h b/Source/WebCore/svg/SVGUseElement.h
index 46ee8b341..46ee8b341 100755..100644
--- a/Source/WebCore/svg/SVGUseElement.h
+++ b/Source/WebCore/svg/SVGUseElement.h
diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp
index 8d8f0cb40..8d8f0cb40 100755..100644
--- a/Source/WebCore/testing/InternalSettings.cpp
+++ b/Source/WebCore/testing/InternalSettings.cpp
diff --git a/Source/WebCore/testing/InternalSettings.h b/Source/WebCore/testing/InternalSettings.h
index 78f36e017..78f36e017 100755..100644
--- a/Source/WebCore/testing/InternalSettings.h
+++ b/Source/WebCore/testing/InternalSettings.h
diff --git a/Source/WebCore/testing/InternalSettings.idl b/Source/WebCore/testing/InternalSettings.idl
index f3464be9a..f3464be9a 100755..100644
--- a/Source/WebCore/testing/InternalSettings.idl
+++ b/Source/WebCore/testing/InternalSettings.idl
diff --git a/Source/WebKit/blackberry/Api/InRegionScroller.cpp b/Source/WebKit/blackberry/Api/InRegionScroller.cpp
index cd68c4c76..0913405f8 100644
--- a/Source/WebKit/blackberry/Api/InRegionScroller.cpp
+++ b/Source/WebKit/blackberry/Api/InRegionScroller.cpp
@@ -219,6 +219,9 @@ void InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint(const Web
return;
}
+ if (!renderView->compositor()->scrollLayer())
+ continue;
+
if (canScrollInnerFrame(view->frame())) {
pushBackInRegionScrollable(new InRegionScrollableArea(m_webPage, layer));
continue;
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp
index bbf8425cb..d2b7f7898 100644
--- a/Source/WebKit/blackberry/Api/WebPage.cpp
+++ b/Source/WebKit/blackberry/Api/WebPage.cpp
@@ -55,6 +55,7 @@
#endif
#include "EditorClientBlackBerry.h"
#include "FocusController.h"
+#include "Frame.h"
#include "FrameLoaderClientBlackBerry.h"
#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
#include "GeolocationClientMock.h"
@@ -1160,8 +1161,6 @@ void WebPagePrivate::setLoadState(LoadState state)
if (m_backingStore->d->renderVisibleContents() && !m_backingStore->d->isSuspended() && !m_backingStore->d->shouldDirectRenderingToWindow())
m_backingStore->d->blitVisibleContents();
- zoomToInitialScaleOnLoad();
-
// Update cursor status.
updateCursor();
@@ -3201,12 +3200,21 @@ void WebPagePrivate::setPageVisibilityState()
void WebPagePrivate::setVisible(bool visible)
{
- m_visible = visible;
+ if (visible != m_visible) {
+ if (visible) {
+ if (m_mainFrame)
+ m_mainFrame->animation()->resumeAnimations();
+ if (m_page->scriptedAnimationsSuspended())
+ m_page->resumeScriptedAnimations();
+ } else {
+ if (m_mainFrame)
+ m_mainFrame->animation()->suspendAnimations();
+ if (!m_page->scriptedAnimationsSuspended())
+ m_page->suspendScriptedAnimations();
+ }
- if (visible && m_page->scriptedAnimationsSuspended())
- m_page->resumeScriptedAnimations();
- if (!visible && !m_page->scriptedAnimationsSuspended())
- m_page->suspendScriptedAnimations();
+ m_visible = visible;
+ }
#if ENABLE(PAGE_VISIBILITY_API)
setPageVisibilityState();
@@ -5454,6 +5462,10 @@ void WebPagePrivate::setCompositorDrawsRootLayer(bool compositorDrawsRootLayer)
// When the BlackBerry port forces compositing mode, the root layer stops
// painting to window and starts painting to layer instead.
m_page->settings()->setForceCompositingMode(compositorDrawsRootLayer);
+
+ if (!m_mainFrame)
+ return;
+
if (FrameView* view = m_mainFrame->view())
view->updateCompositingLayers();
#endif
diff --git a/Source/WebKit/blackberry/Api/WebPageClient.h b/Source/WebKit/blackberry/Api/WebPageClient.h
index aab7d09bc..e3e05c83e 100644
--- a/Source/WebKit/blackberry/Api/WebPageClient.h
+++ b/Source/WebKit/blackberry/Api/WebPageClient.h
@@ -139,7 +139,7 @@ public:
virtual void notifyContentRendered(const Platform::IntRect&) = 0;
virtual void resizeSurfaceIfNeeded() = 0;
- virtual void inputFocusGained(Platform::BlackBerryInputType, int inputStyle, Platform::VirtualKeyboardType, Platform::VirtualKeyboardEnterKeyType) = 0;
+ virtual void inputFocusGained(int64_t inputStyle, Platform::VirtualKeyboardType, Platform::VirtualKeyboardEnterKeyType) = 0;
virtual void inputFocusLost() = 0;
virtual void inputTextChanged() = 0;
virtual void inputSelectionChanged(unsigned selectionStart, unsigned selectionEnd) = 0;
diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog
index e4cb6eb99..62914fd11 100644
--- a/Source/WebKit/blackberry/ChangeLog
+++ b/Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,210 @@
+2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page
+ https://bugs.webkit.org/show_bug.cgi?id=98514
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::transitionToCommittedForNewPage):
+
+2012-10-20 Andrew Lo <anlo@rim.com>
+
+ [BlackBerry] m_mainFrame should be null checked before use in WebPagePrivate destructor
+ https://bugs.webkit.org/show_bug.cgi?id=99916
+
+ Reviewed by George Staikos.
+ Internally reviewed by Arvid Nilsson.
+
+ Internal PR228029
+ Add null checks for m_mainFrame for things that happen during
+ WebPage destruction.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setVisible):
+ (BlackBerry::WebKit::WebPagePrivate::setCompositorDrawsRootLayer):
+
+2012-10-19 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Convert input style to int64_t
+ https://bugs.webkit.org/show_bug.cgi?id=99848
+
+ Reviewed by Yong Li.
+
+ PR 227381.
+
+ Switch input style mask to int64_t to match the the updated definition.
+
+ Reviewed Internally by Nima Ghanavatian.
+
+ * Api/WebPageClient.h:
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::inputStyle):
+ * WebKitSupport/InputHandler.h:
+ (InputHandler):
+
+2012-10-19 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Move all keyboard type calculations into InputHandler.
+ https://bugs.webkit.org/show_bug.cgi?id=99847
+
+ Reviewed by Yong Li.
+
+ PR 227381.
+
+ Move all keyboard type calculations into webkit and avoid passing type
+ information to the webview.
+
+ Reviewed Internally by Nima Ghanavatian.
+
+ * Api/WebPageClient.h:
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::convertInputTypeToVKBType):
+ (WebKit):
+ (BlackBerry::WebKit::InputHandler::setElementFocused):
+
+2012-10-19 Jacky Jiang <zhajiang@rim.com>
+
+ [BlackBerry] Page viewport aspect ratio not kept on navigating back
+ https://bugs.webkit.org/show_bug.cgi?id=99760
+
+ Reviewed by Yong Li.
+ Internally reviewed by Konrad Piascik
+
+ PR: 222437
+ This is to fix the second issue on PR222437 that the viewport not kept
+ when navigating back from google after rotation to bloomberg.
+ We were trying to restore the history contents size and scale of
+ bloomberg which has virtual viewport. The scale would be recalculated
+ based on the new screen size. However, we would still use the current
+ contents size if it was greater than the history contents size in
+ FrameView::setContentsSize which made the contents seem to be scaled
+ too much.
+ Actually when we relayout the contents after rotation change, the
+ current contents size which is based on the virtual viewport has taken
+ the screen size into account. Shrinking the contents size will be
+ expensive. So we can ignore screen size based scale calculation here.
+
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::restoreViewState):
+
+2012-10-19 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Add input logs to InputHandler::ensureFocusTextElementVisible.
+ https://bugs.webkit.org/show_bug.cgi?id=99837
+
+ Reviewed by Antonio Gomes.
+
+ Add input logs for InputHandler::ensureFocusTextElementVisible.
+
+ Reviewed Internally by Nima Ghanavatian.
+
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
+
+2012-10-19 Andrew Lo <anlo@rim.com>
+
+ [BlackBerry] Should suspend AnimationController when WebPage becomes invisible.
+ https://bugs.webkit.org/show_bug.cgi?id=99844
+
+ Reviewed by Yong Li.
+ Internally reviewed by Arvid Nilsson & Yong Li.
+
+ Suspend animation controller when the tab becomes invisible,
+ in addition to suspending scripted animations.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setVisible):
+
+2012-10-19 Mike Fenton <mifenton@rim.com>
+
+ [BlackBerry] Don't attempt to auto scroll on input for Fixed Position elements.
+ https://bugs.webkit.org/show_bug.cgi?id=99833
+
+ Reviewed by Antonio Gomes.
+
+ PR 195024.
+
+ Don't attempt to scroll fixed position elements.
+
+ Reviewed Internally by Arvid Nilsson.
+
+ * WebKitSupport/DOMSupport.cpp:
+ (BlackBerry::WebKit::DOMSupport::isFixedPositionOrHasFixedPositionAncestor):
+ (DOMSupport):
+ * WebKitSupport/DOMSupport.h:
+ (WebCore):
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
+
+2012-10-18 Jacky Jiang <zhajiang@rim.com>
+
+ [BlackBerry] Page viewport aspect ratio not kept on navigating back
+ https://bugs.webkit.org/show_bug.cgi?id=99760
+
+ Reviewed by Rob Buis.
+ Internally reviewed by Konrad Piascik.
+
+ PR: 190469
+ This was added in r127628 which was trying to fix some rendering
+ defects on maps.google.com and news.qq.com, however it was very harmful
+ and caused regressions.
+ zoomToFitScale() depends on the current contents size. During history
+ navigation and device rotation, if zoomToFitScale() is based on the
+ final contents size which is expected, there will still be a scale
+ calculation like this afterwards
+ screenSize.width()/screenSize.height()*zoomToFitScale() which will
+ result in a wrong scale. During the history navigation, if
+ zoomToFitScale() isn't based on the final contents size, then we will
+ get the wrong scale as well for sure.
+ This issue will be fixed by removing the wrong calculation.
+ The original issue of r127628 was fixed by the patch of PR225981.
+
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::restoreViewState):
+
+2012-10-18 John Griggs <jgriggs@rim.com>
+
+ 2012-10-18 John Griggs <jgriggs@rim.com>
+
+ Crash in InRegionScrollableArea constructor while loading page
+ https://bugs.webkit.org/show_bug.cgi?id=99733
+
+ Reviewed by Antonio Gomes.
+
+ Check scrollLayer and avoid constructing InRegionScrollableArea when it is NULL.
+
+ * Api/InRegionScroller.cpp:
+ (BlackBerry::WebKit::InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint):
+
+2012-10-17 Jacky Jiang <zhajiang@rim.com>
+
+ [BlackBerry] Possible redundant zoomToInitialScaleOnLoad() in WebPagePrivate::setLoadState
+ https://bugs.webkit.org/show_bug.cgi?id=99624
+
+ Reviewed by Rob Buis.
+ Internally reviewed by Arvid Nilsson
+
+ PR: 225981
+ Several reasons to eliminate the ancient unnecessary
+ zoomToInitialScaleOnLoad() in WebPagePrivate::setLoadState committed:
+ - At this point, we have only committed the data we received.
+ - For the new load, we haven't started parsing the tokens and building
+ the DOM tree and the first layout will happen after that.
+ - For the load restored from cache, the first layout will happen after
+ setLoadState committed which is called by
+ FrameLoader::dispatchDidCommitLoad().
+ - zoomToInitialScaleOnLoad() can still be called after the first
+ layout finished.
+ - zoomToInitialScaleOnLoad() is expensive and it will boost the load
+ performance after the removal.
+ - Removal of this can fix some weird rendering defects on yahoo.com,
+ maps.google.com, news.qq.com and so on during load and rotation
+ mentioned on the PR.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setLoadState):
+
2012-10-17 Mike Fenton <mifenton@rim.com>
[BlackBerry] Prevent focus zoom on non-userscalable pages.
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
index 86b418985..44ce0d63a 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
@@ -448,6 +448,7 @@ void FrameLoaderClientBlackBerry::transitionToCommittedForNewPage()
backgroundColor.hasAlpha(), /* is transparent */
m_webPagePrivate->actualVisibleSize(), /* fixed reported size */
m_webPagePrivate->fixedLayoutSize(), /* fixed layout size */
+ IntRect(), /* fixed visible content rect */
m_webPagePrivate->useFixedLayout(), /* use fixed layout */
ScrollbarAlwaysOff, /* hor mode */
true, /* lock the mode */
@@ -1083,12 +1084,6 @@ void FrameLoaderClientBlackBerry::restoreViewState()
// Also, try to keep the users zoom if any.
double scale = viewState.scale;
- // If it was zoomToFitScale use the new zoomToFitScale because
- // the new one may be different to the old one due to contents
- // size change (e.g. after reloaded).
- if (viewState.isZoomToFitScale)
- scale = m_webPagePrivate->zoomToFitScale();
-
bool shouldReflowBlock = viewState.shouldReflowBlock;
if (m_webPagePrivate->m_userPerformedManualZoom) {
scale = m_webPagePrivate->currentScale();
@@ -1103,8 +1098,8 @@ void FrameLoaderClientBlackBerry::restoreViewState()
if (!scrollChanged && !scaleChanged && !reflowChanged && !orientationChanged)
return;
- // When rotate happens, only zoom when previous page was zoomToFitScale, otherwise keep old scale.
- if (orientationChanged && viewState.isZoomToFitScale)
+ // When rotate happens, only zoom when previous page was zoomToFitScale and didn't have virtual viewport, otherwise keep old scale.
+ if (orientationChanged && viewState.isZoomToFitScale && !m_webPagePrivate->hasVirtualViewport())
scale = BlackBerry::Platform::Graphics::Screen::primaryScreen()->width() * scale / static_cast<double>(BlackBerry::Platform::Graphics::Screen::primaryScreen()->height());
// Don't flash checkerboard before WebPagePrivate::restoreHistoryViewState() finished.
diff --git a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
index 0283b1348..1d81a5eaa 100644
--- a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
@@ -563,6 +563,20 @@ bool isEmptyRangeOrAllSpaces(VisiblePosition startPosition, VisiblePosition endP
return false;
}
+bool isFixedPositionOrHasFixedPositionAncestor(RenderObject* renderer)
+{
+ RenderObject* currentRenderer = renderer;
+ while (currentRenderer) {
+
+ if (currentRenderer->isOutOfFlowPositioned() && currentRenderer->style()->position() == FixedPosition)
+ return true;
+
+ currentRenderer = currentRenderer->parent();
+ }
+
+ return false;
+}
+
} // DOMSupport
} // WebKit
} // BlackBerry
diff --git a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.h b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.h
index f75b9a41a..a86e12a35 100644
--- a/Source/WebKit/blackberry/WebKitSupport/DOMSupport.h
+++ b/Source/WebKit/blackberry/WebKitSupport/DOMSupport.h
@@ -38,6 +38,7 @@ class Node;
class Position;
class QualifiedName;
class Range;
+class RenderObject;
class VisiblePosition;
class VisibleSelection;
}
@@ -96,6 +97,8 @@ WebCore::Frame* incrementFrame(WebCore::Frame* curr, bool forward, bool wrapFlag
PassRefPtr<WebCore::Range> trimWhitespaceFromRange(WebCore::VisiblePosition startPosition, WebCore::VisiblePosition endPosition);
bool isEmptyRangeOrAllSpaces(WebCore::VisiblePosition, WebCore::VisiblePosition);
+bool isFixedPositionOrHasFixedPositionAncestor(WebCore::RenderObject*);
+
} // DOMSupport
} // WebKit
} // BlackBerry
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
index e2ea590a9..07397011b 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
@@ -188,7 +188,7 @@ static BlackBerryInputType convertInputType(const HTMLInputElement* inputElement
return InputTypeText;
}
-static int inputStyle(BlackBerryInputType type, const Element* element)
+static int64_t inputStyle(BlackBerryInputType type, const Element* element)
{
switch (type) {
case InputTypeEmail:
@@ -242,6 +242,26 @@ static int inputStyle(BlackBerryInputType type, const Element* element)
return DEFAULT_STYLE;
}
+static VirtualKeyboardType convertInputTypeToVKBType(BlackBerryInputType inputType)
+{
+ switch (inputType) {
+ case InputTypeURL:
+ return VKBTypeUrl;
+ case InputTypeEmail:
+ return VKBTypeEmail;
+ case InputTypeTelephone:
+ return VKBTypePhone;
+ case InputTypePassword:
+ return VKBTypePassword;
+ case InputTypeNumber:
+ case InputTypeHexadecimal:
+ return VKBTypePin;
+ default:
+ // All other types are text based use default keyboard.
+ return VKBTypeDefault;
+ }
+}
+
static VirtualKeyboardType convertStringToKeyboardType(const AtomicString& string)
{
DEFINE_STATIC_LOCAL(AtomicString, Default, ("default"));
@@ -812,6 +832,9 @@ void InputHandler::setElementFocused(Element* element)
m_currentFocusElementTextEditMask = inputStyle(type, element);
VirtualKeyboardType keyboardType = keyboardTypeAttribute(element);
+ if (keyboardType == VKBTypeNotSet)
+ keyboardType = convertInputTypeToVKBType(type);
+
VirtualKeyboardEnterKeyType enterKeyType = keyboardEnterKeyTypeAttribute(element);
if (enterKeyType == VKBEnterKeyNotSet && type != InputTypeTextArea) {
@@ -823,7 +846,7 @@ void InputHandler::setElementFocused(Element* element)
}
FocusLog(LogLevelInfo, "InputHandler::setElementFocused, Type=%d, Style=%d, Keyboard Type=%d, Enter Key=%d", type, m_currentFocusElementTextEditMask, keyboardType, enterKeyType);
- m_webPage->m_client->inputFocusGained(type, m_currentFocusElementTextEditMask, keyboardType, enterKeyType);
+ m_webPage->m_client->inputFocusGained(m_currentFocusElementTextEditMask, keyboardType, enterKeyType);
handleInputLocaleChanged(m_webPage->m_webSettings->isWritingDirectionRTL());
@@ -1036,6 +1059,10 @@ void InputHandler::ensureFocusTextElementVisible(CaretScrollType scrollType)
if (!(Platform::Settings::instance()->allowedScrollAdjustmentForInputFields() & scrollType))
return;
+ // Fixed position elements cannot be scrolled into view.
+ if (DOMSupport::isFixedPositionOrHasFixedPositionAncestor(m_currentFocusElement->renderer()))
+ return;
+
Frame* elementFrame = m_currentFocusElement->document()->frame();
if (!elementFrame)
return;
@@ -1084,7 +1111,9 @@ void InputHandler::ensureFocusTextElementVisible(CaretScrollType scrollType)
m_focusZoomScale = m_webPage->currentScale();
m_focusZoomLocation = selectionFocusRect.location();
}
- m_webPage->zoomAboutPoint(s_minimumTextHeightInPixels / fontHeight, m_focusZoomLocation);
+ double zoomScaleRequired = static_cast<double>(s_minimumTextHeightInPixels) / fontHeight;
+ m_webPage->zoomAboutPoint(zoomScaleRequired, m_focusZoomLocation);
+ InputLog(LogLevelInfo, "InputHandler::ensureFocusTextElementVisible zooming in to %f at point %d, %d", zoomScaleRequired, m_focusZoomLocation.x(), m_focusZoomLocation.y());
} else {
m_focusZoomScale = 0.0;
m_focusZoomLocation = WebCore::IntPoint();
@@ -1157,6 +1186,7 @@ void InputHandler::ensureFocusTextElementVisible(CaretScrollType scrollType)
scrollLocation = scrollLocation.shrunkTo(maximumScrollPosition);
mainFrameView->setScrollPosition(scrollLocation);
mainFrameView->setConstrainsScrollingToContentEdge(true);
+ InputLog(LogLevelInfo, "InputHandler::ensureFocusTextElementVisible scrolling to point %d, %d", scrollLocation.x(), scrollLocation.y());
}
}
m_webPage->resumeBackingStore();
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
index 6a27e2bf2..ad569794b 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
@@ -212,7 +212,7 @@ private:
bool m_changingFocus;
FocusElementType m_currentFocusElementType;
- int m_currentFocusElementTextEditMask;
+ int64_t m_currentFocusElementTextEditMask;
int m_composingTextStart;
int m_composingTextEnd;
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 1be153b8e..b2a38d2b7 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,457 @@
+2012-10-22 Keishi Hattori <keishi@webkit.org>
+
+ Remove monthFormatInLDML
+ https://bugs.webkit.org/show_bug.cgi?id=99971
+
+ Reviewed by Kent Tamura.
+
+ * src/LocalizedStrings.cpp:
+
+2012-10-22 Keishi Hattori <keishi@webkit.org>
+
+ [Chromium] Rename WeekFormatInLDML to WeekFormatTemplate
+ https://bugs.webkit.org/show_bug.cgi?id=99972
+
+ Reviewed by Kent Tamura.
+
+ * src/LocalizedStrings.cpp:
+ (WebCore::weekFormatInLDML):
+
+2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page
+ https://bugs.webkit.org/show_bug.cgi?id=98514
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::createFrameView):
+
+2012-10-22 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: merge "docked" state into the "dock side" enum.
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Reviewed by Vsevolod Vlasov.
+
+ Otherwise, it is hard to manage these inter-dependent flags.
+
+ * src/InspectorFrontendClientImpl.cpp:
+ (WebKit::InspectorFrontendClientImpl::requestSetDockSide):
+ * src/InspectorFrontendClientImpl.h:
+ (InspectorFrontendClientImpl):
+
+2012-10-21 Kent Tamura <tkent@chromium.org>
+
+ Page popup: Fix crash by events after closing
+ https://bugs.webkit.org/show_bug.cgi?id=99951
+
+ Reviewed by Hajime Morita.
+
+ - We should not handle events after closePopup call.
+ - We should uninstall a DOMWindowPagePopup supplement in closePopup.
+
+ * src/WebPagePopupImpl.cpp:
+ (WebKit::WebPagePopupImpl::WebPagePopupImpl):
+ Initialize m_closing.
+ (WebKit::WebPagePopupImpl::handleGestureEvent):
+ Don't handle events if m_closing.
+ (WebKit::WebPagePopupImpl::handleInputEvent): Ditto.
+ (WebKit::WebPagePopupImpl::handleKeyEvent): Ditto.
+ (WebKit::WebPagePopupImpl::closePopup):
+ - Uninstall a DOMWindowPagePopup supplement.
+ - Set m_closing.
+ * src/WebPagePopupImpl.h:
+ (WebPagePopupImpl): Declare m_closing.
+
+2012-10-21 Terry Anderson <tdanderson@chromium.org>
+
+ [chromium] Storing the enclosing rect dimensions of the first finger for a two finger tap
+ https://bugs.webkit.org/show_bug.cgi?id=99763
+
+ Reviewed by Adam Barth.
+
+ Add a struct |twoFingerTap| inside the union |data| of a WebGestureEvent. The fields |firstFingerWidth|
+ and |firstFingerHeight| will represent the dimensions of the enclosing rectangle corresponding to the
+ first touch point in the gesture. These will be used in a future CL to perform target fuzzing on a
+ two-finger tap gesture.
+
+ Note: I chose not to name the two fields |width| and |height| so that they aren't confused with the
+ width and height of the gesture's bounding box, which contains the enclosing rectangles of both touch
+ points. My future fuzzing CL will only be concerned with the location and enclosing rectangle of the
+ first touch point.
+
+ * public/WebInputEvent.h:
+
+2012-10-19 Yusuf Ozuysal <yusufo@google.com>
+
+ [chromium] Double-tap defaults to zoom (should only do this on Android)
+ https://bugs.webkit.org/show_bug.cgi?id=99600
+
+ Reviewed by Adam Barth.
+
+ Adds a web setting for enabling DoubleTapToZoom on a doubleTap gesture.
+ This gesture was just needed for mobile, and the patch that implemented it caused regressions on other platforms.
+
+ * public/WebSettings.h:
+ * src/WebSettingsImpl.cpp:
+ (WebKit::WebSettingsImpl::WebSettingsImpl):
+ (WebKit::WebSettingsImpl::setDoubleTapToZoomEnabled):
+ (WebKit):
+ * src/WebSettingsImpl.h:
+ (WebSettingsImpl):
+ (WebKit::WebSettingsImpl::doubleTapToZoomEnabled):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleGestureEvent):
+ * tests/WebFrameTest.cpp:
+
+2012-10-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r131944.
+ http://trac.webkit.org/changeset/131944
+ https://bugs.webkit.org/show_bug.cgi?id=99891
+
+ On second thoughts, not such a great idea (Requested by jamesr
+ on #webkit).
+
+ * public/WebView.h:
+ (WebKit):
+ (WebView):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ (WebKit):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+ * tests/GraphicsLayerChromiumTest.cpp:
+ (WebKit::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest):
+
+2012-10-19 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] when building a shared library component build, we must not depend on WebCore
+
+ Unreviewed build fix.
+
+ * WebKit.gyp:
+
+2012-10-19 Tony Chang <tony@chromium.org>
+
+ Unreviewed, rolling out r131936.
+ http://trac.webkit.org/changeset/131936
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Broke the clang build
+
+ * public/WebDevToolsFrontendClient.h:
+ (WebKit::WebDevToolsFrontendClient::requestDockWindow):
+ (WebKit::WebDevToolsFrontendClient::requestUndockWindow):
+ * src/InspectorFrontendClientImpl.cpp:
+ (WebKit::InspectorFrontendClientImpl::requestAttachWindow):
+ (WebKit):
+ (WebKit::InspectorFrontendClientImpl::requestDetachWindow):
+ (WebKit::InspectorFrontendClientImpl::requestSetDockSide):
+ * src/InspectorFrontendClientImpl.h:
+ (InspectorFrontendClientImpl):
+
+2012-10-19 Alexandre Elias <aelias@chromium.org>
+
+ [chromium] API to pass impl thread via WebLayerTreeView
+ https://bugs.webkit.org/show_bug.cgi?id=99863
+
+ Reviewed by James Robinson.
+
+ This adds an API to pass the compositor impl thread via WebView and
+ WebLayerTreeView. This is currently a no-op change, but in the future
+ this codepath will supercede WebCompositor. The goal is to avoid statics
+ in compositor initialization.
+
+ * public/WebView.h:
+ (WebKit):
+ (WebView):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::setCompositorImplThread):
+ (WebKit):
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+ * tests/GraphicsLayerChromiumTest.cpp:
+ (WebKit::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest):
+
+2012-10-19 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: merge "docked" state into the "dock side" enum.
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Reviewed by Vsevolod Vlasov.
+
+ * public/WebDevToolsFrontendClient.h:
+ * src/InspectorFrontendClientImpl.cpp:
+ (WebKit::InspectorFrontendClientImpl::requestSetDockSide):
+ * src/InspectorFrontendClientImpl.h:
+ (InspectorFrontendClientImpl):
+
+2012-09-08 Alpha Lam <hclam@chromium.org>
+
+ [chromium] Implement deferred image decoding
+ https://bugs.webkit.org/show_bug.cgi?id=94240
+
+ Reviewed by Stephen White.
+
+ Adding new unit tests for deferred image decoding.
+ These tests are defined in DeferredImageDecoderTest.cpp. They verify
+ image decoding happens only when SkPicture is rasterized for both
+ scaled and non-scaled cases.
+
+ Tests: DeferredImageDecoderTest.drawIntoSkPicture
+ DeferredImageDecoderTest.drawScaledIntoSkPicture
+
+ * WebKit.gypi:
+ * public/WebSettings.h:
+ * src/WebKit.cpp:
+ (WebKit::shutdown):
+ * src/WebSettingsImpl.cpp:
+ (WebKit::WebSettingsImpl::setDeferredImageDecodingEnabled):
+ (WebKit):
+ * src/WebSettingsImpl.h:
+ (WebSettingsImpl):
+ * tests/DeferredImageDecoderTest.cpp: Added.
+ (WebCore):
+ (DeferredImageDecoderTest):
+ (WebCore::DeferredImageDecoderTest::SetUp):
+ (WebCore::DeferredImageDecoderTest::TearDown):
+ (WebCore::TEST_F):
+ * tests/MockImageDecoder.h: Added.
+ (WebCore):
+ (MockImageDecoder):
+ (WebCore::MockImageDecoder::MockImageDecoder):
+ (WebCore::MockImageDecoder::filenameExtension):
+ (WebCore::MockImageDecoder::frameBufferAtIndex):
+ (WebCore::MockImageDecoder::frameBufferRequestCount):
+
+2012-10-19 Alpha Lam <hclam@chromium.org>
+
+ [chromium] Roll DEPS
+
+ Unreviewed DEPS roll.
+
+ * DEPS:
+
+2012-10-19 Dongwoo Joshua Im <dw.im@samsung.com>
+
+ Rename ENABLE_CSS3_TEXT_DECORATION to ENABLE_CSS3_TEXT
+ https://bugs.webkit.org/show_bug.cgi?id=99804
+
+ Reviewed by Julien Chaffraix.
+
+ CSS3 text related properties will be implemented under this flag,
+ including text decoration, text-align-last, and text-justify.
+
+ * features.gypi:
+
+2012-10-19 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] fix the fix
+
+ Unreviewed build fix.
+
+ Forgot to invert the condition when to set the type to none in the
+ previous attempt.
+
+ * WebKit.gyp:
+
+2012-10-19 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] Fix inside chromium build on Mac
+
+ Unreviewed build fix.
+
+ Xcode won't create a static library without any sources. So instead of
+ ommitting the sources, just override the webkit_test_support's type
+ with 'none'.
+
+ * WebKit.gyp:
+
+2012-10-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Web Inspector: NMI provide data for mixing with tcmalloc heap dumps.
+ https://bugs.webkit.org/show_bug.cgi?id=99457
+
+ Reviewed by Yury Semikhatsky.
+
+ Embedder's code wraps the map with counted objects info into InstrumentedObjectSizeProvider
+ and forces downstream code to make tcmalloc heap snapshot.
+ The default implementation is empty.
+
+ * public/WebDevToolsAgentClient.h:
+ (InstrumentedObjectSizeProvider):
+ (WebKit::WebDevToolsAgentClient::InstrumentedObjectSizeProvider::~InstrumentedObjectSizeProvider):
+ (WebKit::WebDevToolsAgentClient::dumpUncountedAllocatedObjects):
+ (WebDevToolsAgentClient):
+ * src/InspectorClientImpl.cpp:
+ (WebKit::InspectorClientImpl::dumpUncountedAllocatedObjects):
+ (WebKit):
+ * src/InspectorClientImpl.h:
+ (InspectorClientImpl):
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::getAllocatedObjects):
+ (WebKit::WebDevToolsAgentImpl::dumpUncountedAllocatedObjects):
+ (WebKit):
+ * src/WebDevToolsAgentImpl.h:
+ (WebDevToolsAgentImpl):
+
+2012-10-18 Kent Tamura <tkent@chromium.org>
+
+ Add shortMonthLabels and shortStandAloneMonthLabels to Localizer
+ https://bugs.webkit.org/show_bug.cgi?id=99787
+
+ * tests/LocaleMacTest.cpp:
+ (TEST_F): Disable tests depends on OS X versions.
+
+2012-10-18 Kent Tamura <tkent@chromium.org>
+
+ Add shortMonthLabels and shortStandAloneMonthLabels to Localizer
+ https://bugs.webkit.org/show_bug.cgi?id=99787
+
+ Reviewed by Kentaro Hara.
+
+ * tests/LocaleMacTest.cpp:
+ (LocaleMacTest::shortMonthLabel): A helper.
+ (LocaleMacTest::shortStandAloneMonthLabel): Ditto.
+ (TEST_F): Added tests for some locales.
+ * tests/LocaleWinTest.cpp:
+ (LocaleWinTest::shortMonthLabel): A helper.
+ (TEST_F): Added tests for some locales. We don't test
+ LocaleWin::shortStandAloneMonthLabels because it is identical to
+ shortMonthLabels.
+ * tests/LocalizedDateICUTest.cpp:
+ (LocalizedDateICUTest::shortMonthLabel): A helper.
+ (LocalizedDateICUTest::shortStandAloneMonthLabel): Ditto.
+ (TEST_F): Added tests for some locales.
+
+2012-10-18 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] Add a webkit_test_support target that WebTestingSupport
+ https://bugs.webkit.org/show_bug.cgi?id=99772
+
+ Reviewed by Adam Barth.
+
+ Before, embedders would need to compile the WebTestingSupport.cpp
+ themselves, which in turn depends on WebCore headers.
+
+ * WebKit.gyp:
+
+2012-10-18 W. James MacLean <wjmaclean@chromium.org>
+
+ [chromium] Re-enable gesture highlight layout tests, fix GestureLongPress regression.
+ https://bugs.webkit.org/show_bug.cgi?id=99632
+
+ Reviewed by James Robinson.
+
+ Re-enable layout tests for gesture highlights. Includes fix for GestureTapCancel test.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleGestureEvent):
+
+2012-10-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r131810.
+ http://trac.webkit.org/changeset/131810
+ https://bugs.webkit.org/show_bug.cgi?id=99762
+
+ Broke linux debug webkit_unit_tests (Requested by
+ danakj|gardening on #webkit).
+
+ * WebKit.gypi:
+ * public/WebSettings.h:
+ * src/WebKit.cpp:
+ (WebKit::shutdown):
+ * src/WebSettingsImpl.cpp:
+ (WebKit::WebSettingsImpl::WebSettingsImpl):
+ * src/WebSettingsImpl.h:
+ (WebSettingsImpl):
+ * tests/DeferredImageDecoderTest.cpp: Removed.
+ * tests/MockImageDecoder.h: Removed.
+
+2012-10-18 Alpha Lam <hclam@chromium.org>
+
+ [chromium] Implement deferred image decoding
+ https://bugs.webkit.org/show_bug.cgi?id=94240
+
+ Reviewed by Stephen White.
+
+ Adding new unit tests for deferred image decoding.
+ These tests are defined in DeferredImageDecoderTest.cpp. They verify
+ image decoding happens only when SkPicture is rasterized for both
+ scaled and non-scaled cases.
+
+ Tests: DeferredImageDecoderTest.drawIntoSkPicture
+ DeferredImageDecoderTest.drawScaledIntoSkPicture
+
+ * WebKit.gypi:
+ * public/WebSettings.h:
+ * src/WebKit.cpp:
+ (WebKit::shutdown):
+ * src/WebSettingsImpl.cpp:
+ (WebKit::WebSettingsImpl::setDeferredImageDecodingEnabled):
+ (WebKit):
+ * src/WebSettingsImpl.h:
+ (WebSettingsImpl):
+ * tests/DeferredImageDecoderTest.cpp: Added.
+ (WebCore):
+ (DeferredImageDecoderTest):
+ (WebCore::DeferredImageDecoderTest::SetUp):
+ (WebCore::DeferredImageDecoderTest::TearDown):
+ (WebCore::TEST_F):
+ * tests/MockImageDecoder.h: Added.
+ (WebCore):
+ (MockImageDecoder):
+ (WebCore::MockImageDecoder::MockImageDecoder):
+ (WebCore::MockImageDecoder::filenameExtension):
+ (WebCore::MockImageDecoder::frameBufferAtIndex):
+ (WebCore::MockImageDecoder::frameBufferRequestCount):
+
+2012-10-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-10-18 Pablo Flouret <pablof@motorola.com>
+
+ Implement css3-conditional's @supports rule
+ https://bugs.webkit.org/show_bug.cgi?id=86146
+
+ Reviewed by Antti Koivisto.
+
+ * features.gypi:
+ Add an ENABLE_CSS3_CONDITIONAL_RULES flag.
+
+2012-10-18 Kent Tamura <tkent@chromium.org>
+
+ Add Localizer::monthFormat and implementations
+ https://bugs.webkit.org/show_bug.cgi?id=99704
+
+ * tests/LocaleMacTest.cpp:
+ (TEST_F): Remove tests for fr_FR and ru locales for a compatibility reason.
+
+2012-10-18 Kent Tamura <tkent@chromium.org>
+
+ Add Localizer::monthFormat and implementations
+ https://bugs.webkit.org/show_bug.cgi?id=99704
+
+ Reviewed by Kentaro Hara.
+
+ * tests/LocaleMacTest.cpp:
+ (LocaleMacTest::monthFormat): A helper function.
+ (TEST_F): Added some tests.
+ * tests/LocaleWinTest.cpp:
+ (LocaleWinTest::monthFormat): A helper function.
+ (TEST_F): Added some tests.
+ * tests/LocalizedDateICUTest.cpp:
+ (LocalizedDateICUTest::monthFormat): A helper function.
+ (TEST_F): Added some tests.
+
2012-10-17 Mike West <mkwst@chromium.org>
Move mixed content logic out of FrameLoader
diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS
index 1fdffb9ca..42b3e567d 100644
--- a/Source/WebKit/chromium/DEPS
+++ b/Source/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '162322'
+ 'chromium_rev': '162983'
}
deps = {
diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp
index ef9997ea4..3edc4a5b4 100644
--- a/Source/WebKit/chromium/WebKit.gyp
+++ b/Source/WebKit/chromium/WebKit.gyp
@@ -864,6 +864,28 @@
],
},
{
+ 'target_name': 'webkit_test_support',
+ 'conditions': [
+ ['inside_chromium_build==1 and component=="shared_library"', {
+ 'type': 'none',
+ }, { # else: inside_chromium_build==0 or component!="shared_library"
+ 'type': 'static_library',
+ 'dependencies': [
+ '../../WTF/WTF.gyp/WTF.gyp:wtf',
+ '../../WebCore/WebCore.gyp/WebCore.gyp:webcore_test_support',
+ ],
+ 'include_dirs': [
+ 'public',
+ '../../WebCore/testing/v8', # for WebCoreTestSupport.h, needed to link in window.internals code.
+ ],
+ 'sources': [
+ 'src/WebTestingSupport.cpp',
+ 'public/WebTestingSupport.h',
+ ],
+ }],
+ ],
+ },
+ {
'target_name': 'inspector_resources',
'type': 'none',
'dependencies': [
diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi
index 24cae298f..64063a021 100644
--- a/Source/WebKit/chromium/WebKit.gypi
+++ b/Source/WebKit/chromium/WebKit.gypi
@@ -61,6 +61,7 @@
'tests/CompositorFakeWebGraphicsContext3D.h',
'tests/DateTimeFormatTest.cpp',
'tests/DecimalTest.cpp',
+ 'tests/DeferredImageDecoderTest.cpp',
'tests/DragImageTest.cpp',
'tests/EventListenerTest.cpp',
'tests/FakeWebCompositorOutputSurface.h',
@@ -78,8 +79,9 @@
'tests/IDBLevelDBCodingTest.cpp',
'tests/IDBRequestTest.cpp',
'tests/ImageLayerChromiumTest.cpp',
- 'tests/KURLTest.cpp',
+ 'tests/MockImageDecoder.h',
'tests/KeyboardTest.cpp',
+ 'tests/KURLTest.cpp',
'tests/LevelDBTest.cpp',
'tests/LinkHighlightTest.cpp',
'tests/ListenerLeakTest.cpp',
diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi
index 3d08ea898..2d18c773d 100644
--- a/Source/WebKit/chromium/features.gypi
+++ b/Source/WebKit/chromium/features.gypi
@@ -38,7 +38,8 @@
'ENABLE_BLOB_SLICE=1',
'ENABLE_CHANNEL_MESSAGING=1',
'ENABLE_CSP_NEXT=1',
- 'ENABLE_CSS3_TEXT_DECORATION=0',
+ 'ENABLE_CSS3_CONDITIONAL_RULES=0',
+ 'ENABLE_CSS3_TEXT=0',
'ENABLE_CSS_BOX_DECORATION_BREAK=1',
'ENABLE_CSS_COMPOSITING=0',
'ENABLE_CSS_EXCLUSIONS=1',
diff --git a/Source/WebKit/chromium/public/WebDevToolsAgentClient.h b/Source/WebKit/chromium/public/WebDevToolsAgentClient.h
index 7ac2c7c97..beb3e832f 100644
--- a/Source/WebKit/chromium/public/WebDevToolsAgentClient.h
+++ b/Source/WebKit/chromium/public/WebDevToolsAgentClient.h
@@ -69,6 +69,14 @@ public:
};
virtual void visitAllocatedObjects(AllocatedObjectVisitor*) { }
+ class InstrumentedObjectSizeProvider {
+ public:
+ virtual size_t objectSize(const void* ptr) const = 0;
+ protected:
+ virtual ~InstrumentedObjectSizeProvider() { }
+ };
+ virtual void dumpUncountedAllocatedObjects(const InstrumentedObjectSizeProvider*) { }
+
protected:
~WebDevToolsAgentClient() { }
};
diff --git a/Source/WebKit/chromium/public/WebInputEvent.h b/Source/WebKit/chromium/public/WebInputEvent.h
index f3edaf95e..328c0337e 100644
--- a/Source/WebKit/chromium/public/WebInputEvent.h
+++ b/Source/WebKit/chromium/public/WebInputEvent.h
@@ -379,38 +379,43 @@ public:
int globalY;
union {
- struct {
- int tapCount;
- int width;
- int height;
- } tap;
-
- struct {
- int width;
- int height;
- } tapDown;
-
- struct {
- int width;
- int height;
- } longPress;
-
- struct {
- float deltaX;
- float deltaY;
- float velocityX;
- float velocityY;
- } scrollUpdate;
-
- struct {
- float velocityX;
- float velocityY;
- SourceDevice sourceDevice;
- } flingStart;
-
- struct {
- float scale;
- } pinchUpdate;
+ struct {
+ int tapCount;
+ int width;
+ int height;
+ } tap;
+
+ struct {
+ int width;
+ int height;
+ } tapDown;
+
+ struct {
+ int width;
+ int height;
+ } longPress;
+
+ struct {
+ int firstFingerWidth;
+ int firstFingerHeight;
+ } twoFingerTap;
+
+ struct {
+ float deltaX;
+ float deltaY;
+ float velocityX;
+ float velocityY;
+ } scrollUpdate;
+
+ struct {
+ float velocityX;
+ float velocityY;
+ SourceDevice sourceDevice;
+ } flingStart;
+
+ struct {
+ float scale;
+ } pinchUpdate;
} data;
WebGestureEvent(unsigned sizeParam = sizeof(WebGestureEvent))
diff --git a/Source/WebKit/chromium/public/WebSettings.h b/Source/WebKit/chromium/public/WebSettings.h
index abd84ed0e..d5d963f91 100644
--- a/Source/WebKit/chromium/public/WebSettings.h
+++ b/Source/WebKit/chromium/public/WebSettings.h
@@ -86,9 +86,11 @@ public:
virtual void setDefaultTextEncodingName(const WebString&) = 0;
virtual void setDefaultTileSize(WebSize) = 0;
virtual void setDeferred2dCanvasEnabled(bool) = 0;
+ virtual void setDeferredImageDecodingEnabled(bool) = 0;
virtual void setDeveloperExtrasEnabled(bool) = 0;
virtual void setDeviceSupportsMouse(bool) = 0;
virtual void setDeviceSupportsTouch(bool) = 0;
+ virtual void setDoubleTapToZoomEnabled(bool) = 0;
virtual void setDownloadableBinaryFontsEnabled(bool) = 0;
virtual void setEditableLinkBehaviorNeverLive() = 0;
virtual void setEditingBehavior(EditingBehavior) = 0;
diff --git a/Source/WebKit/chromium/src/InspectorClientImpl.cpp b/Source/WebKit/chromium/src/InspectorClientImpl.cpp
index 402b8695c..f8020ef0b 100644
--- a/Source/WebKit/chromium/src/InspectorClientImpl.cpp
+++ b/Source/WebKit/chromium/src/InspectorClientImpl.cpp
@@ -169,6 +169,12 @@ void InspectorClientImpl::getAllocatedObjects(HashSet<const void*>& set)
agent->getAllocatedObjects(set);
}
+void InspectorClientImpl::dumpUncountedAllocatedObjects(const HashMap<const void*, size_t>& map)
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->dumpUncountedAllocatedObjects(map);
+}
+
void InspectorClientImpl::willProcessTask()
{
InspectorInstrumentation::willProcessTask(m_inspectedWebView->page());
diff --git a/Source/WebKit/chromium/src/InspectorClientImpl.h b/Source/WebKit/chromium/src/InspectorClientImpl.h
index 9e1ea370e..34de35a09 100644
--- a/Source/WebKit/chromium/src/InspectorClientImpl.h
+++ b/Source/WebKit/chromium/src/InspectorClientImpl.h
@@ -79,6 +79,7 @@ public:
virtual bool supportsFrameInstrumentation();
virtual void getAllocatedObjects(HashSet<const void*>&);
+ virtual void dumpUncountedAllocatedObjects(const HashMap<const void*, size_t>&);
private:
// WebThread::TaskObserver
diff --git a/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
index 763c85da8..fcfa25f9c 100644
--- a/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
+++ b/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
@@ -103,19 +103,15 @@ void InspectorFrontendClientImpl::closeWindow()
m_client->closeWindow();
}
-void InspectorFrontendClientImpl::requestAttachWindow()
-{
- m_client->requestDockWindow();
-}
-
-void InspectorFrontendClientImpl::requestDetachWindow()
-{
- m_client->requestUndockWindow();
-}
-
-void InspectorFrontendClientImpl::requestSetDockSide(const String& side)
-{
- m_client->requestSetDockSide(side);
+void InspectorFrontendClientImpl::requestSetDockSide(DockSide side)
+{
+ String sideString = "undocked";
+ switch (side) {
+ case DOCKED_TO_RIGHT: sideString = "right"; break;
+ case DOCKED_TO_BOTTOM: sideString = "bottom"; break;
+ case UNDOCKED: sideString = "undocked"; break;
+ }
+ m_client->requestSetDockSide(sideString);
}
void InspectorFrontendClientImpl::changeAttachedWindowHeight(unsigned)
diff --git a/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h b/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h
index 55e57e696..72f8d68b6 100644
--- a/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h
+++ b/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h
@@ -62,9 +62,7 @@ public:
virtual void bringToFront();
virtual void closeWindow();
- virtual void requestAttachWindow();
- virtual void requestDetachWindow();
- virtual void requestSetDockSide(const String&);
+ virtual void requestSetDockSide(DockSide);
virtual void changeAttachedWindowHeight(unsigned);
virtual void openInNewTab(const String& url);
diff --git a/Source/WebKit/chromium/src/LocalizedStrings.cpp b/Source/WebKit/chromium/src/LocalizedStrings.cpp
index 0cc8e00eb..4ef239c6f 100644
--- a/Source/WebKit/chromium/src/LocalizedStrings.cpp
+++ b/Source/WebKit/chromium/src/LocalizedStrings.cpp
@@ -268,14 +268,9 @@ String placeholderForYearField()
return query(WebLocalizedString::PlaceholderForYearField);
}
-String monthFormatInLDML()
-{
- return query(WebLocalizedString::MonthFormatInLDML);
-}
-
String weekFormatInLDML()
{
- return query(WebLocalizedString::WeekFormatInLDML);
+ return query(WebLocalizedString::WeekFormatTemplate);
}
#endif
diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
index 7f362036b..5c25ff64e 100644
--- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
+++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
@@ -462,12 +462,13 @@ void WebDevToolsAgentImpl::getAllocatedObjects(HashSet<const void*>& set)
CountingVisitor() : m_totalObjectsCount(0)
{
}
+
virtual bool visitObject(const void* ptr)
{
++m_totalObjectsCount;
return true;
}
- size_t totalObjectsCount()
+ size_t totalObjectsCount() const
{
return m_totalObjectsCount;
}
@@ -488,7 +489,7 @@ void WebDevToolsAgentImpl::getAllocatedObjects(HashSet<const void*>& set)
, m_pointers(new const void*[maxObjectsCount])
{
}
- ~PointerCollector()
+ virtual ~PointerCollector()
{
delete[] m_pointers;
}
@@ -531,6 +532,25 @@ void WebDevToolsAgentImpl::getAllocatedObjects(HashSet<const void*>& set)
}
}
+void WebDevToolsAgentImpl::dumpUncountedAllocatedObjects(const HashMap<const void*, size_t>& map)
+{
+ class InstrumentedObjectSizeProvider : public WebDevToolsAgentClient::InstrumentedObjectSizeProvider {
+ public:
+ InstrumentedObjectSizeProvider(const HashMap<const void*, size_t>& map) : m_map(map) { }
+ virtual size_t objectSize(const void* ptr) const
+ {
+ HashMap<const void*, size_t>::const_iterator i = m_map.find(ptr);
+ return i == m_map.end() ? 0 : i->value;
+ }
+
+ private:
+ const HashMap<const void*, size_t>& m_map;
+ };
+
+ InstrumentedObjectSizeProvider provider(map);
+ m_client->dumpUncountedAllocatedObjects(&provider);
+}
+
void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message)
{
inspectorController()->dispatchMessageFromFrontend(message);
diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
index 6a9663127..a5061cf49 100644
--- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
+++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
@@ -106,6 +106,7 @@ public:
virtual void autoZoomPageToFitWidth();
virtual void getAllocatedObjects(HashSet<const void*>&);
+ virtual void dumpUncountedAllocatedObjects(const HashMap<const void*, size_t>&);
int hostId() { return m_hostId; }
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index ff4a0b44c..98bec3aba 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -2271,7 +2271,7 @@ void WebFrameImpl::createFrameView()
WebViewImpl* webView = viewImpl();
bool isMainFrame = webView->mainFrameImpl()->frame() == frame();
- frame()->createView(webView->size(), Color::white, webView->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0);
+ frame()->createView(webView->size(), Color::white, webView->isTransparent(), webView->fixedLayoutSize(), IntRect(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0);
if (webView->shouldAutoResize() && isMainFrame)
frame()->view()->enableAutoSizeMode(true, webView->minAutoSize(), webView->maxAutoSize());
diff --git a/Source/WebKit/chromium/src/WebKit.cpp b/Source/WebKit/chromium/src/WebKit.cpp
index e357f28e4..243d08e62 100644
--- a/Source/WebKit/chromium/src/WebKit.cpp
+++ b/Source/WebKit/chromium/src/WebKit.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "WebKit.h"
+#include "ImageDecodingStore.h"
#include "LayoutTestSupport.h"
#include "Logging.h"
#include "MutationObserver.h"
@@ -165,6 +166,7 @@ void shutdown()
}
#endif
s_webKitPlatformSupport = 0;
+ WebCore::ImageDecodingStore::shutdown();
Platform::shutdown();
WebPrerenderingSupport::shutdown();
}
diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
index e4808fd70..078ae7e86 100644
--- a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
@@ -142,6 +142,7 @@ bool PagePopupFeaturesClient::isEnabled(Document*, ContextFeatures::FeatureType
WebPagePopupImpl::WebPagePopupImpl(WebWidgetClient* client)
: m_widgetClient(client)
+ , m_closing(false)
{
ASSERT(client);
}
@@ -259,7 +260,7 @@ bool WebPagePopupImpl::handleCharEvent(const WebKeyboardEvent&)
#if ENABLE(GESTURE_EVENTS)
bool WebPagePopupImpl::handleGestureEvent(const WebGestureEvent& event)
{
- if (!m_page || !m_page->mainFrame() || !m_page->mainFrame()->view())
+ if (m_closing || !m_page || !m_page->mainFrame() || !m_page->mainFrame()->view())
return false;
Frame& frame = *m_page->mainFrame();
return frame.eventHandler()->handleGestureEvent(PlatformGestureEventBuilder(frame.view(), event));
@@ -268,12 +269,14 @@ bool WebPagePopupImpl::handleGestureEvent(const WebGestureEvent& event)
bool WebPagePopupImpl::handleInputEvent(const WebInputEvent& event)
{
+ if (m_closing)
+ return false;
return PageWidgetDelegate::handleInputEvent(m_page.get(), *this, event);
}
bool WebPagePopupImpl::handleKeyEvent(const PlatformKeyboardEvent& event)
{
- if (!m_page->mainFrame() || !m_page->mainFrame()->view())
+ if (m_closing || !m_page->mainFrame() || !m_page->mainFrame()->view())
return false;
return m_page->mainFrame()->eventHandler()->keyEvent(event);
}
@@ -302,7 +305,9 @@ void WebPagePopupImpl::closePopup()
m_page->setGroupName(String());
m_page->mainFrame()->loader()->stopAllLoaders();
m_page->mainFrame()->loader()->stopLoading(UnloadEventPolicyNone);
+ DOMWindowPagePopup::uninstall(m_page->mainFrame()->document()->domWindow());
}
+ m_closing = true;
// m_widgetClient might be 0 because this widget might be already closed.
if (m_widgetClient) {
// closeWidgetSoon() will call this->close() later.
diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.h b/Source/WebKit/chromium/src/WebPagePopupImpl.h
index cf2bbba78..34b4794bd 100644
--- a/Source/WebKit/chromium/src/WebPagePopupImpl.h
+++ b/Source/WebKit/chromium/src/WebPagePopupImpl.h
@@ -94,6 +94,7 @@ private:
OwnPtr<WebCore::Page> m_page;
OwnPtr<PagePopupChromeClient> m_chromeClient;
WebCore::PagePopupClient* m_popupClient;
+ bool m_closing;
friend class WebPagePopup;
friend class PagePopupChromeClient;
diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
index 988c5e66b..a667bedf5 100644
--- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp
+++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
@@ -32,6 +32,7 @@
#include "WebSettingsImpl.h"
#include "FontRenderingMode.h"
+#include "ImageDecodingStore.h"
#include "Settings.h"
#include <public/WebString.h>
#include <public/WebURL.h>
@@ -55,6 +56,8 @@ WebSettingsImpl::WebSettingsImpl(Settings* settings)
, m_applyDefaultDeviceScaleFactorInCompositor(false)
, m_gestureTapHighlightEnabled(true)
, m_autoZoomFocusedNodeToLegibleScale(false)
+ , m_deferredImageDecodingEnabled(false)
+ , m_doubleTapToZoomEnabled(false)
, m_defaultTileSize(WebSize(256, 256))
, m_maxUntiledLayerSize(WebSize(512, 512))
{
@@ -264,6 +267,11 @@ void WebSettingsImpl::setPageCacheSupportsPlugins(bool pageCacheSupportsPlugins)
m_settings->setPageCacheSupportsPlugins(pageCacheSupportsPlugins);
}
+void WebSettingsImpl::setDoubleTapToZoomEnabled(bool doubleTapToZoomEnabled)
+{
+ m_doubleTapToZoomEnabled = doubleTapToZoomEnabled;
+}
+
void WebSettingsImpl::setDownloadableBinaryFontsEnabled(bool enabled)
{
m_settings->setDownloadableBinaryFontsEnabled(enabled);
@@ -480,6 +488,15 @@ void WebSettingsImpl::setDeferred2dCanvasEnabled(bool enabled)
m_settings->setDeferred2dCanvasEnabled(enabled);
}
+void WebSettingsImpl::setDeferredImageDecodingEnabled(bool enabled)
+{
+ if (!m_deferredImageDecodingEnabled && enabled)
+ ImageDecodingStore::initializeOnMainThread();
+ if (m_deferredImageDecodingEnabled && !enabled)
+ ImageDecodingStore::shutdown();
+ m_deferredImageDecodingEnabled = enabled;
+}
+
void WebSettingsImpl::setAcceleratedCompositingForFixedPositionEnabled(bool enabled)
{
m_settings->setAcceleratedCompositingForFixedPositionEnabled(enabled);
diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h
index 1169c31cf..74968c4f6 100644
--- a/Source/WebKit/chromium/src/WebSettingsImpl.h
+++ b/Source/WebKit/chromium/src/WebSettingsImpl.h
@@ -78,9 +78,11 @@ public:
virtual void setDefaultTextEncodingName(const WebString&);
virtual void setDefaultTileSize(WebSize);
virtual void setDeferred2dCanvasEnabled(bool);
+ virtual void setDeferredImageDecodingEnabled(bool);
virtual void setDeveloperExtrasEnabled(bool);
virtual void setDeviceSupportsMouse(bool);
virtual void setDeviceSupportsTouch(bool);
+ virtual void setDoubleTapToZoomEnabled(bool);
virtual void setDownloadableBinaryFontsEnabled(bool);
virtual void setEditableLinkBehaviorNeverLive();
virtual void setEditingBehavior(EditingBehavior);
@@ -165,6 +167,7 @@ public:
bool applyPageScaleFactorInCompositor() const;
bool autoZoomFocusedNodeToLegibleScale() const { return m_autoZoomFocusedNodeToLegibleScale; }
bool gestureTapHighlightEnabled() { return m_gestureTapHighlightEnabled; }
+ bool doubleTapToZoomEnabled() { return m_doubleTapToZoomEnabled; }
WebSize defaultTileSize() const { return m_defaultTileSize; }
WebSize maxUntiledLayerSize() const { return m_maxUntiledLayerSize; }
@@ -178,6 +181,8 @@ private:
bool m_applyDefaultDeviceScaleFactorInCompositor;
bool m_gestureTapHighlightEnabled;
bool m_autoZoomFocusedNodeToLegibleScale;
+ bool m_deferredImageDecodingEnabled;
+ bool m_doubleTapToZoomEnabled;
WebSize m_defaultTileSize;
WebSize m_maxUntiledLayerSize;
};
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index d6bf94b96..9f2a845dd 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -679,6 +679,7 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
m_linkHighlight->startHighlightAnimationIfNeeded();
break;
case WebInputEvent::GestureTap:
+ case WebInputEvent::GestureLongPress:
// If a link highlight is active, kill it.
m_linkHighlight.clear();
break;
@@ -774,10 +775,12 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
break;
}
case WebInputEvent::GestureDoubleTap:
- m_client->cancelScheduledContentIntents();
- animateZoomAroundPoint(WebPoint(event.x, event.y), DoubleTap);
- eventSwallowed = true;
- break;
+ if (m_webSettings->doubleTapToZoomEnabled()) {
+ m_client->cancelScheduledContentIntents();
+ animateZoomAroundPoint(WebPoint(event.x, event.y), DoubleTap);
+ eventSwallowed = true;
+ break;
+ }
case WebInputEvent::GestureScrollBegin:
case WebInputEvent::GesturePinchBegin:
m_client->cancelScheduledContentIntents();
diff --git a/Source/WebKit/chromium/tests/DeferredImageDecoderTest.cpp b/Source/WebKit/chromium/tests/DeferredImageDecoderTest.cpp
new file mode 100644
index 000000000..482549805
--- /dev/null
+++ b/Source/WebKit/chromium/tests/DeferredImageDecoderTest.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "DeferredImageDecoder.h"
+
+#include "ImageDecodingStore.h"
+#include "MockImageDecoder.h"
+#include "NativeImageSkia.h"
+#include "SkCanvas.h"
+#include "SkDevice.h"
+#include "SkPicture.h"
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+namespace {
+
+class DeferredImageDecoderTest : public ::testing::Test {
+public:
+ virtual void SetUp()
+ {
+ ImageDecodingStore::initializeOnMainThread();
+ m_actualDecoder = new MockImageDecoder();
+ m_actualDecoder->setSize(600, 613);
+ m_lazyDecoder = DeferredImageDecoder::createForTesting(adoptPtr(m_actualDecoder));
+ m_canvas.setDevice(new SkDevice(SkBitmap::kARGB_8888_Config, 100, 100))->unref();
+ }
+
+ virtual void TearDown()
+ {
+ ImageDecodingStore::shutdown();
+ }
+
+protected:
+ // Don't own this but saves the pointer to query states.
+ MockImageDecoder* m_actualDecoder;
+ OwnPtr<DeferredImageDecoder> m_lazyDecoder;
+ SkPicture m_picture;
+ SkCanvas m_canvas;
+};
+
+TEST_F(DeferredImageDecoderTest, drawIntoSkPicture)
+{
+ OwnPtr<NativeImageSkia> image(adoptPtr(m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage()));
+ EXPECT_EQ(m_actualDecoder->size().width(), image->bitmap().width());
+ EXPECT_EQ(m_actualDecoder->size().height(), image->bitmap().height());
+ EXPECT_FALSE(image->bitmap().isNull());
+ EXPECT_TRUE(image->bitmap().isImmutable());
+
+ SkCanvas* tempCanvas = m_picture.beginRecording(100, 100);
+ tempCanvas->drawBitmap(image->bitmap(), 0, 0);
+ m_picture.endRecording();
+ EXPECT_EQ(0, m_actualDecoder->frameBufferRequestCount());
+
+ m_canvas.drawPicture(m_picture);
+ EXPECT_EQ(1, m_actualDecoder->frameBufferRequestCount());
+}
+
+TEST_F(DeferredImageDecoderTest, drawScaledIntoSkPicture)
+{
+ OwnPtr<NativeImageSkia> image(adoptPtr(m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage()));
+ SkBitmap scaledBitmap = image->resizedBitmap(SkISize::Make(50, 51), SkIRect::MakeWH(50, 51));
+ EXPECT_FALSE(scaledBitmap.isNull());
+ EXPECT_TRUE(scaledBitmap.isImmutable());
+ EXPECT_EQ(50, scaledBitmap.width());
+ EXPECT_EQ(51, scaledBitmap.height());
+ EXPECT_EQ(0, m_actualDecoder->frameBufferRequestCount());
+
+ SkCanvas* tempCanvas = m_picture.beginRecording(100, 100);
+ tempCanvas->drawBitmap(scaledBitmap, 0, 0);
+ m_picture.endRecording();
+ EXPECT_EQ(0, m_actualDecoder->frameBufferRequestCount());
+
+ m_canvas.drawPicture(m_picture);
+ EXPECT_EQ(1, m_actualDecoder->frameBufferRequestCount());
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp b/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
index cd2a07649..2be4e567e 100644
--- a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
+++ b/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
@@ -24,6 +24,7 @@
*/
#include "config.h"
+#include "IDBCallbacks.h"
#include "IDBCursorBackendInterface.h"
#include "IDBDatabaseBackendInterface.h"
#include "IDBDatabaseCallbacks.h"
diff --git a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
index c59dce675..45cdd1cb2 100644
--- a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
+++ b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
@@ -33,7 +33,7 @@ namespace WebCore {
class IDBFakeBackingStore : public IDBBackingStore {
public:
virtual void getDatabaseNames(Vector<String>& foundNames) OVERRIDE { }
- virtual bool getIDBDatabaseMetaData(const String& name, String& foundStringVersion, int64_t& foundIntVersion, int64_t& foundId, int64_t& maxObjectStoreId) OVERRIDE { return false; }
+ virtual bool getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata*) OVERRIDE { return false; }
virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId) OVERRIDE { return true; }
virtual bool updateIDBDatabaseMetaData(Transaction*, int64_t rowId, const String& version) OVERRIDE { return false; }
virtual bool updateIDBDatabaseIntVersion(Transaction*, int64_t rowId, int64_t version) OVERRIDE { return false; }
diff --git a/Source/WebKit/chromium/tests/LocaleMacTest.cpp b/Source/WebKit/chromium/tests/LocaleMacTest.cpp
index 449776195..91482d94d 100644
--- a/Source/WebKit/chromium/tests/LocaleMacTest.cpp
+++ b/Source/WebKit/chromium/tests/LocaleMacTest.cpp
@@ -120,6 +120,12 @@ protected:
#endif
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+ String monthFormat(const String& localeString)
+ {
+ OwnPtr<LocaleMac> locale = LocaleMac::create(localeString);
+ return locale->monthFormat();
+ }
+
String timeFormat(const String& localeString)
{
OwnPtr<LocaleMac> locale = LocaleMac::create(localeString);
@@ -132,6 +138,18 @@ protected:
return locale->shortTimeFormat();
}
+ String shortMonthLabel(const String& localeString, unsigned index)
+ {
+ OwnPtr<LocaleMac> locale = LocaleMac::create(localeString);
+ return locale->shortMonthLabels()[index];
+ }
+
+ String shortStandAloneMonthLabel(const String& localeString, unsigned index)
+ {
+ OwnPtr<LocaleMac> locale = LocaleMac::create(localeString);
+ return locale->shortStandAloneMonthLabels()[index];
+ }
+
String timeAMPMLabel(const String& localeString, unsigned index)
{
OwnPtr<LocaleMac> locale = LocaleMac::create(localeString);
@@ -236,6 +254,16 @@ TEST_F(LocaleMacTest, isRTL)
#endif
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+TEST_F(LocaleMacTest, monthFormat)
+{
+ EXPECT_STREQ("MMM yyyy", monthFormat("en_US").utf8().data());
+ EXPECT_STREQ("yyyy\xE5\xB9\xB4M\xE6\x9C\x88", monthFormat("ja_JP").utf8().data());
+
+ // fr_FR and ru return different results on OS versions.
+ // "MMM yyyy" "LLL yyyy" on 10.6 and 10.7
+ // "MMM y" "LLL y" on 10.8
+}
+
TEST_F(LocaleMacTest, timeFormat)
{
EXPECT_STREQ("h:mm:ss a", timeFormat("en_US").utf8().data());
@@ -250,6 +278,30 @@ TEST_F(LocaleMacTest, shortTimeFormat)
EXPECT_STREQ("H:mm", shortTimeFormat("ja_JP").utf8().data());
}
+TEST_F(LocaleMacTest, shortMonthLabels)
+{
+ EXPECT_STREQ("Jan", shortMonthLabel("en_US", 0).utf8().data());
+ EXPECT_STREQ("Jan", shortStandAloneMonthLabel("en_US", 0).utf8().data());
+ EXPECT_STREQ("Dec", shortMonthLabel("en_US", 11).utf8().data());
+ EXPECT_STREQ("Dec", shortStandAloneMonthLabel("en_US", 11).utf8().data());
+
+ EXPECT_STREQ("janv.", shortMonthLabel("fr_FR", 0).utf8().data());
+ EXPECT_STREQ("janv.", shortStandAloneMonthLabel("fr_FR", 0).utf8().data());
+ EXPECT_STREQ("d\xC3\xA9" "c.", shortMonthLabel("fr_FR", 11).utf8().data());
+ EXPECT_STREQ("d\xC3\xA9" "c.", shortStandAloneMonthLabel("fr_FR", 11).utf8().data());
+
+ EXPECT_STREQ("1\xE6\x9C\x88", shortMonthLabel("ja_JP", 0).utf8().data());
+ EXPECT_STREQ("1\xE6\x9C\x88", shortStandAloneMonthLabel("ja_JP", 0).utf8().data());
+ EXPECT_STREQ("12\xE6\x9C\x88", shortMonthLabel("ja_JP", 11).utf8().data());
+ EXPECT_STREQ("12\xE6\x9C\x88", shortStandAloneMonthLabel("ja_JP", 11).utf8().data());
+
+ EXPECT_STREQ("\xD0\xBC\xD0\xB0\xD1\x80\xD1\x82\xD0\xB0", shortMonthLabel("ru_RU", 2).utf8().data());
+ EXPECT_STREQ("\xD0\xBC\xD0\xB0\xD1\x8F", shortMonthLabel("ru_RU", 4).utf8().data());
+ // The ru_RU locale returns different stand-alone month labels on OS versions.
+ // "\xD0\xBC\xD0\xB0\xD1\x80\xD1\x82" "\xD0\xBC\xD0\xB0\xD0\xB9" on 10.6 and 10.7
+ // "\xD0\x9C\xD0\xB0\xD1\x80\xD1\x82" "\xD0\x9C\xD0\xB0\xD0\xB9" on 10.8
+}
+
TEST_F(LocaleMacTest, timeAMPMLabels)
{
EXPECT_STREQ("AM", timeAMPMLabel("en_US", 0).utf8().data());
diff --git a/Source/WebKit/chromium/tests/LocaleWinTest.cpp b/Source/WebKit/chromium/tests/LocaleWinTest.cpp
index 75af419dd..35f064aac 100644
--- a/Source/WebKit/chromium/tests/LocaleWinTest.cpp
+++ b/Source/WebKit/chromium/tests/LocaleWinTest.cpp
@@ -129,6 +129,12 @@ protected:
#endif
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+ String monthFormat(LCID lcid)
+ {
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid);
+ return locale->monthFormat();
+ }
+
String timeFormat(LCID lcid)
{
OwnPtr<LocaleWin> locale = LocaleWin::create(lcid);
@@ -141,6 +147,12 @@ protected:
return locale->shortTimeFormat();
}
+ String shortMonthLabel(LCID lcid, unsigned index)
+ {
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid);
+ return locale->shortMonthLabels()[index];
+ }
+
String timeAMPMLabel(LCID lcid, unsigned index)
{
OwnPtr<LocaleWin> locale = LocaleWin::create(lcid);
@@ -284,6 +296,13 @@ TEST_F(LocaleWinTest, dateFormat)
EXPECT_STREQ("yyyy'-'''''MMMM'-'dd", LocaleWin::dateFormat("yyyy-''''MMMM-dd").utf8().data());
}
+TEST_F(LocaleWinTest, monthFormat)
+{
+ EXPECT_STREQ("MMMM', 'yyyy", monthFormat(EnglishUS).utf8().data());
+ EXPECT_STREQ("MMMM' 'yyyy", monthFormat(FrenchFR).utf8().data());
+ EXPECT_STREQ("yyyy'\xE5\xB9\xB4'M'\xE6\x9C\x88'", monthFormat(JapaneseJP).utf8().data());
+}
+
TEST_F(LocaleWinTest, timeFormat)
{
EXPECT_STREQ("h:mm:ss a", timeFormat(EnglishUS).utf8().data());
@@ -298,6 +317,16 @@ TEST_F(LocaleWinTest, shortTimeFormat)
EXPECT_STREQ("H:mm:ss", shortTimeFormat(JapaneseJP).utf8().data());
}
+TEST_F(LocaleWinTest, shortMonthLabels)
+{
+ EXPECT_STREQ("Jan", shortMonthLabel(EnglishUS, 0).utf8().data());
+ EXPECT_STREQ("Dec", shortMonthLabel(EnglishUS, 11).utf8().data());
+ EXPECT_STREQ("janv.", shortMonthLabel(FrenchFR, 0).utf8().data());
+ EXPECT_STREQ("d\xC3\xA9" "c.", shortMonthLabel(FrenchFR, 11).utf8().data());
+ EXPECT_STREQ("1", shortMonthLabel(JapaneseJP, 0).utf8().data());
+ EXPECT_STREQ("12", shortMonthLabel(JapaneseJP, 11).utf8().data());
+}
+
TEST_F(LocaleWinTest, timeAMPMLabels)
{
EXPECT_STREQ("AM", timeAMPMLabel(EnglishUS, 0).utf8().data());
diff --git a/Source/WebKit/chromium/tests/LocalizedDateICUTest.cpp b/Source/WebKit/chromium/tests/LocalizedDateICUTest.cpp
index 771a3cbc0..88946e84d 100644
--- a/Source/WebKit/chromium/tests/LocalizedDateICUTest.cpp
+++ b/Source/WebKit/chromium/tests/LocalizedDateICUTest.cpp
@@ -88,6 +88,12 @@ protected:
return Labels(labels);
}
+ String monthFormat(const char* localeString)
+ {
+ OwnPtr<LocaleICU> locale = LocaleICU::create(localeString);
+ return locale->monthFormat();
+ }
+
String localizedDateFormatText(const char* localeString)
{
OwnPtr<LocaleICU> locale = LocaleICU::create(localeString);
@@ -100,6 +106,18 @@ protected:
return locale->shortTimeFormat();
}
+ String shortMonthLabel(const char* localeString, unsigned index)
+ {
+ OwnPtr<LocaleICU> locale = LocaleICU::create(localeString);
+ return locale->shortMonthLabels()[index];
+ }
+
+ String shortStandAloneMonthLabel(const char* localeString, unsigned index)
+ {
+ OwnPtr<LocaleICU> locale = LocaleICU::create(localeString);
+ return locale->shortStandAloneMonthLabels()[index];
+ }
+
Labels timeAMPMLabels(const char* localeString)
{
OwnPtr<LocaleICU> locale = LocaleICU::create(localeString);
@@ -126,6 +144,13 @@ TEST_F(LocalizedDateICUTest, isRTL)
EXPECT_FALSE(isRTL("**invalid**"));
}
+TEST_F(LocalizedDateICUTest, monthFormat)
+{
+ EXPECT_STREQ("MMM yyyy", monthFormat("en_US").utf8().data());
+ EXPECT_STREQ("MMM yyyy", monthFormat("fr").utf8().data());
+ EXPECT_STREQ("yyyy\xE5\xB9\xB4M\xE6\x9C\x88", monthFormat("ja").utf8().data());
+}
+
TEST_F(LocalizedDateICUTest, localizedDateFormatText)
{
// Note: EXPECT_EQ(String, String) doesn't print result as string.
@@ -141,6 +166,29 @@ TEST_F(LocalizedDateICUTest, localizedShortDateFormatText)
EXPECT_STREQ("H:mm", localizedShortDateFormatText("ja").utf8().data());
}
+TEST_F(LocalizedDateICUTest, shortMonthLabels)
+{
+ EXPECT_STREQ("Jan", shortMonthLabel("en_US", 0).utf8().data());
+ EXPECT_STREQ("Jan", shortStandAloneMonthLabel("en_US", 0).utf8().data());
+ EXPECT_STREQ("Dec", shortMonthLabel("en_US", 11).utf8().data());
+ EXPECT_STREQ("Dec", shortStandAloneMonthLabel("en_US", 11).utf8().data());
+
+ EXPECT_STREQ("janv.", shortMonthLabel("fr_FR", 0).utf8().data());
+ EXPECT_STREQ("janv.", shortStandAloneMonthLabel("fr_FR", 0).utf8().data());
+ EXPECT_STREQ("d\xC3\xA9" "c.", shortMonthLabel("fr_FR", 11).utf8().data());
+ EXPECT_STREQ("d\xC3\xA9" "c.", shortStandAloneMonthLabel("fr_FR", 11).utf8().data());
+
+ EXPECT_STREQ("1\xE6\x9C\x88", shortMonthLabel("ja_JP", 0).utf8().data());
+ EXPECT_STREQ("1\xE6\x9C\x88", shortStandAloneMonthLabel("ja_JP", 0).utf8().data());
+ EXPECT_STREQ("12\xE6\x9C\x88", shortMonthLabel("ja_JP", 11).utf8().data());
+ EXPECT_STREQ("12\xE6\x9C\x88", shortStandAloneMonthLabel("ja_JP", 11).utf8().data());
+
+ EXPECT_STREQ("\xD0\xBC\xD0\xB0\xD1\x80\xD1\x82\xD0\xB0", shortMonthLabel("ru_RU", 2).utf8().data());
+ EXPECT_STREQ("\xD0\xBC\xD0\xB0\xD1\x80\xD1\x82", shortStandAloneMonthLabel("ru_RU", 2).utf8().data());
+ EXPECT_STREQ("\xD0\xBC\xD0\xB0\xD1\x8F", shortMonthLabel("ru_RU", 4).utf8().data());
+ EXPECT_STREQ("\xD0\xBC\xD0\xB0\xD0\xB9", shortStandAloneMonthLabel("ru_RU", 4).utf8().data());
+}
+
TEST_F(LocalizedDateICUTest, timeAMPMLabels)
{
EXPECT_EQ(labels("AM", "PM"), timeAMPMLabels("en_US"));
diff --git a/Source/WebKit/chromium/tests/MockImageDecoder.h b/Source/WebKit/chromium/tests/MockImageDecoder.h
new file mode 100644
index 000000000..5cf23744e
--- /dev/null
+++ b/Source/WebKit/chromium/tests/MockImageDecoder.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MockImageDecoder_h
+
+#include "ImageDecoder.h"
+
+namespace WebCore {
+
+class MockImageDecoder : public ImageDecoder {
+public:
+ MockImageDecoder()
+ : ImageDecoder(ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied)
+ , m_frameBufferRequestCount(0)
+ { }
+
+ virtual String filenameExtension() const
+ {
+ return "mock";
+ }
+
+ virtual ImageFrame* frameBufferAtIndex(size_t)
+ {
+ ++m_frameBufferRequestCount;
+
+ m_frameBufferCache.resize(1);
+ m_frameBufferCache[0].setSize(size().width(), size().height());
+ return &m_frameBufferCache[0];
+ }
+
+ int frameBufferRequestCount() const { return m_frameBufferRequestCount; }
+
+private:
+ int m_frameBufferRequestCount;
+};
+
+} // namespace WebCore
+
+#endif // MockImageDecoder_h
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index c8704bc4e..77773bf25 100644
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,56 @@
+2012-10-22 Ryuan Choi <ryuan.choi@gmail.com>
+
+ [EFL] pc files should use DATA_INSTALL_DIR for datadir
+ https://bugs.webkit.org/show_bug.cgi?id=99961
+
+ Reviewed by Gyuyoung Kim.
+
+ * ewebkit.pc.in: Used DATA_INSTALL_DIR instead of hardcoded `shared/XXX`
+
+2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page
+ https://bugs.webkit.org/show_bug.cgi?id=98514
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_view_create_for_view):
+
+2012-10-21 Seokju Kwon <seokju.kwon@samsung.com>
+
+ [EFL] Fix failure to access the inspector resources
+ https://bugs.webkit.org/show_bug.cgi?id=99816
+
+ Reviewed by Gyuyoung Kim.
+
+ access() returns -1, if path has a file protocol like "file://".
+ And I have removed it from the first argument of access().
+ If not, inspectorBaseURL() or inspectorFilesPath() always returns WEB_INSPECTOR_DIR.
+ Then all layout test related to inspector can fail after installing webkit package.
+
+ * WebCoreSupport/InspectorClientEfl.cpp:
+ (WebCore::InspectorClientEfl::inspectorFilesPath):
+
+2012-10-20 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+
+ [EFL][DRT] Implement tracking and painting repaint rectangles.
+ https://bugs.webkit.org/show_bug.cgi?id=99838
+
+ Reviewed by Gyuyoung Kim.
+
+ Add the required DumpRenderTreeSupport plumbing functions to
+ interact with FrameView and track/obtain repaint rectangles for
+ DumpRenderTree.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled):
+ (DumpRenderTreeSupportEfl::setTracksRepaints):
+ (DumpRenderTreeSupportEfl::resetTrackedRepaints):
+ (DumpRenderTreeSupportEfl::isTrackingRepaints):
+ (DumpRenderTreeSupportEfl::trackedRepaintRects):
+ * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
2012-10-18 Kangil Han <kangil.han@samsung.com>
[EFL] Add unit test for ewk_frame_source_get.
diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
index 746602949..eee7122e7 100644
--- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
@@ -1,6 +1,7 @@
/*
Copyright (C) 2011 ProFUSION embedded systems
Copyright (C) 2011 Samsung Electronics
+ Copyright (C) 2012 Intel Corporation. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -378,6 +379,51 @@ void DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled(Evas_Object* e
editorClient->setSelectTrailingWhitespaceEnabled(enabled);
}
+void DumpRenderTreeSupportEfl::setTracksRepaints(Evas_Object* ewkFrame, bool enabled)
+{
+ DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame);
+
+ if (frame->view())
+ frame->view()->setTracksRepaints(enabled);
+}
+
+void DumpRenderTreeSupportEfl::resetTrackedRepaints(Evas_Object* ewkFrame)
+{
+ DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame);
+
+ if (frame->view())
+ frame->view()->resetTrackedRepaints();
+}
+
+bool DumpRenderTreeSupportEfl::isTrackingRepaints(const Evas_Object* ewkFrame)
+{
+ DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, false);
+
+ if (!frame->view())
+ return false;
+
+ return frame->view()->isTrackingRepaints();
+}
+
+Eina_List* DumpRenderTreeSupportEfl::trackedRepaintRects(const Evas_Object* ewkFrame)
+{
+ DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, 0);
+
+ if (!frame->view())
+ return 0;
+
+ const Vector<WebCore::IntRect>& repaintRects = frame->view()->trackedRepaintRects();
+ size_t count = repaintRects.size();
+ Eina_List* rectList = 0;
+
+ for (size_t i = 0; i < count; ++i) {
+ Eina_Rectangle* rect = eina_rectangle_new(repaintRects[i].x(), repaintRects[i].y(), repaintRects[i].width(), repaintRects[i].height());
+ rectList = eina_list_append(rectList, rect);
+ }
+
+ return rectList;
+}
+
void DumpRenderTreeSupportEfl::garbageCollectorCollect()
{
WebCore::gcController().garbageCollectNow();
diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
index ccc087351..35c05001d 100644
--- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
+++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
@@ -1,6 +1,7 @@
/*
Copyright (C) 2011 ProFUSION embedded systems
Copyright (C) 2011 Samsung Electronics
+ Copyright (C) 2012 Intel Corporation. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -83,6 +84,11 @@ public:
static void setSmartInsertDeleteEnabled(Evas_Object* ewkView, bool enabled);
static void setSelectTrailingWhitespaceEnabled(Evas_Object* ewkView, bool enabled);
+ static void setTracksRepaints(Evas_Object* ewkFrame, bool enabled);
+ static void resetTrackedRepaints(Evas_Object* ewkFrame);
+ static bool isTrackingRepaints(const Evas_Object* ewkFrame);
+ static Eina_List* trackedRepaintRects(const Evas_Object* ewkFrame);
+
static void garbageCollectorCollect();
static void garbageCollectorCollectOnAlternateThread(bool waitUntilDone);
static size_t javaScriptObjectsCount();
diff --git a/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
index 3dd815ab9..591dee202 100644
--- a/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
@@ -140,11 +140,11 @@ void InspectorClientEfl::releaseFrontendPage()
String InspectorClientEfl::inspectorFilesPath()
{
- String inspectorFilesPath = "file://" + String(WEB_INSPECTOR_INSTALL_DIR);
+ String inspectorFilesPath = WEB_INSPECTOR_INSTALL_DIR;
if (access(inspectorFilesPath.utf8().data(), R_OK))
- inspectorFilesPath = "file://" + String(WEB_INSPECTOR_DIR);
+ inspectorFilesPath = WEB_INSPECTOR_DIR;
- return inspectorFilesPath;
+ return "file://" + inspectorFilesPath;
}
InspectorFrontendClientEfl::InspectorFrontendClientEfl(Evas_Object* inspectedView, Evas_Object* inspectorView, InspectorClientEfl* inspectorClient)
diff --git a/Source/WebKit/efl/ewebkit.pc.in b/Source/WebKit/efl/ewebkit.pc.in
index 0d9be3f39..2ffd291ab 100644
--- a/Source/WebKit/efl/ewebkit.pc.in
+++ b/Source/WebKit/efl/ewebkit.pc.in
@@ -2,7 +2,7 @@ prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
-datadir=${prefix}/share/@WebKit_LIBRARY_NAME@-@PROJECT_VERSION_MAJOR@
+datadir=${prefix}/@DATA_INSTALL_DIR@
Name: WebKit-EFL
Description: Web content engine for EFL applications
diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp
index 11957e446..738a93918 100644
--- a/Source/WebKit/efl/ewk/ewk_frame.cpp
+++ b/Source/WebKit/efl/ewk/ewk_frame.cpp
@@ -1621,7 +1621,7 @@ void ewk_frame_view_create_for_view(Evas_Object* ewkFrame, Evas_Object* view)
else
background = WebCore::Color(red * 255 / alpha, green * 255 / alpha, blue * 255 / alpha, alpha);
- smartData->frame->createView(size, background, !alpha, WebCore::IntSize(), false);
+ smartData->frame->createView(size, background, !alpha);
if (!smartData->frame->view())
return;
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index 986e4b1d3..f66a29871 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,13 @@
+2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page
+ https://bugs.webkit.org/show_bug.cgi?id=98514
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
+
2012-10-10 Brady Eidson <beidson@apple.com>
Switch ResourceLoader::resourceData() from SharedBuffer to ResourceBuffer
diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 085f41c6a..d154b1d31 100644
--- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -1224,7 +1224,7 @@ void FrameLoaderClient::transitionToCommittedForNewPage()
Frame* frame = core(m_frame);
ASSERT(frame);
- frame->createView(size, backgroundColor, transparent, IntSize(), false);
+ frame->createView(size, backgroundColor, transparent);
// We need to do further manipulation on the FrameView if it was the mainFrame
if (frame != frame->page()->mainFrame())
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 4e29f0e43..8aa53eb80 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,36 @@
+2012-10-21 Andreas Kling <kling@webkit.org>
+
+ Remove Page::javaScriptURLsAreAllowed setting.
+ <http://webkit.org/b/99944>
+
+ Reviewed by Anders Carlsson.
+
+ * WebKit.order:
+ * WebView/WebView.mm:
+ * WebView/WebViewPrivate.h:
+
+2012-10-19 Dongwoo Joshua Im <dw.im@samsung.com>
+
+ Rename ENABLE_CSS3_TEXT_DECORATION to ENABLE_CSS3_TEXT
+ https://bugs.webkit.org/show_bug.cgi?id=99804
+
+ Reviewed by Julien Chaffraix.
+
+ CSS3 text related properties will be implemented under this flag,
+ including text decoration, text-align-last, and text-justify.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-10-18 Pablo Flouret <pablof@motorola.com>
+
+ Implement css3-conditional's @supports rule
+ https://bugs.webkit.org/show_bug.cgi?id=86146
+
+ Reviewed by Antti Koivisto.
+
+ * Configurations/FeatureDefines.xcconfig:
+ Add an ENABLE_CSS3_CONDITIONAL_RULES flag.
+
2012-10-17 Joseph Pecoraro <pecoraro@apple.com>
[Mac] Uninitialized Members in WebDataSourcePrivate
diff --git a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
index bc40f76e4..eee0fe431 100644
--- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -48,7 +48,8 @@ ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
ENABLE_CSS_COMPOSITING = ENABLE_CSS_COMPOSITING;
ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
ENABLE_CSS_VARIABLES = ;
-ENABLE_CSS3_TEXT_DECORATION = ;
+ENABLE_CSS3_CONDITIONAL_RULES = ;
+ENABLE_CSS3_TEXT = ;
ENABLE_CUSTOM_SCHEME_HANDLER = ;
ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
@@ -143,4 +144,4 @@ ENABLE_WEB_TIMING = ;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebKit/mac/WebKit.order b/Source/WebKit/mac/WebKit.order
index 43ad19a83..6263b7e59 100644
--- a/Source/WebKit/mac/WebKit.order
+++ b/Source/WebKit/mac/WebKit.order
@@ -2422,7 +2422,6 @@ __ZN12PluginWidgetD0Ev
-[WebView estimatedProgress]
+[WebView canShowMIMEType:]
-[WebFrame(WebPrivate) _loadType]
--[WebView(WebPrivate) _setJavaScriptURLsAreAllowed:]
-[WebView(WebPendingPublic) addVisitedLinks:]
-[WebHistoryItem(WebPrivate) _transientPropertyForKey:]
-[WebElementDictionary _targetWebFrame]
diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm
index 2aae548eb..dadf1533d 100644
--- a/Source/WebKit/mac/WebView/WebView.mm
+++ b/Source/WebKit/mac/WebView/WebView.mm
@@ -2474,11 +2474,6 @@ static inline IMP getMethod(id o, SEL s)
return _private->page->areMemoryCacheClientCallsEnabled();
}
-- (void)_setJavaScriptURLsAreAllowed:(BOOL)areAllowed
-{
- _private->page->setJavaScriptURLsAreAllowed(areAllowed);
-}
-
+ (NSCursor *)_pointingHandCursor
{
return handCursor().platformCursor();
diff --git a/Source/WebKit/mac/WebView/WebViewPrivate.h b/Source/WebKit/mac/WebView/WebViewPrivate.h
index 26f5da714..fd5b9b06d 100644
--- a/Source/WebKit/mac/WebView/WebViewPrivate.h
+++ b/Source/WebKit/mac/WebView/WebViewPrivate.h
@@ -486,8 +486,6 @@ Could be worth adding to the API.
- (void)setMemoryCacheDelegateCallsEnabled:(BOOL)suspend;
- (BOOL)areMemoryCacheDelegateCallsEnabled;
-- (void)_setJavaScriptURLsAreAllowed:(BOOL)setJavaScriptURLsAreAllowed;
-
+ (NSCursor *)_pointingHandCursor;
// SPI for DumpRenderTree
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
index 9019f4688..a9eb9a099 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -94,6 +94,7 @@
#include "PageClientQt.h"
#include "PageGroup.h"
#include "Pasteboard.h"
+#include "PlatformGestureEvent.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformTouchEvent.h"
#include "PlatformWheelEvent.h"
@@ -131,6 +132,7 @@
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QFileDialog>
+#include <QGestureEvent>
#include <QInputDialog>
#include <QLabel>
#include <QMenu>
@@ -1333,6 +1335,37 @@ bool QWebPagePrivate::touchEvent(QTouchEvent* event)
#endif
}
+bool QWebPagePrivate::gestureEvent(QGestureEvent* event)
+{
+#if ENABLE(GESTURE_EVENTS)
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame.data());
+ if (!frame->view())
+ return false;
+
+ // QGestureEvents can contain updates for multiple gestures.
+ bool handled = false;
+ QGesture* gesture = event->gesture(Qt::TapGesture);
+ // Beware that gestures send by DumpRenderTree will have state Qt::NoGesture,
+ // due to not originating from a GestureRecognizer.
+ if (gesture && (gesture->state() == Qt::GestureStarted || gesture->state() == Qt::NoGesture)) {
+ frame->eventHandler()->handleGestureEvent(convertGesture(event, gesture));
+ event->setAccepted(true);
+ handled = true;
+ }
+ gesture = event->gesture(Qt::TapAndHoldGesture);
+ if (gesture && (gesture->state() == Qt::GestureStarted || gesture->state() == Qt::NoGesture)) {
+ frame->eventHandler()->sendContextMenuEventForGesture(convertGesture(event, gesture));
+ event->setAccepted(true);
+ handled = true;
+ }
+
+ return handled;
+#else
+ event->ignore();
+ return false;
+#endif
+}
+
/*!
This method is used by the input method to query a set of properties of the page
to be able to support complex input method operations as support for surrounding
@@ -3143,6 +3176,11 @@ bool QWebPage::event(QEvent *ev)
case QEvent::TouchCancel:
// Return whether the default action was cancelled in the JS event handler
return d->touchEvent(static_cast<QTouchEvent*>(ev));
+#ifndef QT_NO_GESTURES
+ case QEvent::Gesture:
+ d->gestureEvent(static_cast<QGestureEvent*>(ev));
+ break;
+#endif
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange:
d->dynamicPropertyChangeEvent(static_cast<QDynamicPropertyChangeEvent*>(ev));
diff --git a/Source/WebKit/qt/Api/qwebpage_p.h b/Source/WebKit/qt/Api/qwebpage_p.h
index 86577d351..794322991 100644
--- a/Source/WebKit/qt/Api/qwebpage_p.h
+++ b/Source/WebKit/qt/Api/qwebpage_p.h
@@ -26,6 +26,7 @@
#include <qbasictimer.h>
#include <qnetworkproxy.h>
#include <qevent.h>
+#include <qgesture.h>
#include <qgraphicssceneevent.h>
#include "qwebpage.h"
@@ -133,6 +134,8 @@ public:
// Returns whether the default action was cancelled in the JS event handler
bool touchEvent(QTouchEvent*);
+ bool gestureEvent(QGestureEvent*);
+
class TouchAdjuster {
public:
TouchAdjuster(unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding);
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 06bb3220a..553d7fa20 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,48 @@
+2012-10-22 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] Fix build without QtWidgets
+ https://bugs.webkit.org/show_bug.cgi?id=99981
+
+ Reviewed by Tor Arne Vestbø.
+
+ Remove dependency to QtWidgets that is not needed here anymore since
+ the removal of the QtQuick1 code.
+
+ * declarative/experimental/experimental.pri:
+ * declarative/public.pri:
+
+2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page
+ https://bugs.webkit.org/show_bug.cgi?id=98514
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): Use FrameView::fixedVisibleContentRect
+ instead of FrameView::visibleContentRect as the source to always keep the correct state.
+
+2012-10-22 Allan Sandfeld Jensen <allan.jensen@digia.com>
+
+ [Qt] Basic gesture event handling
+ https://bugs.webkit.org/show_bug.cgi?id=66173
+
+ Reviewed by Simon Hausmann.
+
+ Implement basic handling of QGestureEvent converting and forwarding
+ Tap and TapAndHold gestures to WebCore.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::gestureEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+ (QWebPagePrivate):
+ * WebCoreSupport/WebEventConversion.cpp:
+ (WebKitPlatformGestureEvent):
+ (WebCore::WebKitPlatformGestureEvent::WebKitPlatformGestureEvent):
+ (WebCore::convertGesture):
+ * WebCoreSupport/WebEventConversion.h:
+
2012-10-17 Tor Arne Vestbø <tor.arne.vestbo@digia.com>
[Qt] Modularize documentation for QtWebKit
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 6600acc82..0731d9315 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -272,11 +272,13 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
bool hLock = hScrollbar != ScrollbarAuto;
bool vLock = vScrollbar != ScrollbarAuto;
- IntSize currentVisibleContentSize = m_frame->view() ? m_frame->view()->visibleContentRect().size() : IntSize();
+ // The HistoryController will update the scroll position later if needed.
+ IntRect currentVisibleContentRect = m_frame->view() ? IntRect(IntPoint::zero(), m_frame->view()->fixedVisibleContentRect().size()) : IntRect();
m_frame->createView(m_webFrame->page()->viewportSize(),
backgroundColor, !backgroundColor.alpha(),
preferredLayoutSize.isValid() ? IntSize(preferredLayoutSize) : IntSize(),
+ currentVisibleContentRect,
preferredLayoutSize.isValid(),
hScrollbar, hLock,
vScrollbar, vLock);
@@ -284,13 +286,8 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
bool isMainFrame = m_frame == m_frame->page()->mainFrame();
if (isMainFrame && page->d->client) {
bool resizesToContents = page->d->client->viewResizesToContentsEnabled();
-
m_frame->view()->setPaintsEntireContents(resizesToContents);
m_frame->view()->setDelegatesScrolling(resizesToContents);
-
- // The HistoryController will update the scroll position later if needed.
- IntRect rect = resizesToContents ? IntRect(IntPoint::zero(), currentVisibleContentSize) : IntRect();
- m_frame->view()->setFixedVisibleContentRect(rect);
}
}
diff --git a/Source/WebKit/qt/WebCoreSupport/WebEventConversion.cpp b/Source/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
index 222676620..d6159241e 100644
--- a/Source/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
@@ -22,14 +22,18 @@
#include "config.h"
#include "WebEventConversion.h"
+#include "PlatformGestureEvent.h"
#include "PlatformMouseEvent.h"
#include "PlatformTouchEvent.h"
#include "PlatformTouchPoint.h"
#include "PlatformWheelEvent.h"
#include <QApplication>
+#include <QGesture>
+#include <QGestureEvent>
#include <QGraphicsSceneMouseEvent>
#include <QTouchEvent>
#include <QWheelEvent>
+#include <QWidget>
#include <wtf/CurrentTime.h>
namespace WebCore {
@@ -302,6 +306,38 @@ WebKitPlatformTouchPoint::WebKitPlatformTouchPoint(const QTouchEvent::TouchPoint
}
#endif
+#if ENABLE(GESTURE_EVENTS)
+class WebKitPlatformGestureEvent : public PlatformGestureEvent {
+public:
+ WebKitPlatformGestureEvent(const QGestureEvent*, const QGesture*);
+};
+
+WebKitPlatformGestureEvent::WebKitPlatformGestureEvent(const QGestureEvent* event, const QGesture* gesture)
+{
+ switch (gesture->gestureType()) {
+ case Qt::TapGesture: {
+ m_type = PlatformEvent::GestureTap;
+ QPointF globalPos = static_cast<const QTapGesture*>(gesture)->position();
+ m_globalPosition = globalPos.toPoint();
+ m_position = event->widget()->mapFromGlobal(globalPos.toPoint());
+ break;
+ }
+ case Qt::TapAndHoldGesture: {
+ m_type = PlatformEvent::GestureLongPress;
+ QPointF globalPos = static_cast<const QTapAndHoldGesture*>(gesture)->position();
+ m_globalPosition = globalPos.toPoint();
+ m_position = event->widget()->mapFromGlobal(globalPos.toPoint());
+ break;
+ }
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ m_timestamp = WTF::currentTime();
+}
+
+#endif
+
PlatformWheelEvent convertWheelEvent(QWheelEvent* event)
{
return WebKitPlatformWheelEvent(event);
@@ -319,4 +355,11 @@ PlatformTouchEvent convertTouchEvent(QTouchEvent* event)
}
#endif
+#if ENABLE(GESTURE_EVENTS)
+PlatformGestureEvent convertGesture(QGestureEvent* event, QGesture* gesture)
+{
+ return WebKitPlatformGestureEvent(event, gesture);
+}
+#endif
+
}
diff --git a/Source/WebKit/qt/WebCoreSupport/WebEventConversion.h b/Source/WebKit/qt/WebCoreSupport/WebEventConversion.h
index 09c63d17c..3224eee90 100644
--- a/Source/WebKit/qt/WebCoreSupport/WebEventConversion.h
+++ b/Source/WebKit/qt/WebCoreSupport/WebEventConversion.h
@@ -27,6 +27,8 @@ class QGraphicsSceneMouseEvent;
class QWheelEvent;
class QGraphicsSceneWheelEvent;
class QTouchEvent;
+class QGesture;
+class QGestureEvent;
QT_END_NAMESPACE
namespace WebCore {
@@ -34,7 +36,6 @@ namespace WebCore {
class PlatformMouseEvent;
class PlatformWheelEvent;
-
PlatformMouseEvent convertMouseEvent(QInputEvent*, int clickCount);
PlatformMouseEvent convertMouseEvent(QGraphicsSceneMouseEvent*, int clickCount);
PlatformWheelEvent convertWheelEvent(QWheelEvent*);
@@ -44,4 +45,9 @@ PlatformWheelEvent convertWheelEvent(QGraphicsSceneWheelEvent*);
class PlatformTouchEvent;
PlatformTouchEvent convertTouchEvent(QTouchEvent*);
#endif
+
+#if ENABLE(GESTURE_EVENTS)
+class PlatformGestureEvent;
+PlatformGestureEvent convertGesture(QGestureEvent*, QGesture*);
+#endif
}
diff --git a/Source/WebKit/qt/declarative/experimental/experimental.pri b/Source/WebKit/qt/declarative/experimental/experimental.pri
index 1792b0ebb..3775056aa 100644
--- a/Source/WebKit/qt/declarative/experimental/experimental.pri
+++ b/Source/WebKit/qt/declarative/experimental/experimental.pri
@@ -24,7 +24,7 @@ contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
wince*:LIBS += $$QMAKE_LIBS_GUI
-QT += widgets network quick quick-private webkitwidgets webkitwidgets-private
+QT += network quick quick-private webkitwidgets webkitwidgets-private
DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}
diff --git a/Source/WebKit/qt/declarative/public.pri b/Source/WebKit/qt/declarative/public.pri
index bf4e1f701..9216a8b64 100644
--- a/Source/WebKit/qt/declarative/public.pri
+++ b/Source/WebKit/qt/declarative/public.pri
@@ -24,7 +24,7 @@ contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
wince*:LIBS += $$QMAKE_LIBS_GUI
-QT += webkitwidgets webkitwidgets-private widgets quick quick-private
+QT += webkitwidgets webkitwidgets-private quick quick-private
WEBKIT += wtf
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index ca85c9d1b..d12c28de8 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,32 @@
+2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page
+ https://bugs.webkit.org/show_bug.cgi?id=98514
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage):
+
+2012-10-21 Andreas Kling <kling@webkit.org>
+
+ Remove Page::javaScriptURLsAreAllowed setting.
+ <http://webkit.org/b/99944>
+
+ Reviewed by Anders Carlsson.
+
+ Have WebView::setJavaScriptURLsAreAllowed() do nothing and return E_NOTIMPL
+ to prevent COM ABI breakage.
+
+ * WebView.cpp:
+ (WebView::setJavaScriptURLsAreAllowed):
+
+2012-10-18 Roger Fong <roger_fong@apple.com>
+
+ Unreviewed. Build fix after r131701 and r131777.
+
+ * WebKit.vcproj/WebKit.sln:
+
2012-10-14 Sam Weinig <sam@webkit.org>
Fix the windows build.
diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index f0e93c0a1..0e4b10656 100644
--- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -724,7 +724,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
view->frameRect(&rect);
bool transparent = view->transparent();
Color backgroundColor = transparent ? Color::transparent : Color::white;
- core(m_webFrame)->createView(IntRect(rect).size(), backgroundColor, transparent, IntSize(), false);
+ core(m_webFrame)->createView(IntRect(rect).size(), backgroundColor, transparent);
}
void WebFrameLoaderClient::didSaveToPageCache()
diff --git a/Source/WebKit/win/WebKit.vcproj/WebKit.sln b/Source/WebKit/win/WebKit.vcproj/WebKit.sln
index 0723b2e10..71b83a875 100644
--- a/Source/WebKit/win/WebKit.vcproj/WebKit.sln
+++ b/Source/WebKit/win/WebKit.vcproj/WebKit.sln
@@ -648,6 +648,42 @@ Global
{5AE5F5E4-782D-4F63-B4D7-3977B52B9950}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32
{5AE5F5E4-782D-4F63-B4D7-3977B52B9950}.Release|Win32.ActiveCfg = Release|Win32
{5AE5F5E4-782D-4F63-B4D7-3977B52B9950}.Release|Win32.Build.0 = Release|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Debug_All|Win32.Build.0 = Debug_All|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Debug_Cairo_CFLite|Win32.Build.0 = Debug_Cairo_CFLite|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Debug|Win32.ActiveCfg = Debug|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Debug|Win32.Build.0 = Debug|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Production|Win32.ActiveCfg = Production|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Production|Win32.Build.0 = Production|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Release_Cairo_CFLite|Win32.ActiveCfg = Release_Cairo_CFLite|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Release|Win32.ActiveCfg = Release|Win32
+ {877150A0-41B3-4730-9D98-1B8298098B14}.Release|Win32.Build.0 = Release|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Debug_All|Win32.Build.0 = Debug_All|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Debug_Cairo_CFLite|Win32.Build.0 = Debug_Cairo_CFLite|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Debug|Win32.Build.0 = Debug|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Production|Win32.ActiveCfg = Production|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Production|Win32.Build.0 = Production|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Release_Cairo_CFLite|Win32.ActiveCfg = Release_Cairo_CFLite|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Release|Win32.ActiveCfg = Release|Win32
+ {D595E3F6-24F2-4C60-935C-95D50C6B3E96}.Release|Win32.Build.0 = Release|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Debug_All|Win32.Build.0 = Debug_All|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Debug_Cairo_CFLite|Win32.Build.0 = Debug_Cairo_CFLite|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Debug|Win32.Build.0 = Debug|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Production|Win32.ActiveCfg = Production|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Production|Win32.Build.0 = Production|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Release_Cairo_CFLite|Win32.ActiveCfg = Release_Cairo_CFLite|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Release|Win32.ActiveCfg = Release|Win32
+ {9221744B-5715-4F56-9590-42F7AB23DD8B}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -665,6 +701,8 @@ Global
{0A324352-B3B6-496C-9E5B-4C7E923E628B} = {63FB6F8A-C601-43E3-BD16-A00A465C2CB6}
{E498CA9D-3BD2-4D52-8E37-C8DC76526325} = {63FB6F8A-C601-43E3-BD16-A00A465C2CB6}
{83414B15-1C0D-490B-990E-03F4D49170E4} = {63FB6F8A-C601-43E3-BD16-A00A465C2CB6}
+ {AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {A671AE22-FBCE-4C41-A723-82939FCA3E92}
+ {5AE5F5E4-782D-4F63-B4D7-3977B52B9950} = {A671AE22-FBCE-4C41-A723-82939FCA3E92}
{2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD} = {9AB9C96C-9039-4FA9-8F83-BBFC8F8B2182}
{2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB} = {9AB9C96C-9039-4FA9-8F83-BBFC8F8B2182}
{AAE88FEF-509E-4D49-870B-7357922C276F} = {9AB9C96C-9039-4FA9-8F83-BBFC8F8B2182}
@@ -690,7 +728,5 @@ Global
{DD7949B6-F2B4-47C2-9C42-E21E84CB1017} = {62DCDFE4-EAD2-48E1-A2BD-BD54AD3C7459}
{2974EA02-840B-4995-8719-8920A61006F1} = {62DCDFE4-EAD2-48E1-A2BD-BD54AD3C7459}
{C13FA6EF-B531-4BAD-9A23-18E2BEB8B040} = {62DCDFE4-EAD2-48E1-A2BD-BD54AD3C7459}
- {AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {A671AE22-FBCE-4C41-A723-82939FCA3E92}
- {5AE5F5E4-782D-4F63-B4D7-3977B52B9950} = {A671AE22-FBCE-4C41-A723-82939FCA3E92}
EndGlobalSection
EndGlobal
diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp
index d454c9882..6b1bade4a 100644
--- a/Source/WebKit/win/WebView.cpp
+++ b/Source/WebKit/win/WebView.cpp
@@ -6175,10 +6175,9 @@ HRESULT WebView::setMemoryCacheDelegateCallsEnabled(BOOL enabled)
return S_OK;
}
-HRESULT WebView::setJavaScriptURLsAreAllowed(BOOL areAllowed)
+HRESULT WebView::setJavaScriptURLsAreAllowed(BOOL)
{
- m_page->setJavaScriptURLsAreAllowed(areAllowed);
- return S_OK;
+ return E_NOTIMPL;
}
HRESULT WebView::setCanStartPlugins(BOOL canStartPlugins)
diff --git a/Source/WebKit/wx/ChangeLog b/Source/WebKit/wx/ChangeLog
index 2f2ba758b..e9eaf1319 100644
--- a/Source/WebKit/wx/ChangeLog
+++ b/Source/WebKit/wx/ChangeLog
@@ -1,3 +1,13 @@
+2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page
+ https://bugs.webkit.org/show_bug.cgi?id=98514
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage):
+
2012-09-25 Beth Dakin <bdakin@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=95397
diff --git a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index f6ba4dde4..dcd912502 100644
--- a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -976,7 +976,7 @@ void FrameLoaderClientWx::transitionToCommittedForNewPage()
Color backgroundColor = transparent ? WebCore::Color::transparent : WebCore::Color::white;
if (m_frame)
- m_frame->createView(size, backgroundColor, transparent, IntSize(), false);
+ m_frame->createView(size, backgroundColor, transparent);
}
void FrameLoaderClientWx::didSaveToPageCache()
diff --git a/Source/WebKit2/CMakeLists.txt b/Source/WebKit2/CMakeLists.txt
index 0c2d01604..235af260c 100644
--- a/Source/WebKit2/CMakeLists.txt
+++ b/Source/WebKit2/CMakeLists.txt
@@ -6,6 +6,7 @@ SET(WebKit2_INCLUDE_DIRECTORIES
"${WEBKIT2_DIR}/Shared"
"${WEBKIT2_DIR}/Shared/API"
"${WEBKIT2_DIR}/Shared/API/c"
+ "${WEBKIT2_DIR}/Shared/CoordinatedGraphics"
"${WEBKIT2_DIR}/Shared/CoreIPCSupport"
"${WEBKIT2_DIR}/Shared/Plugins"
"${WEBKIT2_DIR}/Shared/Plugins/Netscape"
@@ -135,6 +136,7 @@ SET(WebKit2_SOURCES
Shared/APIClientTraits.cpp
Shared/APIObject.cpp
Shared/ChildProcess.cpp
+ Shared/ConnectionStack.cpp
Shared/DictionaryPopupInfo.cpp
Shared/EditorState.cpp
Shared/FontInfo.cpp
@@ -214,6 +216,8 @@ SET(WebKit2_SOURCES
Shared/API/c/WKURLResponse.cpp
Shared/API/c/WKUserContentURLPattern.cpp
+ Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp
+
Shared/Plugins/NPIdentifierData.cpp
Shared/Plugins/NPObjectMessageReceiver.cpp
Shared/Plugins/NPObjectProxy.cpp
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index f8398f3af..e34143e69 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,1750 @@
+2012-10-22 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] Fix build without QtWidgets
+ https://bugs.webkit.org/show_bug.cgi?id=99981
+
+ Reviewed by Tor Arne Vestbø.
+
+ Make it possible to compile WebProcess without QtWidgets by instantiating a
+ QGuiApplication instead of a QApplication if we're built without widgets.
+
+ * WebProcess.pro:
+ * qt/MainQt.cpp:
+ (main):
+
+2012-10-22 Ryuan Choi <ryuan.choi@gmail.com>
+
+ [EFL] pc files should use DATA_INSTALL_DIR for datadir
+ https://bugs.webkit.org/show_bug.cgi?id=99961
+
+ Reviewed by Gyuyoung Kim.
+
+ * ewebkit.pc.in: Fixed wrong datadir
+
+2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page
+ https://bugs.webkit.org/show_bug.cgi?id=98514
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Use FrameView::fixedVisibleContentRect
+ instead of WebFrame::visibleContentBounds as the source to always keep the correct state.
+
+2012-10-22 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: merge "docked" state into the "dock side" enum.
+ https://bugs.webkit.org/show_bug.cgi?id=99717
+
+ Reviewed by Vsevolod Vlasov.
+
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
+2012-10-21 Milian Wolff <milian.wolff@kdab.com>
+
+ [Qt] QNX build fails when building against Qt without clipboard support
+ https://bugs.webkit.org/show_bug.cgi?id=98040
+
+ Reviewed by Simon Hausmann.
+
+ Gracefully handle QT_NO_CLIPBOARD and do not try to access qApp->clipboard()
+ in such cases. Instead, return false to indicate global selection is unsupported.
+
+ * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+ (WebKit::WebEditorClient::supportsGlobalSelection):
+
+2012-10-21 Hyungchan Kim <hyungchan2.kim@lge.com>
+
+ Add a separate flag for rgb swizzling whether it can be modified or not
+ https://bugs.webkit.org/show_bug.cgi?id=98728
+
+ BitmapTexture swizzles the source image if the OpenGL driver
+ doesn't support the BGRA extension.
+ In case of directly composited images, the source image should not
+ be modified.
+
+ http://www.satine.org/research/webkit/snowleopard/snowstack.html
+
+ Reviewed by Noam Rosenthal.
+
+ No new tests as this is only testable on specific hardware and
+ currently not avaiable in the bots.
+
+ * platform/graphics/texmap/TextureMapper.h:
+ (BitmapTexture):
+ * platform/graphics/texmap/TextureMapperBackingStore.cpp:
+ (WebCore::TextureMapperTile::updateContents):
+ (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
+ (WebCore::TextureMapperTiledBackingStore::updateContents):
+ * platform/graphics/texmap/TextureMapperBackingStore.h:
+ (TextureMapperTile):
+ (TextureMapperTiledBackingStore):
+ (WebCore::TextureMapperTiledBackingStore::updateContents):
+ * platform/graphics/texmap/TextureMapperGL.cpp:
+ (WebCore::TextureMapperGL::drawRepaintCounter):
+ (WebCore::BitmapTextureGL::updateContents):
+ * platform/graphics/texmap/TextureMapperGL.h:
+ (BitmapTextureGL):
+ * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
+ (WebCore::BitmapTextureImageBuffer::updateContents):
+ * platform/graphics/texmap/TextureMapperImageBuffer.h:
+ (BitmapTextureImageBuffer):
+ * platform/graphics/texmap/TextureMapperLayer.cpp:
+ (WebCore::TextureMapperLayer::updateBackingStore):
+
+2012-10-21 Seokju Kwon <seokju.kwon@samsung.com>
+
+ [EFL] Fix failure to access the inspector resources
+ https://bugs.webkit.org/show_bug.cgi?id=99816
+
+ Reviewed by Gyuyoung Kim.
+
+ access() returns -1, if path has a file protocol like "file://".
+ And I have removed it from the first argument of access().
+ If not, inspectorBaseURL() or inspectorFilesPath() always returns WEB_INSPECTOR_DIR.
+ Then all layout test related to inspector can fail after installing webkit package.
+
+ * UIProcess/efl/WebInspectorProxyEfl.cpp:
+ (WebKit::WebInspectorProxy::inspectorBaseURL):
+
+2012-10-21 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Make Ewk_Error, Ewk_Resource and Ewk_Popup_Menu_Item members private
+ https://bugs.webkit.org/show_bug.cgi?id=99931
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make Ewk_Error, Ewk_Resource and Ewk_Popup_Menu_Item class
+ members private.
+
+ * UIProcess/API/efl/ewk_error.cpp:
+ (Ewk_Error::Ewk_Error):
+ (Ewk_Error::url):
+ (Ewk_Error::description):
+ (Ewk_Error::domain):
+ (Ewk_Error::errorCode):
+ (Ewk_Error::isCancellation):
+ (ewk_error_type_get):
+ (ewk_error_url_get):
+ (ewk_error_code_get):
+ (ewk_error_description_get):
+ (ewk_error_cancellation_get):
+ * UIProcess/API/efl/ewk_error_private.h:
+ (Ewk_Error):
+ * UIProcess/API/efl/ewk_popup_menu_item.cpp:
+ (Ewk_Popup_Menu_Item::Ewk_Popup_Menu_Item):
+ (Ewk_Popup_Menu_Item::type):
+ (Ewk_Popup_Menu_Item::textDirection):
+ (Ewk_Popup_Menu_Item::text):
+ (Ewk_Popup_Menu_Item::tooltipText):
+ (Ewk_Popup_Menu_Item::accessibilityText):
+ (Ewk_Popup_Menu_Item::hasTextDirectionOverride):
+ (Ewk_Popup_Menu_Item::isEnabled):
+ (Ewk_Popup_Menu_Item::isLabel):
+ (Ewk_Popup_Menu_Item::isSelected):
+ (ewk_popup_menu_item_type_get):
+ (ewk_popup_menu_item_text_get):
+ (ewk_popup_menu_item_text_direction_get):
+ (ewk_popup_menu_item_text_direction_override_get):
+ (ewk_popup_menu_item_tooltip_get):
+ (ewk_popup_menu_item_accessibility_text_get):
+ (ewk_popup_menu_item_enabled_get):
+ (ewk_popup_menu_item_is_label_get):
+ (ewk_popup_menu_item_selected_get):
+ * UIProcess/API/efl/ewk_popup_menu_item_private.h:
+ (Ewk_Popup_Menu_Item):
+ * UIProcess/API/efl/ewk_resource.cpp:
+ (Ewk_Resource::Ewk_Resource):
+ (Ewk_Resource::url):
+ (Ewk_Resource::isMainResource):
+ (ewk_resource_url_get):
+ (ewk_resource_main_resource_get):
+ * UIProcess/API/efl/ewk_resource_private.h:
+ (Ewk_Resource):
+
+2012-10-21 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Make Ewk_Url_Request, Ewk_Url_Response and Ewk_Url_Scheme_Request members private
+ https://bugs.webkit.org/show_bug.cgi?id=99936
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make wk_Url_Request, Ewk_Url_Response and Ewk_Url_Scheme_Request
+ class members private.
+
+ * UIProcess/API/efl/ewk_context.cpp:
+ (ewk_context_url_scheme_request_received):
+ * UIProcess/API/efl/ewk_download_job.cpp:
+ (Ewk_Download_Job::estimatedProgress):
+ * UIProcess/API/efl/ewk_url_request.cpp:
+ (Ewk_Url_Request::Ewk_Url_Request):
+ (Ewk_Url_Request::url):
+ (Ewk_Url_Request::firstParty):
+ (Ewk_Url_Request::httpMethod):
+ (ewk_url_request_url_get):
+ (ewk_request_cookies_first_party_get):
+ (ewk_url_request_http_method_get):
+ * UIProcess/API/efl/ewk_url_request_private.h:
+ (Ewk_Url_Request):
+ * UIProcess/API/efl/ewk_url_response.cpp:
+ (Ewk_Url_Response::Ewk_Url_Response):
+ (Ewk_Url_Response::httpStatusCode):
+ (Ewk_Url_Response::url):
+ (Ewk_Url_Response::mimeType):
+ (Ewk_Url_Response::contentLength):
+ (ewk_url_response_url_get):
+ (ewk_url_response_status_code_get):
+ (ewk_url_response_mime_type_get):
+ (ewk_url_response_content_length_get):
+ * UIProcess/API/efl/ewk_url_response_private.h:
+ (Ewk_Url_Response):
+ * UIProcess/API/efl/ewk_url_scheme_request.cpp:
+ (Ewk_Url_Scheme_Request::Ewk_Url_Scheme_Request):
+ (Ewk_Url_Scheme_Request::id):
+ (Ewk_Url_Scheme_Request::url):
+ (Ewk_Url_Scheme_Request::scheme):
+ (Ewk_Url_Scheme_Request::path):
+ (Ewk_Url_Scheme_Request::finish):
+ (ewk_url_scheme_request_scheme_get):
+ (ewk_url_scheme_request_url_get):
+ (ewk_url_scheme_request_path_get):
+ (ewk_url_scheme_request_finish):
+ * UIProcess/API/efl/ewk_url_scheme_request.h: Fix ewk_url_scheme_request_finish() declaration
+ so that the request argument is no longer marked as const and so that the content type is of
+ type uint64_t instead of unsigned int.
+ * UIProcess/API/efl/ewk_url_scheme_request_private.h:
+ (Ewk_Url_Scheme_Request):
+
+2012-10-21 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Make Ewk_Form_Submission_Request, Ewk_Navigation_Data and Ewk_Navigation_Policy_Decision members private
+ https://bugs.webkit.org/show_bug.cgi?id=99934
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make Ewk_Form_Submission_Request, Ewk_Navigation_Data and
+ Ewk_Navigation_Policy_Decision class members private.
+
+ * UIProcess/API/efl/ewk_form_submission_request.cpp:
+ (Ewk_Form_Submission_Request::Ewk_Form_Submission_Request):
+ (Ewk_Form_Submission_Request::~Ewk_Form_Submission_Request):
+ (Ewk_Form_Submission_Request::fieldValue):
+ (Ewk_Form_Submission_Request::fieldNames):
+ (Ewk_Form_Submission_Request::submit):
+ (ewk_form_submission_request_field_names_get):
+ (ewk_form_submission_request_field_value_get):
+ (ewk_form_submission_request_submit):
+ * UIProcess/API/efl/ewk_form_submission_request_private.h:
+ (Ewk_Form_Submission_Request):
+ * UIProcess/API/efl/ewk_navigation_data.cpp:
+ (Ewk_Navigation_Data::Ewk_Navigation_Data):
+ (Ewk_Navigation_Data::originalRequest):
+ (Ewk_Navigation_Data::title):
+ (Ewk_Navigation_Data::url):
+ (ewk_navigation_data_title_get):
+ (ewk_navigation_data_original_request_get):
+ (ewk_navigation_data_url_get):
+ * UIProcess/API/efl/ewk_navigation_data_private.h:
+ (Ewk_Navigation_Data):
+ * UIProcess/API/efl/ewk_navigation_policy_decision.cpp:
+ (Ewk_Navigation_Policy_Decision::Ewk_Navigation_Policy_Decision):
+ (Ewk_Navigation_Policy_Decision::~Ewk_Navigation_Policy_Decision):
+ (Ewk_Navigation_Policy_Decision::navigationType):
+ (Ewk_Navigation_Policy_Decision::mouseButton):
+ (Ewk_Navigation_Policy_Decision::modifiers):
+ (Ewk_Navigation_Policy_Decision::frameName):
+ (Ewk_Navigation_Policy_Decision::request):
+ (Ewk_Navigation_Policy_Decision::accept):
+ (Ewk_Navigation_Policy_Decision::reject):
+ (Ewk_Navigation_Policy_Decision::download):
+ (ewk_navigation_policy_navigation_type_get):
+ (ewk_navigation_policy_mouse_button_get):
+ (ewk_navigation_policy_modifiers_get):
+ (ewk_navigation_policy_frame_name_get):
+ (ewk_navigation_policy_request_get):
+ (ewk_navigation_policy_decision_accept):
+ (ewk_navigation_policy_decision_reject):
+ (ewk_navigation_policy_decision_download):
+ * UIProcess/API/efl/ewk_navigation_policy_decision_private.h:
+ (Ewk_Navigation_Policy_Decision):
+
+2012-10-21 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Make Ewk_Favicon_Database members private
+ https://bugs.webkit.org/show_bug.cgi?id=99932
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make Ewk_Favicon_Database class members private.
+
+ * UIProcess/API/efl/ewk_favicon_database.cpp:
+ (Ewk_Favicon_Database::Ewk_Favicon_Database):
+ (Ewk_Favicon_Database::iconURLForPageURL):
+ (Ewk_Favicon_Database::watchChanges):
+ (Ewk_Favicon_Database::unwatchChanges):
+ (AsyncIconRequestResponse):
+ (AsyncIconRequestResponse::AsyncIconRequestResponse):
+ (respond_icon_request_idle):
+ (Ewk_Favicon_Database::iconForPageURL):
+ (Ewk_Favicon_Database::didChangeIconForPageURL):
+ (Ewk_Favicon_Database::getIconSurfaceSynchronously):
+ (Ewk_Favicon_Database::iconDataReadyForPageURL):
+ (ewk_favicon_database_icon_url_get):
+ (ewk_favicon_database_async_icon_get):
+ (ewk_favicon_database_icon_change_callback_add):
+ (ewk_favicon_database_icon_change_callback_del):
+ * UIProcess/API/efl/ewk_favicon_database.h:
+ * UIProcess/API/efl/ewk_favicon_database_private.h:
+ (Ewk_Favicon_Database):
+ * UIProcess/API/efl/ewk_view.cpp:
+ (Ewk_View_Private_Data::~Ewk_View_Private_Data):
+ (_ewk_view_initialize):
+
+2012-10-21 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Make Ewk back / forward list classes members private and remove private C functions
+ https://bugs.webkit.org/show_bug.cgi?id=99929
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make Ewk_Back_Forward_List and Ewk_Back_Forward_List_Item members
+ private and remove private C functions.
+
+ * UIProcess/API/efl/ewk_back_forward_list.cpp:
+ (Ewk_Back_Forward_List::Ewk_Back_Forward_List):
+ (Ewk_Back_Forward_List::nextItem):
+ (Ewk_Back_Forward_List::previousItem):
+ (Ewk_Back_Forward_List::currentItem):
+ (Ewk_Back_Forward_List::itemAt):
+ (Ewk_Back_Forward_List::size):
+ (Ewk_Back_Forward_List::backList):
+ (Ewk_Back_Forward_List::forwardList):
+ (Ewk_Back_Forward_List::getFromCacheOrCreate):
+ (Ewk_Back_Forward_List::createEinaList):
+ (Ewk_Back_Forward_List::update):
+ (ewk_back_forward_list_current_item_get):
+ (ewk_back_forward_list_previous_item_get):
+ (ewk_back_forward_list_next_item_get):
+ (ewk_back_forward_list_item_at_index_get):
+ (ewk_back_forward_list_count):
+ (ewk_back_forward_list_n_back_items_copy):
+ (ewk_back_forward_list_n_forward_items_copy):
+ * UIProcess/API/efl/ewk_back_forward_list_item.cpp:
+ (Ewk_Back_Forward_List_Item::Ewk_Back_Forward_List_Item):
+ (Ewk_Back_Forward_List_Item::url):
+ (Ewk_Back_Forward_List_Item::title):
+ (Ewk_Back_Forward_List_Item::originalURL):
+ (ewk_back_forward_list_item_url_get):
+ (ewk_back_forward_list_item_title_get):
+ (ewk_back_forward_list_item_original_url_get):
+ * UIProcess/API/efl/ewk_back_forward_list_item_private.h:
+ (Ewk_Back_Forward_List_Item):
+ * UIProcess/API/efl/ewk_back_forward_list_private.h:
+ (Ewk_Back_Forward_List):
+ * UIProcess/API/efl/ewk_view_loader_client.cpp:
+ (didChangeBackForwardList):
+
+2012-10-21 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Make Ewk_Cookie_Manager members private
+ https://bugs.webkit.org/show_bug.cgi?id=99930
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make Ewk_Cookie_Manager class members private.
+
+ * UIProcess/API/efl/ewk_cookie_manager.cpp:
+ (Ewk_Cookie_Manager::Ewk_Cookie_Manager):
+ (Ewk_Cookie_Manager::~Ewk_Cookie_Manager):
+ (Ewk_Cookie_Manager::setPersistentStorage):
+ (Ewk_Cookie_Manager::setHTTPAcceptPolicy):
+ (Ewk_Cookie_Manager::clearHostnameCookies):
+ (Ewk_Cookie_Manager::clearAllCookies):
+ (Ewk_Cookie_Manager::watchChanges):
+ (Ewk_Cookie_Manager::isWatchingForChanges):
+ (Ewk_Cookie_Manager::getHostNamesWithCookies):
+ (Ewk_Cookie_Manager::getHTTPAcceptPolicy):
+ (Ewk_Cookie_Manager::cookiesDidChange):
+ (ewk_cookie_manager_persistent_storage_set):
+ (ewk_cookie_manager_accept_policy_set):
+ (Get_Policy_Async_Data):
+ (Get_Policy_Async_Data::Get_Policy_Async_Data):
+ (ewk_cookie_manager_async_accept_policy_get):
+ (Get_Hostnames_Async_Data):
+ (Get_Hostnames_Async_Data::Get_Hostnames_Async_Data):
+ (ewk_cookie_manager_async_hostnames_with_cookies_get):
+ (ewk_cookie_manager_hostname_cookies_clear):
+ (ewk_cookie_manager_cookies_clear):
+ (ewk_cookie_manager_changes_watch):
+ * UIProcess/API/efl/ewk_cookie_manager_private.h:
+ (Ewk_Cookie_Manager):
+
+2012-10-21 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Make Ewk intent classes members private
+ https://bugs.webkit.org/show_bug.cgi?id=99832
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make Ewk_Intent and Ewk_Intent_Service members
+ private and add class methods to get them.
+
+ * UIProcess/API/efl/ewk_intent.cpp:
+ (Ewk_Intent::Ewk_Intent):
+ (Ewk_Intent::webIntentData):
+ (Ewk_Intent::action):
+ (Ewk_Intent::type):
+ (Ewk_Intent::service):
+ (Ewk_Intent::suggestions):
+ (Ewk_Intent::extra):
+ (Ewk_Intent::extraKeys):
+ (ewk_intent_action_get):
+ (ewk_intent_type_get):
+ (ewk_intent_service_get):
+ (ewk_intent_suggestions_get):
+ (ewk_intent_extra_get):
+ (ewk_intent_extra_names_get):
+ * UIProcess/API/efl/ewk_intent_private.h:
+ (WebKit):
+ (Ewk_Intent):
+ * UIProcess/API/efl/ewk_intent_service.cpp:
+ (Ewk_Intent_Service::Ewk_Intent_Service):
+ (Ewk_Intent_Service::action):
+ (Ewk_Intent_Service::type):
+ (Ewk_Intent_Service::href):
+ (Ewk_Intent_Service::title):
+ (Ewk_Intent_Service::disposition):
+ (ewk_intent_service_action_get):
+ (ewk_intent_service_type_get):
+ (ewk_intent_service_href_get):
+ (ewk_intent_service_title_get):
+ (ewk_intent_service_disposition_get):
+ * UIProcess/API/efl/ewk_intent_service_private.h:
+ (Ewk_Intent_Service):
+ * UIProcess/API/efl/ewk_view.cpp:
+ (ewk_view_intent_deliver):
+
+2012-10-21 Christophe Dumez <christophe.dumez@intel.com>
+
+ [EFL][WK2] Make Ewk_Download_Job members private and remove private C functions
+ https://bugs.webkit.org/show_bug.cgi?id=99697
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make Ewk_Download_Job private and replace private C functions
+ by class methods. New methods were also added to match the
+ public C API.
+
+ * UIProcess/API/efl/ewk_context.cpp:
+ (ewk_context_download_job_add):
+ * UIProcess/API/efl/ewk_context_download_client.cpp:
+ (decideDestinationWithSuggestedFilename):
+ (didReceiveResponse):
+ (didCreateDestination):
+ (didReceiveData):
+ (didFail):
+ (didCancel):
+ (didFinish):
+ * UIProcess/API/efl/ewk_download_job.cpp:
+ (Ewk_Download_Job::Ewk_Download_Job):
+ (Ewk_Download_Job::id):
+ (Ewk_Download_Job::view):
+ (ewk_download_job_state_get):
+ (Ewk_Download_Job::state):
+ (ewk_download_job_request_get):
+ (Ewk_Download_Job::request):
+ (ewk_download_job_response_get):
+ (Ewk_Download_Job::response):
+ (ewk_download_job_destination_get):
+ (Ewk_Download_Job::destination):
+ (ewk_download_job_destination_set):
+ (Ewk_Download_Job::setDestination):
+ (ewk_download_job_suggested_filename_get):
+ (Ewk_Download_Job::suggestedFileName):
+ (ewk_download_job_cancel):
+ (Ewk_Download_Job::cancel):
+ (ewk_download_job_estimated_progress_get):
+ (Ewk_Download_Job::estimatedProgress):
+ (ewk_download_job_elapsed_time_get):
+ (Ewk_Download_Job::elapsedTime):
+ (Ewk_Download_Job::setResponse):
+ (Ewk_Download_Job::setSuggestedFileName):
+ (Ewk_Download_Job::incrementReceivedData):
+ (Ewk_Download_Job::setState):
+ * UIProcess/API/efl/ewk_download_job.h:
+ * UIProcess/API/efl/ewk_download_job_private.h:
+ (Ewk_Download_Job):
+
+2012-10-19 Anders Carlsson <andersca@apple.com>
+
+ Remove ::encode template specializations and just use overloads
+ https://bugs.webkit.org/show_bug.cgi?id=99865
+
+ Reviewed by Andreas Kling.
+
+ Get rid of the various encode functions and just use overloading instead.
+
+ * Platform/CoreIPC/ArgumentCoders.cpp:
+ (CoreIPC::::encode):
+ * Platform/CoreIPC/ArgumentCoders.h:
+ * Platform/CoreIPC/ArgumentEncoder.cpp:
+ (CoreIPC::ArgumentEncoder::encodeVariableLengthByteArray):
+ (CoreIPC::ArgumentEncoder::encode):
+ * Platform/CoreIPC/ArgumentEncoder.h:
+ (ArgumentEncoder):
+ (CoreIPC::ArgumentEncoder::encodeEnum):
+ * Platform/CoreIPC/win/ConnectionWin.cpp:
+ (CoreIPC::Connection::sendOutgoingMessage):
+ * Platform/mac/SharedMemoryMac.cpp:
+ (WebKit::SharedMemory::Handle::encode):
+ * Platform/win/SharedMemoryWin.cpp:
+ (WebKit::SharedMemory::Handle::encode):
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
+ (CoreIPC::::encode):
+ * Shared/DictionaryPopupInfo.cpp:
+ (WebKit::DictionaryPopupInfo::encode):
+ * Shared/Plugins/NPIdentifierData.cpp:
+ (WebKit::NPIdentifierData::encode):
+ (WebKit::NPIdentifierData::decode):
+ * Shared/UserMessageCoders.h:
+ (WebKit::UserMessageEncoder::baseEncode):
+ * Shared/WebCoreArgumentCoders.cpp:
+ (CoreIPC::::encode):
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode):
+ * Shared/cf/ArgumentCodersCF.cpp:
+ (CoreIPC::encode):
+ * Shared/mac/ArgumentCodersMac.mm:
+ (CoreIPC::encode):
+ * Shared/mac/KeychainAttribute.cpp:
+ (CoreIPC::encode):
+ * Shared/mac/PlatformCertificateInfo.mm:
+ (WebKit::PlatformCertificateInfo::encode):
+ * Shared/mac/SandboxExtensionMac.mm:
+ (WebKit::SandboxExtension::HandleArray::encode):
+ * Shared/mac/SecItemRequestData.cpp:
+ (WebKit::SecItemRequestData::encode):
+ * Shared/mac/SecItemResponseData.cpp:
+ (WebKit::SecItemResponseData::encode):
+ * Shared/mac/SecKeychainItemRequestData.cpp:
+ (WebKit::SecKeychainItemRequestData::encode):
+ * Shared/mac/SecKeychainItemResponseData.cpp:
+ (WebKit::SecKeychainItemResponseData::encode):
+ * Shared/qt/ArgumentCodersQt.cpp:
+ (CoreIPC::::encode):
+ * Shared/qt/QtNetworkReplyData.cpp:
+ (WebKit::QtNetworkReplyData::encode):
+ * Shared/soup/PlatformCertificateInfo.cpp:
+ (WebKit::PlatformCertificateInfo::encode):
+ * Shared/win/LayerTreeContextWin.cpp:
+ (WebKit::LayerTreeContext::encode):
+ * Shared/win/PlatformCertificateInfo.cpp:
+ (WebKit::PlatformCertificateInfo::encode):
+ * Shared/win/WindowGeometry.cpp:
+ (WebKit::WindowGeometry::encode):
+ * WebProcess/WebPage/EncoderAdapter.cpp:
+ (WebKit::EncoderAdapter::encodeBool):
+ (WebKit::EncoderAdapter::encodeUInt16):
+ (WebKit::EncoderAdapter::encodeUInt32):
+ (WebKit::EncoderAdapter::encodeUInt64):
+ (WebKit::EncoderAdapter::encodeInt32):
+ (WebKit::EncoderAdapter::encodeInt64):
+ (WebKit::EncoderAdapter::encodeFloat):
+ (WebKit::EncoderAdapter::encodeDouble):
+ (WebKit::EncoderAdapter::encodeString):
+
+2012-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Fix compile warning.
+
+ * UIProcess/API/gtk/tests/GNUmakefile.am: Pass sourcedir to
+ glib-compile-resource when generating dependencies too.
+
+2012-10-19 Seokju Kwon <seokju.kwon@samsung.com>
+
+ [EFL][WK2] Change the title of inspector window when inspected page is changed
+ https://bugs.webkit.org/show_bug.cgi?id=99684
+
+ Reviewed by Gyuyoung Kim.
+
+ Implement platformInspectedURLChanged() to change the title of inspector window
+ when inspected page is changed.
+
+ * UIProcess/efl/WebInspectorProxyEfl.cpp:
+ (WebKit::WebInspectorProxy::platformInspectedURLChanged):
+
+2012-10-19 Dan Bernstein <mitz@apple.com>
+
+ Add bundle API for hit-testing
+ https://bugs.webkit.org/show_bug.cgi?id=99907
+
+ Reviewed by Sam Weinig.
+
+ Test: TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp
+
+ * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+ (WKBundleFrameCreateHitTestResult): Added this wrapper.
+ * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::hitTest): Added. Hit tests at the given point, ignoring clipping.
+ * WebProcess/WebPage/WebFrame.h:
+ (WebFrame): Declared hitTest.
+
+2012-10-19 Jinwoo Song <jinwoo7.song@samsung.com>
+
+ [EFL][WK2] Add API unit tests for scaling
+ https://bugs.webkit.org/show_bug.cgi?id=99451
+
+ Reviewed by Gyuyoung Kim.
+
+ Add API unit test for ewk_view_scale_set()/get() APIs.
+
+ * UIProcess/API/efl/tests/test_ewk2_view.cpp:
+ (TEST_F):
+
+2012-10-19 KyungTae Kim <ktf.kim@samsung.com>
+
+ [WK2][EFL] Modify ewk_view_scale_set to public API
+ https://bugs.webkit.org/show_bug.cgi?id=99902
+
+ Reviewed by Gyuyoung Kim.
+
+ Modify ewk_view_scale_set to public API.
+
+ * UIProcess/API/efl/ewk_view.h:
+
+2012-10-19 Andreas Kling <kling@webkit.org>
+
+ Race condition in WebProcessProxy::handleGetPlugins().
+ <http://webkit.org/b/99903>
+ <rdar://problem/12541471>
+
+ Reviewed by Anders Carlsson.
+
+ Scope the Vector<PluginModuleInfo> so that all the destructors are guaranteed
+ to have run when sendDidGetPlugins() executes on the main thread.
+
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::handleGetPlugins):
+
+2012-10-19 Brady Eidson <beidson@apple.com>
+
+ WebProcess should only connect to the NetworkProcess if NetworkProcess is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=99885
+
+ Reviewed by Alexey Proskuryakov.
+
+ WebContext should tell each WebProcess it creates whether NetworkProcess use is enabled.
+
+ Add a WebProcess initialization flag for whether or not NetworkProcess use is enabled:
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
+ (WebKit::WebProcessCreationParameters::encode):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h:
+ (WebProcessCreationParameters):
+
+ Include that info in the initialization parameters:
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::createNewWebProcess):
+
+ Store whether or not NetworkProcess use is enabled, and only connect to the NetworkProcess if appropriate:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::WebProcess):
+ (WebKit::WebProcess::initializeWebProcess):
+ (WebKit::WebProcess::ensureNetworkProcessConnection):
+ * WebProcess/WebProcess.h:
+
+2012-10-19 Brady Eidson <beidson@apple.com>
+
+ Add infrastructure for NetworkProcess management
+ https://bugs.webkit.org/show_bug.cgi?id=99817
+
+ Reviewed by Alexey Proskuryakov.
+
+ Add support for the WebProcess itself requesting a connection to the default NetworkProcess.
+
+ Add proper handling of crashes so any of the Web/Network/UI processes crash the others take appropriate action.
+
+ Project file stuff and general messaging changes:
+ * DerivedSources.make:
+ * Platform/CoreIPC/MessageID.h:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * Platform/CoreIPC/HandleMessage.h:
+ (CoreIPC):
+ (CoreIPC::callMemberFunction): Add some new required templates.
+
+ WebContext now does much less of this stuff:
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::createNewWebProcess):
+ * UIProcess/WebContext.h:
+ (WebContext):
+
+ UIProcess now has a process manager to handle most of this:
+ * UIProcess/Network/NetworkProcessManager.cpp:
+ (WebKit):
+ (WebKit::NetworkProcessManager::shared):
+ (WebKit::NetworkProcessManager::NetworkProcessManager):
+ (WebKit::NetworkProcessManager::getNetworkProcessConnection):
+ (WebKit::NetworkProcessManager::ensureNetworkProcess):
+ (WebKit::NetworkProcessManager::removeNetworkProcessProxy):
+ * UIProcess/Network/NetworkProcessManager.h:
+ (WebKit):
+ (NetworkProcessManager):
+
+ Flesh out the NetworkProcessProxy to handle creating these connections between Network and Web Processes:
+ * UIProcess/Network/NetworkProcessProxy.cpp:
+ (WebKit::NetworkProcessProxy::create):
+ (WebKit::NetworkProcessProxy::NetworkProcessProxy):
+ (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
+ (WebKit):
+ (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
+ (WebKit::NetworkProcessProxy::didReceiveMessage):
+ (WebKit::NetworkProcessProxy::didClose):
+ (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
+ (WebKit::NetworkProcessProxy::didFinishLaunching):
+ * UIProcess/Network/NetworkProcessProxy.h:
+ (WebKit):
+ (NetworkProcessProxy):
+ * UIProcess/Network/NetworkProcessProxy.messages.in:
+
+ Add a class representing a connection from a NetworkProcess to a particular WebProcess:
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp: Added.
+ (WebKit):
+ (WebKit::NetworkConnectionToWebProcess::create):
+ (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
+ (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
+ (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
+ (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
+ (WebKit::NetworkConnectionToWebProcess::didClose):
+ (WebKit::NetworkConnectionToWebProcess::didReceiveInvalidMessage):
+ (WebKit::NetworkConnectionToWebProcess::didReceiveNetworkConnectionToWebProcessMessage):
+ * NetworkProcess/NetworkConnectionToWebProcess.h:
+ (WebKit):
+ (NetworkConnectionToWebProcess):
+ (WebKit::NetworkConnectionToWebProcess::connection):
+ * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+
+ Add the ability for a NetworkProcess to create a connection for a different process, which is used on behalf of WebProcesses for now:
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
+ (WebKit):
+ (WebKit::NetworkProcess::didClose):
+ (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
+ * NetworkProcess/NetworkProcess.h:
+ (WebKit):
+ (NetworkProcess):
+ * NetworkProcess/NetworkProcess.messages.in:
+
+ Forward on the message that a WebProcess wants a connection to a NetworkProcess:
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit):
+ (WebKit::WebProcessProxy::getNetworkProcessConnection):
+ * UIProcess/WebProcessProxy.h:
+ (WebProcessProxy):
+ * UIProcess/WebProcessProxy.messages.in:
+
+ Add a class representing the WebProcesses connection to the NetworkProcess:
+ * WebProcess/Network/NetworkProcessConnection.cpp:
+ (WebKit):
+ (WebKit::NetworkProcessConnection::NetworkProcessConnection):
+ (WebKit::NetworkProcessConnection::~NetworkProcessConnection):
+ (WebKit::NetworkProcessConnection::didReceiveMessage):
+ (WebKit::NetworkProcessConnection::didReceiveSyncMessage):
+ (WebKit::NetworkProcessConnection::didClose):
+ (WebKit::NetworkProcessConnection::didReceiveInvalidMessage):
+ * WebProcess/Network/NetworkProcessConnection.h:
+ (WebKit):
+ (NetworkProcessConnection):
+ (WebKit::NetworkProcessConnection::create):
+ (WebKit::NetworkProcessConnection::connection):
+
+ Have the WebProcess make sure it has a connection to the NetworkProcess, even though it currently does nothing with it:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::initializeWebProcess):
+ (WebKit):
+ (WebKit::WebProcess::ensureNetworkProcessConnection):
+ (WebKit::WebProcess::networkProcessConnectionClosed):
+ (WebKit::WebProcess::networkProcessCrashed):
+ * WebProcess/WebProcess.h:
+ (WebKit):
+ (WebProcess):
+ * WebProcess/WebProcess.messages.in:
+
+2012-10-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r131931.
+ http://trac.webkit.org/changeset/131931
+ https://bugs.webkit.org/show_bug.cgi?id=99871
+
+ Broke Safari exensions (Requested by smfr on #webkit).
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Platform/CoreIPC/Connection.cpp:
+ (CoreIPC::Connection::createSyncMessageEncoder):
+ (CoreIPC::Connection::dispatchSyncMessage):
+ * Platform/CoreIPC/Connection.h:
+ (Connection):
+ (CoreIPC::Connection::deprecatedSendSync):
+ (CoreIPC::Connection::deprecatedSend):
+ * Platform/CoreIPC/MessageDecoder.cpp:
+ (CoreIPC::MessageDecoder::MessageDecoder):
+ * Platform/CoreIPC/MessageDecoder.h:
+ (MessageDecoder):
+ * Platform/CoreIPC/MessageEncoder.cpp:
+ (CoreIPC::MessageEncoder::create):
+ (CoreIPC::MessageEncoder::MessageEncoder):
+ * Platform/CoreIPC/MessageEncoder.h:
+ (MessageEncoder):
+ * Platform/CoreIPC/MessageReceiverMap.cpp:
+ (CoreIPC::MessageReceiverMap::dispatchMessage):
+ * Platform/CoreIPC/MessageReceiverMap.h:
+ (MessageReceiverMap):
+ * Platform/CoreIPC/StringReference.cpp: Removed.
+ * Platform/CoreIPC/StringReference.h: Removed.
+ * Platform/CoreIPC/mac/ConnectionMac.cpp:
+ (CoreIPC::Connection::open):
+ * Scripts/webkit2/messages.py:
+ (message_to_struct_declaration):
+ (forward_declarations_and_headers):
+ (generate_messages_header):
+ * Scripts/webkit2/messages_unittest.py:
+ * Shared/CoreIPCSupport/WebContextMessageKinds.h:
+ * Target.pri:
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::WebContext):
+ * UIProcess/WebContext.h:
+ (WebContext):
+ * UIProcess/WebProcessProxy.h:
+ (WebKit::WebProcessProxy::deprecatedSend):
+ (WebKit::WebProcessProxy::send):
+ * WebKit2.xcodeproj/project.pbxproj:
+ * win/WebKit2.vcproj:
+
+2012-10-19 Anders Carlsson <andersca@apple.com>
+
+ Don't use CStrings for message receiver names and message names
+ https://bugs.webkit.org/show_bug.cgi?id=99853
+
+ Reviewed by Andreas Kling.
+
+ Introduce StringReference which is similar to DataReference except it holds a pointer to + length of a char *
+ and can be created from a string literal. Use this in place of CString in MessageEncoder/MessageDecoder and
+ make MessageReceiverMap use a HashMap from StringReferences to MessageReceivers for global message receivers.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Platform/CoreIPC/Connection.cpp:
+ (CoreIPC::Connection::createSyncMessageEncoder):
+ (CoreIPC::Connection::dispatchSyncMessage):
+ * Platform/CoreIPC/Connection.h:
+ (Connection):
+ (CoreIPC::Connection::deprecatedSendSync):
+ (CoreIPC::Connection::deprecatedSend):
+ * Platform/CoreIPC/MessageDecoder.cpp:
+ (CoreIPC::MessageDecoder::MessageDecoder):
+ * Platform/CoreIPC/MessageDecoder.h:
+ (CoreIPC::MessageDecoder::messageReceiverName):
+ (CoreIPC::MessageDecoder::messageName):
+ (MessageDecoder):
+ * Platform/CoreIPC/MessageEncoder.cpp:
+ (CoreIPC::MessageEncoder::create):
+ (CoreIPC::MessageEncoder::MessageEncoder):
+ * Platform/CoreIPC/MessageEncoder.h:
+ (CoreIPC):
+ (MessageEncoder):
+ * Platform/CoreIPC/MessageReceiverMap.cpp:
+ (CoreIPC::MessageReceiverMap::addMessageReceiver):
+ (CoreIPC):
+ (CoreIPC::MessageReceiverMap::dispatchMessage):
+ * Platform/CoreIPC/MessageReceiverMap.h:
+ (MessageReceiverMap):
+ * Platform/CoreIPC/StringReference.cpp: Added.
+ (CoreIPC):
+ (CoreIPC::StringReference::encode):
+ (CoreIPC::StringReference::decode):
+ (CoreIPC::StringReference::Hash::hash):
+ * Platform/CoreIPC/StringReference.h: Added.
+ (CoreIPC):
+ (StringReference):
+ (CoreIPC::StringReference::StringReference):
+ (CoreIPC::StringReference::isEmpty):
+ (CoreIPC::StringReference::size):
+ (CoreIPC::StringReference::data):
+ (CoreIPC::StringReference::operator==):
+ (Hash):
+ (CoreIPC::StringReference::Hash::equal):
+ (WTF):
+ * Platform/CoreIPC/mac/ConnectionMac.cpp:
+ (CoreIPC::Connection::open):
+ * Scripts/webkit2/messages.py:
+ (message_to_struct_declaration):
+ (forward_declarations_and_headers):
+ (generate_messages_header):
+ * Scripts/webkit2/messages_unittest.py:
+ * Shared/CoreIPCSupport/WebContextMessageKinds.h:
+ * Target.pri:
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::WebContext):
+ (WebKit::WebContext::addMessageReceiver):
+ (WebKit):
+ * UIProcess/WebContext.h:
+ (WebContext):
+ * UIProcess/WebProcessProxy.h:
+ (WebKit::WebProcessProxy::deprecatedSend):
+ (WebKit::WebProcessProxy::send):
+ * WebKit2.xcodeproj/project.pbxproj:
+ * win/WebKit2.vcproj:
+
+2012-10-19 Dongwoo Joshua Im <dw.im@samsung.com>
+
+ Rename ENABLE_CSS3_TEXT_DECORATION to ENABLE_CSS3_TEXT
+ https://bugs.webkit.org/show_bug.cgi?id=99804
+
+ Reviewed by Julien Chaffraix.
+
+ CSS3 text related properties will be implemented under this flag,
+ including text decoration, text-align-last, and text-justify.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-10-19 Brady Eidson <beidson@apple.com>
+
+ REGRESSION (r131686): Crash in NSToolTipManager mouseEnteredToolTip
+ <rdar://problem/12527528> and https://bugs.webkit.org/show_bug.cgi?id=99792
+
+ Patch by Darin Adler, reviewed by Brady Eidson.
+
+ We should explicitly remove tooltips when the view moves to a new window.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView viewDidMoveToWindow]):
+
+2012-10-19 Balazs Kelemen <kbalazs@webkit.org>
+
+ [Qt][WTR] renderToOffscreenBuffer should not be set if the real render loop is active
+ https://bugs.webkit.org/show_bug.cgi?id=99831
+
+ Reviewed by Jocelyn Turcotte.
+
+ Update the comment about renderToOffscreenBuffer to better describe its role.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::setNeedsDisplay):
+
+2012-10-19 Yael Aharon <yael.aharon@intel.com>
+
+ [EFL][WK2] Rename EflViewportHandler to PageViewportControllerClientEfl
+ https://bugs.webkit.org/show_bug.cgi?id=99101
+
+ Reviewed by Gyuyoung Kim.
+
+ Rename EFlViewportHandler to PageViewportControllerClientEfl.
+ Also, make it inherit from PageViewportControllerClient. The actual implementation
+ of PageViewportControllerClient for Efl port will come in a separate patch.
+
+ * CMakeLists.txt:
+ * PlatformEfl.cmake:
+ * UIProcess/API/efl/EflViewportHandler.cpp: Removed.
+ * UIProcess/API/efl/EflViewportHandler.h: Removed.
+ * UIProcess/API/efl/PageViewportControllerClientEfl.cpp: Copied from Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp.
+ (WebKit::PageViewportControllerClientEfl::PageViewportControllerClientEfl):
+ (WebKit::PageViewportControllerClientEfl::~PageViewportControllerClientEfl):
+ (WebKit::PageViewportControllerClientEfl::drawingArea):
+ (WebKit::PageViewportControllerClientEfl::setRendererActive):
+ (WebKit::PageViewportControllerClientEfl::display):
+ (WebKit::PageViewportControllerClientEfl::updateViewportSize):
+ (WebKit::PageViewportControllerClientEfl::setVisibleContentsRect):
+ (WebKit::PageViewportControllerClientEfl::didChangeContentsSize):
+ (WebKit):
+ (WebKit::PageViewportControllerClientEfl::setViewportPosition):
+ (WebKit::PageViewportControllerClientEfl::setContentsScale):
+ (WebKit::PageViewportControllerClientEfl::didResumeContent):
+ (WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
+ (WebKit::PageViewportControllerClientEfl::didChangeViewportAttributes):
+ (WebKit::PageViewportControllerClientEfl::setController):
+ * UIProcess/API/efl/PageViewportControllerClientEfl.h: Copied from Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h.
+ (WebKit::PageViewportControllerClientEfl::create):
+ (PageViewportControllerClientEfl):
+ * UIProcess/API/efl/ewk_view.cpp:
+ (Ewk_View_Private_Data):
+ (_ewk_view_initialize):
+ (ewk_view_scale_set):
+ * UIProcess/PageViewportController.cpp:
+ * UIProcess/PageViewportController.h:
+
+2012-10-19 Csaba Osztrogonác <ossy@webkit.org>
+
+ REGRESSION(r131844): It broke the build on !ENABLE(NETSCAPE_PLUGIN_API) platforms
+ https://bugs.webkit.org/show_bug.cgi?id=99820
+
+ Reviewed by Jocelyn Turcotte.
+
+ * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
+ (WebKit::ProcessLauncher::launchProcess): Add missing ENABLE(PLUGIN_PROCESS) guard.
+ * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp: The whole file should be ENABLE(NETSCAPE_PLUGIN_API) guarded as the PluginInfoStore class.
+ (WebKit::PluginInfoStore::getPluginInfo):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::createPlugin): Eliminate the unused webPage variable (build fail with -Werror) if !(PLATFORM(MAC)||ENABLE(NETSCAPE_PLUGIN_API)).
+
+2012-10-19 Huang Dongsung <luxtella@company100.net>
+
+ Build fix after r131741 for !ENABLE(CSS_SHADERS) platforms.
+ https://bugs.webkit.org/show_bug.cgi?id=99775
+
+ Reviewed by Csaba Osztrogonác.
+
+ A class in WebKit namespace is only used when ENABLE(CSS_SHADERS), so we
+ must guard "using namespace WebKit" by ENABLE(CSS_SHADERS). Otherwise,
+ it brokes the Qt --minimal build.
+
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
+ (CoreIPC::::decode):
+
+2012-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ REGRESSION (r130640 - r130644): TestCookieManager API test is failing
+ https://bugs.webkit.org/show_bug.cgi?id=98738
+
+ Reviewed by Philippe Normand.
+
+ For some reason the order of the domains in the array has changed,
+ but it doesn't really matter, what we want to check is that both
+ cookies have been accepted and the array contains both domains.
+
+ * UIProcess/API/gtk/tests/TestCookieManager.cpp:
+ (testCookieManagerAcceptPolicy): Check that first and third party
+ domains are present in the domains array.
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ WebPageProxy::canShowMIMEType() should return false for plugins when they are disabled
+ https://bugs.webkit.org/show_bug.cgi?id=99449
+
+ Reviewed by Anders Carlsson.
+
+ * UIProcess/API/gtk/tests/GNUmakefile.am:
+ * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
+ (testWebViewCanShowMIMEType): Test that
+ webkit_web_view_can_show_mime_type() returns FALSE if plugins are
+ disabled.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::canShowMIMEType): Return false for
+ MIME-Type of plugins if they are disabled.
+
+2012-10-18 Brady Eidson <beidson@apple.com>
+
+ Move ConnectionStack out of WebProcessConnection into its own files.
+ https://bugs.webkit.org/show_bug.cgi?id=99813
+
+ Reviewed by Andreas Kling.
+
+ ConnectionStack will need to be used in a few upcoming areas, so it needs to be in its own header and implementation files.
+
+ Project file stuff:
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebKit2.xcodeproj/project.pbxproj:
+
+ Move it from here:
+ * PluginProcess/WebProcessConnection.cpp:
+ (WebKit::WebProcessConnection::setGlobalException):
+ (WebKit::WebProcessConnection::didReceiveMessage):
+ (WebKit::WebProcessConnection::didReceiveSyncMessage):
+
+ Into here:
+ * Shared/ConnectionStack.cpp: Added.
+ (WebKit):
+ (WebKit::ConnectionStack::shared):
+ * Shared/ConnectionStack.h: Added.
+ (CoreIPC):
+ (WebKit):
+ (ConnectionStack):
+ (WebKit::ConnectionStack::current):
+ (CurrentConnectionPusher):
+ (WebKit::ConnectionStack::CurrentConnectionPusher::CurrentConnectionPusher):
+ (WebKit::ConnectionStack::CurrentConnectionPusher::~CurrentConnectionPusher):
+
+2012-10-18 Eunmi Lee <eunmi15.lee@samsung.com>
+
+ [EFL][WK2] Move ewk_{init,shutdown}() to the main() function of EFL API test.
+ https://bugs.webkit.org/show_bug.cgi?id=99681
+
+ Reviewed by Gyuyoung Kim.
+
+ The ewk_{init,shutdown}() is called whenever processing the each test,
+ so tests can be failed if EFL libraries APIs are called between
+ ewk_shutdown() and next ewk_init().
+ The ewk_{init,shutdown}() should be called once per application.
+
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
+ (EWK2UnitTest::EWK2UnitTestBase::SetUp):
+ (EWK2UnitTest::EWK2UnitTestBase::TearDown):
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp:
+ (main):
+
+2012-10-18 Byungwoo Lee <bw80.lee@samsung.com>
+
+ Fix build warning.
+ https://bugs.webkit.org/show_bug.cgi?id=99788
+
+ Reviewed by Kentaro Hara.
+
+ Remove parameter name or use ASSERT_UNUSED macro for removing
+ -Wunused-parameter.
+
+ * PluginProcess/unix/PluginProcessMainUnix.cpp:
+ (WebKit::PluginProcessMainUnix):
+ * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
+ (WebKit::PluginProcessProxy::platformInitializeLaunchOptions):
+
+2012-10-18 Ryuan Choi <ryuan.choi@gmail.com>
+
+ Attempt to fix the WebKit2/Efl build after r131841.
+
+ Unreviewed build fix.
+
+ Rename addMessageReceiver to deprecatedAddMessageReceiver.
+
+ * UIProcess/WebBatteryManagerProxy.cpp:
+ (WebKit::WebBatteryManagerProxy::WebBatteryManagerProxy):
+ * UIProcess/WebNetworkInfoManagerProxy.cpp:
+ (WebKit::WebNetworkInfoManagerProxy::WebNetworkInfoManagerProxy):
+ * UIProcess/WebVibrationProxy.cpp:
+ (WebKit::WebVibrationProxy::WebVibrationProxy):
+ * UIProcess/soup/WebSoupRequestManagerProxy.cpp:
+ (WebKit::WebSoupRequestManagerProxy::WebSoupRequestManagerProxy):
+
+2012-10-18 Benjamin Poulain <bpoulain@apple.com>
+
+ [WK2] WebKit2 does not build without PLUGIN_PROCESS on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=99771
+
+ Reviewed by Anders Carlsson.
+
+ Add ENABLE(PLUGIN_PROCESS), ENABLE(SHARED_WORKER_PROCESS) and ENABLE(NETSCAPE_PLUGIN_API)
+ as needed to exclude the code with dependencies on PLUGIN_PROCESS.
+
+ * Platform/CoreIPC/MessageID.h:
+ * Shared/SharedWorkerProcessCreationParameters.cpp:
+ * Shared/SharedWorkerProcessCreationParameters.h:
+ * SharedWorkerProcess/SharedWorkerProcess.cpp:
+ * SharedWorkerProcess/SharedWorkerProcess.h:
+ * SharedWorkerProcess/SharedWorkerProcess.messages.in:
+ * SharedWorkerProcess/mac/SharedWorkerProcessMac.mm:
+ * SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm:
+ * UIProcess/API/C/WKContext.cpp:
+ (WKContextSetAdditionalPluginsDirectory):
+ (WKContextGetPluginSiteDataManager):
+ * UIProcess/API/C/WKPluginSiteDataManager.cpp:
+ (WKPluginSiteDataManagerGetTypeID):
+ (WKPluginSiteDataManagerGetSitesWithData):
+ * UIProcess/Launcher/ProcessLauncher.cpp:
+ (WebKit::ProcessLauncher::processTypeAsString):
+ (WebKit::ProcessLauncher::getProcessTypeFromString):
+ * UIProcess/Launcher/ProcessLauncher.h:
+ * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+ (WebKit::createProcess):
+ * UIProcess/Plugins/PluginInfoStore.cpp:
+ * UIProcess/Plugins/PluginInfoStore.h:
+ * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
+ * UIProcess/Plugins/WebPluginSiteDataManager.h:
+ * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
+ (WebKit::PluginInfoStore::getPluginInfo):
+ * UIProcess/SharedWorkers/SharedWorkerProcessManager.cpp:
+ * UIProcess/SharedWorkers/SharedWorkerProcessManager.h:
+ * UIProcess/SharedWorkers/SharedWorkerProcessProxy.cpp:
+ * UIProcess/SharedWorkers/SharedWorkerProcessProxy.h:
+ * UIProcess/SharedWorkers/SharedWorkerProcessProxy.messages.in:
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::WebContext):
+ (WebKit::WebContext::~WebContext):
+ (WebKit::WebContext::shouldTerminate):
+ (WebKit::WebContext::disconnectProcess):
+ (WebKit):
+ * UIProcess/WebContext.h:
+ (WebContext):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::canShowMIMEType):
+ (WebKit):
+ (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit):
+ * UIProcess/WebProcessProxy.h:
+ (WebProcessProxy):
+ * UIProcess/WebProcessProxy.messages.in:
+ * WebKit2Prefix.h:
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::createPlugin):
+ (WebKit::WebFrameLoaderClient::recreatePlugin):
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+ (WebKit::WebPlatformStrategies::WebPlatformStrategies):
+ (WebKit::WebPlatformStrategies::refreshPlugins):
+ (WebKit::WebPlatformStrategies::getPluginInfo):
+ (WebKit):
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
+ (WebPlatformStrategies):
+ (WebKit):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit):
+ (WebKit::WebPage::createPlugin):
+ (WebKit::canPluginHandleResponse):
+ * WebProcess/WebPage/WebPage.h:
+ (WebPage):
+ * WebProcess/WebProcess.cpp:
+ (WebKit):
+ * WebProcess/WebProcess.h:
+ (WebProcess):
+ * WebProcess/WebProcess.messages.in:
+
+2012-10-18 Laszlo Gombos <l.gombos@samsung.com>
+
+ [EFL] Buildfix if Netscape plugin support is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=99757
+
+ Reviewed by Gyuyoung Kim.
+
+ Guard PluginProcessMainUnix.cpp with ENABLE(PLUGIN_PROCESS).
+
+ * PluginProcess/unix/PluginProcessMainUnix.cpp:
+
+2012-10-18 Anders Carlsson <andersca@apple.com>
+
+ Deprecate the current version of MessageReceiverMap::addMessageReceiver
+ https://bugs.webkit.org/show_bug.cgi?id=99797
+
+ Reviewed by Andreas Kling.
+
+ Rename addMessageReceiver to deprecatedAddMessageReceiver in preparation for adding a new
+ version that takes a string instead.
+
+ * Platform/CoreIPC/Connection.h:
+ (CoreIPC::Connection::deprecatedAddMessageReceiver):
+ * Platform/CoreIPC/MessageReceiverMap.cpp:
+ (CoreIPC::MessageReceiverMap::deprecatedAddMessageReceiver):
+ (CoreIPC::MessageReceiverMap::invalidate):
+ (CoreIPC::MessageReceiverMap::dispatchMessage):
+ (CoreIPC::MessageReceiverMap::dispatchSyncMessage):
+ * Platform/CoreIPC/MessageReceiverMap.h:
+ (MessageReceiverMap):
+ * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
+ (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
+ * UIProcess/WebApplicationCacheManagerProxy.cpp:
+ (WebKit::WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy):
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::WebContext):
+ (WebKit::WebContext::deprecatedAddMessageReceiver):
+ * UIProcess/WebContext.h:
+ (WebContext):
+ * UIProcess/WebCookieManagerProxy.cpp:
+ (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
+ * UIProcess/WebDatabaseManagerProxy.cpp:
+ (WebKit::WebDatabaseManagerProxy::WebDatabaseManagerProxy):
+ * UIProcess/WebGeolocationManagerProxy.cpp:
+ (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
+ * UIProcess/WebIconDatabase.cpp:
+ (WebKit::WebIconDatabase::WebIconDatabase):
+ * UIProcess/WebKeyValueStorageManagerProxy.cpp:
+ (WebKit::WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy):
+ * UIProcess/WebMediaCacheManagerProxy.cpp:
+ (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
+ * UIProcess/WebResourceCacheManagerProxy.cpp:
+ (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy):
+ * WebProcess/Authentication/AuthenticationManager.cpp:
+ (WebKit::AuthenticationManager::AuthenticationManager):
+ * WebProcess/Geolocation/WebGeolocationManager.cpp:
+ (WebKit::WebGeolocationManager::registerWebPage):
+
+2012-10-18 Chris Fleizach <cfleizach@apple.com>
+
+ AX: Crashes in WebProcess at com.apple.WebCore: -[AccessibilityObjectWrapper remoteAccessibilityParentObject] + 78
+ https://bugs.webkit.org/show_bug.cgi?id=96443
+
+ Reviewed by Beth Dakin.
+
+ It appears that the crash is due to not checking whether the page object is null.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::accessibilityRemoteObject):
+
+2012-10-18 Jaehun Lim <ljaehun.lim@samsung.com>
+
+ Add support for float-valued prefernces
+ https://bugs.webkit.org/show_bug.cgi?id=99419
+
+ Reviewed by Anders Carlsson.
+
+ Support float values for preferences in WK2.
+
+ * Shared/WebPreferencesStore.cpp:
+ (WebKit::WebPreferencesStore::encode):
+ (WebKit::WebPreferencesStore::decode):
+ (WebKit):
+ (WebKit::defaultValueForKey):
+ * Shared/WebPreferencesStore.h:
+ (WebKit):
+ (WebPreferencesStore):
+ * UIProcess/WebPreferences.cpp:
+ (WebKit::WebPreferences::updateFloatValueForKey):
+ (WebKit):
+ * UIProcess/WebPreferences.h:
+ (WebPreferences):
+ * UIProcess/cf/WebPreferencesCF.cpp:
+ (WebKit::WebPreferences::platformUpdateFloatValueForKey):
+ (WebKit):
+ * UIProcess/efl/WebPreferencesEfl.cpp:
+ (WebKit::WebPreferences::platformUpdateFloatValueForKey):
+ (WebKit):
+ * UIProcess/gtk/WebPreferencesGtk.cpp:
+ (WebKit::WebPreferences::platformUpdateFloatValueForKey):
+ (WebKit):
+ * UIProcess/mac/WebPreferencesMac.mm:
+ (WebKit::WebPreferences::platformUpdateFloatValueForKey):
+ (WebKit):
+ * UIProcess/qt/WebPreferencesQt.cpp:
+ (WebKit::WebPreferences::platformUpdateFloatValueForKey):
+ (WebKit):
+
+2012-10-18 Anders Carlsson <andersca@apple.com>
+
+ Replace uses of ArgumentEncoder/ArgumentDecoder with MessageEncoder/MessageDecoder
+ https://bugs.webkit.org/show_bug.cgi?id=99746
+
+ Reviewed by Andreas Kling.
+
+ Change all occurrences of ArgumentDecoder* to MessageDecoder& and all occurrences of ArgumentEncoder*
+ to ArgumentEncoder& in all the message receivers. This is the second step towards getting rid of MessageID.
+
+2012-10-18 Yael Aharon <yael.aharon@intel.com>
+
+ PageViewportController::m_rawAttributes.devicePixelRatio is not initialized
+ https://bugs.webkit.org/show_bug.cgi?id=99751
+
+ Reviewed by Antonio Gomes.
+
+ PageViewportController::m_rawAttributes.devicePixelRatio needs to be initialized.
+ Due to race condition, we could set the viewport attributes before the first layout.
+ If that happens, PageViewportController::m_rawAttributes.devicePixelRatio
+ is used without being initialized.
+
+ * UIProcess/PageViewportController.cpp:
+ (WebKit::PageViewportController::PageViewportController):
+
+2012-10-18 Roger Fong <roger_fong@apple.com>
+
+ Unreviewed. Build fix after r131701 and r131777.
+
+ * win/WebKit2.def:
+
+2012-10-18 Anders Carlsson <andersca@apple.com>
+
+ Build fix.
+
+ * Scripts/webkit2/messages.py:
+ (message_to_struct_declaration):
+ (generate_messages_header):
+ * Scripts/webkit2/messages_unittest.py:
+
+2012-10-18 Anders Carlsson <andersca@apple.com>
+
+ Generated messages should have a receiver name and a name
+ https://bugs.webkit.org/show_bug.cgi?id=99740
+
+ Reviewed by Andreas Kling.
+
+ As a first step towards getting rid of MessageID, give each generated message a name and receiver name
+ and pass them along when sending the messages.
+
+ * Platform/CoreIPC/Connection.h:
+ (CoreIPC::Connection::send):
+ (CoreIPC::Connection::sendSync):
+ * Platform/CoreIPC/MessageSender.h:
+ (CoreIPC::MessageSender::send):
+ * Scripts/webkit2/messages.py:
+ (message_to_struct_declaration):
+ (generate_messages_header):
+ * Scripts/webkit2/messages_unittest.py:
+
+2012-10-18 Pablo Flouret <pablof@motorola.com>
+
+ Implement css3-conditional's @supports rule
+ https://bugs.webkit.org/show_bug.cgi?id=86146
+
+ Reviewed by Antti Koivisto.
+
+ * Configurations/FeatureDefines.xcconfig:
+ Add an ENABLE_CSS3_CONDITIONAL_RULES flag.
+
+2012-10-18 Michael Saboff <msaboff@apple.com>
+
+ Make conversion between JSStringRef and WKStringRef work without character size conversions
+ https://bugs.webkit.org/show_bug.cgi?id=99727
+
+ Reviewed by Anders Carlsson.
+
+ Use the wrapped WTFString object to convert between JSStringRef and WKStringRef.
+
+ * Shared/WebString.h:
+ (WebKit::JSStringCreateWithString):
+ (WebKit::WebString::create):
+ (WebKit::WebString::createJSString):
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Don't use using namespace WebKit in private headers in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=99724
+
+ Reviewed by Xan Lopez.
+
+ Move using namespace WebKit from private headers to the cpp file.
+
+ * UIProcess/API/gtk/WebKitBackForwardList.cpp:
+ * UIProcess/API/gtk/WebKitBackForwardListPrivate.h:
+ * UIProcess/API/gtk/WebKitContextMenu.cpp:
+ * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
+ * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
+ * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
+ * UIProcess/API/gtk/WebKitCookieManager.cpp:
+ * UIProcess/API/gtk/WebKitCookieManagerPrivate.h:
+ * UIProcess/API/gtk/WebKitDownload.cpp:
+ * UIProcess/API/gtk/WebKitDownloadPrivate.h:
+ * UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h:
+ * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
+ * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
+ * UIProcess/API/gtk/WebKitFindController.cpp:
+ * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
+ * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h:
+ * UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:
+ * UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h:
+ * UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
+ * UIProcess/API/gtk/WebKitGeolocationProvider.h:
+ * UIProcess/API/gtk/WebKitHitTestResult.cpp:
+ * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
+ * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
+ * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h:
+ * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
+ * UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h:
+ * UIProcess/API/gtk/WebKitPolicyDecision.cpp:
+ * UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h:
+ * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
+ * UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h:
+ * UIProcess/API/gtk/WebKitSettings.cpp:
+ * UIProcess/API/gtk/WebKitSettingsPrivate.h:
+ * UIProcess/API/gtk/WebKitURIResponse.cpp:
+ * UIProcess/API/gtk/WebKitURIResponsePrivate.h:
+ * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
+ * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ * UIProcess/API/gtk/WebKitWebContextPrivate.h:
+ * UIProcess/API/gtk/WebKitWebInspector.cpp:
+ * UIProcess/API/gtk/WebKitWebInspectorPrivate.h:
+ * UIProcess/API/gtk/WebKitWebResource.cpp:
+ * UIProcess/API/gtk/WebKitWebResourcePrivate.h:
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+ * UIProcess/API/gtk/WebKitWebViewPrivate.h:
+ * UIProcess/API/gtk/WebKitWindowProperties.cpp:
+ * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Don't use the C API internally in WebKitFileChooserRequest
+ https://bugs.webkit.org/show_bug.cgi?id=96774
+
+ Reviewed by Xan Lopez.
+
+ Using the C++ classes directly instead of the C API wrappers we
+ avoid a lot of toImpl/toAPI casts, string conversions and
+ allocations. The code is also a lot simpler and easier to read.
+
+ * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
+ (_WebKitFileChooserRequestPrivate):
+ (webkitFileChooserRequestCreate):
+ (webkit_file_chooser_request_get_mime_types):
+ (webkit_file_chooser_request_get_mime_types_filter):
+ (webkit_file_chooser_request_get_select_multiple):
+ (webkit_file_chooser_request_select_files):
+ (webkit_file_chooser_request_get_selected_files):
+ (webkit_file_chooser_request_cancel):
+ * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
+ * UIProcess/API/gtk/WebKitUIClient.cpp:
+ (runOpenPanel):
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Don't use the C API internally in WebKitFormSubmissionRequest
+ https://bugs.webkit.org/show_bug.cgi?id=96777
+
+ Reviewed by Xan Lopez.
+
+ Using the C++ classes directly instead of the C API wrappers we
+ avoid a lot of toImpl/toAPI casts, string conversions and
+ allocations. The code is also a lot simpler and easier to read.
+
+ * UIProcess/API/gtk/WebKitFormClient.cpp:
+ (willSubmitForm):
+ * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
+ (_WebKitFormSubmissionRequestPrivate):
+ (webkitFormSubmissionRequestCreate):
+ (webkit_form_submission_request_get_text_fields):
+ (webkit_form_submission_request_submit):
+ * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h:
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Don't use the C API internally in WebKitSettings
+ https://bugs.webkit.org/show_bug.cgi?id=96784
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Using the C++ classes directly instead of the C API wrappers we
+ avoid a lot of toImpl/toAPI casts, string conversions and
+ allocations. The code is also a lot simpler and easier to read.
+
+ * UIProcess/API/gtk/WebKitSettings.cpp:
+ (_WebKitSettingsPrivate):
+ (webkit_settings_class_init):
+ (webkit_settings_init):
+ (webkitSettingsAttachSettingsToPage):
+ (webkit_settings_get_enable_javascript):
+ (webkit_settings_set_enable_javascript):
+ (webkit_settings_get_auto_load_images):
+ (webkit_settings_set_auto_load_images):
+ (webkit_settings_get_load_icons_ignoring_image_load_setting):
+ (webkit_settings_set_load_icons_ignoring_image_load_setting):
+ (webkit_settings_get_enable_offline_web_application_cache):
+ (webkit_settings_set_enable_offline_web_application_cache):
+ (webkit_settings_get_enable_html5_local_storage):
+ (webkit_settings_set_enable_html5_local_storage):
+ (webkit_settings_get_enable_html5_database):
+ (webkit_settings_set_enable_html5_database):
+ (webkit_settings_get_enable_xss_auditor):
+ (webkit_settings_set_enable_xss_auditor):
+ (webkit_settings_get_enable_frame_flattening):
+ (webkit_settings_set_enable_frame_flattening):
+ (webkit_settings_get_enable_plugins):
+ (webkit_settings_set_enable_plugins):
+ (webkit_settings_get_enable_java):
+ (webkit_settings_set_enable_java):
+ (webkit_settings_get_javascript_can_open_windows_automatically):
+ (webkit_settings_set_javascript_can_open_windows_automatically):
+ (webkit_settings_get_enable_hyperlink_auditing):
+ (webkit_settings_set_enable_hyperlink_auditing):
+ (webkit_settings_set_default_font_family):
+ (webkit_settings_set_monospace_font_family):
+ (webkit_settings_set_serif_font_family):
+ (webkit_settings_set_sans_serif_font_family):
+ (webkit_settings_set_cursive_font_family):
+ (webkit_settings_set_fantasy_font_family):
+ (webkit_settings_set_pictograph_font_family):
+ (webkit_settings_get_default_font_size):
+ (webkit_settings_set_default_font_size):
+ (webkit_settings_get_default_monospace_font_size):
+ (webkit_settings_set_default_monospace_font_size):
+ (webkit_settings_get_minimum_font_size):
+ (webkit_settings_set_minimum_font_size):
+ (webkit_settings_set_default_charset):
+ (webkit_settings_get_enable_private_browsing):
+ (webkit_settings_set_enable_private_browsing):
+ (webkit_settings_get_enable_developer_extras):
+ (webkit_settings_set_enable_developer_extras):
+ (webkit_settings_get_enable_resizable_text_areas):
+ (webkit_settings_set_enable_resizable_text_areas):
+ (webkit_settings_get_enable_tabs_to_links):
+ (webkit_settings_set_enable_tabs_to_links):
+ (webkit_settings_get_enable_dns_prefetching):
+ (webkit_settings_set_enable_dns_prefetching):
+ (webkit_settings_get_enable_caret_browsing):
+ (webkit_settings_set_enable_caret_browsing):
+ (webkit_settings_get_enable_fullscreen):
+ (webkit_settings_set_enable_fullscreen):
+ (webkit_settings_get_print_backgrounds):
+ (webkit_settings_set_print_backgrounds):
+ (webkit_settings_get_enable_webaudio):
+ (webkit_settings_set_enable_webaudio):
+ (webkit_settings_get_enable_webgl):
+ (webkit_settings_set_enable_webgl):
+ (webkit_settings_get_allow_modal_dialogs):
+ (webkit_settings_get_zoom_text_only):
+ (webkit_settings_get_javascript_can_access_clipboard):
+ (webkit_settings_set_javascript_can_access_clipboard):
+ (webkit_settings_get_media_playback_requires_user_gesture):
+ (webkit_settings_set_media_playback_requires_user_gesture):
+ (webkit_settings_get_media_playback_allows_inline):
+ (webkit_settings_set_media_playback_allows_inline):
+ (webkit_settings_get_draw_compositing_indicators):
+ (webkit_settings_set_draw_compositing_indicators):
+ (webkit_settings_get_enable_site_specific_quirks):
+ (webkit_settings_set_enable_site_specific_quirks):
+ (webkit_settings_get_enable_page_cache):
+ (webkit_settings_set_enable_page_cache):
+ (webkit_settings_get_enable_smooth_scrolling):
+ (webkit_settings_set_enable_smooth_scrolling):
+ * UIProcess/API/gtk/WebKitSettingsPrivate.h:
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkitWebViewSetSettings):
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Fix GTK+ debug build.
+
+ * UIProcess/API/gtk/WebKitWebResource.cpp:
+ (webkitWebResourceCreate):
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Don't use the C API internally in WebKitWindowProperties
+ https://bugs.webkit.org/show_bug.cgi?id=96785
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Using the C++ classes directly instead of the C API wrappers we
+ avoid a lot of toImpl/toAPI casts, string conversions and
+ allocations. The code is also a lot simpler and easier to read.
+
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkitWebViewCreateNewPage):
+ * UIProcess/API/gtk/WebKitWindowProperties.cpp:
+ (webkitWindowPropertiesUpdateFromWebWindowFeatures):
+ * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
+
+2012-10-18 Huang Dongsung <luxtella@company100.net>
+
+ [WK2] Add CustomFilterOperation serialization in ArgumentCoder.
+ https://bugs.webkit.org/show_bug.cgi?id=98733
+
+ Reviewed by Noam Rosenthal.
+
+ Add ArgumentCoders for CustomFilterOperation and all dependent classes.
+ Coordinated Graphics will use this css shaders serialization when it enables CSS
+ Shaders.
+
+ No new tests, code path is not activated yet.
+
+ * CMakeLists.txt:
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: Added.
+ (CoreIPC):
+ (CoreIPC::::encode):
+ (CoreIPC::::decode):
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h: Added.
+ (WebCore):
+ (CoreIPC):
+ * Shared/CoordinatedGraphics/WebCustomFilterProgram.h: Added.
+ (WebKit):
+ (WebCustomFilterProgram):
+ WebCustomFilterProgram is made to serialize the data of a
+ StyleCustomFilterProgram to the UI process.
+ (WebKit::WebCustomFilterProgram::create):
+ (WebKit::WebCustomFilterProgram::WebCustomFilterProgram):
+ * Shared/ShareableSurface.cpp:
+ * Shared/WebCoreArgumentCoders.cpp:
+ * Shared/WebCoreArgumentCoders.h:
+ * Target.pri:
+ * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h:
+ * WebKit2.pri:
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Don't use the C API internally in WebKitWebResource
+ https://bugs.webkit.org/show_bug.cgi?id=96783
+
+ Reviewed by Xan Lopez.
+
+ Using the C++ classes directly instead of the C API wrappers we
+ avoid a lot of toImpl/toAPI casts, string conversions and
+ allocations. The code is also a lot simpler and easier to read.
+
+ * UIProcess/API/gtk/WebKitWebResource.cpp:
+ (_WebKitWebResourcePrivate):
+ (webkitWebResourceCreate):
+ (webkitWebResourceGetFrame):
+ (ResourceGetDataAsyncData):
+ (resourceDataCallback):
+ (webkit_web_resource_get_data):
+ (webkit_web_resource_get_data_finish):
+ * UIProcess/API/gtk/WebKitWebResourcePrivate.h:
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (setCertificateToMainResource):
+ (webkitWebViewResourceLoadStarted):
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Don't use the C API internally in WebKitURIResponse
+ https://bugs.webkit.org/show_bug.cgi?id=96782
+
+ Reviewed by Xan Lopez.
+
+ Using the C++ classes directly instead of the C API wrappers we
+ avoid a lot of toImpl/toAPI casts, string conversions and
+ allocations. The code is also a lot simpler and easier to read.
+
+ * UIProcess/API/gtk/WebKitURIResponse.cpp:
+ (webkitURIResponseSetCertificateInfo):
+ * UIProcess/API/gtk/WebKitURIResponsePrivate.h:
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (setCertificateToMainResource):
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Don't use the C API internally in PolicyClient classes
+ https://bugs.webkit.org/show_bug.cgi?id=96781
+
+ Reviewed by Xan Lopez.
+
+ Using the C++ classes directly instead of the C API wrappers we
+ avoid a lot of toImpl/toAPI casts, string conversions and
+ allocations. The code is also a lot simpler and easier to read.
+
+ * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
+ (webkitNavigationPolicyDecisionCreate):
+ * UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h:
+ * UIProcess/API/gtk/WebKitPolicyClient.cpp:
+ (decidePolicyForNavigationActionCallback):
+ (decidePolicyForNewWindowActionCallback):
+ (decidePolicyForResponseCallback):
+ (attachPolicyClientToView):
+ * UIProcess/API/gtk/WebKitPolicyClient.h:
+ * UIProcess/API/gtk/WebKitPolicyDecision.cpp:
+ (_WebKitPolicyDecisionPrivate):
+ (webkitPolicyDecisionFinalize):
+ (webkitPolicyDecisionSetListener):
+ (webkit_policy_decision_use):
+ (webkit_policy_decision_ignore):
+ (webkit_policy_decision_download):
+ * UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h:
+ * UIProcess/API/gtk/WebKitPrivate.cpp:
+ (wkEventMouseButtonToWebKitMouseButton):
+ * UIProcess/API/gtk/WebKitPrivate.h:
+ * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
+ (webkitResponsePolicyDecisionCreate):
+ * UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h:
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkitWebViewConstructed):
+
+2012-10-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Don't use the C API internally in WebKitHitTestResult
+ https://bugs.webkit.org/show_bug.cgi?id=96779
+
+ Reviewed by Xan Lopez.
+
+ Using the C++ classes directly instead of the C API wrappers we
+ avoid a lot of toImpl/toAPI casts, string conversions and
+ allocations. The code is also a lot simpler and easier to read.
+
+ * UIProcess/API/gtk/WebKitHitTestResult.cpp:
+ (webkitHitTestResultCreate):
+ (webkitHitTestResultCompare):
+ * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkitWebViewMouseTargetChanged):
+ (webkitWebViewPopulateContextMenu):
+
2012-10-15 Balazs Kelemen <kbalazs@webkit.org>
[Qt][WTR] Do a forced repaint before generating pixel results
diff --git a/Source/WebKit2/Configurations/FeatureDefines.xcconfig b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
index 01640f4f7..ce0af8680 100644
--- a/Source/WebKit2/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit2/Configurations/FeatureDefines.xcconfig
@@ -48,7 +48,8 @@ ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
ENABLE_CSS_VARIABLES = ;
-ENABLE_CSS3_TEXT_DECORATION = ;
+ENABLE_CSS3_CONDITIONAL_RULES = ;
+ENABLE_CSS3_TEXT = ;
ENABLE_CUSTOM_SCHEME_HANDLER = ;
ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
@@ -148,4 +149,4 @@ ENABLE_WEB_TIMING = ;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebKit2/DerivedSources.make b/Source/WebKit2/DerivedSources.make
index 9ab6db6e0..35976969c 100644
--- a/Source/WebKit2/DerivedSources.make
+++ b/Source/WebKit2/DerivedSources.make
@@ -44,6 +44,7 @@ VPATH = \
$(WebKit2)/WebProcess \
$(WebKit2)/UIProcess \
$(WebKit2)/UIProcess/Downloads \
+ $(WebKit2)/UIProcess/Network \
$(WebKit2)/UIProcess/Notifications \
$(WebKit2)/UIProcess/Plugins \
$(WebKit2)/UIProcess/SharedWorkers \
@@ -56,6 +57,7 @@ MESSAGE_RECEIVERS = \
DownloadProxy \
EventDispatcher \
NetworkProcess \
+ NetworkProcessProxy \
NPObjectMessageReceiver \
PluginControllerProxy \
PluginProcess \
@@ -69,6 +71,7 @@ MESSAGE_RECEIVERS = \
WebCookieManager \
WebCookieManagerProxy \
WebConnection \
+ NetworkConnectionToWebProcess \
WebContext \
WebDatabaseManager \
WebDatabaseManagerProxy \
diff --git a/Source/WebKit2/GNUmakefile.list.am b/Source/WebKit2/GNUmakefile.list.am
index f1e80d57a..4cf80f965 100644
--- a/Source/WebKit2/GNUmakefile.list.am
+++ b/Source/WebKit2/GNUmakefile.list.am
@@ -368,6 +368,8 @@ webkit2_sources += \
Source/WebKit2/Shared/ChildProcess.cpp \
Source/WebKit2/Shared/ChildProcess.h \
Source/WebKit2/Shared/CommandLine.h \
+ Source/WebKit2/Shared/ConnectionStack.cpp \
+ Source/WebKit2/Shared/ConnectionStack.h \
Source/WebKit2/Shared/CoreIPCSupport/WebConnectionMessageKinds.h \
Source/WebKit2/Shared/CoreIPCSupport/WebContextMessageKinds.h \
Source/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h \
@@ -1259,6 +1261,8 @@ webkit2_plugin_process_sources += \
Source/WebKit2/PluginProcess/unix/PluginProcessUnix.cpp \
Source/WebKit2/Shared/ChildProcess.cpp \
Source/WebKit2/Shared/ChildProcess.h \
+ Source/WebKit2/Shared/ConnectionStack.cpp \
+ Source/WebKit2/Shared/ConnectionStack.h \
Source/WebKit2/Shared/ProcessExecutablePath.h \
Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp \
Source/WebKit2/Shared/Plugins/NPIdentifierData.h \
diff --git a/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
new file mode 100644
index 000000000..1fdce180b
--- /dev/null
+++ b/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NetworkConnectionToWebProcess.h"
+
+#include "ConnectionStack.h"
+#include "NetworkProcess.h"
+#include <WebCore/RunLoop.h>
+
+#if ENABLE(NETWORK_PROCESS)
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<NetworkConnectionToWebProcess> NetworkConnectionToWebProcess::create(CoreIPC::Connection::Identifier connectionIdentifier)
+{
+ return adoptRef(new NetworkConnectionToWebProcess(connectionIdentifier));
+}
+
+NetworkConnectionToWebProcess::NetworkConnectionToWebProcess(CoreIPC::Connection::Identifier connectionIdentifier)
+{
+ m_connection = CoreIPC::Connection::createServerConnection(connectionIdentifier, this, RunLoop::main());
+ m_connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true);
+ m_connection->open();
+}
+
+NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess()
+{
+ ASSERT(!m_connection);
+}
+
+void NetworkConnectionToWebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
+{
+ ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::shared(), connection);
+
+ if (messageID.is<CoreIPC::MessageClassNetworkConnectionToWebProcess>()) {
+ didReceiveNetworkConnectionToWebProcessMessage(connection, messageID, decoder);
+ return;
+ }
+
+ ASSERT_NOT_REACHED();
+}
+
+void NetworkConnectionToWebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& arguments, OwnPtr<CoreIPC::MessageEncoder>& reply)
+{
+ ASSERT_NOT_REACHED();
+}
+
+void NetworkConnectionToWebProcess::didClose(CoreIPC::Connection*)
+{
+ // Protect ourself as we might be otherwise be deleted during this function
+ RefPtr<NetworkConnectionToWebProcess> protector(this);
+
+ NetworkProcess::shared().removeNetworkConnectionToWebProcess(this);
+
+ m_connection = 0;
+}
+
+void NetworkConnectionToWebProcess::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID)
+{
+}
+
+void NetworkConnectionToWebProcess::didReceiveNetworkConnectionToWebProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&)
+{
+ // Empty for now - There are no messages to handle.
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
diff --git a/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
new file mode 100644
index 000000000..635136094
--- /dev/null
+++ b/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NetworkConnectionToWebProcess_h
+#define NetworkConnectionToWebProcess_h
+
+#if ENABLE(NETWORK_PROCESS)
+
+#include "Connection.h"
+#include "NetworkConnectionToWebProcessMessages.h"
+#include <wtf/HashSet.h>
+#include <wtf/RefCounted.h>
+
+namespace WebKit {
+
+class NetworkConnectionToWebProcess : public RefCounted<NetworkConnectionToWebProcess>, CoreIPC::Connection::Client {
+public:
+ static PassRefPtr<NetworkConnectionToWebProcess> create(CoreIPC::Connection::Identifier);
+ virtual ~NetworkConnectionToWebProcess();
+
+ CoreIPC::Connection* connection() const { return m_connection.get(); }
+
+private:
+ NetworkConnectionToWebProcess(CoreIPC::Connection::Identifier);
+
+ // CoreIPC::Connection::Client
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
+ virtual void didClose(CoreIPC::Connection*);
+ virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
+
+ // Message handlers.
+ void didReceiveNetworkConnectionToWebProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+
+ RefPtr<CoreIPC::Connection> m_connection;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
+
+#endif // NetworkConnectionToWebProcess_h
diff --git a/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in
new file mode 100644
index 000000000..a1047c83a
--- /dev/null
+++ b/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in
@@ -0,0 +1,29 @@
+# Copyright (C) 2012 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#if ENABLE(NETWORK_PROCESS)
+
+messages -> NetworkConnectionToWebProcess {
+
+}
+
+#endif // ENABLE(NETWORK_PROCESS)
diff --git a/Source/WebKit2/NetworkProcess/NetworkProcess.cpp b/Source/WebKit2/NetworkProcess/NetworkProcess.cpp
index b2289b07b..5be2e9b21 100644
--- a/Source/WebKit2/NetworkProcess/NetworkProcess.cpp
+++ b/Source/WebKit2/NetworkProcess/NetworkProcess.cpp
@@ -30,7 +30,11 @@
#include "ArgumentCoders.h"
#include "Attachment.h"
+#include "NetworkConnectionToWebProcess.h"
+#include "NetworkProcessProxyMessages.h"
+#include <WebCore/ResourceRequest.h>
#include <WebCore/RunLoop.h>
+#include <wtf/text/CString.h>
using namespace WebCore;
@@ -59,22 +63,27 @@ void NetworkProcess::initialize(CoreIPC::Connection::Identifier serverIdentifier
m_uiConnection->open();
}
+void NetworkProcess::removeNetworkConnectionToWebProcess(NetworkConnectionToWebProcess* connection)
+{
+ size_t vectorIndex = m_webProcessConnections.find(connection);
+ ASSERT(vectorIndex != notFound);
+
+ m_webProcessConnections.remove(vectorIndex);
+}
+
bool NetworkProcess::shouldTerminate()
{
return true;
}
-void NetworkProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void NetworkProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveNetworkProcessMessage(connection, messageID, arguments);
+ didReceiveNetworkProcessMessage(connection, messageID, decoder);
}
void NetworkProcess::didClose(CoreIPC::Connection*)
{
- // Either the connection to the UIProcess or a connection to a WebProcess has gone away.
- // In the future we'll do appropriate cleanup and decide whether or not we want to keep
- // the NetworkProcess open.
- // For now we'll always close it.
+ // The UIProcess just crashed.
RunLoop::current()->stop();
}
@@ -92,6 +101,24 @@ void NetworkProcess::initializeNetworkProcess(const NetworkProcessCreationParame
platformInitialize(parameters);
}
+void NetworkProcess::createNetworkConnectionToWebProcess()
+{
+#if PLATFORM(MAC)
+ // Create the listening port.
+ mach_port_t listeningPort;
+ mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
+
+ // Create a listening connection.
+ RefPtr<NetworkConnectionToWebProcess> connection = NetworkConnectionToWebProcess::create(CoreIPC::Connection::Identifier(listeningPort));
+ m_webProcessConnections.append(connection.release());
+
+ CoreIPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
+ m_uiConnection->send(Messages::NetworkProcessProxy::DidCreateNetworkConnectionToWebProcess(clientPort), 0);
+#else
+ notImplemented();
+#endif
+}
+
} // namespace WebKit
#endif // ENABLE(NETWORK_PROCESS)
diff --git a/Source/WebKit2/NetworkProcess/NetworkProcess.h b/Source/WebKit2/NetworkProcess/NetworkProcess.h
index f72a8f9ab..5828e1f5e 100644
--- a/Source/WebKit2/NetworkProcess/NetworkProcess.h
+++ b/Source/WebKit2/NetworkProcess/NetworkProcess.h
@@ -36,7 +36,8 @@ namespace WebCore {
}
namespace WebKit {
-
+
+class NetworkConnectionToWebProcess;
struct NetworkProcessCreationParameters;
class NetworkProcess : ChildProcess {
@@ -46,6 +47,8 @@ public:
void initialize(CoreIPC::Connection::Identifier, WebCore::RunLoop*);
+ void removeNetworkConnectionToWebProcess(NetworkConnectionToWebProcess*);
+
private:
NetworkProcess();
~NetworkProcess();
@@ -56,17 +59,22 @@ private:
virtual bool shouldTerminate();
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
virtual void syncMessageSendTimedOut(CoreIPC::Connection*);
// Message Handlers
- void didReceiveNetworkProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveNetworkProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void initializeNetworkProcess(const NetworkProcessCreationParameters&);
+ void createNetworkConnectionToWebProcess();
// The connection to the UI process.
RefPtr<CoreIPC::Connection> m_uiConnection;
+
+ // Connections to WebProcesses.
+ Vector<RefPtr<NetworkConnectionToWebProcess> > m_webProcessConnections;
+
};
} // namespace WebKit
diff --git a/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in
index 5e46a8efb..029536a34 100644
--- a/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in
+++ b/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in
@@ -25,6 +25,9 @@
messages -> NetworkProcess {
# Initializes the network process.
InitializeNetworkProcess(WebKit::NetworkProcessCreationParameters processCreationParameters)
+
+ # Creates a connection for communication with a WebProcess
+ CreateNetworkConnectionToWebProcess()
}
#endif // ENABLE(NETWORK_PROCESS)
diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp b/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp
index 232f38bb9..f0c17d38e 100644
--- a/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp
+++ b/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp
@@ -50,7 +50,7 @@ void ArgumentCoder<CString>::encode(ArgumentEncoder* encoder, const CString& str
{
// Special case the null string.
if (string.isNull()) {
- encoder->encodeUInt32(std::numeric_limits<uint32_t>::max());
+ encoder->encode(std::numeric_limits<uint32_t>::max());
return;
}
@@ -91,14 +91,14 @@ void ArgumentCoder<String>::encode(ArgumentEncoder* encoder, const String& strin
{
// Special case the null string.
if (string.isNull()) {
- encoder->encodeUInt32(std::numeric_limits<uint32_t>::max());
+ encoder->encode(std::numeric_limits<uint32_t>::max());
return;
}
uint32_t length = string.length();
encoder->encode(length);
bool is8Bit = string.is8Bit();
- encoder->encodeBool(is8Bit);
+ encoder->encode(is8Bit);
if (is8Bit)
encoder->encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.characters8()), length * sizeof(LChar), __alignof(LChar));
else
diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h b/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h
index af163be6d..f16d7c92f 100644
--- a/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h
+++ b/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h
@@ -100,7 +100,7 @@ template<bool fixedSizeElements, typename T> struct VectorArgumentCoder;
template<typename T> struct VectorArgumentCoder<false, T> {
static void encode(ArgumentEncoder* encoder, const Vector<T>& vector)
{
- encoder->encodeUInt64(vector.size());
+ encoder->encode(static_cast<uint64_t>(vector.size()));
for (size_t i = 0; i < vector.size(); ++i)
encoder->encode(vector[i]);
}
@@ -129,7 +129,7 @@ template<typename T> struct VectorArgumentCoder<false, T> {
template<typename T> struct VectorArgumentCoder<true, T> {
static void encode(ArgumentEncoder* encoder, const Vector<T>& vector)
{
- encoder->encodeUInt64(vector.size());
+ encoder->encode(static_cast<uint64_t>(vector.size()));
encoder->encodeFixedLengthData(reinterpret_cast<const uint8_t*>(vector.data()), vector.size() * sizeof(T), __alignof(T));
}
@@ -164,7 +164,7 @@ template<typename KeyArg, typename MappedArg, typename HashArg, typename KeyTrai
static void encode(ArgumentEncoder* encoder, const HashMapType& hashMap)
{
- encoder->encodeUInt64(hashMap.size());
+ encoder->encode(static_cast<uint64_t>(hashMap.size()));
for (typename HashMapType::const_iterator it = hashMap.begin(), end = hashMap.end(); it != end; ++it)
encoder->encode(*it);
}
diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp
index 9df51ec19..94801132f 100644
--- a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp
+++ b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp
@@ -101,62 +101,60 @@ void ArgumentEncoder::encodeFixedLengthData(const uint8_t* data, size_t size, un
void ArgumentEncoder::encodeVariableLengthByteArray(const DataReference& dataReference)
{
- // Encode the size.
- encodeUInt64(static_cast<uint64_t>(dataReference.size()));
-
+ encode(static_cast<uint64_t>(dataReference.size()));
encodeFixedLengthData(dataReference.data(), dataReference.size(), 1);
}
-void ArgumentEncoder::encodeBool(bool n)
+void ArgumentEncoder::encode(bool n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
*reinterpret_cast<bool*>(buffer) = n;
}
-void ArgumentEncoder::encodeUInt16(uint16_t n)
+void ArgumentEncoder::encode(uint16_t n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
*reinterpret_cast<uint16_t*>(buffer) = n;
}
-void ArgumentEncoder::encodeUInt32(uint32_t n)
+void ArgumentEncoder::encode(uint32_t n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
*reinterpret_cast<uint32_t*>(buffer) = n;
}
-void ArgumentEncoder::encodeUInt64(uint64_t n)
+void ArgumentEncoder::encode(uint64_t n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
*reinterpret_cast<uint64_t*>(buffer) = n;
}
-void ArgumentEncoder::encodeInt32(int32_t n)
+void ArgumentEncoder::encode(int32_t n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
*reinterpret_cast<int32_t*>(buffer) = n;
}
-void ArgumentEncoder::encodeInt64(int64_t n)
+void ArgumentEncoder::encode(int64_t n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
*reinterpret_cast<int64_t*>(buffer) = n;
}
-void ArgumentEncoder::encodeFloat(float n)
+void ArgumentEncoder::encode(float n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
*reinterpret_cast<float*>(buffer) = n;
}
-void ArgumentEncoder::encodeDouble(double n)
+void ArgumentEncoder::encode(double n)
{
uint8_t* buffer = grow(sizeof(n), sizeof(n));
@@ -175,13 +173,4 @@ Vector<Attachment> ArgumentEncoder::releaseAttachments()
return newList;
}
-#ifndef NDEBUG
-void ArgumentEncoder::debug()
-{
- printf("ArgumentEncoder::debug()\n");
- printf("Number of Attachments: %d\n", (int)m_attachments.size());
- printf("Size of buffer: %d\n", (int)m_bufferSize);
-}
-#endif
-
} // namespace CoreIPC
diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
index 9bfea0304..54780134a 100644
--- a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
+++ b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
@@ -45,20 +45,20 @@ public:
void encodeFixedLengthData(const uint8_t*, size_t, unsigned alignment);
void encodeVariableLengthByteArray(const DataReference&);
- void encodeBool(bool);
- void encodeUInt16(uint16_t);
- void encodeUInt32(uint32_t);
- void encodeUInt64(uint64_t);
- void encodeInt32(int32_t);
- void encodeInt64(int64_t);
- void encodeFloat(float);
- void encodeDouble(double);
+ void encode(bool);
+ void encode(uint16_t);
+ void encode(uint32_t);
+ void encode(uint64_t);
+ void encode(int32_t);
+ void encode(int64_t);
+ void encode(float);
+ void encode(double);
template<typename T> void encodeEnum(T t)
{
COMPILE_ASSERT(sizeof(T) <= sizeof(uint64_t), enum_type_must_not_be_larger_than_64_bits);
- encodeUInt64(static_cast<uint64_t>(t));
+ encode(static_cast<uint64_t>(t));
}
// Generic type encode function.
@@ -73,10 +73,6 @@ public:
void addAttachment(const Attachment&);
Vector<Attachment> releaseAttachments();
-#ifndef NDEBUG
- void debug();
-#endif
-
protected:
ArgumentEncoder();
@@ -92,46 +88,6 @@ private:
Vector<Attachment> m_attachments;
};
-template<> inline void ArgumentEncoder::encode(const bool& n)
-{
- encodeBool(n);
-}
-
-template<> inline void ArgumentEncoder::encode(const uint16_t& n)
-{
- encodeUInt16(n);
-}
-
-template<> inline void ArgumentEncoder::encode(const uint32_t& n)
-{
- encodeUInt32(n);
-}
-
-template<> inline void ArgumentEncoder::encode(const uint64_t& n)
-{
- encodeUInt64(n);
-}
-
-template<> inline void ArgumentEncoder::encode(const int32_t& n)
-{
- encodeInt32(n);
-}
-
-template<> inline void ArgumentEncoder::encode(const int64_t& n)
-{
- encodeInt64(n);
-}
-
-template<> inline void ArgumentEncoder::encode(const float& n)
-{
- encodeFloat(n);
-}
-
-template<> inline void ArgumentEncoder::encode(const double& n)
-{
- encodeDouble(n);
-}
-
} // namespace CoreIPC
#endif // ArgumentEncoder_h
diff --git a/Source/WebKit2/Platform/CoreIPC/Connection.cpp b/Source/WebKit2/Platform/CoreIPC/Connection.cpp
index 98f355934..b9f8fcfdc 100644
--- a/Source/WebKit2/Platform/CoreIPC/Connection.cpp
+++ b/Source/WebKit2/Platform/CoreIPC/Connection.cpp
@@ -536,7 +536,8 @@ void Connection::processIncomingMessage(MessageID messageID, PassOwnPtr<MessageD
for (size_t i = 0; i < m_connectionQueueClients.size(); ++i) {
bool didHandleMessage = false;
- m_connectionQueueClients[i]->didReceiveMessageOnConnectionWorkQueue(this, incomingMessage.messageID(), incomingMessage.arguments(), didHandleMessage);
+ MessageDecoder* decoder = incomingMessage.arguments();
+ m_connectionQueueClients[i]->didReceiveMessageOnConnectionWorkQueue(this, incomingMessage.messageID(), *decoder, didHandleMessage);
if (didHandleMessage) {
// A connection queue client handled the message, our work here is done.
incomingMessage.releaseArguments();
@@ -614,25 +615,24 @@ void Connection::sendOutgoingMessages()
}
}
-void Connection::dispatchSyncMessage(MessageID messageID, MessageDecoder* decoder)
+void Connection::dispatchSyncMessage(MessageID messageID, MessageDecoder& decoder)
{
ASSERT(messageID.isSync());
uint64_t syncRequestID = 0;
- if (!decoder->decodeUInt64(syncRequestID) || !syncRequestID) {
+ if (!decoder.decodeUInt64(syncRequestID) || !syncRequestID) {
// We received an invalid sync message.
- decoder->markInvalid();
+ decoder.markInvalid();
return;
}
- // FIXME: ArgumentEncoder should be MessageEncoder here.
- OwnPtr<ArgumentEncoder> replyEncoder = MessageEncoder::create("", "", syncRequestID);
+ OwnPtr<MessageEncoder> replyEncoder = MessageEncoder::create("", "", syncRequestID);
// Hand off both the decoder and encoder to the client.
m_client->didReceiveSyncMessage(this, messageID, decoder, replyEncoder);
// FIXME: If the message was invalid, we should send back a SyncMessageError.
- ASSERT(!decoder->isInvalid());
+ ASSERT(!decoder.isInvalid());
if (replyEncoder)
sendSyncReply(adoptPtr(static_cast<MessageEncoder*>(replyEncoder.leakPtr())));
@@ -654,7 +654,7 @@ void Connection::enqueueIncomingMessage(IncomingMessage& incomingMessage)
m_clientRunLoop->dispatch(WTF::bind(&Connection::dispatchOneMessage, this));
}
-void Connection::dispatchMessage(MessageID messageID, MessageDecoder* decoder)
+void Connection::dispatchMessage(MessageID messageID, MessageDecoder& decoder)
{
// Try the message receiver map first.
if (m_messageReceiverMap.dispatchMessage(this, messageID, decoder))
@@ -681,9 +681,9 @@ void Connection::dispatchMessage(IncomingMessage& message)
m_didReceiveInvalidMessage = false;
if (message.messageID().isSync())
- dispatchSyncMessage(message.messageID(), arguments.get());
+ dispatchSyncMessage(message.messageID(), *arguments);
else
- dispatchMessage(message.messageID(), arguments.get());
+ dispatchMessage(message.messageID(), *arguments);
m_didReceiveInvalidMessage |= arguments->isInvalid();
m_inDispatchMessageCount--;
diff --git a/Source/WebKit2/Platform/CoreIPC/Connection.h b/Source/WebKit2/Platform/CoreIPC/Connection.h
index 7313b7fbb..fb42d9e72 100644
--- a/Source/WebKit2/Platform/CoreIPC/Connection.h
+++ b/Source/WebKit2/Platform/CoreIPC/Connection.h
@@ -101,7 +101,7 @@ public:
class QueueClient {
public:
- virtual void didReceiveMessageOnConnectionWorkQueue(Connection*, MessageID, ArgumentDecoder*, bool& didHandleMessage) = 0;
+ virtual void didReceiveMessageOnConnectionWorkQueue(Connection*, MessageID, MessageDecoder&, bool& didHandleMessage) = 0;
protected:
virtual ~QueueClient() { }
@@ -174,9 +174,9 @@ public:
void addQueueClient(QueueClient*);
void removeQueueClient(QueueClient*);
- void addMessageReceiver(MessageClass messageClass, MessageReceiver* messageReceiver)
+ void deprecatedAddMessageReceiver(MessageClass messageClass, MessageReceiver* messageReceiver)
{
- m_messageReceiverMap.addMessageReceiver(messageClass, messageReceiver);
+ m_messageReceiverMap.deprecatedAddMessageReceiver(messageClass, messageReceiver);
}
bool open();
@@ -276,8 +276,8 @@ private:
void dispatchConnectionDidClose();
void dispatchOneMessage();
void dispatchMessage(IncomingMessage&);
- void dispatchMessage(MessageID, MessageDecoder*);
- void dispatchSyncMessage(MessageID, MessageDecoder*);
+ void dispatchMessage(MessageID, MessageDecoder&);
+ void dispatchSyncMessage(MessageID, MessageDecoder&);
void didFailToSendSyncMessage();
// Can be called on any thread.
@@ -410,7 +410,7 @@ private:
template<typename T> bool Connection::send(const T& message, uint64_t destinationID, unsigned messageSendFlags)
{
- OwnPtr<MessageEncoder> encoder = MessageEncoder::create("", "", destinationID);
+ OwnPtr<MessageEncoder> encoder = MessageEncoder::create(T::receiverName(), T::name(), destinationID);
encoder->encode(message);
return sendMessage(MessageID(T::messageID), encoder.release(), messageSendFlags);
@@ -419,7 +419,7 @@ template<typename T> bool Connection::send(const T& message, uint64_t destinatio
template<typename T> bool Connection::sendSync(const T& message, const typename T::Reply& reply, uint64_t destinationID, double timeout, unsigned syncSendFlags)
{
uint64_t syncRequestID = 0;
- OwnPtr<MessageEncoder> encoder = createSyncMessageEncoder("", "", destinationID, syncRequestID);
+ OwnPtr<MessageEncoder> encoder = createSyncMessageEncoder(T::receiverName(), T::name(), destinationID, syncRequestID);
// Encode the rest of the input arguments.
encoder->encode(message);
@@ -440,7 +440,7 @@ template<typename T> bool Connection::waitForAndDispatchImmediately(uint64_t des
return false;
ASSERT(decoder->destinationID() == destinationID);
- m_client->didReceiveMessage(this, MessageID(T::messageID), decoder.get());
+ m_client->didReceiveMessage(this, MessageID(T::messageID), *decoder);
return true;
}
diff --git a/Source/WebKit2/Platform/CoreIPC/HandleMessage.h b/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
index 909c6286b..77401c12a 100644
--- a/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -2,6 +2,8 @@
#define HandleMessage_h
#include "Arguments.h"
+#include "MessageDecoder.h"
+#include "MessageEncoder.h"
namespace CoreIPC {
@@ -196,6 +198,12 @@ void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, Arguments3<R1, R
}
// Dispatch functions with delayed reply arguments.
+template<typename C, typename MF, typename R>
+void callMemberFunction(const Arguments0&, PassRefPtr<R> delayedReply, C* object, MF function)
+{
+ (object->*function)(delayedReply);
+}
+
template<typename C, typename MF, typename P1, typename R>
void callMemberFunction(const Arguments1<P1>& args, PassRefPtr<R> delayedReply, C* object, MF function)
{
@@ -209,6 +217,12 @@ void callMemberFunction(const Arguments2<P1, P2>& args, PassRefPtr<R> delayedRep
}
// Dispatch functions with connection parameter.
+template<typename C, typename MF>
+void callMemberFunction(Connection* connection, const Arguments0&, C* object, MF function)
+{
+ (object->*function)(connection);
+}
+
template<typename C, typename MF, typename P1>
void callMemberFunction(Connection* connection, const Arguments1<P1>& args, C* object, MF function)
{
@@ -230,132 +244,131 @@ void callMemberFunction(Connection* connection, const Arguments4<P1, P2, P3, P4>
// Variadic dispatch functions.
template<typename C, typename MF>
-void callMemberFunction(const Arguments0&, ArgumentDecoder* argumentDecoder, C* object, MF function)
+void callMemberFunction(const Arguments0&, MessageDecoder& decoder, C* object, MF function)
{
- (object->*function)(argumentDecoder);
+ (object->*function)(decoder);
}
template<typename C, typename MF, typename P1>
-void callMemberFunction(const Arguments1<P1>& args, ArgumentDecoder* argumentDecoder, C* object, MF function)
+void callMemberFunction(const Arguments1<P1>& args, MessageDecoder& decoder, C* object, MF function)
{
- (object->*function)(args.argument1, argumentDecoder);
+ (object->*function)(args.argument1, decoder);
}
template<typename C, typename MF, typename P1, typename P2>
-void callMemberFunction(const Arguments2<P1, P2>& args, ArgumentDecoder* argumentDecoder, C* object, MF function)
+void callMemberFunction(const Arguments2<P1, P2>& args, MessageDecoder& decoder, C* object, MF function)
{
- (object->*function)(args.argument1, args.argument2, argumentDecoder);
+ (object->*function)(args.argument1, args.argument2, decoder);
}
template<typename C, typename MF, typename P1, typename P2, typename P3>
-void callMemberFunction(const Arguments3<P1, P2, P3>& args, ArgumentDecoder* argumentDecoder, C* object, MF function)
+void callMemberFunction(const Arguments3<P1, P2, P3>& args, MessageDecoder& decoder, C* object, MF function)
{
- (object->*function)(args.argument1, args.argument2, args.argument3, argumentDecoder);
+ (object->*function)(args.argument1, args.argument2, args.argument3, decoder);
}
template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4>
-void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, ArgumentDecoder* argumentDecoder, C* object, MF function)
+void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, MessageDecoder& decoder, C* object, MF function)
{
- (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, argumentDecoder);
+ (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, decoder);
}
template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5>
-void callMemberFunction(const Arguments5<P1, P2, P3, P4, P5>& args, ArgumentDecoder* argumentDecoder, C* object, MF function)
+void callMemberFunction(const Arguments5<P1, P2, P3, P4, P5>& args, MessageDecoder& decoder, C* object, MF function)
{
- (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, argumentDecoder);
+ (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, decoder);
}
template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
-void callMemberFunction(const Arguments6<P1, P2, P3, P4, P5, P6>& args, ArgumentDecoder* argumentDecoder, C* object, MF function)
+void callMemberFunction(const Arguments6<P1, P2, P3, P4, P5, P6>& args, MessageDecoder& decoder, C* object, MF function)
{
- (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, argumentDecoder);
+ (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, decoder);
}
template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
-void callMemberFunction(const Arguments7<P1, P2, P3, P4, P5, P6, P7>& args, ArgumentDecoder* argumentDecoder, C* object, MF function)
+void callMemberFunction(const Arguments7<P1, P2, P3, P4, P5, P6, P7>& args, MessageDecoder& decoder, C* object, MF function)
{
- (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, args.argument7, argumentDecoder);
+ (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, args.argument7, decoder);
}
// Variadic dispatch functions with non-variadic reply arguments.
template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename R1, typename R2, typename R3>
-void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, ArgumentDecoder* argumentDecoder, Arguments3<R1, R2, R3>& replyArgs, C* object, MF function)
+void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, MessageDecoder& decoder, Arguments3<R1, R2, R3>& replyArgs, C* object, MF function)
{
- (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, argumentDecoder, replyArgs.argument1, replyArgs.argument2, replyArgs.argument3);
+ (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, decoder, replyArgs.argument1, replyArgs.argument2, replyArgs.argument3);
}
template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename R1, typename R2>
-void callMemberFunction(const Arguments6<P1, P2, P3, P4, P5, P6>& args, ArgumentDecoder* argumentDecoder, Arguments2<R1, R2>& replyArgs, C* object, MF function)
+void callMemberFunction(const Arguments6<P1, P2, P3, P4, P5, P6>& args, MessageDecoder& decoder, Arguments2<R1, R2>& replyArgs, C* object, MF function)
{
- (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, argumentDecoder, replyArgs.argument1, replyArgs.argument2);
+ (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, decoder, replyArgs.argument1, replyArgs.argument2);
}
template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename R1, typename R2, typename R3>
-void callMemberFunction(const Arguments6<P1, P2, P3, P4, P5, P6>& args, ArgumentDecoder* argumentDecoder, Arguments3<R1, R2, R3>& replyArgs, C* object, MF function)
+void callMemberFunction(const Arguments6<P1, P2, P3, P4, P5, P6>& args, MessageDecoder& decoder, Arguments3<R1, R2, R3>& replyArgs, C* object, MF function)
{
- (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, argumentDecoder, replyArgs.argument1, replyArgs.argument2, replyArgs.argument3);
+ (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, decoder, replyArgs.argument1, replyArgs.argument2, replyArgs.argument3);
}
// Main dispatch functions
template<typename T, typename C, typename MF>
-void handleMessage(ArgumentDecoder* argumentDecoder, C* object, MF function)
+void handleMessage(MessageDecoder& decoder, C* object, MF function)
{
typename T::DecodeType::ValueType arguments;
- if (!argumentDecoder->decode(arguments))
+ if (!decoder.decode(arguments))
return;
callMemberFunction(arguments, object, function);
}
template<typename T, typename C, typename MF>
-void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, MF function)
+void handleMessage(MessageDecoder& decoder, MessageEncoder& replyEncoder, C* object, MF function)
{
typename T::DecodeType::ValueType arguments;
- if (!argumentDecoder->decode(arguments))
+ if (!decoder.decode(arguments))
return;
typename T::Reply::ValueType replyArguments;
callMemberFunction(arguments, replyArguments, object, function);
- replyEncoder->encode(replyArguments);
+ replyEncoder.encode(replyArguments);
}
template<typename T, typename C, typename MF>
-void handleMessageOnConnectionQueue(Connection* connection, ArgumentDecoder* argumentDecoder, C* object, MF function)
+void handleMessageOnConnectionQueue(Connection* connection, MessageDecoder& decoder, C* object, MF function)
{
typename T::DecodeType::ValueType arguments;
- if (!argumentDecoder->decode(arguments))
+ if (!decoder.decode(arguments))
return;
callMemberFunction(connection, arguments, object, function);
}
template<typename T, typename C, typename MF>
-void handleMessageVariadic(ArgumentDecoder* argumentDecoder, C* object, MF function)
+void handleMessageVariadic(MessageDecoder& decoder, C* object, MF function)
{
typename T::DecodeType::ValueType arguments;
- if (!argumentDecoder->decode(arguments))
+ if (!decoder.decode(arguments))
return;
- callMemberFunction(arguments, argumentDecoder, object, function);
+ callMemberFunction(arguments, decoder, object, function);
}
-
template<typename T, typename C, typename MF>
-void handleMessageVariadic(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, MF function)
+void handleMessageVariadic(MessageDecoder& decoder, MessageEncoder& replyEncoder, C* object, MF function)
{
typename T::DecodeType::ValueType arguments;
- if (!argumentDecoder->decode(arguments))
+ if (!decoder.decode(arguments))
return;
typename T::Reply::ValueType replyArguments;
- callMemberFunction(arguments, argumentDecoder, replyArguments, object, function);
- replyEncoder->encode(replyArguments);
+ callMemberFunction(arguments, decoder, replyArguments, object, function);
+ replyEncoder.encode(replyArguments);
}
template<typename T, typename C, typename MF>
-void handleMessageDelayed(Connection* connection, ArgumentDecoder* argumentDecoder, OwnPtr<ArgumentEncoder>& replyEncoder, C* object, MF function)
+void handleMessageDelayed(Connection* connection, MessageDecoder& decoder, OwnPtr<MessageEncoder>& replyEncoder, C* object, MF function)
{
typename T::DecodeType::ValueType arguments;
- if (!argumentDecoder->decode(arguments))
+ if (!decoder.decode(arguments))
return;
RefPtr<typename T::DelayedReply> delayedReply = adoptRef(new typename T::DelayedReply(connection, replyEncoder.release()));
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageID.h b/Source/WebKit2/Platform/CoreIPC/MessageID.h
index 38a31cba6..a89e64f5c 100644
--- a/Source/WebKit2/Platform/CoreIPC/MessageID.h
+++ b/Source/WebKit2/Platform/CoreIPC/MessageID.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -109,8 +109,16 @@ enum MessageClass {
// Messages sent by the UI process to the network process.
MessageClassNetworkProcess,
+ // Messages sent by the network process to the UI process.
+ MessageClassNetworkProcessProxy,
+
+ // Messages sent by the web process to the network process.
+ MessageClassNetworkConnectionToWebProcess,
+
+#if ENABLE(SHARED_WORKER_PROCESS)
// Messages sent by the UI process to the shared worker process.
MessageClassSharedWorkerProcess,
+#endif // ENABLE(SHARED_WORKER_PROCESS)
// Messages sent by the shared worker process to the UI process.
MessageClassSharedWorkerProcessProxy,
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageReceiver.h b/Source/WebKit2/Platform/CoreIPC/MessageReceiver.h
index f7b61ccdc..9560e66ee 100644
--- a/Source/WebKit2/Platform/CoreIPC/MessageReceiver.h
+++ b/Source/WebKit2/Platform/CoreIPC/MessageReceiver.h
@@ -32,16 +32,16 @@
namespace CoreIPC {
-class ArgumentDecoder;
-class ArgumentEncoder;
+class MessageDecoder;
+class MessageEncoder;
class Connection;
class MessageReceiver {
public:
virtual ~MessageReceiver() { }
- virtual void didReceiveMessage(Connection*, MessageID, ArgumentDecoder*) = 0;
- virtual void didReceiveSyncMessage(Connection*, MessageID, ArgumentDecoder*, OwnPtr<ArgumentEncoder>&)
+ virtual void didReceiveMessage(Connection*, MessageID, MessageDecoder&) = 0;
+ virtual void didReceiveSyncMessage(Connection*, MessageID, MessageDecoder&, OwnPtr<MessageEncoder>&)
{
ASSERT_NOT_REACHED();
}
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp b/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp
index e4c666e6b..50ab296ec 100644
--- a/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp
+++ b/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp
@@ -38,36 +38,31 @@ MessageReceiverMap::~MessageReceiverMap()
{
}
-void MessageReceiverMap::addMessageReceiver(MessageClass messageClass, MessageReceiver* messageReceiver)
+void MessageReceiverMap::deprecatedAddMessageReceiver(MessageClass messageClass, MessageReceiver* messageReceiver)
{
- ASSERT(!m_globalMessageReceivers.contains(messageClass));
- m_globalMessageReceivers.set(messageClass, messageReceiver);
+ ASSERT(!m_deprecatedGlobalMessageReceivers.contains(messageClass));
+ m_deprecatedGlobalMessageReceivers.set(messageClass, messageReceiver);
}
void MessageReceiverMap::invalidate()
{
- m_globalMessageReceivers.clear();
+ m_deprecatedGlobalMessageReceivers.clear();
}
-bool MessageReceiverMap::knowsHowToHandleMessage(MessageID messageID) const
+bool MessageReceiverMap::dispatchMessage(Connection* connection, MessageID messageID, MessageDecoder& decoder)
{
- return m_globalMessageReceivers.contains(messageID.messageClass());
-}
-
-bool MessageReceiverMap::dispatchMessage(Connection* connection, MessageID messageID, ArgumentDecoder* argumentDecoder)
-{
- if (MessageReceiver* messageReceiver = m_globalMessageReceivers.get(messageID.messageClass())) {
- messageReceiver->didReceiveMessage(connection, messageID, argumentDecoder);
+ if (MessageReceiver* messageReceiver = m_deprecatedGlobalMessageReceivers.get(messageID.messageClass())) {
+ messageReceiver->didReceiveMessage(connection, messageID, decoder);
return true;
}
return false;
}
-bool MessageReceiverMap::dispatchSyncMessage(Connection* connection, MessageID messageID, ArgumentDecoder* argumentDecoder, OwnPtr<ArgumentEncoder>& reply)
+bool MessageReceiverMap::dispatchSyncMessage(Connection* connection, MessageID messageID, MessageDecoder& decoder, OwnPtr<MessageEncoder>& replyEncoder)
{
- if (MessageReceiver* messageReceiver = m_globalMessageReceivers.get(messageID.messageClass())) {
- messageReceiver->didReceiveSyncMessage(connection, messageID, argumentDecoder, reply);
+ if (MessageReceiver* messageReceiver = m_deprecatedGlobalMessageReceivers.get(messageID.messageClass())) {
+ messageReceiver->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
return true;
}
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h b/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h
index b3fb2ee2d..c9240e416 100644
--- a/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h
+++ b/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h
@@ -27,14 +27,14 @@
#define MessageReceiverMap_h
#include "MessageID.h"
-#include <wtf/Forward.h>
#include <wtf/HashMap.h>
+#include <wtf/text/CString.h>
namespace CoreIPC {
-class ArgumentEncoder;
-class ArgumentDecoder;
class Connection;
+class MessageDecoder;
+class MessageEncoder;
class MessageReceiver;
class MessageReceiverMap {
@@ -42,17 +42,17 @@ public:
MessageReceiverMap();
~MessageReceiverMap();
- void addMessageReceiver(MessageClass, MessageReceiver*);
+ // FIXME: Stop using this deprecated function and get rid of it.
+ void deprecatedAddMessageReceiver(MessageClass, MessageReceiver*);
void invalidate();
- bool knowsHowToHandleMessage(MessageID) const;
- bool dispatchMessage(Connection*, MessageID, ArgumentDecoder*);
- bool dispatchSyncMessage(Connection*, MessageID, ArgumentDecoder*, OwnPtr<ArgumentEncoder>&);
+ bool dispatchMessage(Connection*, MessageID, MessageDecoder&);
+ bool dispatchSyncMessage(Connection*, MessageID, MessageDecoder&, OwnPtr<MessageEncoder>&);
private:
// Message receivers that don't require a destination ID.
- HashMap<unsigned, MessageReceiver*> m_globalMessageReceivers;
+ HashMap<unsigned, MessageReceiver*> m_deprecatedGlobalMessageReceivers;
};
};
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageSender.h b/Source/WebKit2/Platform/CoreIPC/MessageSender.h
index 74381050c..d806d2b73 100644
--- a/Source/WebKit2/Platform/CoreIPC/MessageSender.h
+++ b/Source/WebKit2/Platform/CoreIPC/MessageSender.h
@@ -40,7 +40,7 @@ public:
template<typename U> bool send(const U& message, uint64_t destinationID)
{
- OwnPtr<MessageEncoder> encoder = MessageEncoder::create("", "", destinationID);
+ OwnPtr<MessageEncoder> encoder = MessageEncoder::create(U::receiverName(), U::name(), destinationID);
encoder->encode(message);
return static_cast<T*>(this)->sendMessage(MessageID(U::messageID), encoder.release());
diff --git a/Source/WebKit2/Platform/CoreIPC/win/ConnectionWin.cpp b/Source/WebKit2/Platform/CoreIPC/win/ConnectionWin.cpp
index c91e7c331..4ecfc17c0 100644
--- a/Source/WebKit2/Platform/CoreIPC/win/ConnectionWin.cpp
+++ b/Source/WebKit2/Platform/CoreIPC/win/ConnectionWin.cpp
@@ -288,7 +288,7 @@ bool Connection::sendOutgoingMessage(MessageID messageID, PassOwnPtr<MessageEnco
return false;
// We put the message ID last.
- encoder->encodeUInt32(messageID.toInt());
+ encoder->encode(static_cast<uint32_t>(messageID.toInt()));
// Write the outgoing message.
diff --git a/Source/WebKit2/Platform/mac/SharedMemoryMac.cpp b/Source/WebKit2/Platform/mac/SharedMemoryMac.cpp
index db2a1874b..338192240 100644
--- a/Source/WebKit2/Platform/mac/SharedMemoryMac.cpp
+++ b/Source/WebKit2/Platform/mac/SharedMemoryMac.cpp
@@ -57,7 +57,7 @@ bool SharedMemory::Handle::isNull() const
void SharedMemory::Handle::encode(CoreIPC::ArgumentEncoder* encoder) const
{
- encoder->encodeUInt64(m_size);
+ encoder->encode(static_cast<uint64_t>(m_size));
encoder->encode(CoreIPC::MachPort(m_port, MACH_MSG_TYPE_MOVE_SEND));
m_port = MACH_PORT_NULL;
}
diff --git a/Source/WebKit2/Platform/win/SharedMemoryWin.cpp b/Source/WebKit2/Platform/win/SharedMemoryWin.cpp
index c7e67798c..2aa28f8c0 100644
--- a/Source/WebKit2/Platform/win/SharedMemoryWin.cpp
+++ b/Source/WebKit2/Platform/win/SharedMemoryWin.cpp
@@ -53,16 +53,16 @@ bool SharedMemory::Handle::isNull() const
void SharedMemory::Handle::encode(CoreIPC::ArgumentEncoder* encoder) const
{
- encoder->encodeUInt64(m_size);
+ encoder->encode(static_cast<uint64_t>(m_size));
// Hand off ownership of our HANDLE to the receiving process. It will close it for us.
// FIXME: If the receiving process crashes before it receives the memory, the memory will be
// leaked. See <http://webkit.org/b/47502>.
- encoder->encodeUInt64(reinterpret_cast<uint64_t>(m_handle));
+ encoder->encode(reinterpret_cast<uint64_t>(m_handle));
m_handle = 0;
// Send along our PID so that the receiving process can duplicate the HANDLE for its own use.
- encoder->encodeUInt32(::GetCurrentProcessId());
+ encoder->encode(static_cast<uint32_t>(::GetCurrentProcessId()));
}
static bool getDuplicatedHandle(HANDLE sourceHandle, DWORD sourcePID, HANDLE& duplicatedHandle)
diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake
index d734148d3..519adfb47 100644
--- a/Source/WebKit2/PlatformEfl.cmake
+++ b/Source/WebKit2/PlatformEfl.cmake
@@ -42,7 +42,7 @@ LIST(APPEND WebKit2_SOURCES
UIProcess/API/C/soup/WKSoupRequestManager.cpp
UIProcess/API/efl/BatteryProvider.cpp
- UIProcess/API/efl/EflViewportHandler.cpp
+ UIProcess/API/efl/PageViewportControllerClientEfl.cpp
UIProcess/API/efl/NetworkInfoProvider.cpp
UIProcess/API/efl/PageClientImpl.cpp
UIProcess/API/efl/VibrationProvider.cpp
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.h b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
index 83dd3fb74..3c4f92a7d 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -61,8 +61,8 @@ public:
bool initialize(const PluginCreationParameters&);
void destroy();
- void didReceivePluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceivePluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
bool wantsWheelEvents() const;
diff --git a/Source/WebKit2/PluginProcess/PluginProcess.cpp b/Source/WebKit2/PluginProcess/PluginProcess.cpp
index 7125d7d86..03c6f00b9 100644
--- a/Source/WebKit2/PluginProcess/PluginProcess.cpp
+++ b/Source/WebKit2/PluginProcess/PluginProcess.cpp
@@ -134,9 +134,9 @@ bool PluginProcess::shouldTerminate()
return true;
}
-void PluginProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void PluginProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceivePluginProcessMessage(connection, messageID, arguments);
+ didReceivePluginProcessMessage(connection, messageID, decoder);
}
void PluginProcess::didClose(CoreIPC::Connection*)
diff --git a/Source/WebKit2/PluginProcess/PluginProcess.h b/Source/WebKit2/PluginProcess/PluginProcess.h
index 645153cee..0d855429d 100644
--- a/Source/WebKit2/PluginProcess/PluginProcess.h
+++ b/Source/WebKit2/PluginProcess/PluginProcess.h
@@ -74,12 +74,12 @@ private:
virtual bool shouldTerminate();
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didClose(CoreIPC::Connection*);
- virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didClose(CoreIPC::Connection*) OVERRIDE;
+ virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID) OVERRIDE;
// Message handlers.
- void didReceivePluginProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceivePluginProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void initializePluginProcess(const PluginProcessCreationParameters&);
void createWebProcessConnection();
void getSitesWithData(uint64_t callbackID);
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
index 0507d613b..21a867038 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
@@ -29,6 +29,7 @@
#if ENABLE(PLUGIN_PROCESS)
#include "ArgumentCoders.h"
+#include "ConnectionStack.h"
#include "NPRemoteObjectMap.h"
#include "PluginControllerProxy.h"
#include "PluginCreationParameters.h"
@@ -42,51 +43,6 @@ using namespace WebCore;
namespace WebKit {
-class ConnectionStack {
-public:
- CoreIPC::Connection* current()
- {
- return m_connectionStack.last();
- }
-
- class CurrentConnectionPusher {
- public:
- CurrentConnectionPusher(ConnectionStack& connectionStack, CoreIPC::Connection* connection)
- : m_connectionStack(connectionStack)
-#if !ASSERT_DISABLED
- , m_connection(connection)
-#endif
- {
- m_connectionStack.m_connectionStack.append(connection);
- }
-
- ~CurrentConnectionPusher()
- {
- ASSERT(m_connectionStack.current() == m_connection);
- m_connectionStack.m_connectionStack.removeLast();
- }
-
- private:
- ConnectionStack& m_connectionStack;
-#if !ASSERT_DISABLED
- CoreIPC::Connection* m_connection;
-#endif
- };
-
-private:
- // It's OK for these to be weak pointers because we only push object on the stack
- // from within didReceiveMessage and didReceiveSyncMessage and the Connection objects are
- // already ref'd for the duration of those functions.
- Vector<CoreIPC::Connection*, 4> m_connectionStack;
-};
-
-static ConnectionStack& connectionStack()
-{
- DEFINE_STATIC_LOCAL(ConnectionStack, connectionStack, ());
-
- return connectionStack;
-}
-
PassRefPtr<WebProcessConnection> WebProcessConnection::create(CoreIPC::Connection::Identifier connectionIdentifier)
{
return adoptRef(new WebProcessConnection(connectionIdentifier));
@@ -151,57 +107,57 @@ void WebProcessConnection::removePluginControllerProxy(PluginControllerProxy* pl
void WebProcessConnection::setGlobalException(const String& exceptionString)
{
- CoreIPC::Connection* connection = connectionStack().current();
+ CoreIPC::Connection* connection = ConnectionStack::shared().current();
if (!connection)
return;
connection->sendSync(Messages::PluginProcessConnection::SetException(exceptionString), Messages::PluginProcessConnection::SetException::Reply(), 0);
}
-void WebProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- ConnectionStack::CurrentConnectionPusher currentConnection(connectionStack(), connection);
+ ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::shared(), connection);
if (messageID.is<CoreIPC::MessageClassWebProcessConnection>()) {
- didReceiveWebProcessConnectionMessage(connection, messageID, arguments);
+ didReceiveWebProcessConnectionMessage(connection, messageID, decoder);
return;
}
- if (!arguments->destinationID()) {
+ if (!decoder.destinationID()) {
ASSERT_NOT_REACHED();
return;
}
- PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
+ PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(decoder.destinationID());
if (!pluginControllerProxy)
return;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
- pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, messageID, arguments);
+ pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, messageID, decoder);
}
-void WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- ConnectionStack::CurrentConnectionPusher currentConnection(connectionStack(), connection);
+ ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::shared(), connection);
- uint64_t destinationID = arguments->destinationID();
+ uint64_t destinationID = decoder.destinationID();
if (!destinationID) {
- didReceiveSyncWebProcessConnectionMessage(connection, messageID, arguments, reply);
+ didReceiveSyncWebProcessConnectionMessage(connection, messageID, decoder, replyEncoder);
return;
}
if (messageID.is<CoreIPC::MessageClassNPObjectMessageReceiver>()) {
- m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
return;
}
- PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
+ PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(decoder.destinationID());
if (!pluginControllerProxy)
return;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
- pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, messageID, arguments, reply);
+ pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, messageID, decoder, replyEncoder);
}
void WebProcessConnection::didClose(CoreIPC::Connection*)
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.h b/Source/WebKit2/PluginProcess/WebProcessConnection.h
index 8296b5470..8a15c9c2b 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.h
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.h
@@ -62,14 +62,14 @@ private:
void destroyPluginControllerProxy(PluginControllerProxy*);
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
// Message handlers.
- void didReceiveWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void createPlugin(const PluginCreationParameters&, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply>);
void createPluginAsynchronously(const PluginCreationParameters&);
void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete);
diff --git a/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp
index 4113d3dfa..e25f0674e 100644
--- a/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp
+++ b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp
@@ -28,6 +28,8 @@
#include "config.h"
#include "PluginProcessMainUnix.h"
+#if ENABLE(PLUGIN_PROCESS)
+
#include "Logging.h"
#include "NetscapePlugin.h"
#include "PluginProcess.h"
@@ -71,9 +73,9 @@ static int webkitXError(Display* xdisplay, XErrorEvent* error)
WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
{
- ASSERT(argc == 2 || argc == 3);
+ ASSERT_UNUSED(argc, argc == 2 || argc == 3);
bool scanPlugin = !strcmp(argv[1], "-scanPlugin");
- ASSERT(argc == 2 || (argc == 3 && scanPlugin));
+ ASSERT_UNUSED(argc, argc == 2 || (argc == 3 && scanPlugin));
#if PLATFORM(GTK)
gtk_init(&argc, &argv);
@@ -111,3 +113,5 @@ WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
}
} // namespace WebKit
+
+#endif
diff --git a/Source/WebKit2/Scripts/webkit2/messages.py b/Source/WebKit2/Scripts/webkit2/messages.py
index 56d97bc81..4584a8531 100644
--- a/Source/WebKit2/Scripts/webkit2/messages.py
+++ b/Source/WebKit2/Scripts/webkit2/messages.py
@@ -129,18 +129,21 @@ def message_to_struct_declaration(message):
result.append('struct %s : %s' % (message.name, base_class(message)))
result.append(' {\n')
result.append(' static const Kind messageID = %s;\n' % message.id())
+ result.append(' static const char* receiverName() { return messageReceiverName(); }\n')
+ result.append(' static const char* name() { return "%s"; }\n' % message.name)
+ result.append('\n')
if message.reply_parameters != None:
if message.has_attribute(DELAYED_ATTRIBUTE):
send_parameters = [(function_parameter_type(x.type), x.name) for x in message.reply_parameters]
result.append(' struct DelayedReply : public ThreadSafeRefCounted<DelayedReply> {\n')
- result.append(' DelayedReply(PassRefPtr<CoreIPC::Connection>, PassOwnPtr<CoreIPC::ArgumentEncoder>);\n')
+ result.append(' DelayedReply(PassRefPtr<CoreIPC::Connection>, PassOwnPtr<CoreIPC::MessageEncoder>);\n')
result.append(' ~DelayedReply();\n')
result.append('\n')
result.append(' bool send(%s);\n' % ', '.join([' '.join(x) for x in send_parameters]))
result.append('\n')
result.append(' private:\n')
result.append(' RefPtr<CoreIPC::Connection> m_connection;\n')
- result.append(' OwnPtr<CoreIPC::ArgumentEncoder> m_arguments;\n')
+ result.append(' OwnPtr<CoreIPC::MessageEncoder> m_encoder;\n')
result.append(' };\n\n')
result.append(' typedef %s Reply;\n' % reply_type(message))
@@ -279,11 +282,19 @@ def generate_messages_header(file):
result.append(forward_declarations)
result.append('\n')
- result.append('namespace Messages {\n\nnamespace %s {\n\n' % receiver.name)
+ result.append('namespace Messages {\nnamespace %s {\n' % receiver.name)
+ result.append('\n')
+ result.append('static inline const char* messageReceiverName()\n')
+ result.append('{\n')
+ result.append(' return "%s";\n' % receiver.name)
+ result.append('}\n')
+ result.append('\n')
+
result.append(messages_to_kind_enum(receiver.messages))
result.append('\n')
result.append('\n'.join([message_to_struct_declaration(x) for x in receiver.messages]))
- result.append('\n} // namespace %s\n\n} // namespace Messages\n' % receiver.name)
+ result.append('\n')
+ result.append('} // namespace %s\n} // namespace Messages\n' % receiver.name)
result.append('\nnamespace CoreIPC {\n\n')
result.append('template<> struct MessageKindTraits<Messages::%s::Kind> {\n' % receiver.name)
@@ -306,7 +317,7 @@ def handler_function(receiver, message):
def async_case_statement(receiver, message):
- dispatch_function_args = ['arguments', 'this', '&%s' % handler_function(receiver, message)]
+ dispatch_function_args = ['decoder', 'this', '&%s' % handler_function(receiver, message)]
dispatch_function = 'handleMessage'
if message.has_attribute(VARIADIC_ATTRIBUTE):
dispatch_function += 'Variadic'
@@ -333,7 +344,7 @@ def sync_case_statement(receiver, message):
result = []
result.append(' case Messages::%s::%s:\n' % (receiver.name, message.id()))
- result.append(' CoreIPC::%s<Messages::%s::%s>(%sarguments, reply%s, this, &%s);\n' % (dispatch_function, receiver.name, message.name, 'connection, ' if message.has_attribute(DELAYED_ATTRIBUTE) else '', '' if message.has_attribute(DELAYED_ATTRIBUTE) else '.get()', handler_function(receiver, message)))
+ result.append(' CoreIPC::%s<Messages::%s::%s>(%sdecoder, %sreplyEncoder, this, &%s);\n' % (dispatch_function, receiver.name, message.name, 'connection, ' if message.has_attribute(DELAYED_ATTRIBUTE) else '', '' if message.has_attribute(DELAYED_ATTRIBUTE) else '*', handler_function(receiver, message)))
result.append(' return;\n')
return surround_in_condition(''.join(result), message.condition)
@@ -409,7 +420,7 @@ def generate_message_handler(file):
headers = {
'"%s"' % messages_header_filename(receiver): [None],
'"HandleMessage.h"': [None],
- '"ArgumentDecoder.h"': [None],
+ '"MessageDecoder.h"': [None],
}
type_conditions = {}
@@ -488,9 +499,9 @@ def generate_message_handler(file):
if message.condition:
result.append('#if %s\n\n' % message.condition)
- result.append('%s::DelayedReply::DelayedReply(PassRefPtr<CoreIPC::Connection> connection, PassOwnPtr<CoreIPC::ArgumentEncoder> arguments)\n' % message.name)
+ result.append('%s::DelayedReply::DelayedReply(PassRefPtr<CoreIPC::Connection> connection, PassOwnPtr<CoreIPC::MessageEncoder> encoder)\n' % message.name)
result.append(' : m_connection(connection)\n')
- result.append(' , m_arguments(arguments)\n')
+ result.append(' , m_encoder(encoder)\n')
result.append('{\n')
result.append('}\n')
result.append('\n')
@@ -501,9 +512,9 @@ def generate_message_handler(file):
result.append('\n')
result.append('bool %s::DelayedReply::send(%s)\n' % (message.name, ', '.join([' '.join(x) for x in send_parameters])))
result.append('{\n')
- result.append(' ASSERT(m_arguments);\n')
- result += [' m_arguments->encode(%s);\n' % x.name for x in message.reply_parameters]
- result.append(' bool result = m_connection->sendSyncReply(static_pointer_cast<CoreIPC::MessageEncoder>(m_arguments.release()));\n')
+ result.append(' ASSERT(m_encoder);\n')
+ result += [' m_encoder->encode(%s);\n' % x.name for x in message.reply_parameters]
+ result.append(' bool result = m_connection->sendSyncReply(m_encoder.release());\n')
result.append(' m_connection = nullptr;\n')
result.append(' return result;\n')
result.append('}\n')
@@ -533,7 +544,7 @@ def generate_message_handler(file):
async_messages.append(message)
if async_dispatch_on_connection_queue_messages:
- result.append('void %s::didReceive%sMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)\n' % (receiver.name, receiver.name))
+ result.append('void %s::didReceive%sMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, bool& didHandleMessage)\n' % (receiver.name, receiver.name))
result.append('{\n')
result.append('#if COMPILER(MSVC)\n')
result.append('#pragma warning(push)\n')
@@ -550,7 +561,7 @@ def generate_message_handler(file):
result.append('}\n\n')
if async_messages:
- result.append('void %s::didReceive%sMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)\n' % (receiver.name, receiver.name))
+ result.append('void %s::didReceive%sMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)\n' % (receiver.name, receiver.name))
result.append('{\n')
result.append(' switch (messageID.get<Messages::%s::Kind>()) {\n' % receiver.name)
result += [async_case_statement(receiver, message) for message in async_messages]
@@ -562,7 +573,7 @@ def generate_message_handler(file):
if sync_messages:
result.append('\n')
- result.append('void %s::didReceiveSync%sMessage(CoreIPC::Connection*%s, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)\n' % (receiver.name, receiver.name, ' connection' if sync_delayed_messages else ''))
+ result.append('void %s::didReceiveSync%sMessage(CoreIPC::Connection*%s, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)\n' % (receiver.name, receiver.name, ' connection' if sync_delayed_messages else ''))
result.append('{\n')
result.append(' switch (messageID.get<Messages::%s::Kind>()) {\n' % receiver.name)
result += [sync_case_statement(receiver, message) for message in sync_messages]
diff --git a/Source/WebKit2/Scripts/webkit2/messages_unittest.py b/Source/WebKit2/Scripts/webkit2/messages_unittest.py
index 8ebbfd89d..e8d190d45 100644
--- a/Source/WebKit2/Scripts/webkit2/messages_unittest.py
+++ b/Source/WebKit2/Scripts/webkit2/messages_unittest.py
@@ -339,9 +339,13 @@ namespace WebKit {
}
namespace Messages {
-
namespace WebPage {
+static inline const char* messageReceiverName()
+{
+ return "WebPage";
+}
+
enum Kind {
LoadURLID,
#if ENABLE(TOUCH_EVENTS)
@@ -375,6 +379,9 @@ enum Kind {
struct LoadURL : CoreIPC::Arguments1<const WTF::String&> {
static const Kind messageID = LoadURLID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "LoadURL"; }
+
typedef CoreIPC::Arguments1<const WTF::String&> DecodeType;
explicit LoadURL(const WTF::String& url)
: CoreIPC::Arguments1<const WTF::String&>(url)
@@ -385,6 +392,9 @@ struct LoadURL : CoreIPC::Arguments1<const WTF::String&> {
#if ENABLE(TOUCH_EVENTS)
struct TouchEvent : CoreIPC::Arguments1<const WebKit::WebTouchEvent&> {
static const Kind messageID = TouchEventID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "TouchEvent"; }
+
typedef CoreIPC::Arguments1<const WebKit::WebTouchEvent&> DecodeType;
explicit TouchEvent(const WebKit::WebTouchEvent& event)
: CoreIPC::Arguments1<const WebKit::WebTouchEvent&>(event)
@@ -395,6 +405,9 @@ struct TouchEvent : CoreIPC::Arguments1<const WebKit::WebTouchEvent&> {
struct DidReceivePolicyDecision : CoreIPC::Arguments3<uint64_t, uint64_t, uint32_t> {
static const Kind messageID = DidReceivePolicyDecisionID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "DidReceivePolicyDecision"; }
+
typedef CoreIPC::Arguments3<uint64_t, uint64_t, uint32_t> DecodeType;
DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction)
: CoreIPC::Arguments3<uint64_t, uint64_t, uint32_t>(frameID, listenerID, policyAction)
@@ -404,11 +417,17 @@ struct DidReceivePolicyDecision : CoreIPC::Arguments3<uint64_t, uint64_t, uint32
struct Close : CoreIPC::Arguments0 {
static const Kind messageID = CloseID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "Close"; }
+
typedef CoreIPC::Arguments0 DecodeType;
};
struct PreferencesDidChange : CoreIPC::Arguments1<const WebKit::WebPreferencesStore&> {
static const Kind messageID = PreferencesDidChangeID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "PreferencesDidChange"; }
+
typedef CoreIPC::Arguments1<const WebKit::WebPreferencesStore&> DecodeType;
explicit PreferencesDidChange(const WebKit::WebPreferencesStore& store)
: CoreIPC::Arguments1<const WebKit::WebPreferencesStore&>(store)
@@ -418,6 +437,9 @@ struct PreferencesDidChange : CoreIPC::Arguments1<const WebKit::WebPreferencesSt
struct SendDoubleAndFloat : CoreIPC::Arguments2<double, float> {
static const Kind messageID = SendDoubleAndFloatID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "SendDoubleAndFloat"; }
+
typedef CoreIPC::Arguments2<double, float> DecodeType;
SendDoubleAndFloat(double d, float f)
: CoreIPC::Arguments2<double, float>(d, f)
@@ -427,6 +449,9 @@ struct SendDoubleAndFloat : CoreIPC::Arguments2<double, float> {
struct SendInts : CoreIPC::Arguments2<const Vector<uint64_t>&, const Vector<Vector<uint64_t> >&> {
static const Kind messageID = SendIntsID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "SendInts"; }
+
typedef CoreIPC::Arguments2<const Vector<uint64_t>&, const Vector<Vector<uint64_t> >&> DecodeType;
SendInts(const Vector<uint64_t>& ints, const Vector<Vector<uint64_t> >& intVectors)
: CoreIPC::Arguments2<const Vector<uint64_t>&, const Vector<Vector<uint64_t> >&>(ints, intVectors)
@@ -436,6 +461,9 @@ struct SendInts : CoreIPC::Arguments2<const Vector<uint64_t>&, const Vector<Vect
struct CreatePlugin : CoreIPC::Arguments2<uint64_t, const WebKit::Plugin::Parameters&> {
static const Kind messageID = CreatePluginID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "CreatePlugin"; }
+
typedef CoreIPC::Arguments1<bool&> Reply;
typedef CoreIPC::Arguments2<uint64_t, const WebKit::Plugin::Parameters&> DecodeType;
CreatePlugin(uint64_t pluginInstanceID, const WebKit::Plugin::Parameters& parameters)
@@ -446,6 +474,9 @@ struct CreatePlugin : CoreIPC::Arguments2<uint64_t, const WebKit::Plugin::Parame
struct RunJavaScriptAlert : CoreIPC::Arguments2<uint64_t, const WTF::String&> {
static const Kind messageID = RunJavaScriptAlertID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "RunJavaScriptAlert"; }
+
typedef CoreIPC::Arguments0 Reply;
typedef CoreIPC::Arguments2<uint64_t, const WTF::String&> DecodeType;
RunJavaScriptAlert(uint64_t frameID, const WTF::String& message)
@@ -456,6 +487,9 @@ struct RunJavaScriptAlert : CoreIPC::Arguments2<uint64_t, const WTF::String&> {
struct GetPlugins : CoreIPC::Arguments1<bool> {
static const Kind messageID = GetPluginsID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "GetPlugins"; }
+
typedef CoreIPC::Arguments1<Vector<WebCore::PluginInfo>&> Reply;
typedef CoreIPC::Arguments1<bool> DecodeType;
explicit GetPlugins(bool refresh)
@@ -466,15 +500,18 @@ struct GetPlugins : CoreIPC::Arguments1<bool> {
struct GetPluginProcessConnection : CoreIPC::Arguments1<const WTF::String&> {
static const Kind messageID = GetPluginProcessConnectionID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "GetPluginProcessConnection"; }
+
struct DelayedReply : public ThreadSafeRefCounted<DelayedReply> {
- DelayedReply(PassRefPtr<CoreIPC::Connection>, PassOwnPtr<CoreIPC::ArgumentEncoder>);
+ DelayedReply(PassRefPtr<CoreIPC::Connection>, PassOwnPtr<CoreIPC::MessageEncoder>);
~DelayedReply();
bool send(const CoreIPC::Connection::Handle& connectionHandle);
private:
RefPtr<CoreIPC::Connection> m_connection;
- OwnPtr<CoreIPC::ArgumentEncoder> m_arguments;
+ OwnPtr<CoreIPC::MessageEncoder> m_encoder;
};
typedef CoreIPC::Arguments1<CoreIPC::Connection::Handle&> Reply;
@@ -487,15 +524,18 @@ struct GetPluginProcessConnection : CoreIPC::Arguments1<const WTF::String&> {
struct TestMultipleAttributes : CoreIPC::Arguments0 {
static const Kind messageID = TestMultipleAttributesID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "TestMultipleAttributes"; }
+
struct DelayedReply : public ThreadSafeRefCounted<DelayedReply> {
- DelayedReply(PassRefPtr<CoreIPC::Connection>, PassOwnPtr<CoreIPC::ArgumentEncoder>);
+ DelayedReply(PassRefPtr<CoreIPC::Connection>, PassOwnPtr<CoreIPC::MessageEncoder>);
~DelayedReply();
bool send();
private:
RefPtr<CoreIPC::Connection> m_connection;
- OwnPtr<CoreIPC::ArgumentEncoder> m_arguments;
+ OwnPtr<CoreIPC::MessageEncoder> m_encoder;
};
typedef CoreIPC::Arguments0 Reply;
@@ -504,6 +544,9 @@ struct TestMultipleAttributes : CoreIPC::Arguments0 {
struct TestConnectionQueue : CoreIPC::Arguments1<uint64_t> {
static const Kind messageID = TestConnectionQueueID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "TestConnectionQueue"; }
+
typedef CoreIPC::Arguments1<uint64_t> DecodeType;
explicit TestConnectionQueue(uint64_t pluginID)
: CoreIPC::Arguments1<uint64_t>(pluginID)
@@ -513,6 +556,9 @@ struct TestConnectionQueue : CoreIPC::Arguments1<uint64_t> {
struct TestParameterAttributes : CoreIPC::Arguments3<uint64_t, double, double> {
static const Kind messageID = TestParameterAttributesID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "TestParameterAttributes"; }
+
typedef CoreIPC::Arguments3<uint64_t, double, double> DecodeType;
TestParameterAttributes(uint64_t foo, double bar, double baz)
: CoreIPC::Arguments3<uint64_t, double, double>(foo, bar, baz)
@@ -523,6 +569,9 @@ struct TestParameterAttributes : CoreIPC::Arguments3<uint64_t, double, double> {
#if PLATFORM(MAC)
struct DidCreateWebProcessConnection : CoreIPC::Arguments1<const CoreIPC::MachPort&> {
static const Kind messageID = DidCreateWebProcessConnectionID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "DidCreateWebProcessConnection"; }
+
typedef CoreIPC::Arguments1<const CoreIPC::MachPort&> DecodeType;
explicit DidCreateWebProcessConnection(const CoreIPC::MachPort& connectionIdentifier)
: CoreIPC::Arguments1<const CoreIPC::MachPort&>(connectionIdentifier)
@@ -534,6 +583,9 @@ struct DidCreateWebProcessConnection : CoreIPC::Arguments1<const CoreIPC::MachPo
#if PLATFORM(MAC)
struct InterpretKeyEvent : CoreIPC::Arguments1<uint32_t> {
static const Kind messageID = InterpretKeyEventID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "InterpretKeyEvent"; }
+
typedef CoreIPC::Arguments1<Vector<WebCore::KeypressCommand>&> Reply;
typedef CoreIPC::Arguments1<uint32_t> DecodeType;
explicit InterpretKeyEvent(uint32_t type)
@@ -546,6 +598,9 @@ struct InterpretKeyEvent : CoreIPC::Arguments1<uint32_t> {
#if ENABLE(DEPRECATED_FEATURE)
struct DeprecatedOperation : CoreIPC::Arguments1<const CoreIPC::DummyType&> {
static const Kind messageID = DeprecatedOperationID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "DeprecatedOperation"; }
+
typedef CoreIPC::Arguments1<const CoreIPC::DummyType&> DecodeType;
explicit DeprecatedOperation(const CoreIPC::DummyType& dummy)
: CoreIPC::Arguments1<const CoreIPC::DummyType&>(dummy)
@@ -557,6 +612,9 @@ struct DeprecatedOperation : CoreIPC::Arguments1<const CoreIPC::DummyType&> {
#if ENABLE(EXPERIMENTAL_FEATURE)
struct ExperimentalOperation : CoreIPC::Arguments1<const CoreIPC::DummyType&> {
static const Kind messageID = ExperimentalOperationID;
+ static const char* receiverName() { return messageReceiverName(); }
+ static const char* name() { return "ExperimentalOperation"; }
+
typedef CoreIPC::Arguments1<const CoreIPC::DummyType&> DecodeType;
explicit ExperimentalOperation(const CoreIPC::DummyType& dummy)
: CoreIPC::Arguments1<const CoreIPC::DummyType&>(dummy)
@@ -566,7 +624,6 @@ struct ExperimentalOperation : CoreIPC::Arguments1<const CoreIPC::DummyType&> {
#endif
} // namespace WebPage
-
} // namespace Messages
namespace CoreIPC {
@@ -613,7 +670,6 @@ _expected_receiver_implementation = """/*
#include "WebPage.h"
#include "ArgumentCoders.h"
-#include "ArgumentDecoder.h"
#include "Connection.h"
#if ENABLE(DEPRECATED_FEATURE) || ENABLE(EXPERIMENTAL_FEATURE)
#include "DummyType.h"
@@ -622,6 +678,7 @@ _expected_receiver_implementation = """/*
#if PLATFORM(MAC)
#include "MachPort.h"
#endif
+#include "MessageDecoder.h"
#include "Plugin.h"
#include "WebCoreArgumentCoders.h"
#if ENABLE(TOUCH_EVENTS)
@@ -640,9 +697,9 @@ namespace Messages {
namespace WebPage {
-GetPluginProcessConnection::DelayedReply::DelayedReply(PassRefPtr<CoreIPC::Connection> connection, PassOwnPtr<CoreIPC::ArgumentEncoder> arguments)
+GetPluginProcessConnection::DelayedReply::DelayedReply(PassRefPtr<CoreIPC::Connection> connection, PassOwnPtr<CoreIPC::MessageEncoder> encoder)
: m_connection(connection)
- , m_arguments(arguments)
+ , m_encoder(encoder)
{
}
@@ -653,16 +710,16 @@ GetPluginProcessConnection::DelayedReply::~DelayedReply()
bool GetPluginProcessConnection::DelayedReply::send(const CoreIPC::Connection::Handle& connectionHandle)
{
- ASSERT(m_arguments);
- m_arguments->encode(connectionHandle);
- bool result = m_connection->sendSyncReply(static_pointer_cast<CoreIPC::MessageEncoder>(m_arguments.release()));
+ ASSERT(m_encoder);
+ m_encoder->encode(connectionHandle);
+ bool result = m_connection->sendSyncReply(m_encoder.release());
m_connection = nullptr;
return result;
}
-TestMultipleAttributes::DelayedReply::DelayedReply(PassRefPtr<CoreIPC::Connection> connection, PassOwnPtr<CoreIPC::ArgumentEncoder> arguments)
+TestMultipleAttributes::DelayedReply::DelayedReply(PassRefPtr<CoreIPC::Connection> connection, PassOwnPtr<CoreIPC::MessageEncoder> encoder)
: m_connection(connection)
- , m_arguments(arguments)
+ , m_encoder(encoder)
{
}
@@ -673,8 +730,8 @@ TestMultipleAttributes::DelayedReply::~DelayedReply()
bool TestMultipleAttributes::DelayedReply::send()
{
- ASSERT(m_arguments);
- bool result = m_connection->sendSyncReply(static_pointer_cast<CoreIPC::MessageEncoder>(m_arguments.release()));
+ ASSERT(m_encoder);
+ bool result = m_connection->sendSyncReply(m_encoder.release());
m_connection = nullptr;
return result;
}
@@ -685,7 +742,7 @@ bool TestMultipleAttributes::DelayedReply::send()
namespace WebKit {
-void WebPage::didReceiveWebPageMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)
+void WebPage::didReceiveWebPageMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, bool& didHandleMessage)
{
#if COMPILER(MSVC)
#pragma warning(push)
@@ -693,7 +750,7 @@ void WebPage::didReceiveWebPageMessageOnConnectionWorkQueue(CoreIPC::Connection*
#endif
switch (messageID.get<Messages::WebPage::Kind>()) {
case Messages::WebPage::TestConnectionQueueID:
- CoreIPC::handleMessageOnConnectionQueue<Messages::WebPage::TestConnectionQueue>(connection, arguments, this, &WebPage::testConnectionQueue);
+ CoreIPC::handleMessageOnConnectionQueue<Messages::WebPage::TestConnectionQueue>(connection, decoder, this, &WebPage::testConnectionQueue);
didHandleMessage = true;
return;
default:
@@ -704,48 +761,48 @@ void WebPage::didReceiveWebPageMessageOnConnectionWorkQueue(CoreIPC::Connection*
#endif
}
-void WebPage::didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebPage::didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
switch (messageID.get<Messages::WebPage::Kind>()) {
case Messages::WebPage::LoadURLID:
- CoreIPC::handleMessage<Messages::WebPage::LoadURL>(arguments, this, &WebPage::loadURL);
+ CoreIPC::handleMessage<Messages::WebPage::LoadURL>(decoder, this, &WebPage::loadURL);
return;
#if ENABLE(TOUCH_EVENTS)
case Messages::WebPage::TouchEventID:
- CoreIPC::handleMessage<Messages::WebPage::TouchEvent>(arguments, this, &WebPage::touchEvent);
+ CoreIPC::handleMessage<Messages::WebPage::TouchEvent>(decoder, this, &WebPage::touchEvent);
return;
#endif
case Messages::WebPage::DidReceivePolicyDecisionID:
- CoreIPC::handleMessage<Messages::WebPage::DidReceivePolicyDecision>(arguments, this, &WebPage::didReceivePolicyDecision);
+ CoreIPC::handleMessage<Messages::WebPage::DidReceivePolicyDecision>(decoder, this, &WebPage::didReceivePolicyDecision);
return;
case Messages::WebPage::CloseID:
- CoreIPC::handleMessage<Messages::WebPage::Close>(arguments, this, &WebPage::close);
+ CoreIPC::handleMessage<Messages::WebPage::Close>(decoder, this, &WebPage::close);
return;
case Messages::WebPage::PreferencesDidChangeID:
- CoreIPC::handleMessage<Messages::WebPage::PreferencesDidChange>(arguments, this, &WebPage::preferencesDidChange);
+ CoreIPC::handleMessage<Messages::WebPage::PreferencesDidChange>(decoder, this, &WebPage::preferencesDidChange);
return;
case Messages::WebPage::SendDoubleAndFloatID:
- CoreIPC::handleMessage<Messages::WebPage::SendDoubleAndFloat>(arguments, this, &WebPage::sendDoubleAndFloat);
+ CoreIPC::handleMessage<Messages::WebPage::SendDoubleAndFloat>(decoder, this, &WebPage::sendDoubleAndFloat);
return;
case Messages::WebPage::SendIntsID:
- CoreIPC::handleMessage<Messages::WebPage::SendInts>(arguments, this, &WebPage::sendInts);
+ CoreIPC::handleMessage<Messages::WebPage::SendInts>(decoder, this, &WebPage::sendInts);
return;
case Messages::WebPage::TestParameterAttributesID:
- CoreIPC::handleMessage<Messages::WebPage::TestParameterAttributes>(arguments, this, &WebPage::testParameterAttributes);
+ CoreIPC::handleMessage<Messages::WebPage::TestParameterAttributes>(decoder, this, &WebPage::testParameterAttributes);
return;
#if PLATFORM(MAC)
case Messages::WebPage::DidCreateWebProcessConnectionID:
- CoreIPC::handleMessage<Messages::WebPage::DidCreateWebProcessConnection>(arguments, this, &WebPage::didCreateWebProcessConnection);
+ CoreIPC::handleMessage<Messages::WebPage::DidCreateWebProcessConnection>(decoder, this, &WebPage::didCreateWebProcessConnection);
return;
#endif
#if ENABLE(DEPRECATED_FEATURE)
case Messages::WebPage::DeprecatedOperationID:
- CoreIPC::handleMessage<Messages::WebPage::DeprecatedOperation>(arguments, this, &WebPage::deprecatedOperation);
+ CoreIPC::handleMessage<Messages::WebPage::DeprecatedOperation>(decoder, this, &WebPage::deprecatedOperation);
return;
#endif
#if ENABLE(EXPERIMENTAL_FEATURE)
case Messages::WebPage::ExperimentalOperationID:
- CoreIPC::handleMessage<Messages::WebPage::ExperimentalOperation>(arguments, this, &WebPage::experimentalOperation);
+ CoreIPC::handleMessage<Messages::WebPage::ExperimentalOperation>(decoder, this, &WebPage::experimentalOperation);
return;
#endif
default:
@@ -755,21 +812,21 @@ void WebPage::didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID
ASSERT_NOT_REACHED();
}
-void WebPage::didReceiveSyncWebPageMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebPage::didReceiveSyncWebPageMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
switch (messageID.get<Messages::WebPage::Kind>()) {
case Messages::WebPage::CreatePluginID:
- CoreIPC::handleMessage<Messages::WebPage::CreatePlugin>(arguments, reply.get(), this, &WebPage::createPlugin);
+ CoreIPC::handleMessage<Messages::WebPage::CreatePlugin>(decoder, *replyEncoder, this, &WebPage::createPlugin);
return;
case Messages::WebPage::RunJavaScriptAlertID:
- CoreIPC::handleMessage<Messages::WebPage::RunJavaScriptAlert>(arguments, reply.get(), this, &WebPage::runJavaScriptAlert);
+ CoreIPC::handleMessage<Messages::WebPage::RunJavaScriptAlert>(decoder, *replyEncoder, this, &WebPage::runJavaScriptAlert);
return;
case Messages::WebPage::GetPluginProcessConnectionID:
- CoreIPC::handleMessageDelayed<Messages::WebPage::GetPluginProcessConnection>(connection, arguments, reply, this, &WebPage::getPluginProcessConnection);
+ CoreIPC::handleMessageDelayed<Messages::WebPage::GetPluginProcessConnection>(connection, decoder, replyEncoder, this, &WebPage::getPluginProcessConnection);
return;
#if PLATFORM(MAC)
case Messages::WebPage::InterpretKeyEventID:
- CoreIPC::handleMessage<Messages::WebPage::InterpretKeyEvent>(arguments, reply.get(), this, &WebPage::interpretKeyEvent);
+ CoreIPC::handleMessage<Messages::WebPage::InterpretKeyEvent>(decoder, *replyEncoder, this, &WebPage::interpretKeyEvent);
return;
#endif
default:
diff --git a/Source/WebKit2/Shared/ConnectionStack.cpp b/Source/WebKit2/Shared/ConnectionStack.cpp
new file mode 100644
index 000000000..944dc7386
--- /dev/null
+++ b/Source/WebKit2/Shared/ConnectionStack.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ConnectionStack.h"
+
+namespace WebKit {
+
+ConnectionStack& ConnectionStack::shared()
+{
+ DEFINE_STATIC_LOCAL(ConnectionStack, connectionStack, ());
+
+ return connectionStack;
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/Shared/ConnectionStack.h b/Source/WebKit2/Shared/ConnectionStack.h
new file mode 100644
index 000000000..6eea5ba4d
--- /dev/null
+++ b/Source/WebKit2/Shared/ConnectionStack.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ConnectionStack_h
+#define ConnectionStack_h
+
+#include <wtf/Vector.h>
+
+namespace CoreIPC {
+ class Connection;
+}
+
+namespace WebKit {
+
+class ConnectionStack {
+public:
+ static ConnectionStack& shared();
+
+ CoreIPC::Connection* current()
+ {
+ return m_connectionStack.last();
+ }
+
+ class CurrentConnectionPusher {
+ public:
+ CurrentConnectionPusher(ConnectionStack& connectionStack, CoreIPC::Connection* connection)
+ : m_connectionStack(connectionStack)
+#if !ASSERT_DISABLED
+ , m_connection(connection)
+#endif
+ {
+ m_connectionStack.m_connectionStack.append(connection);
+ }
+
+ ~CurrentConnectionPusher()
+ {
+ ASSERT(m_connectionStack.current() == m_connection);
+ m_connectionStack.m_connectionStack.removeLast();
+ }
+
+ private:
+ ConnectionStack& m_connectionStack;
+#if !ASSERT_DISABLED
+ CoreIPC::Connection* m_connection;
+#endif
+ };
+
+private:
+ // It's OK for these to be weak pointers because we only push object on the stack
+ // from within didReceiveMessage and didReceiveSyncMessage and the Connection objects are
+ // already ref'd for the duration of those functions.
+ Vector<CoreIPC::Connection*, 4> m_connectionStack;
+};
+
+} // namespace WebKit
+
+#endif // ConnectionStack_h
diff --git a/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp b/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp
new file mode 100644
index 000000000..a237288b4
--- /dev/null
+++ b/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp
@@ -0,0 +1,538 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Company 100, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CoordinatedGraphicsArgumentCoders.h"
+
+#if USE(COORDINATED_GRAPHICS)
+#include "WebCoreArgumentCoders.h"
+#include <WebCore/Animation.h>
+#include <WebCore/Color.h>
+#include <WebCore/FloatPoint3D.h>
+#include <WebCore/IntPoint.h>
+#include <WebCore/Length.h>
+#include <WebCore/TransformationMatrix.h>
+
+#if ENABLE(CSS_FILTERS)
+#include <WebCore/FilterOperations.h>
+#endif
+
+#if ENABLE(CSS_SHADERS)
+#include "WebCustomFilterProgram.h"
+#include <WebCore/CustomFilterArrayParameter.h>
+#include <WebCore/CustomFilterNumberParameter.h>
+#include <WebCore/CustomFilterOperation.h>
+#include <WebCore/CustomFilterProgram.h>
+#include <WebCore/CustomFilterTransformParameter.h>
+#include <WebCore/IdentityTransformOperation.h>
+#include <WebCore/Matrix3DTransformOperation.h>
+#include <WebCore/MatrixTransformOperation.h>
+#include <WebCore/PerspectiveTransformOperation.h>
+#include <WebCore/RotateTransformOperation.h>
+#include <WebCore/ScaleTransformOperation.h>
+#include <WebCore/SkewTransformOperation.h>
+#include <WebCore/TranslateTransformOperation.h>
+#endif
+
+#if USE(GRAPHICS_SURFACE)
+#include <WebCore/GraphicsSurface.h>
+#endif
+
+using namespace WebCore;
+#if ENABLE(CSS_SHADERS)
+using namespace WebKit;
+#endif
+
+namespace CoreIPC {
+
+void ArgumentCoder<FloatPoint3D>::encode(ArgumentEncoder* encoder, const FloatPoint3D& floatPoint3D)
+{
+ SimpleArgumentCoder<FloatPoint3D>::encode(encoder, floatPoint3D);
+}
+
+bool ArgumentCoder<FloatPoint3D>::decode(ArgumentDecoder* decoder, FloatPoint3D& floatPoint3D)
+{
+ return SimpleArgumentCoder<FloatPoint3D>::decode(decoder, floatPoint3D);
+}
+
+void ArgumentCoder<Length>::encode(ArgumentEncoder* encoder, const Length& length)
+{
+ SimpleArgumentCoder<Length>::encode(encoder, length);
+}
+
+bool ArgumentCoder<Length>::decode(ArgumentDecoder* decoder, Length& length)
+{
+ return SimpleArgumentCoder<Length>::decode(decoder, length);
+}
+
+void ArgumentCoder<TransformationMatrix>::encode(ArgumentEncoder* encoder, const TransformationMatrix& transformationMatrix)
+{
+ SimpleArgumentCoder<TransformationMatrix>::encode(encoder, transformationMatrix);
+}
+
+bool ArgumentCoder<TransformationMatrix>::decode(ArgumentDecoder* decoder, TransformationMatrix& transformationMatrix)
+{
+ return SimpleArgumentCoder<TransformationMatrix>::decode(decoder, transformationMatrix);
+}
+
+#if ENABLE(CSS_FILTERS)
+void ArgumentCoder<WebCore::FilterOperations>::encode(ArgumentEncoder* encoder, const WebCore::FilterOperations& filters)
+{
+ encoder->encode(static_cast<uint32_t>(filters.size()));
+ for (size_t i = 0; i < filters.size(); ++i) {
+ const FilterOperation* filter = filters.at(i);
+ FilterOperation::OperationType type = filter->getOperationType();
+ encoder->encodeEnum(type);
+ switch (type) {
+ case FilterOperation::GRAYSCALE:
+ case FilterOperation::SEPIA:
+ case FilterOperation::SATURATE:
+ case FilterOperation::HUE_ROTATE:
+ encoder->encode(static_cast<double>(static_cast<const BasicColorMatrixFilterOperation*>(filter)->amount()));
+ break;
+ case FilterOperation::INVERT:
+ case FilterOperation::BRIGHTNESS:
+ case FilterOperation::CONTRAST:
+ case FilterOperation::OPACITY:
+ encoder->encode(static_cast<double>(static_cast<const BasicComponentTransferFilterOperation*>(filter)->amount()));
+ break;
+ case FilterOperation::BLUR:
+ ArgumentCoder<Length>::encode(encoder, static_cast<const BlurFilterOperation*>(filter)->stdDeviation());
+ break;
+ case FilterOperation::DROP_SHADOW: {
+ const DropShadowFilterOperation* shadow = static_cast<const DropShadowFilterOperation*>(filter);
+ ArgumentCoder<IntPoint>::encode(encoder, shadow->location());
+ encoder->encode(static_cast<int32_t>(shadow->stdDeviation()));
+ ArgumentCoder<Color>::encode(encoder, shadow->color());
+ break;
+ }
+#if ENABLE(CSS_SHADERS)
+ case FilterOperation::CUSTOM: {
+ const CustomFilterOperation* customOperation = static_cast<const CustomFilterOperation*>(filter);
+
+ ASSERT(customOperation->program());
+ RefPtr<CustomFilterProgram> program = customOperation->program();
+ ASSERT(program->isLoaded());
+ CustomFilterProgramInfo programInfo = program->programInfo();
+ encoder->encode(programInfo.vertexShaderString());
+ encoder->encode(programInfo.fragmentShaderString());
+ encoder->encodeEnum(program->programType());
+ CustomFilterProgramMixSettings mixSettings = programInfo.mixSettings();
+ encoder->encodeEnum(mixSettings.blendMode);
+ encoder->encodeEnum(mixSettings.compositeOperator);
+
+ CustomFilterParameterList parameters = customOperation->parameters();
+ encoder->encode(static_cast<uint32_t>(parameters.size()));
+ for (size_t i = 0; i < parameters.size(); ++i) {
+ RefPtr<CustomFilterParameter> parameter = parameters[i];
+ encoder->encode(parameter->name());
+ encoder->encodeEnum(parameter->parameterType());
+
+ switch (parameter->parameterType()) {
+ case CustomFilterParameter::ARRAY: {
+ CustomFilterArrayParameter* arrayParameter = static_cast<CustomFilterArrayParameter*>(parameter.get());
+ encoder->encode(static_cast<uint32_t>(arrayParameter->size()));
+ for (size_t j = 0; j < arrayParameter->size(); ++j)
+ encoder->encode(arrayParameter->valueAt(j));
+ break;
+ }
+ case CustomFilterParameter::NUMBER: {
+ CustomFilterNumberParameter* nubmerParameter = static_cast<CustomFilterNumberParameter*>(parameter.get());
+ encoder->encode(static_cast<uint32_t>(nubmerParameter->size()));
+ for (size_t j = 0; j < nubmerParameter->size(); ++j)
+ encoder->encode(nubmerParameter->valueAt(j));
+ break;
+ }
+ case CustomFilterParameter::TRANSFORM: {
+ CustomFilterTransformParameter* transformParameter = static_cast<CustomFilterTransformParameter*>(parameter.get());
+ ArgumentCoder<TransformOperations>::encode(encoder, transformParameter->operations());
+ break;
+ }
+ }
+ }
+
+ encoder->encode(customOperation->meshRows());
+ encoder->encode(customOperation->meshColumns());
+ encoder->encodeEnum(customOperation->meshBoxType());
+ encoder->encodeEnum(customOperation->meshType());
+ break;
+ }
+#endif
+ default:
+ break;
+ }
+ }
+}
+
+bool ArgumentCoder<WebCore::FilterOperations>::decode(ArgumentDecoder* decoder, WebCore::FilterOperations& filters)
+{
+ uint32_t size;
+ if (!decoder->decodeUInt32(size))
+ return false;
+
+ Vector<RefPtr<FilterOperation> >& operations = filters.operations();
+
+ for (size_t i = 0; i < size; ++i) {
+ FilterOperation::OperationType type;
+ RefPtr<FilterOperation> filter;
+ if (!decoder->decodeEnum(type))
+ return false;
+
+ switch (type) {
+ case FilterOperation::GRAYSCALE:
+ case FilterOperation::SEPIA:
+ case FilterOperation::SATURATE:
+ case FilterOperation::HUE_ROTATE: {
+ double value;
+ if (!decoder->decodeDouble(value))
+ return false;
+ filter = BasicColorMatrixFilterOperation::create(value, type);
+ break;
+ }
+ case FilterOperation::INVERT:
+ case FilterOperation::BRIGHTNESS:
+ case FilterOperation::CONTRAST:
+ case FilterOperation::OPACITY: {
+ double value;
+ if (!decoder->decodeDouble(value))
+ return false;
+ filter = BasicComponentTransferFilterOperation::create(value, type);
+ break;
+ }
+ case FilterOperation::BLUR: {
+ Length length;
+ if (!ArgumentCoder<Length>::decode(decoder, length))
+ return false;
+ filter = BlurFilterOperation::create(length, type);
+ break;
+ }
+ case FilterOperation::DROP_SHADOW: {
+ IntPoint location;
+ int32_t stdDeviation;
+ Color color;
+ if (!ArgumentCoder<IntPoint>::decode(decoder, location))
+ return false;
+ if (!decoder->decodeInt32(stdDeviation))
+ return false;
+ if (!ArgumentCoder<Color>::decode(decoder, color))
+ return false;
+ filter = DropShadowFilterOperation::create(location, stdDeviation, color, type);
+ break;
+ }
+#if ENABLE(CSS_SHADERS)
+ case FilterOperation::CUSTOM: {
+ String vertexShaderString;
+ String fragmentShaderString;
+ CustomFilterProgramType programType;
+ CustomFilterProgramMixSettings mixSettings;
+ if (!decoder->decode(vertexShaderString))
+ return false;
+ if (!decoder->decode(fragmentShaderString))
+ return false;
+ if (!decoder->decodeEnum(programType))
+ return false;
+ if (!decoder->decodeEnum(mixSettings.blendMode))
+ return false;
+ if (!decoder->decodeEnum(mixSettings.compositeOperator))
+ return false;
+ RefPtr<CustomFilterProgram> program = WebCustomFilterProgram::create(vertexShaderString, fragmentShaderString, programType, mixSettings);
+
+ uint32_t parametersSize;
+ if (!decoder->decodeUInt32(parametersSize))
+ return false;
+
+ CustomFilterParameterList parameters(parametersSize);
+ for (size_t i = 0; i < parametersSize; ++i) {
+ String name;
+ CustomFilterParameter::ParameterType parameterType;
+ if (!decoder->decode(name))
+ return false;
+ if (!decoder->decodeEnum(parameterType))
+ return false;
+
+ switch (parameterType) {
+ case CustomFilterParameter::ARRAY: {
+ RefPtr<CustomFilterArrayParameter> arrayParameter = CustomFilterArrayParameter::create(name);
+ parameters.append(arrayParameter);
+ uint32_t arrayParameterSize;
+ if (!decoder->decodeUInt32(arrayParameterSize))
+ return false;
+ double arrayParameterValue;
+ for (size_t j = 0; j < arrayParameterSize; ++j) {
+ if (!decoder->decode(arrayParameterValue))
+ return false;
+ arrayParameter->addValue(arrayParameterValue);
+ }
+ break;
+ }
+ case CustomFilterParameter::NUMBER: {
+ RefPtr<CustomFilterNumberParameter> numberParameter = CustomFilterNumberParameter::create(name);
+ parameters.append(numberParameter);
+ uint32_t numberParameterSize;
+ if (!decoder->decodeUInt32(numberParameterSize))
+ return false;
+ double numberParameterValue;
+ for (size_t j = 0; j < numberParameterSize; ++j) {
+ if (!decoder->decode(numberParameterValue))
+ return false;
+ numberParameter->addValue(numberParameterValue);
+ }
+ break;
+ }
+ case CustomFilterParameter::TRANSFORM: {
+ RefPtr<CustomFilterTransformParameter> transformParameter = CustomFilterTransformParameter::create(name);
+ parameters.append(transformParameter);
+ TransformOperations operations;
+ if (!ArgumentCoder<TransformOperations>::decode(decoder, operations))
+ return false;
+ transformParameter->setOperations(operations);
+ break;
+ }
+ }
+ }
+
+ unsigned meshRows;
+ unsigned meshColumns;
+ CustomFilterOperation::MeshBoxType meshBoxType;
+ CustomFilterOperation::MeshType meshType;
+ if (!decoder->decode(meshRows))
+ return false;
+ if (!decoder->decode(meshColumns))
+ return false;
+ if (!decoder->decodeEnum(meshBoxType))
+ return false;
+ if (!decoder->decodeEnum(meshType))
+ return false;
+
+ filter = CustomFilterOperation::create(program, parameters, meshRows, meshColumns, meshBoxType, meshType);
+ break;
+ }
+#endif
+ default:
+ break;
+ }
+
+ if (filter)
+ operations.append(filter);
+ }
+
+ return true;
+}
+#endif
+
+#if ENABLE(CSS_SHADERS)
+void ArgumentCoder<TransformOperations>::encode(ArgumentEncoder* encoder, const TransformOperations& transformOperations)
+{
+ encoder->encode(static_cast<uint32_t>(transformOperations.size()));
+ for (size_t i = 0; i < transformOperations.size(); ++i) {
+ const TransformOperation* operation = transformOperations.at(i);
+ encoder->encodeEnum(operation->getOperationType());
+
+ switch (operation->getOperationType()) {
+ case TransformOperation::SCALE_X:
+ case TransformOperation::SCALE_Y:
+ case TransformOperation::SCALE:
+ case TransformOperation::SCALE_Z:
+ case TransformOperation::SCALE_3D:
+ encoder->encode(static_cast<const ScaleTransformOperation*>(operation)->x());
+ encoder->encode(static_cast<const ScaleTransformOperation*>(operation)->y());
+ encoder->encode(static_cast<const ScaleTransformOperation*>(operation)->z());
+ break;
+ case TransformOperation::TRANSLATE_X:
+ case TransformOperation::TRANSLATE_Y:
+ case TransformOperation::TRANSLATE:
+ case TransformOperation::TRANSLATE_Z:
+ case TransformOperation::TRANSLATE_3D:
+ ArgumentCoder<Length>::encode(encoder, static_cast<const TranslateTransformOperation*>(operation)->x());
+ ArgumentCoder<Length>::encode(encoder, static_cast<const TranslateTransformOperation*>(operation)->y());
+ ArgumentCoder<Length>::encode(encoder, static_cast<const TranslateTransformOperation*>(operation)->z());
+ break;
+ case TransformOperation::ROTATE:
+ case TransformOperation::ROTATE_X:
+ case TransformOperation::ROTATE_Y:
+ case TransformOperation::ROTATE_3D:
+ encoder->encode(static_cast<const RotateTransformOperation*>(operation)->x());
+ encoder->encode(static_cast<const RotateTransformOperation*>(operation)->y());
+ encoder->encode(static_cast<const RotateTransformOperation*>(operation)->z());
+ encoder->encode(static_cast<const RotateTransformOperation*>(operation)->angle());
+ break;
+ case TransformOperation::SKEW_X:
+ case TransformOperation::SKEW_Y:
+ case TransformOperation::SKEW:
+ encoder->encode(static_cast<const SkewTransformOperation*>(operation)->angleX());
+ encoder->encode(static_cast<const SkewTransformOperation*>(operation)->angleY());
+ break;
+ case TransformOperation::MATRIX:
+ ArgumentCoder<TransformationMatrix>::encode(encoder, static_cast<const MatrixTransformOperation*>(operation)->matrix());
+ break;
+ case TransformOperation::MATRIX_3D:
+ ArgumentCoder<TransformationMatrix>::encode(encoder, static_cast<const Matrix3DTransformOperation*>(operation)->matrix());
+ break;
+ case TransformOperation::PERSPECTIVE:
+ ArgumentCoder<Length>::encode(encoder, static_cast<const PerspectiveTransformOperation*>(operation)->perspective());
+ break;
+ case TransformOperation::IDENTITY:
+ break;
+ case TransformOperation::NONE:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+}
+
+bool ArgumentCoder<TransformOperations>::decode(ArgumentDecoder* decoder, TransformOperations& transformOperations)
+{
+ uint32_t operationsSize;
+ if (!decoder->decodeUInt32(operationsSize))
+ return false;
+
+ for (size_t i = 0; i < operationsSize; ++i) {
+ TransformOperation::OperationType operationType;
+ if (!decoder->decodeEnum(operationType))
+ return false;
+
+ switch (operationType) {
+ case TransformOperation::SCALE_X:
+ case TransformOperation::SCALE_Y:
+ case TransformOperation::SCALE:
+ case TransformOperation::SCALE_Z:
+ case TransformOperation::SCALE_3D: {
+ double x, y, z;
+ if (!decoder->decode(x))
+ return false;
+ if (!decoder->decode(y))
+ return false;
+ if (!decoder->decode(z))
+ return false;
+ transformOperations.operations().append(ScaleTransformOperation::create(x, y, z, operationType));
+ break;
+ }
+ case TransformOperation::TRANSLATE_X:
+ case TransformOperation::TRANSLATE_Y:
+ case TransformOperation::TRANSLATE:
+ case TransformOperation::TRANSLATE_Z:
+ case TransformOperation::TRANSLATE_3D: {
+ Length x, y, z;
+ if (!ArgumentCoder<Length>::decode(decoder, x))
+ return false;
+ if (!ArgumentCoder<Length>::decode(decoder, y))
+ return false;
+ if (!ArgumentCoder<Length>::decode(decoder, z))
+ return false;
+ transformOperations.operations().append(TranslateTransformOperation::create(x, y, z, operationType));
+ break;
+ }
+ case TransformOperation::ROTATE:
+ case TransformOperation::ROTATE_X:
+ case TransformOperation::ROTATE_Y:
+ case TransformOperation::ROTATE_3D: {
+ double x, y, z, angle;
+ if (!decoder->decode(x))
+ return false;
+ if (!decoder->decode(y))
+ return false;
+ if (!decoder->decode(z))
+ return false;
+ if (!decoder->decode(angle))
+ return false;
+ transformOperations.operations().append(RotateTransformOperation::create(x, y, z, angle, operationType));
+ break;
+ }
+ case TransformOperation::SKEW_X:
+ case TransformOperation::SKEW_Y:
+ case TransformOperation::SKEW: {
+ double angleX, angleY;
+ if (!decoder->decode(angleX))
+ return false;
+ if (!decoder->decode(angleY))
+ return false;
+ transformOperations.operations().append(SkewTransformOperation::create(angleX, angleY, operationType));
+ break;
+ }
+ case TransformOperation::MATRIX: {
+ TransformationMatrix matrix;
+ if (!ArgumentCoder<TransformationMatrix>::decode(decoder, matrix))
+ return false;
+ transformOperations.operations().append(MatrixTransformOperation::create(matrix));
+ break;
+ }
+ case TransformOperation::MATRIX_3D: {
+ TransformationMatrix matrix;
+ if (!ArgumentCoder<TransformationMatrix>::decode(decoder, matrix))
+ return false;
+ transformOperations.operations().append(Matrix3DTransformOperation::create(matrix));
+ break;
+ }
+ case TransformOperation::PERSPECTIVE: {
+ Length perspective;
+ if (!ArgumentCoder<Length>::decode(decoder, perspective))
+ return false;
+ transformOperations.operations().append(PerspectiveTransformOperation::create(perspective));
+ break;
+ }
+ case TransformOperation::IDENTITY:
+ transformOperations.operations().append(IdentityTransformOperation::create());
+ break;
+ case TransformOperation::NONE:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+ return true;
+}
+#endif
+
+#if USE(GRAPHICS_SURFACE)
+void ArgumentCoder<WebCore::GraphicsSurfaceToken>::encode(ArgumentEncoder* encoder, const WebCore::GraphicsSurfaceToken& token)
+{
+#if OS(DARWIN)
+ encoder->encode(static_cast<uint32_t>(token.frontBufferHandle));
+ encoder->encode(static_cast<uint32_t>(token.backBufferHandle));
+#endif
+#if OS(LINUX)
+ encoder->encode(static_cast<uint32_t>(token.frontBufferHandle));
+#endif
+}
+
+bool ArgumentCoder<WebCore::GraphicsSurfaceToken>::decode(ArgumentDecoder* decoder, WebCore::GraphicsSurfaceToken& token)
+{
+#if OS(DARWIN)
+ if (!decoder->decodeUInt32(token.frontBufferHandle))
+ return false;
+ if (!decoder->decodeUInt32(token.backBufferHandle))
+ return false;
+#endif
+#if OS(LINUX)
+ if (!decoder->decodeUInt32(token.frontBufferHandle))
+ return false;
+#endif
+ return true;
+}
+#endif
+
+} // namespace CoreIPC
+#endif // USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h b/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h
new file mode 100644
index 000000000..87b4c5fe7
--- /dev/null
+++ b/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Company 100, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CoordinatedGraphicsArgumentCoders_h
+#define CoordinatedGraphicsArgumentCoders_h
+
+#if USE(COORDINATED_GRAPHICS)
+#include "ArgumentCoders.h"
+
+namespace WebCore {
+class FloatPoint3D;
+class TransformationMatrix;
+struct Length;
+
+#if ENABLE(CSS_FILTERS)
+class FilterOperations;
+#endif
+
+#if ENABLE(CSS_SHADERS)
+class TransformOperations;
+#endif
+
+#if USE(GRAPHICS_SURFACE)
+struct GraphicsSurfaceToken;
+#endif
+}
+
+namespace CoreIPC {
+
+template<> struct ArgumentCoder<WebCore::FloatPoint3D> {
+ static void encode(ArgumentEncoder*, const WebCore::FloatPoint3D&);
+ static bool decode(ArgumentDecoder*, WebCore::FloatPoint3D&);
+};
+
+template<> struct ArgumentCoder<WebCore::Length> {
+ static void encode(ArgumentEncoder*, const WebCore::Length&);
+ static bool decode(ArgumentDecoder*, WebCore::Length&);
+};
+
+template<> struct ArgumentCoder<WebCore::TransformationMatrix> {
+ static void encode(ArgumentEncoder*, const WebCore::TransformationMatrix&);
+ static bool decode(ArgumentDecoder*, WebCore::TransformationMatrix&);
+};
+
+#if ENABLE(CSS_FILTERS)
+template<> struct ArgumentCoder<WebCore::FilterOperations> {
+ static void encode(ArgumentEncoder*, const WebCore::FilterOperations&);
+ static bool decode(ArgumentDecoder*, WebCore::FilterOperations&);
+};
+#endif
+
+#if ENABLE(CSS_SHADERS)
+template<> struct ArgumentCoder<WebCore::TransformOperations> {
+ static void encode(ArgumentEncoder*, const WebCore::TransformOperations&);
+ static bool decode(ArgumentDecoder*, WebCore::TransformOperations&);
+};
+#endif
+
+#if USE(GRAPHICS_SURFACE)
+template<> struct ArgumentCoder<WebCore::GraphicsSurfaceToken> {
+ static void encode(ArgumentEncoder*, const WebCore::GraphicsSurfaceToken&);
+ static bool decode(ArgumentDecoder*, WebCore::GraphicsSurfaceToken&);
+};
+#endif
+
+} // namespace CoreIPC
+#endif // USE(COORDINATED_GRAPHICS)
+
+#endif // CoordinatedGraphicsArgumentCoders_h
diff --git a/Source/WebKit2/Shared/CoordinatedGraphics/WebCustomFilterProgram.h b/Source/WebKit2/Shared/CoordinatedGraphics/WebCustomFilterProgram.h
new file mode 100644
index 000000000..eb097c295
--- /dev/null
+++ b/Source/WebKit2/Shared/CoordinatedGraphics/WebCustomFilterProgram.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2012 Company 100, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebCustomFilterProgram_h
+#define WebCustomFilterProgram_h
+
+#if USE(COORDINATED_GRAPHICS) && ENABLE(CSS_SHADERS)
+#include <WebCore/CustomFilterProgram.h>
+
+namespace WebKit {
+
+class WebCustomFilterProgram : public WebCore::CustomFilterProgram {
+public:
+ static PassRefPtr<WebCustomFilterProgram> create(String vertexShaderString, String m_fragmentShaderString, WebCore::CustomFilterProgramType programType, WebCore::CustomFilterProgramMixSettings mixSettings)
+ {
+ return adoptRef(new WebCustomFilterProgram(vertexShaderString, m_fragmentShaderString, programType, mixSettings));
+ }
+
+ virtual bool isLoaded() const OVERRIDE { return true; }
+
+ virtual bool operator==(const CustomFilterProgram& o) const OVERRIDE
+ {
+ // The following cast is ugly, but WebCustomFilterProgram is the single implementation of CustomFilterProgram on UI Process.
+ const WebCustomFilterProgram* other = static_cast<const WebCustomFilterProgram*>(&o);
+ return mixSettings() == other->mixSettings() && m_vertexShaderString == other->vertexShaderString() && m_fragmentShaderString == other->fragmentShaderString();
+ }
+
+protected:
+ virtual String vertexShaderString() const OVERRIDE { return m_vertexShaderString; }
+ virtual String fragmentShaderString() const OVERRIDE { return m_fragmentShaderString; }
+
+ virtual void willHaveClients() OVERRIDE { notifyClients(); }
+ virtual void didRemoveLastClient() OVERRIDE { }
+
+private:
+ WebCustomFilterProgram(String vertexShaderString, String fragmentShaderString, WebCore::CustomFilterProgramType programType, WebCore::CustomFilterProgramMixSettings mixSettings)
+ : WebCore::CustomFilterProgram(programType, mixSettings)
+ , m_vertexShaderString(vertexShaderString)
+ , m_fragmentShaderString(fragmentShaderString)
+ {
+ }
+
+ String m_vertexShaderString;
+ String m_fragmentShaderString;
+};
+
+} // namespace WebKit
+
+#endif // USE(COORDINATED_GRAPHICS) && ENABLE(CSS_SHADERS)
+
+#endif // WebCustomFilterProgram_h
diff --git a/Source/WebKit2/Shared/DictionaryPopupInfo.cpp b/Source/WebKit2/Shared/DictionaryPopupInfo.cpp
index 0f9d06ca1..7e6df3a5c 100644
--- a/Source/WebKit2/Shared/DictionaryPopupInfo.cpp
+++ b/Source/WebKit2/Shared/DictionaryPopupInfo.cpp
@@ -42,7 +42,7 @@ void DictionaryPopupInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
bool hadOptions = options;
- encoder->encodeBool(hadOptions);
+ encoder->encode(hadOptions);
if (hadOptions)
CoreIPC::encode(encoder, options.get());
#endif
diff --git a/Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp b/Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp
index 949aad7c2..747172504 100644
--- a/Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp
+++ b/Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp
@@ -73,7 +73,7 @@ void NPIdentifierData::encode(CoreIPC::ArgumentEncoder* encoder) const
if (m_isString)
encoder->encode(m_string);
else
- encoder->encodeInt32(m_number);
+ encoder->encode(static_cast<int32_t>(m_number));
}
bool NPIdentifierData::decode(CoreIPC::ArgumentDecoder* decoder, NPIdentifierData& result)
@@ -84,7 +84,7 @@ bool NPIdentifierData::decode(CoreIPC::ArgumentDecoder* decoder, NPIdentifierDat
if (result.m_isString)
return decoder->decode(result.m_string);
- return decoder->decodeInt32(result.m_number);
+ return decoder->decode(static_cast<int32_t>(result.m_number));
}
} // namespace WebKit
diff --git a/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h b/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
index e0af98bba..92d0a45d2 100644
--- a/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
+++ b/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
@@ -47,7 +47,7 @@ public:
static PassOwnPtr<NPObjectMessageReceiver> create(NPRemoteObjectMap*, Plugin*, uint64_t npObjectID, NPObject*);
~NPObjectMessageReceiver();
- void didReceiveSyncNPObjectMessageReceiverMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveSyncNPObjectMessageReceiverMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
Plugin* plugin() const { return m_plugin; }
NPObject* npObject() const { return m_npObject; }
diff --git a/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp b/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp
index b5ec2d9da..a50186cc4 100644
--- a/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp
+++ b/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp
@@ -227,13 +227,13 @@ void NPRemoteObjectMap::pluginDestroyed(Plugin* plugin)
}
}
-void NPRemoteObjectMap::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void NPRemoteObjectMap::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- NPObjectMessageReceiver* messageReceiver = m_registeredNPObjects.get(arguments->destinationID());
+ NPObjectMessageReceiver* messageReceiver = m_registeredNPObjects.get(decoder.destinationID());
if (!messageReceiver)
return;
- messageReceiver->didReceiveSyncNPObjectMessageReceiverMessage(connection, messageID, arguments, reply);
+ messageReceiver->didReceiveSyncNPObjectMessageReceiverMessage(connection, messageID, decoder, replyEncoder);
}
} // namespace WebKit
diff --git a/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h b/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h
index 0bfaefdf5..68d32abba 100644
--- a/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h
+++ b/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h
@@ -64,7 +64,7 @@ public:
void pluginDestroyed(Plugin*);
- void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
+ void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
private:
explicit NPRemoteObjectMap(CoreIPC::Connection*);
diff --git a/Source/WebKit2/Shared/ShareableSurface.cpp b/Source/WebKit2/Shared/ShareableSurface.cpp
index be093e0c0..f70769895 100644
--- a/Source/WebKit2/Shared/ShareableSurface.cpp
+++ b/Source/WebKit2/Shared/ShareableSurface.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "ShareableSurface.h"
+#include "CoordinatedGraphicsArgumentCoders.h"
#include "GraphicsContext.h"
#include "WebCoreArgumentCoders.h"
#include <WebCore/GraphicsSurfaceToken.h>
@@ -195,13 +196,13 @@ void ShareableSurface::copyToTexture(PassRefPtr<WebCore::BitmapTexture> passText
}
RefPtr<Image> image = m_graphicsSurface->createReadOnlyImage(IntRect(sourceOffset, target.size()));
- texture->updateContents(image.get(), target, IntPoint::zero());
+ texture->updateContents(image.get(), target, IntPoint::zero(), BitmapTexture::UpdateCanModifyOriginalImageData);
}
#endif
ASSERT(m_bitmap);
RefPtr<Image> image = m_bitmap->createImage();
- texture->updateContents(image.get(), target, sourceOffset);
+ texture->updateContents(image.get(), target, sourceOffset, BitmapTexture::UpdateCanModifyOriginalImageData);
return;
}
#endif // USE(TEXTURE_MAPPER)
diff --git a/Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.cpp b/Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.cpp
index fa564adc1..b669307eb 100644
--- a/Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.cpp
+++ b/Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "SharedWorkerProcessCreationParameters.h"
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#include "ArgumentCoders.h"
namespace WebKit {
@@ -60,3 +62,5 @@ bool SharedWorkerProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* dec
} // namespace WebKit
+
+#endif // ENABLE(SHARED_WORKER_PROCESS)
diff --git a/Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.h b/Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.h
index 3a60b4c3d..3fef97535 100644
--- a/Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.h
+++ b/Source/WebKit2/Shared/SharedWorkerProcessCreationParameters.h
@@ -26,6 +26,8 @@
#ifndef SharedWorkerProcessCreationParameters_h
#define SharedWorkerProcessCreationParameters_h
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#include <wtf/text/WTFString.h>
#if PLATFORM(MAC)
@@ -55,4 +57,6 @@ struct SharedWorkerProcessCreationParameters {
} // namespace WebKit
+#endif // ENABLE(SHARED_WORKER_PROCESS)
+
#endif // SharedWorkerProcessCreationParameters_h
diff --git a/Source/WebKit2/Shared/UserMessageCoders.h b/Source/WebKit2/Shared/UserMessageCoders.h
index 2ec5bb4d5..9d8ac5c6b 100644
--- a/Source/WebKit2/Shared/UserMessageCoders.h
+++ b/Source/WebKit2/Shared/UserMessageCoders.h
@@ -70,12 +70,12 @@ public:
bool baseEncode(CoreIPC::ArgumentEncoder* encoder, APIObject::Type& type) const
{
if (!m_root) {
- encoder->encodeUInt32(APIObject::TypeNull);
+ encoder->encode(static_cast<uint32_t>(APIObject::TypeNull));
return true;
}
type = m_root->type();
- encoder->encodeUInt32(type);
+ encoder->encode(static_cast<uint32_t>(type));
switch (type) {
case APIObject::TypeArray: {
diff --git a/Source/WebKit2/Shared/WebConnection.cpp b/Source/WebKit2/Shared/WebConnection.cpp
index 9743a78c7..92e63c4fc 100644
--- a/Source/WebKit2/Shared/WebConnection.cpp
+++ b/Source/WebKit2/Shared/WebConnection.cpp
@@ -55,7 +55,7 @@ void WebConnection::postMessage(const String& messageName, APIObject* messageBod
OwnPtr<CoreIPC::ArgumentEncoder> messageData = CoreIPC::ArgumentEncoder::create();
messageData->encode(messageName);
- encodeMessageBody(messageData.get(), messageBody);
+ encodeMessageBody(*messageData, messageBody);
m_connection->send(Messages::WebConnection::HandleMessage(CoreIPC::DataReference(messageData->buffer(), messageData->bufferSize())), 0);
}
@@ -69,7 +69,7 @@ void WebConnection::handleMessage(const CoreIPC::DataReference& messageData)
return;
RefPtr<APIObject> messageBody;
- if (!decodeMessageBody(decoder.get(), messageBody))
+ if (!decodeMessageBody(*decoder, messageBody))
return;
m_client.didReceiveMessage(this, messageName, messageBody.get());
diff --git a/Source/WebKit2/Shared/WebConnection.h b/Source/WebKit2/Shared/WebConnection.h
index b14d1f347..06a0134dc 100644
--- a/Source/WebKit2/Shared/WebConnection.h
+++ b/Source/WebKit2/Shared/WebConnection.h
@@ -58,11 +58,11 @@ protected:
explicit WebConnection(PassRefPtr<CoreIPC::Connection>);
virtual Type type() const { return APIType; }
- virtual void encodeMessageBody(CoreIPC::ArgumentEncoder*, APIObject*) = 0;
- virtual bool decodeMessageBody(CoreIPC::ArgumentDecoder*, RefPtr<APIObject>&) = 0;
+ virtual void encodeMessageBody(CoreIPC::ArgumentEncoder&, APIObject*) = 0;
+ virtual bool decodeMessageBody(CoreIPC::ArgumentDecoder&, RefPtr<APIObject>&) = 0;
// Implemented in generated WebConnectionMessageReceiver.cpp
- void didReceiveWebConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void handleMessage(const CoreIPC::DataReference& messageData);
RefPtr<CoreIPC::Connection> m_connection;
diff --git a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
index c25ea9511..957313587 100644
--- a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
+++ b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
@@ -51,20 +51,6 @@
#include <WebCore/WindowFeatures.h>
#include <wtf/text/StringHash.h>
-#if USE(COORDINATED_GRAPHICS)
-#include <WebCore/Animation.h>
-#include <WebCore/FloatPoint3D.h>
-#include <WebCore/Length.h>
-#include <WebCore/TransformationMatrix.h>
-
-#if ENABLE(CSS_FILTERS)
-#include <WebCore/FilterOperations.h>
-#endif
-#if USE(GRAPHICS_SURFACE)
-#include <WebCore/GraphicsSurface.h>
-#endif
-#endif
-
using namespace WebCore;
using namespace WebKit;
@@ -340,11 +326,11 @@ void ArgumentCoder<Cursor>::encode(ArgumentEncoder* encoder, const Cursor& curso
return;
if (cursor.image()->isNull()) {
- encoder->encodeBool(false); // There is no valid image being encoded.
+ encoder->encode(false); // There is no valid image being encoded.
return;
}
- encoder->encodeBool(true);
+ encoder->encode(true);
encodeImage(encoder, cursor.image());
encoder->encode(cursor.hotSpot());
}
@@ -660,11 +646,11 @@ bool ArgumentCoder<WindowFeatures>::decode(ArgumentDecoder* decoder, WindowFeatu
void ArgumentCoder<Color>::encode(ArgumentEncoder* encoder, const Color& color)
{
if (!color.isValid()) {
- encoder->encodeBool(false);
+ encoder->encode(false);
return;
}
- encoder->encodeBool(true);
+ encoder->encode(true);
encoder->encode(color.rgb());
}
@@ -874,172 +860,6 @@ bool ArgumentCoder<KURL>::decode(ArgumentDecoder* decoder, KURL& result)
return true;
}
-#if USE(COORDINATED_GRAPHICS)
-void ArgumentCoder<FloatPoint3D>::encode(ArgumentEncoder* encoder, const FloatPoint3D& floatPoint3D)
-{
- SimpleArgumentCoder<FloatPoint3D>::encode(encoder, floatPoint3D);
-}
-
-bool ArgumentCoder<FloatPoint3D>::decode(ArgumentDecoder* decoder, FloatPoint3D& floatPoint3D)
-{
- return SimpleArgumentCoder<FloatPoint3D>::decode(decoder, floatPoint3D);
-}
-
-void ArgumentCoder<Length>::encode(ArgumentEncoder* encoder, const Length& length)
-{
- SimpleArgumentCoder<Length>::encode(encoder, length);
-}
-
-bool ArgumentCoder<Length>::decode(ArgumentDecoder* decoder, Length& length)
-{
- return SimpleArgumentCoder<Length>::decode(decoder, length);
-}
-
-void ArgumentCoder<TransformationMatrix>::encode(ArgumentEncoder* encoder, const TransformationMatrix& transformationMatrix)
-{
- SimpleArgumentCoder<TransformationMatrix>::encode(encoder, transformationMatrix);
-}
-
-bool ArgumentCoder<TransformationMatrix>::decode(ArgumentDecoder* decoder, TransformationMatrix& transformationMatrix)
-{
- return SimpleArgumentCoder<TransformationMatrix>::decode(decoder, transformationMatrix);
-}
-
-#if ENABLE(CSS_FILTERS)
-void ArgumentCoder<WebCore::FilterOperations>::encode(ArgumentEncoder* encoder, const WebCore::FilterOperations& filters)
-{
- encoder->encodeUInt32(filters.size());
- for (size_t i = 0; i < filters.size(); ++i) {
- const FilterOperation* filter = filters.at(i);
- FilterOperation::OperationType type = filter->getOperationType();
- encoder->encodeEnum(type);
- switch (type) {
- case FilterOperation::GRAYSCALE:
- case FilterOperation::SEPIA:
- case FilterOperation::SATURATE:
- case FilterOperation::HUE_ROTATE:
- encoder->encodeDouble(static_cast<const BasicColorMatrixFilterOperation*>(filter)->amount());
- break;
- case FilterOperation::INVERT:
- case FilterOperation::BRIGHTNESS:
- case FilterOperation::CONTRAST:
- case FilterOperation::OPACITY:
- encoder->encodeDouble(static_cast<const BasicComponentTransferFilterOperation*>(filter)->amount());
- break;
- case FilterOperation::BLUR:
- ArgumentCoder<Length>::encode(encoder, static_cast<const BlurFilterOperation*>(filter)->stdDeviation());
- break;
- case FilterOperation::DROP_SHADOW: {
- const DropShadowFilterOperation* shadow = static_cast<const DropShadowFilterOperation*>(filter);
- ArgumentCoder<IntPoint>::encode(encoder, shadow->location());
- encoder->encodeInt32(shadow->stdDeviation());
- ArgumentCoder<Color>::encode(encoder, shadow->color());
- break;
- }
- default:
- break;
- }
- }
-}
-
-bool ArgumentCoder<WebCore::FilterOperations>::decode(ArgumentDecoder* decoder, WebCore::FilterOperations& filters)
-{
- uint32_t size;
- if (!decoder->decodeUInt32(size))
- return false;
-
- Vector<RefPtr<FilterOperation> >& operations = filters.operations();
-
- for (size_t i = 0; i < size; ++i) {
- FilterOperation::OperationType type;
- RefPtr<FilterOperation> filter;
- if (!decoder->decodeEnum(type))
- return false;
-
- switch (type) {
- case FilterOperation::GRAYSCALE:
- case FilterOperation::SEPIA:
- case FilterOperation::SATURATE:
- case FilterOperation::HUE_ROTATE: {
- double value;
- if (!decoder->decodeDouble(value))
- return false;
- filter = BasicColorMatrixFilterOperation::create(value, type);
- break;
- }
- case FilterOperation::INVERT:
- case FilterOperation::BRIGHTNESS:
- case FilterOperation::CONTRAST:
- case FilterOperation::OPACITY: {
- double value;
- if (!decoder->decodeDouble(value))
- return false;
- filter = BasicComponentTransferFilterOperation::create(value, type);
- break;
- }
- case FilterOperation::BLUR: {
- Length length;
- if (!ArgumentCoder<Length>::decode(decoder, length))
- return false;
- filter = BlurFilterOperation::create(length, type);
- break;
- }
- case FilterOperation::DROP_SHADOW: {
- IntPoint location;
- int32_t stdDeviation;
- Color color;
- if (!ArgumentCoder<IntPoint>::decode(decoder, location))
- return false;
- if (!decoder->decodeInt32(stdDeviation))
- return false;
- if (!ArgumentCoder<Color>::decode(decoder, color))
- return false;
- filter = DropShadowFilterOperation::create(location, stdDeviation, color, type);
- break;
- }
- default:
- break;
- }
-
- if (filter)
- operations.append(filter);
- }
-
- return true;
-}
-#endif
-
-#if USE(GRAPHICS_SURFACE)
-void ArgumentCoder<WebCore::GraphicsSurfaceToken>::encode(ArgumentEncoder* encoder, const WebCore::GraphicsSurfaceToken& token)
-{
-#if OS(DARWIN)
- encoder->encodeUInt32(token.frontBufferHandle);
- encoder->encodeUInt32(token.backBufferHandle);
-#endif
-#if OS(LINUX)
- encoder->encodeUInt32(token.frontBufferHandle);
-#endif
-}
-
-bool ArgumentCoder<WebCore::GraphicsSurfaceToken>::decode(ArgumentDecoder* decoder, WebCore::GraphicsSurfaceToken& token)
-{
-#if OS(DARWIN)
- if (!decoder->decodeUInt32(token.frontBufferHandle))
- return false;
- if (!decoder->decodeUInt32(token.backBufferHandle))
- return false;
-#endif
-#if OS(LINUX)
- if (!decoder->decodeUInt32(token.frontBufferHandle))
- return false;
-#endif
- return true;
-}
-
-#endif
-
-#endif
-
void ArgumentCoder<WebCore::UserStyleSheet>::encode(ArgumentEncoder* encoder, const WebCore::UserStyleSheet& userStyleSheet)
{
encoder->encode(userStyleSheet.source());
diff --git a/Source/WebKit2/Shared/WebCoreArgumentCoders.h b/Source/WebKit2/Shared/WebCoreArgumentCoders.h
index 581058cab..6850d6bc7 100644
--- a/Source/WebKit2/Shared/WebCoreArgumentCoders.h
+++ b/Source/WebKit2/Shared/WebCoreArgumentCoders.h
@@ -69,24 +69,6 @@ namespace WebCore {
}
#endif
-#if USE(COORDINATED_GRAPHICS)
-namespace WebCore {
- class FloatPoint3D;
- class TransformationMatrix;
- struct Length;
-
-#if USE(GRAPHICS_SURFACE)
- struct GraphicsSurfaceToken;
-#endif
-}
-
-#if ENABLE(CSS_FILTERS)
-namespace WebCore {
- class FilterOperations;
-}
-#endif
-#endif
-
namespace CoreIPC {
template<> struct ArgumentCoder<WebCore::AffineTransform> {
@@ -260,37 +242,6 @@ template<> struct ArgumentCoder<WebCore::KURL> {
static bool decode(ArgumentDecoder*, WebCore::KURL&);
};
-#if USE(COORDINATED_GRAPHICS)
-template<> struct ArgumentCoder<WebCore::FloatPoint3D> {
- static void encode(ArgumentEncoder*, const WebCore::FloatPoint3D&);
- static bool decode(ArgumentDecoder*, WebCore::FloatPoint3D&);
-};
-
-template<> struct ArgumentCoder<WebCore::Length> {
- static void encode(ArgumentEncoder*, const WebCore::Length&);
- static bool decode(ArgumentDecoder*, WebCore::Length&);
-};
-
-template<> struct ArgumentCoder<WebCore::TransformationMatrix> {
- static void encode(ArgumentEncoder*, const WebCore::TransformationMatrix&);
- static bool decode(ArgumentDecoder*, WebCore::TransformationMatrix&);
-};
-
-#if ENABLE(CSS_FILTERS)
-template<> struct ArgumentCoder<WebCore::FilterOperations> {
- static void encode(ArgumentEncoder*, const WebCore::FilterOperations&);
- static bool decode(ArgumentDecoder*, WebCore::FilterOperations&);
-};
-#endif
-
-#if USE(GRAPHICS_SURFACE)
-template<> struct ArgumentCoder<WebCore::GraphicsSurfaceToken> {
- static void encode(ArgumentEncoder*, const WebCore::GraphicsSurfaceToken&);
- static bool decode(ArgumentDecoder*, WebCore::GraphicsSurfaceToken&);
-};
-#endif
-#endif
-
template<> struct ArgumentCoder<WebCore::UserStyleSheet> {
static void encode(ArgumentEncoder*, const WebCore::UserStyleSheet&);
static bool decode(ArgumentDecoder*, WebCore::UserStyleSheet&);
diff --git a/Source/WebKit2/Shared/WebPreferencesStore.cpp b/Source/WebKit2/Shared/WebPreferencesStore.cpp
index 4f49bb786..740a971aa 100644
--- a/Source/WebKit2/Shared/WebPreferencesStore.cpp
+++ b/Source/WebKit2/Shared/WebPreferencesStore.cpp
@@ -65,6 +65,7 @@ void WebPreferencesStore::encode(CoreIPC::ArgumentEncoder* encoder) const
encoder->encode(m_boolValues);
encoder->encode(m_uint32Values);
encoder->encode(m_doubleValues);
+ encoder->encode(m_floatValues);
}
bool WebPreferencesStore::decode(CoreIPC::ArgumentDecoder* decoder, WebPreferencesStore& result)
@@ -77,6 +78,8 @@ bool WebPreferencesStore::decode(CoreIPC::ArgumentDecoder* decoder, WebPreferenc
return false;
if (!decoder->decode(result.m_doubleValues))
return false;
+ if (!decoder->decode(result.m_floatValues))
+ return false;
return true;
}
@@ -146,6 +149,19 @@ double defaultValueForKey(const String& key)
return defaults.get(key);
}
+template<>
+float defaultValueForKey(const String& key)
+{
+ static HashMap<String, float>& defaults = *new HashMap<String, float>;
+ if (defaults.isEmpty()) {
+#define DEFINE_FLOAT_DEFAULTS(KeyUpper, KeyLower, TypeName, Type, DefaultValue) defaults.set(WebPreferencesKey::KeyLower##Key(), DefaultValue);
+ FOR_EACH_WEBKIT_FLOAT_PREFERENCE(DEFINE_FLOAT_DEFAULTS)
+#undef DEFINE_FLOAT_DEFAULTS
+ }
+
+ return defaults.get(key);
+}
+
template<typename MapType>
static typename MapType::MappedType valueForKey(const MapType& map, const typename MapType::KeyType& key)
{
diff --git a/Source/WebKit2/Shared/WebPreferencesStore.h b/Source/WebKit2/Shared/WebPreferencesStore.h
index 185898334..7bbcae0c2 100644
--- a/Source/WebKit2/Shared/WebPreferencesStore.h
+++ b/Source/WebKit2/Shared/WebPreferencesStore.h
@@ -144,6 +144,9 @@ namespace WebKit {
macro(PDFScaleFactor, pdfScaleFactor, Double, double, 0) \
\
+#define FOR_EACH_WEBKIT_FLOAT_PREFERENCE(macro) \
+ \
+
#if PLATFORM(WIN)
#define DEFAULT_WEBKIT_FONT_SMOOTHING_LEVEL FontSmoothingLevelWindows
#else
@@ -212,6 +215,7 @@ namespace WebKit {
#define FOR_EACH_WEBKIT_PREFERENCE(macro) \
FOR_EACH_WEBKIT_BOOL_PREFERENCE(macro) \
FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
+ FOR_EACH_WEBKIT_FLOAT_PREFERENCE(macro) \
FOR_EACH_WEBKIT_UINT32_PREFERENCE(macro) \
FOR_EACH_WEBKIT_STRING_PREFERENCE(macro) \
\
@@ -246,6 +250,9 @@ struct WebPreferencesStore {
bool setDoubleValueForKey(const String& key, double value);
double getDoubleValueForKey(const String& key) const;
+ bool setFloatValueForKey(const String& key, float value);
+ float getFloatValueForKey(const String& key) const;
+
// For WebKitTestRunner usage.
static void overrideBoolValueForKey(const String& key, bool value);
static void removeTestRunnerOverrides();
@@ -254,6 +261,7 @@ struct WebPreferencesStore {
HashMap<String, bool> m_boolValues;
HashMap<String, uint32_t> m_uint32Values;
HashMap<String, double> m_doubleValues;
+ HashMap<String, float> m_floatValues;
};
} // namespace WebKit
diff --git a/Source/WebKit2/Shared/WebProcessCreationParameters.cpp b/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
index e15e53382..c3fcee6c2 100644
--- a/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
+++ b/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
@@ -46,6 +46,9 @@ WebProcessCreationParameters::WebProcessCreationParameters()
#elif PLATFORM(WIN)
, shouldPaintNativeControls(false)
#endif
+#if ENABLE(NETWORK_PROCESS)
+ , usesNetworkProcess(false)
+#endif
{
}
@@ -100,7 +103,7 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con
encoder->encode(initialHTTPCookieAcceptPolicy);
#if USE(CFURLSTORAGESESSIONS)
CFDataRef storageSession = serializedDefaultStorageSession.get();
- encoder->encodeBool(storageSession);
+ encoder->encode(static_cast<bool>(storageSession));
if (storageSession)
CoreIPC::encode(encoder, storageSession);
#endif // USE(CFURLSTORAGESESSIONS)
@@ -109,6 +112,10 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
encoder->encode(notificationPermissions);
#endif
+
+#if ENABLE(NETWORK_PROCESS)
+ encoder->encode(usesNetworkProcess);
+#endif
}
bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, WebProcessCreationParameters& parameters)
@@ -218,6 +225,11 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web
return false;
#endif
+#if ENABLE(NETWORK_PROCESS)
+ if (!decoder->decode(parameters.usesNetworkProcess))
+ return false;
+#endif
+
return true;
}
diff --git a/Source/WebKit2/Shared/WebProcessCreationParameters.h b/Source/WebKit2/Shared/WebProcessCreationParameters.h
index 0717fcb80..1f4880369 100644
--- a/Source/WebKit2/Shared/WebProcessCreationParameters.h
+++ b/Source/WebKit2/Shared/WebProcessCreationParameters.h
@@ -127,6 +127,10 @@ struct WebProcessCreationParameters {
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
HashMap<String, bool> notificationPermissions;
#endif
+
+#if ENABLE(NETWORK_PROCESS)
+ bool usesNetworkProcess;
+#endif
};
} // namespace WebKit
diff --git a/Source/WebKit2/Shared/WebString.h b/Source/WebKit2/Shared/WebString.h
index 18b3fc8fe..791e6a3a7 100644
--- a/Source/WebKit2/Shared/WebString.h
+++ b/Source/WebKit2/Shared/WebString.h
@@ -27,7 +27,9 @@
#define WebString_h
#include "APIObject.h"
+#include <JavaScriptCore/InitializeThreading.h>
#include <JavaScriptCore/JSStringRef.h>
+#include <JavaScriptCore/OpaqueJSString.h>
#include <wtf/PassRefPtr.h>
#include <wtf/text/WTFString.h>
#include <wtf/unicode/UTF8.h>
@@ -52,7 +54,7 @@ public:
static PassRefPtr<WebString> create(JSStringRef jsStringRef)
{
- return adoptRef(new WebString(String(JSStringGetCharactersPtr(jsStringRef), JSStringGetLength(jsStringRef))));
+ return adoptRef(new WebString(String(jsStringRef->string())));
}
static PassRefPtr<WebString> createFromUTF8String(const char* string)
@@ -93,7 +95,11 @@ public:
const String& string() const { return m_string; }
- JSStringRef createJSString() const { return JSStringCreateWithCharacters(m_string.characters(), m_string.length()); }
+ JSStringRef createJSString() const
+ {
+ JSC::initializeThreading();
+ return OpaqueJSString::create(m_string).leakRef();
+ }
private:
WebString()
diff --git a/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp b/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp
index 35580c5ce..7261abda6 100644
--- a/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp
+++ b/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp
@@ -247,7 +247,7 @@ void encode(ArgumentEncoder* encoder, CFArrayRef array)
CFArrayGetValues(array, CFRangeMake(0, size), values.data());
- encoder->encodeUInt64(size);
+ encoder->encode(static_cast<uint64_t>(size));
for (CFIndex i = 0; i < size; ++i) {
ASSERT(values[i]);
@@ -277,7 +277,7 @@ bool decode(ArgumentDecoder* decoder, RetainPtr<CFArrayRef>& result)
void encode(ArgumentEncoder* encoder, CFBooleanRef boolean)
{
- encoder->encodeBool(CFBooleanGetValue(boolean));
+ encoder->encode(static_cast<bool>(CFBooleanGetValue(boolean)));
}
bool decode(ArgumentDecoder* decoder, RetainPtr<CFBooleanRef>& result)
@@ -310,7 +310,7 @@ bool decode(ArgumentDecoder* decoder, RetainPtr<CFDataRef>& result)
void encode(ArgumentEncoder* encoder, CFDateRef date)
{
- encoder->encodeDouble(CFDateGetAbsoluteTime(date));
+ encoder->encode(static_cast<double>(CFDateGetAbsoluteTime(date)));
}
bool decode(ArgumentDecoder* decoder, RetainPtr<CFDateRef>& result)
@@ -331,7 +331,7 @@ void encode(ArgumentEncoder* encoder, CFDictionaryRef dictionary)
CFDictionaryGetKeysAndValues(dictionary, keys.data(), values.data());
- encoder->encodeUInt64(size);
+ encoder->encode(static_cast<uint64_t>(size));
for (CFIndex i = 0; i < size; ++i) {
ASSERT(keys[i]);
@@ -495,7 +495,7 @@ bool decode(ArgumentDecoder* decoder, RetainPtr<CFStringRef>& result)
void encode(ArgumentEncoder* encoder, CFURLRef url)
{
CFURLRef baseURL = CFURLGetBaseURL(url);
- encoder->encodeBool(baseURL);
+ encoder->encode(static_cast<bool>(baseURL));
if (baseURL)
encode(encoder, baseURL);
diff --git a/Source/WebKit2/Shared/mac/ArgumentCodersMac.mm b/Source/WebKit2/Shared/mac/ArgumentCodersMac.mm
index 7e06aa389..ec6d38be4 100644
--- a/Source/WebKit2/Shared/mac/ArgumentCodersMac.mm
+++ b/Source/WebKit2/Shared/mac/ArgumentCodersMac.mm
@@ -196,11 +196,11 @@ void encode(ArgumentEncoder* encoder, NSAttributedString *string)
position = NSMaxRange(effectiveRange);
}
- encoder->encodeUInt64(ranges.size());
+ encoder->encode(static_cast<uint64_t>(ranges.size()));
for (size_t i = 0; i < ranges.size(); ++i) {
- encoder->encodeUInt64(ranges[i].first.location);
- encoder->encodeUInt64(ranges[i].first.length);
+ encoder->encode(static_cast<uint64_t>(ranges[i].first.location));
+ encoder->encode(static_cast<uint64_t>(ranges[i].first.length));
CoreIPC::encode(encoder, ranges[i].second.get());
}
}
@@ -267,7 +267,7 @@ void encode(ArgumentEncoder* encoder, NSDictionary *dictionary)
NSArray *keys = [dictionary allKeys];
NSArray *values = [dictionary allValues];
- encoder->encodeUInt64(size);
+ encoder->encode(static_cast<uint64_t>(size));
for (NSUInteger i = 0; i < size; ++i) {
id key = [keys objectAtIndex:i];
diff --git a/Source/WebKit2/Shared/mac/KeychainAttribute.cpp b/Source/WebKit2/Shared/mac/KeychainAttribute.cpp
index b3d65c2b7..eb284bcf7 100644
--- a/Source/WebKit2/Shared/mac/KeychainAttribute.cpp
+++ b/Source/WebKit2/Shared/mac/KeychainAttribute.cpp
@@ -53,8 +53,8 @@ namespace CoreIPC {
void encode(CoreIPC::ArgumentEncoder* encoder, const WebKit::KeychainAttribute& attribute)
{
- encoder->encodeUInt32(static_cast<uint32_t>(attribute.tag));
- encoder->encodeBool(attribute.data);
+ encoder->encode(static_cast<uint32_t>(attribute.tag));
+ encoder->encode(static_cast<bool>(attribute.data));
if (attribute.data)
CoreIPC::encode(encoder, attribute.data.get());
}
diff --git a/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm b/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm
index 5ae772cdc..db2b90e75 100644
--- a/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm
+++ b/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm
@@ -52,11 +52,11 @@ PlatformCertificateInfo::PlatformCertificateInfo(CFArrayRef certificateChain)
void PlatformCertificateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
{
if (!m_certificateChain) {
- encoder->encodeBool(false);
+ encoder->encode(false);
return;
}
- encoder->encodeBool(true);
+ encoder->encode(true);
CoreIPC::encode(encoder, m_certificateChain.get());
}
diff --git a/Source/WebKit2/Shared/mac/SandboxExtensionMac.mm b/Source/WebKit2/Shared/mac/SandboxExtensionMac.mm
index 8687a414a..109d1eb88 100644
--- a/Source/WebKit2/Shared/mac/SandboxExtensionMac.mm
+++ b/Source/WebKit2/Shared/mac/SandboxExtensionMac.mm
@@ -128,7 +128,7 @@ size_t SandboxExtension::HandleArray::size() const
void SandboxExtension::HandleArray::encode(CoreIPC::ArgumentEncoder* encoder) const
{
- encoder->encodeUInt64(size());
+ encoder->encode(static_cast<uint64_t>(size()));
for (size_t i = 0; i < m_size; ++i)
encoder->encode(m_data[i]);
diff --git a/Source/WebKit2/Shared/mac/SecItemRequestData.cpp b/Source/WebKit2/Shared/mac/SecItemRequestData.cpp
index aa1c45932..2fb2f2845 100644
--- a/Source/WebKit2/Shared/mac/SecItemRequestData.cpp
+++ b/Source/WebKit2/Shared/mac/SecItemRequestData.cpp
@@ -55,7 +55,7 @@ void SecItemRequestData::encode(CoreIPC::ArgumentEncoder* encoder) const
CoreIPC::encode(encoder, m_queryDictionary.get());
- encoder->encodeBool(m_attributesToMatch.get());
+ encoder->encode(static_cast<bool>(m_attributesToMatch));
if (m_attributesToMatch)
CoreIPC::encode(encoder, m_attributesToMatch.get());
}
diff --git a/Source/WebKit2/Shared/mac/SecItemResponseData.cpp b/Source/WebKit2/Shared/mac/SecItemResponseData.cpp
index 7583e02e1..0cc8f1347 100644
--- a/Source/WebKit2/Shared/mac/SecItemResponseData.cpp
+++ b/Source/WebKit2/Shared/mac/SecItemResponseData.cpp
@@ -43,8 +43,8 @@ SecItemResponseData::SecItemResponseData(OSStatus resultCode, CFTypeRef resultOb
void SecItemResponseData::encode(CoreIPC::ArgumentEncoder* encoder) const
{
- encoder->encodeInt64((int64_t)m_resultCode);
- encoder->encodeBool(m_resultObject.get());
+ encoder->encode(static_cast<int64_t>(m_resultCode));
+ encoder->encode(static_cast<bool>(m_resultObject.get()));
if (m_resultObject)
CoreIPC::encode(encoder, m_resultObject.get());
}
diff --git a/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp b/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp
index 876f86b21..dcbf99458 100644
--- a/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp
+++ b/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp
@@ -127,15 +127,15 @@ void SecKeychainItemRequestData::encode(CoreIPC::ArgumentEncoder* encoder) const
{
encoder->encodeEnum(m_type);
- encoder->encodeBool(m_keychainItem);
+ encoder->encode(static_cast<bool>(m_keychainItem));
if (m_keychainItem)
CoreIPC::encode(encoder, m_keychainItem.get());
- encoder->encodeUInt32(m_keychainAttributes.size());
+ encoder->encode(static_cast<int32_t>(m_keychainAttributes.size()));
for (size_t i = 0, count = m_keychainAttributes.size(); i < count; ++i)
CoreIPC::encode(encoder, m_keychainAttributes[i]);
- encoder->encodeUInt64(m_itemClass);
+ encoder->encode(static_cast<uint64_t>(m_itemClass));
m_dataReference.encode(encoder);
}
diff --git a/Source/WebKit2/Shared/mac/SecKeychainItemResponseData.cpp b/Source/WebKit2/Shared/mac/SecKeychainItemResponseData.cpp
index 70b284a7d..247f89b6a 100644
--- a/Source/WebKit2/Shared/mac/SecKeychainItemResponseData.cpp
+++ b/Source/WebKit2/Shared/mac/SecKeychainItemResponseData.cpp
@@ -65,17 +65,17 @@ SecKeychainItemResponseData::SecKeychainItemResponseData(OSStatus resultCode)
void SecKeychainItemResponseData::encode(CoreIPC::ArgumentEncoder* encoder) const
{
- encoder->encodeInt64((int64_t)m_resultCode);
- encoder->encodeUInt32(m_itemClass);
- encoder->encodeUInt32(m_attributes.size());
+ encoder->encode(static_cast<int64_t>(m_resultCode));
+ encoder->encode(static_cast<uint32_t>(m_itemClass));
+ encoder->encode(static_cast<uint32_t>(m_attributes.size()));
for (size_t i = 0, count = m_attributes.size(); i < count; ++i)
CoreIPC::encode(encoder, m_attributes[i]);
- encoder->encodeBool(m_data.get());
+ encoder->encode(static_cast<bool>(m_data));
if (m_data)
CoreIPC::encode(encoder, m_data.get());
- encoder->encodeBool(m_keychainItem.get());
+ encoder->encode(static_cast<bool>(m_keychainItem));
if (m_keychainItem)
CoreIPC::encode(encoder, m_keychainItem.get());
}
diff --git a/Source/WebKit2/Shared/qt/ArgumentCodersQt.cpp b/Source/WebKit2/Shared/qt/ArgumentCodersQt.cpp
index a439caff1..67dad4829 100644
--- a/Source/WebKit2/Shared/qt/ArgumentCodersQt.cpp
+++ b/Source/WebKit2/Shared/qt/ArgumentCodersQt.cpp
@@ -41,7 +41,7 @@ void ArgumentCoder<WebCore::DragData>::encode(ArgumentEncoder* encoder, const Dr
encoder->encode((uint64_t)dragData.flags());
bool hasPlatformData = dragData.platformData();
- encoder->encodeBool(hasPlatformData);
+ encoder->encode(hasPlatformData);
if (!hasPlatformData)
return;
diff --git a/Source/WebKit2/Shared/qt/QtNetworkReplyData.cpp b/Source/WebKit2/Shared/qt/QtNetworkReplyData.cpp
index f14042727..90f68e78f 100644
--- a/Source/WebKit2/Shared/qt/QtNetworkReplyData.cpp
+++ b/Source/WebKit2/Shared/qt/QtNetworkReplyData.cpp
@@ -45,7 +45,7 @@ void QtNetworkReplyData::encode(CoreIPC::ArgumentEncoder* encoder) const
{
encoder->encode(m_urlString);
encoder->encode(m_contentType);
- encoder->encodeUInt64(m_contentLength);
+ encoder->encode(static_cast<uint64_t>(m_contentLength));
encoder->encode(m_replyUuid);
encoder->encode(m_dataHandle);
}
diff --git a/Source/WebKit2/Shared/soup/PlatformCertificateInfo.cpp b/Source/WebKit2/Shared/soup/PlatformCertificateInfo.cpp
index c7baba3ee..388be7ad8 100644
--- a/Source/WebKit2/Shared/soup/PlatformCertificateInfo.cpp
+++ b/Source/WebKit2/Shared/soup/PlatformCertificateInfo.cpp
@@ -54,18 +54,18 @@ PlatformCertificateInfo::~PlatformCertificateInfo()
void PlatformCertificateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
{
if (!m_certificate) {
- encoder->encodeBool(false);
+ encoder->encode(false);
return;
}
GByteArray* certificateData = 0;
g_object_get(G_OBJECT(m_certificate.get()), "certificate", &certificateData, NULL);
if (!certificateData) {
- encoder->encodeBool(false);
+ encoder->encode(false);
return;
}
- encoder->encodeBool(true);
+ encoder->encode(true);
GRefPtr<GByteArray> certificate = adoptGRef(certificateData);
encoder->encodeVariableLengthByteArray(CoreIPC::DataReference(certificate->data, certificate->len));
encoder->encode(static_cast<uint32_t>(m_tlsErrors));
diff --git a/Source/WebKit2/Shared/win/LayerTreeContextWin.cpp b/Source/WebKit2/Shared/win/LayerTreeContextWin.cpp
index 2cdf2b39c..ad05c1d03 100644
--- a/Source/WebKit2/Shared/win/LayerTreeContextWin.cpp
+++ b/Source/WebKit2/Shared/win/LayerTreeContextWin.cpp
@@ -41,7 +41,7 @@ LayerTreeContext::~LayerTreeContext()
void LayerTreeContext::encode(CoreIPC::ArgumentEncoder* encoder) const
{
- encoder->encodeUInt64(reinterpret_cast<uint64_t>(window));
+ encoder->encode(reinterpret_cast<uint64_t>(window));
}
bool LayerTreeContext::decode(CoreIPC::ArgumentDecoder* decoder, LayerTreeContext& context)
diff --git a/Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp b/Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp
index 4b83fbd53..08cd4e2b3 100644
--- a/Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp
+++ b/Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp
@@ -110,12 +110,12 @@ void PlatformCertificateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
{
// Special case no certificates
if (m_certificateChain.isEmpty()) {
- encoder->encodeUInt64(std::numeric_limits<uint64_t>::max());
+ encoder->encode(std::numeric_limits<uint64_t>::max());
return;
}
uint64_t length = m_certificateChain.size();
- encoder->encodeUInt64(length);
+ encoder->encode(length);
for (size_t i = 0; i < length; ++i)
encoder->encodeVariableLengthByteArray(CoreIPC::DataReference(static_cast<uint8_t*>(m_certificateChain[i]->pbCertEncoded), m_certificateChain[i]->cbCertEncoded));
diff --git a/Source/WebKit2/Shared/win/WindowGeometry.cpp b/Source/WebKit2/Shared/win/WindowGeometry.cpp
index e8e52313b..73caa05dd 100644
--- a/Source/WebKit2/Shared/win/WindowGeometry.cpp
+++ b/Source/WebKit2/Shared/win/WindowGeometry.cpp
@@ -38,7 +38,7 @@ WindowGeometry::WindowGeometry()
void WindowGeometry::encode(CoreIPC::ArgumentEncoder* encoder) const
{
- encoder->encodeUInt64(reinterpret_cast<uint64_t>(window));
+ encoder->encode(reinterpret_cast<uint64_t>(window));
encoder->encode(visible);
encoder->encode(frame);
encoder->encode(clipRect);
diff --git a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp b/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp
index 5c4b206a0..a533d25bc 100644
--- a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp
+++ b/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "SharedWorkerProcess.h"
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#include "ArgumentCoders.h"
#include "Attachment.h"
#include "SharedWorkerProcessCreationParameters.h"
@@ -101,9 +103,9 @@ bool SharedWorkerProcess::shouldTerminate()
return true;
}
-void SharedWorkerProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void SharedWorkerProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveSharedWorkerProcessMessage(connection, messageID, arguments);
+ didReceiveSharedWorkerProcessMessage(connection, messageID, decoder);
}
void SharedWorkerProcess::didClose(CoreIPC::Connection*)
@@ -192,3 +194,5 @@ void SharedWorkerProcess::minimumLifetimeTimerFired()
}
} // namespace WebKit
+
+#endif // ENABLE(SHARED_WORKER_PROCESS)
diff --git a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.h b/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.h
index d8641557e..d5b5c81c8 100644
--- a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.h
+++ b/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.h
@@ -26,6 +26,8 @@
#ifndef SharedWorkerProcess_h
#define SharedWorkerProcess_h
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#include "ChildProcess.h"
#include <wtf/Forward.h>
@@ -55,12 +57,12 @@ private:
virtual bool shouldTerminate();
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
// Message handlers.
- void didReceiveSharedWorkerProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveSharedWorkerProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void initializeSharedWorkerProcess(const SharedWorkerProcessCreationParameters&);
void createWebProcessConnection();
@@ -80,4 +82,6 @@ private:
} // namespace WebKit
+#endif // ENABLE(SHARED_WORKER_PROCESS)
+
#endif // SharedWorkerProcess_h
diff --git a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.messages.in b/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.messages.in
index 23952f9a7..3cd75337b 100644
--- a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.messages.in
+++ b/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.messages.in
@@ -20,6 +20,8 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#if ENABLE(SHARED_WORKER_PROCESS)
+
messages -> SharedWorkerProcess {
# Initializes the shared worker process.
InitializeSharedWorkerProcess(WebKit::SharedWorkerProcessCreationParameters processCreationParameters)
@@ -29,3 +31,5 @@ messages -> SharedWorkerProcess {
# a connection identifier.
CreateWebProcessConnection()
}
+
+#endif // ENABLE(SHARED_WORKER_PROCESS)
diff --git a/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMac.mm b/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMac.mm
index 81b1f6079..341afe96a 100644
--- a/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMac.mm
+++ b/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMac.mm
@@ -26,6 +26,8 @@
#import "config.h"
#import "SharedWorkerProcess.h"
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#import "SharedWorkerProcessProxyMessages.h"
#import "SharedWorkerProcessCreationParameters.h"
#import <WebCore/LocalizedStrings.h>
@@ -72,3 +74,5 @@ void SharedWorkerProcess::platformInitialize(const SharedWorkerProcessCreationPa
}
} // namespace WebKit
+
+#endif // ENABLE(SHARED_WORKER_PROCESS)
diff --git a/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm b/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm
index 024f10949..d94d48b45 100644
--- a/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm
+++ b/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm
@@ -26,6 +26,8 @@
#import "config.h"
#import "SharedWorkerProcessMain.h"
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#import "CommandLine.h"
#import "EnvironmentUtilities.h"
#import "SharedWorkerProcess.h"
@@ -105,3 +107,5 @@ int SharedWorkerProcessMain(const CommandLine& commandLine)
}
}
+
+#endif // ENABLE(SHARED_WORKER_PROCESS)
diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri
index bfa7d3bc6..6c99c85b6 100644
--- a/Source/WebKit2/Target.pri
+++ b/Source/WebKit2/Target.pri
@@ -73,6 +73,7 @@ HEADERS += \
Shared/ShareableSurface.h \
Shared/CacheModel.h \
Shared/ChildProcess.h \
+ Shared/ConnectionStack.h \
Shared/DictionaryPopupInfo.h \
Shared/EditorState.h \
Shared/FontInfo.h \
@@ -132,6 +133,8 @@ HEADERS += \
Shared/WebURLRequest.h \
Shared/WebURLResponse.h \
Shared/WebUserContentURLPattern.h \
+ Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h \
+ Shared/CoordinatedGraphics/WebCustomFilterProgram.h \
Shared/Plugins/Netscape/NetscapePluginModule.h \
Shared/Plugins/NPRemoteObjectMap.h \
Shared/Plugins/NPIdentifierData.h \
@@ -439,6 +442,7 @@ SOURCES += \
Shared/Plugins/PluginModuleInfo.cpp \
Shared/Plugins/PluginProcessCreationParameters.cpp \
Shared/ChildProcess.cpp \
+ Shared/ConnectionStack.cpp \
Shared/DictionaryPopupInfo.cpp \
Shared/EditorState.cpp \
Shared/FontInfo.cpp \
@@ -490,6 +494,7 @@ SOURCES += \
Shared/WebURLRequest.cpp \
Shared/WebURLResponse.cpp \
Shared/WebWheelEvent.cpp \
+ Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp \
Shared/qt/ArgumentCodersQt.cpp \
Shared/qt/LayerTreeContextQt.cpp \
Shared/qt/ShareableBitmapQt.cpp \
diff --git a/Source/WebKit2/UIProcess/API/C/WKContext.cpp b/Source/WebKit2/UIProcess/API/C/WKContext.cpp
index 26e4ab6a4..117bbeda3 100644
--- a/Source/WebKit2/UIProcess/API/C/WKContext.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKContext.cpp
@@ -32,6 +32,7 @@
#include "WebURLRequest.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
+#include <wtf/UnusedParam.h>
#include <wtf/text/WTFString.h>
using namespace WebKit;
@@ -142,7 +143,12 @@ void WKContextSetShouldUseFontSmoothing(WKContextRef contextRef, bool useFontSmo
void WKContextSetAdditionalPluginsDirectory(WKContextRef contextRef, WKStringRef pluginsDirectory)
{
+#if ENABLE(NETSCAPE_PLUGIN_API)
toImpl(contextRef)->setAdditionalPluginsDirectory(toImpl(pluginsDirectory)->string());
+#else
+ UNUSED_PARAM(contextRef);
+ UNUSED_PARAM(pluginsDirectory);
+#endif
}
void WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef contextRef, WKStringRef urlScheme)
@@ -224,7 +230,11 @@ WKNotificationManagerRef WKContextGetNotificationManager(WKContextRef contextRef
WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef contextRef)
{
+#if ENABLE(NETSCAPE_PLUGIN_API)
return toAPI(toImpl(contextRef)->pluginSiteDataManager());
+#else
+ return 0;
+#endif
}
WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef contextRef)
diff --git a/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp b/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
index 179610b0c..39539f449 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,6 +26,7 @@
#include "config.h"
#include "WKPluginSiteDataManager.h"
+#include "APIObject.h"
#include "WKAPICast.h"
#include "WebPluginSiteDataManager.h"
@@ -38,12 +39,22 @@ using namespace std;
WKTypeID WKPluginSiteDataManagerGetTypeID()
{
+#if ENABLE(NETSCAPE_PLUGIN_API)
return toAPI(WebPluginSiteDataManager::APIType);
+#else
+ return APIObject::TypeNull;
+#endif
}
void WKPluginSiteDataManagerGetSitesWithData(WKPluginSiteDataManagerRef managerRef, void* context, WKPluginSiteDataManagerGetSitesWithDataFunction callback)
{
+#if ENABLE(NETSCAPE_PLUGIN_API)
toImpl(managerRef)->getSitesWithData(ArrayCallback::create(context, callback));
+#else
+ UNUSED_PARAM(managerRef);
+ UNUSED_PARAM(context);
+ UNUSED_PARAM(callback);
+#endif
}
#if ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp b/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.cpp
index b1a034496..99160c4a3 100644
--- a/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#include "EflViewportHandler.h"
+#include "PageViewportControllerClientEfl.h"
#if USE(COORDINATED_GRAPHICS)
@@ -37,28 +37,28 @@ using namespace WebCore;
namespace WebKit {
-EflViewportHandler::EflViewportHandler(Evas_Object* viewWidget)
+PageViewportControllerClientEfl::PageViewportControllerClientEfl(Evas_Object* viewWidget)
: m_viewWidget(viewWidget)
, m_scaleFactor(1)
{
ASSERT(m_viewWidget);
}
-EflViewportHandler::~EflViewportHandler()
+PageViewportControllerClientEfl::~PageViewportControllerClientEfl()
{
}
-DrawingAreaProxy* EflViewportHandler::drawingArea() const
+DrawingAreaProxy* PageViewportControllerClientEfl::drawingArea() const
{
return ewk_view_page_get(m_viewWidget)->drawingArea();
}
-void EflViewportHandler::setRendererActive(bool active)
+void PageViewportControllerClientEfl::setRendererActive(bool active)
{
drawingArea()->layerTreeCoordinatorProxy()->layerTreeRenderer()->setActive(active);
}
-void EflViewportHandler::display(const IntRect& rect, const IntPoint& viewPosition)
+void PageViewportControllerClientEfl::display(const IntRect& rect, const IntPoint& viewPosition)
{
WebCore::TransformationMatrix matrix;
matrix.setMatrix(m_scaleFactor, 0, 0, m_scaleFactor, -m_visibleContentRect.x() + viewPosition.x(), -m_visibleContentRect.y() + viewPosition.y());
@@ -71,14 +71,14 @@ void EflViewportHandler::display(const IntRect& rect, const IntPoint& viewPositi
renderer->paintToCurrentGLContext(matrix, 1, clipRect);
}
-void EflViewportHandler::updateViewportSize(const IntSize& viewportSize)
+void PageViewportControllerClientEfl::updateViewportSize(const IntSize& viewportSize)
{
m_viewportSize = viewportSize;
ewk_view_page_get(m_viewWidget)->setViewportSize(viewportSize);
setVisibleContentsRect(m_visibleContentRect.location(), m_scaleFactor, FloatPoint());
}
-void EflViewportHandler::setVisibleContentsRect(const IntPoint& newScrollPosition, float newScale, const FloatPoint& trajectory)
+void PageViewportControllerClientEfl::setVisibleContentsRect(const IntPoint& newScrollPosition, float newScale, const FloatPoint& trajectory)
{
m_scaleFactor = newScale;
m_visibleContentRect = IntRect(newScrollPosition, m_viewportSize);
@@ -100,13 +100,37 @@ void EflViewportHandler::setVisibleContentsRect(const IntPoint& newScrollPositio
drawingArea()->setVisibleContentsRect(enclosingIntRect(mapRectToWebContent), m_scaleFactor, trajectory);
}
-void EflViewportHandler::didChangeContentsSize(const WebCore::IntSize& size)
+void PageViewportControllerClientEfl::didChangeContentsSize(const WebCore::IntSize& size)
{
m_contentsSize = size;
setVisibleContentsRect(m_visibleContentRect.location(), m_scaleFactor, FloatPoint());
drawingArea()->layerTreeCoordinatorProxy()->setContentsSize(WebCore::FloatSize(size.width(), size.height()));
}
+void PageViewportControllerClientEfl::setViewportPosition(const WebCore::FloatPoint& /*contentsPoint*/)
+{
+}
+
+void PageViewportControllerClientEfl::setContentsScale(float, bool /*treatAsInitialValue*/)
+{
+}
+
+void PageViewportControllerClientEfl::didResumeContent()
+{
+}
+
+void PageViewportControllerClientEfl::didChangeVisibleContents()
+{
+}
+
+void PageViewportControllerClientEfl::didChangeViewportAttributes()
+{
+}
+
+void PageViewportControllerClientEfl::setController(PageViewportController* pageViewportController)
+{
+}
+
} // namespace WebKit
#endif // USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h b/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.h
index 1dd231e49..943452651 100644
--- a/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h
+++ b/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.h
@@ -23,23 +23,24 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef EflViewportHandler_h
-#define EflViewportHandler_h
+#ifndef PageViewportControllerClientEfl_h
+#define PageViewportControllerClientEfl_h
#if USE(COORDINATED_GRAPHICS)
#include "PageClientImpl.h"
+#include "PageViewportControllerClient.h"
#include <wtf/PassOwnPtr.h>
namespace WebKit {
-class EflViewportHandler {
+class PageViewportControllerClientEfl : public PageViewportControllerClient {
public:
- static PassOwnPtr<EflViewportHandler> create(Evas_Object* viewWidget)
+ static PassOwnPtr<PageViewportControllerClientEfl> create(Evas_Object* viewWidget)
{
- return adoptPtr(new EflViewportHandler(viewWidget));
+ return adoptPtr(new PageViewportControllerClientEfl(viewWidget));
}
- ~EflViewportHandler();
+ ~PageViewportControllerClientEfl();
DrawingAreaProxy* drawingArea() const;
WebCore::IntSize viewSize() { return m_viewportSize; }
@@ -47,10 +48,20 @@ public:
void display(const WebCore::IntRect& rect, const WebCore::IntPoint& viewPosition);
void updateViewportSize(const WebCore::IntSize& viewportSize);
void setVisibleContentsRect(const WebCore::IntPoint&, float, const WebCore::FloatPoint&);
- void didChangeContentsSize(const WebCore::IntSize& size);
void setRendererActive(bool);
+
+ virtual void setViewportPosition(const WebCore::FloatPoint& contentsPoint);
+ virtual void setContentsScale(float, bool treatAsInitialValue);
+
+ virtual void didResumeContent();
+ virtual void didChangeContentsSize(const WebCore::IntSize&);
+ virtual void didChangeVisibleContents();
+ virtual void didChangeViewportAttributes();
+
+ virtual void setController(PageViewportController*);
+
private:
- explicit EflViewportHandler(Evas_Object*);
+ explicit PageViewportControllerClientEfl(Evas_Object*);
Evas_Object* m_viewWidget;
WebCore::IntRect m_visibleContentRect;
@@ -63,4 +74,4 @@ private:
#endif
-#endif // EflViewportHandler_h
+#endif // PageViewportControllerClientEfl_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp
index 63408d02b..12dbb8f4b 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp
@@ -34,33 +34,70 @@
using namespace WebKit;
-#define EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList_, ...) \
- if (!(list)) { \
- EINA_LOG_CRIT("list is NULL."); \
- return __VA_ARGS__; \
- } \
- if (!(list)->wkList) { \
- EINA_LOG_CRIT("list->wkList is NULL."); \
- return __VA_ARGS__; \
- } \
- WKBackForwardListRef wkList_ = (list)->wkList.get()
+Ewk_Back_Forward_List::Ewk_Back_Forward_List(WKBackForwardListRef listRef)
+ : m_wkList(listRef)
+{ }
+Ewk_Back_Forward_List_Item* Ewk_Back_Forward_List::nextItem() const
+{
+ return getFromCacheOrCreate(WKBackForwardListGetForwardItem(m_wkList.get()));
+}
-static inline Ewk_Back_Forward_List_Item* addItemToWrapperCache(const Ewk_Back_Forward_List* list, WKBackForwardListItemRef wkItem)
+Ewk_Back_Forward_List_Item* Ewk_Back_Forward_List::previousItem() const
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(list, 0);
- EINA_SAFETY_ON_NULL_RETURN_VAL(wkItem, 0);
+ return getFromCacheOrCreate(WKBackForwardListGetBackItem(m_wkList.get()));
+}
+
+Ewk_Back_Forward_List_Item* Ewk_Back_Forward_List::currentItem() const
+{
+ return getFromCacheOrCreate(WKBackForwardListGetCurrentItem(m_wkList.get()));
+}
+
+Ewk_Back_Forward_List_Item* Ewk_Back_Forward_List::itemAt(int index) const
+{
+ return getFromCacheOrCreate(WKBackForwardListGetItemAtIndex(m_wkList.get(), index));
+}
+
+unsigned Ewk_Back_Forward_List::size() const
+{
+ const unsigned currentItem = WKBackForwardListGetCurrentItem(m_wkList.get()) ? 1 : 0;
+
+ return WKBackForwardListGetBackListCount(m_wkList.get()) + WKBackForwardListGetForwardListCount(m_wkList.get()) + currentItem;
+}
+
+WKRetainPtr<WKArrayRef> Ewk_Back_Forward_List::backList(int limit) const
+{
+ if (limit == -1)
+ limit = WKBackForwardListGetBackListCount(m_wkList.get());
+ ASSERT(limit >= 0);
+
+ return adoptWK(WKBackForwardListCopyBackListWithLimit(m_wkList.get(), limit));
+}
+
+WKRetainPtr<WKArrayRef> Ewk_Back_Forward_List::forwardList(int limit) const
+{
+ if (limit == -1)
+ limit = WKBackForwardListGetForwardListCount(m_wkList.get());
+ ASSERT(limit >= 0);
+
+ return adoptWK(WKBackForwardListCopyForwardListWithLimit(m_wkList.get(), limit));
+}
- RefPtr<Ewk_Back_Forward_List_Item> item = list->wrapperCache.get(wkItem);
+Ewk_Back_Forward_List_Item* Ewk_Back_Forward_List::getFromCacheOrCreate(WKBackForwardListItemRef wkItem) const
+{
+ if (!wkItem)
+ return 0;
+
+ RefPtr<Ewk_Back_Forward_List_Item> item = m_wrapperCache.get(wkItem);
if (!item) {
item = Ewk_Back_Forward_List_Item::create(wkItem);
- list->wrapperCache.set(wkItem, item);
+ m_wrapperCache.set(wkItem, item);
}
return item.get();
}
-static inline Eina_List* createEinaList(const Ewk_Back_Forward_List* list, WKArrayRef wkList)
+Eina_List* Ewk_Back_Forward_List::createEinaList(WKArrayRef wkList) const
{
if (!wkList)
return 0;
@@ -70,86 +107,80 @@ static inline Eina_List* createEinaList(const Ewk_Back_Forward_List* list, WKArr
const size_t count = WKArrayGetSize(wkList);
for (size_t i = 0; i < count; ++i) {
WKBackForwardListItemRef wkItem = static_cast<WKBackForwardListItemRef>(WKArrayGetItemAtIndex(wkList, i));
- Ewk_Back_Forward_List_Item* item = addItemToWrapperCache(list, wkItem);
+ Ewk_Back_Forward_List_Item* item = getFromCacheOrCreate(wkItem);
result = eina_list_append(result, ewk_back_forward_list_item_ref(item));
}
return result;
}
+/**
+ * @internal
+ * Updates items cache.
+ */
+void Ewk_Back_Forward_List::update(WKBackForwardListItemRef wkAddedItem, WKArrayRef wkRemovedItems)
+{
+ if (wkAddedItem) // Checking also here to avoid EINA_SAFETY_ON_NULL_RETURN_VAL warnings.
+ getFromCacheOrCreate(wkAddedItem); // Puts new item to the cache.
+
+ const size_t removedItemsSize = wkRemovedItems ? WKArrayGetSize(wkRemovedItems) : 0;
+ for (size_t i = 0; i < removedItemsSize; ++i) {
+ WKBackForwardListItemRef wkItem = static_cast<WKBackForwardListItemRef>(WKArrayGetItemAtIndex(wkRemovedItems, i));
+ m_wrapperCache.remove(wkItem);
+ }
+}
+
Ewk_Back_Forward_List_Item* ewk_back_forward_list_current_item_get(const Ewk_Back_Forward_List* list)
{
- EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(list, 0);
- return addItemToWrapperCache(list, WKBackForwardListGetCurrentItem(wkList));
+ return list->currentItem();
}
Ewk_Back_Forward_List_Item* ewk_back_forward_list_previous_item_get(const Ewk_Back_Forward_List* list)
{
- EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(list, 0);
- return addItemToWrapperCache(list, WKBackForwardListGetBackItem(wkList));
+ return list->previousItem();
}
Ewk_Back_Forward_List_Item* ewk_back_forward_list_next_item_get(const Ewk_Back_Forward_List* list)
{
- EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(list, 0);
- return addItemToWrapperCache(list, WKBackForwardListGetForwardItem(wkList));
+ return list->nextItem();
}
Ewk_Back_Forward_List_Item* ewk_back_forward_list_item_at_index_get(const Ewk_Back_Forward_List* list, int index)
{
- EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(list, 0);
- return addItemToWrapperCache(list, WKBackForwardListGetItemAtIndex(wkList, index));
+ return list->itemAt(index);
}
unsigned ewk_back_forward_list_count(Ewk_Back_Forward_List* list)
{
- EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0);
-
- const unsigned currentItem = ewk_back_forward_list_current_item_get(list) ? 1 : 0;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(list, 0);
- return WKBackForwardListGetBackListCount(wkList) + WKBackForwardListGetForwardListCount(wkList) + currentItem;
+ return list->size();
}
Eina_List* ewk_back_forward_list_n_back_items_copy(const Ewk_Back_Forward_List* list, int limit)
{
- EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(list, 0);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(limit == -1 || limit > 0, 0);
- if (limit == -1)
- limit = WKBackForwardListGetBackListCount(wkList);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(limit >= 0, 0);
- WKRetainPtr<WKArrayRef> backList(AdoptWK, WKBackForwardListCopyBackListWithLimit(wkList, limit));
+ WKRetainPtr<WKArrayRef> backList = list->backList(limit);
- return createEinaList(list, backList.get());
+ return list->createEinaList(backList.get());
}
Eina_List* ewk_back_forward_list_n_forward_items_copy(const Ewk_Back_Forward_List* list, int limit)
{
- EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0);
-
- if (limit == -1)
- limit = WKBackForwardListGetForwardListCount(wkList);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(limit >= 0, 0);
- WKRetainPtr<WKArrayRef> forwardList(AdoptWK, WKBackForwardListCopyForwardListWithLimit(wkList, limit));
+ EINA_SAFETY_ON_NULL_RETURN_VAL(list, 0);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(limit == -1 || limit > 0, 0);
- return createEinaList(list, forwardList.get());
-}
+ WKRetainPtr<WKArrayRef> forwardList = list->forwardList(limit);
-/**
- * @internal
- * Updates items cache.
- */
-void ewk_back_forward_list_changed(Ewk_Back_Forward_List* list, WKBackForwardListItemRef wkAddedItem, WKArrayRef wkRemovedItems)
-{
- if (wkAddedItem) // Checking also here to avoid EINA_SAFETY_ON_NULL_RETURN_VAL warnings.
- addItemToWrapperCache(list, wkAddedItem); // Puts new item to the cache.
-
- const size_t removedItemsSize = wkRemovedItems ? WKArrayGetSize(wkRemovedItems) : 0;
- for (size_t i = 0; i < removedItemsSize; ++i) {
- WKBackForwardListItemRef wkItem = static_cast<WKBackForwardListItemRef>(WKArrayGetItemAtIndex(wkRemovedItems, i));
- list->wrapperCache.remove(wkItem);
- }
+ return list->createEinaList(forwardList.get());
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp
index 8ca1e0d44..5ec236033 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp
@@ -32,16 +32,30 @@
using namespace WebKit;
-#define EWK_BACK_FORWARD_LIST_ITEM_WK_GET_OR_RETURN(item, wkItem_, ...) \
- if (!(item)) { \
- EINA_LOG_CRIT("item is NULL."); \
- return __VA_ARGS__; \
- } \
- if (!(item)->wkItem) { \
- EINA_LOG_CRIT("item->wkItem is NULL."); \
- return __VA_ARGS__; \
- } \
- WKBackForwardListItemRef wkItem_ = (item)->wkItem.get()
+Ewk_Back_Forward_List_Item::Ewk_Back_Forward_List_Item(WKBackForwardListItemRef itemRef)
+ : m_wkItem(itemRef)
+{ }
+
+const char* Ewk_Back_Forward_List_Item::url() const
+{
+ m_url = WKEinaSharedString(AdoptWK, WKBackForwardListItemCopyURL(m_wkItem.get()));
+
+ return m_url;
+}
+
+const char* Ewk_Back_Forward_List_Item::title() const
+{
+ m_title = WKEinaSharedString(AdoptWK, WKBackForwardListItemCopyTitle(m_wkItem.get()));
+
+ return m_title;
+}
+
+const char* Ewk_Back_Forward_List_Item::originalURL() const
+{
+ m_originalURL = WKEinaSharedString(AdoptWK, WKBackForwardListItemCopyOriginalURL(m_wkItem.get()));
+
+ return m_originalURL;
+}
Ewk_Back_Forward_List_Item* ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item* item)
{
@@ -60,27 +74,21 @@ void ewk_back_forward_list_item_unref(Ewk_Back_Forward_List_Item* item)
const char* ewk_back_forward_list_item_url_get(const Ewk_Back_Forward_List_Item* item)
{
- EWK_BACK_FORWARD_LIST_ITEM_WK_GET_OR_RETURN(item, wkItem, 0);
-
- item->url = WKEinaSharedString(AdoptWK, WKBackForwardListItemCopyURL(wkItem));
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
- return item->url;
+ return item->url();
}
const char* ewk_back_forward_list_item_title_get(const Ewk_Back_Forward_List_Item* item)
{
- EWK_BACK_FORWARD_LIST_ITEM_WK_GET_OR_RETURN(item, wkItem, 0);
-
- item->title = WKEinaSharedString(AdoptWK, WKBackForwardListItemCopyTitle(wkItem));
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
- return item->title;
+ return item->title();
}
const char* ewk_back_forward_list_item_original_url_get(const Ewk_Back_Forward_List_Item* item)
{
- EWK_BACK_FORWARD_LIST_ITEM_WK_GET_OR_RETURN(item, wkItem, 0);
-
- item->originalURL = WKEinaSharedString(AdoptWK, WKBackForwardListItemCopyOriginalURL(wkItem));
+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
- return item->originalURL;
+ return item->originalURL();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h
index a300a305e..50718bc26 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h
@@ -37,20 +37,22 @@
*/
class Ewk_Back_Forward_List_Item : public RefCounted<Ewk_Back_Forward_List_Item> {
public:
- WKRetainPtr<WKBackForwardListItemRef> wkItem;
- mutable WKEinaSharedString url;
- mutable WKEinaSharedString title;
- mutable WKEinaSharedString originalURL;
-
static PassRefPtr<Ewk_Back_Forward_List_Item> create(WKBackForwardListItemRef itemRef)
{
return adoptRef(new Ewk_Back_Forward_List_Item(itemRef));
}
+ const char* url() const;
+ const char* title() const;
+ const char* originalURL() const;
+
private:
- explicit Ewk_Back_Forward_List_Item(WKBackForwardListItemRef itemRef)
- : wkItem(itemRef)
- { }
+ explicit Ewk_Back_Forward_List_Item(WKBackForwardListItemRef itemRef);
+
+ WKRetainPtr<WKBackForwardListItemRef> m_wkItem;
+ mutable WKEinaSharedString m_url;
+ mutable WKEinaSharedString m_title;
+ mutable WKEinaSharedString m_originalURL;
};
#endif // ewk_back_forward_list_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h
index fcf25f6cc..7aad46700 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h
@@ -36,20 +36,30 @@ typedef HashMap<WKBackForwardListItemRef, RefPtr<Ewk_Back_Forward_List_Item> > I
class Ewk_Back_Forward_List {
public:
- WKRetainPtr<WKBackForwardListRef> wkList;
- mutable ItemsMap wrapperCache;
-
static PassOwnPtr<Ewk_Back_Forward_List> create(WKBackForwardListRef listRef)
{
return adoptPtr(new Ewk_Back_Forward_List(listRef));
}
+ Ewk_Back_Forward_List_Item* previousItem() const;
+ Ewk_Back_Forward_List_Item* currentItem() const;
+ Ewk_Back_Forward_List_Item* nextItem() const;
+ Ewk_Back_Forward_List_Item* itemAt(int index) const;
+
+ WKRetainPtr<WKArrayRef> backList(int limit = -1) const;
+ WKRetainPtr<WKArrayRef> forwardList(int limit = -1) const;
+ unsigned size() const;
+
+ void update(WKBackForwardListItemRef wkAddedItem, WKArrayRef wkRemovedItems);
+ Eina_List* createEinaList(WKArrayRef wkList) const;
+
private:
- explicit Ewk_Back_Forward_List(WKBackForwardListRef listRef)
- : wkList(listRef)
- { }
-};
+ explicit Ewk_Back_Forward_List(WKBackForwardListRef listRef);
+
+ Ewk_Back_Forward_List_Item* getFromCacheOrCreate(WKBackForwardListItemRef wkItem) const;
-void ewk_back_forward_list_changed(Ewk_Back_Forward_List*, WKBackForwardListItemRef wkAddedItem, WKArrayRef wkRemovedItems);
+ WKRetainPtr<WKBackForwardListRef> m_wkList;
+ mutable ItemsMap m_wrapperCache;
+};
#endif // ewk_back_forward_list_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp
index b7617dab2..9fb889213 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp
@@ -40,6 +40,7 @@
#include "ewk_download_job_private.h"
#include "ewk_favicon_database_private.h"
#include "ewk_private.h"
+#include "ewk_url_scheme_request_private.h"
#include <WebCore/FileSystem.h>
#include <WebCore/IconDatabase.h>
#include <wtf/HashMap.h>
@@ -205,7 +206,7 @@ void ewk_context_download_job_add(Ewk_Context* ewkContext, Ewk_Download_Job* ewk
EINA_SAFETY_ON_NULL_RETURN(ewkContext);
EINA_SAFETY_ON_NULL_RETURN(ewkDownload);
- uint64_t downloadId = ewk_download_job_id_get(ewkDownload);
+ uint64_t downloadId = ewkDownload->id();
if (ewkContext->downloadJobs.contains(downloadId))
return;
@@ -257,7 +258,7 @@ void ewk_context_url_scheme_request_received(Ewk_Context* ewkContext, Ewk_Url_Sc
EINA_SAFETY_ON_NULL_RETURN(ewkContext);
EINA_SAFETY_ON_NULL_RETURN(schemeRequest);
- Ewk_Url_Scheme_Handler handler = ewkContext->urlSchemeHandlers.get(ewk_url_scheme_request_scheme_get(schemeRequest));
+ Ewk_Url_Scheme_Handler handler = ewkContext->urlSchemeHandlers.get(schemeRequest->scheme());
if (!handler.callback)
return;
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp
index 088bd6a79..11647b41e 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp
@@ -53,14 +53,14 @@ static WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownlo
Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), toImpl(wkDownload)->downloadID());
ASSERT(download);
- ewk_download_job_suggested_filename_set(download, toImpl(filename)->string().utf8().data());
+ download->setSuggestedFileName(toImpl(filename)->string().utf8().data());
// We send the new download signal on the Ewk_View only once we have received the response
// and the suggested file name.
- ewk_view_download_job_requested(ewk_download_job_view_get(download), download);
+ ewk_view_download_job_requested(download->view(), download);
// DownloadSoup expects the destination to be a URL.
- String destination = String("file://") + String::fromUTF8(ewk_download_job_destination_get(download));
+ String destination = ASCIILiteral("file://") + String::fromUTF8(download->destination());
return WKStringCreateWithUTF8CString(destination.utf8().data());
}
@@ -69,7 +69,7 @@ static void didReceiveResponse(WKContextRef, WKDownloadRef wkDownload, WKURLResp
{
Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), toImpl(wkDownload)->downloadID());
ASSERT(download);
- ewk_download_job_response_set(download, Ewk_Url_Response::create(wkResponse));
+ download->setResponse(Ewk_Url_Response::create(wkResponse));
}
static void didCreateDestination(WKContextRef, WKDownloadRef wkDownload, WKStringRef /*path*/, const void* clientInfo)
@@ -77,47 +77,47 @@ static void didCreateDestination(WKContextRef, WKDownloadRef wkDownload, WKStrin
Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), toImpl(wkDownload)->downloadID());
ASSERT(download);
- ewk_download_job_state_set(download, EWK_DOWNLOAD_JOB_STATE_DOWNLOADING);
+ download->setState(EWK_DOWNLOAD_JOB_STATE_DOWNLOADING);
}
static void didReceiveData(WKContextRef, WKDownloadRef wkDownload, uint64_t length, const void* clientInfo)
{
Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), toImpl(wkDownload)->downloadID());
ASSERT(download);
- ewk_download_job_received_data(download, length);
+ download->incrementReceivedData(length);
}
-static void didFail(WKContextRef, WKDownloadRef wkDownload, WKErrorRef error, const void *clientInfo)
+static void didFail(WKContextRef, WKDownloadRef wkDownload, WKErrorRef error, const void* clientInfo)
{
uint64_t downloadId = toImpl(wkDownload)->downloadID();
Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), downloadId);
ASSERT(download);
OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(error);
- ewk_download_job_state_set(download, EWK_DOWNLOAD_JOB_STATE_FAILED);
- ewk_view_download_job_failed(ewk_download_job_view_get(download), download, ewkError.get());
+ download->setState(EWK_DOWNLOAD_JOB_STATE_FAILED);
+ ewk_view_download_job_failed(download->view(), download, ewkError.get());
ewk_context_download_job_remove(toEwkContext(clientInfo), downloadId);
}
-static void didCancel(WKContextRef, WKDownloadRef wkDownload, const void *clientInfo)
+static void didCancel(WKContextRef, WKDownloadRef wkDownload, const void* clientInfo)
{
uint64_t downloadId = toImpl(wkDownload)->downloadID();
Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), downloadId);
ASSERT(download);
- ewk_download_job_state_set(download, EWK_DOWNLOAD_JOB_STATE_CANCELLED);
- ewk_view_download_job_cancelled(ewk_download_job_view_get(download), download);
+ download->setState(EWK_DOWNLOAD_JOB_STATE_CANCELLED);
+ ewk_view_download_job_cancelled(download->view(), download);
ewk_context_download_job_remove(toEwkContext(clientInfo), downloadId);
}
-static void didFinish(WKContextRef, WKDownloadRef wkDownload, const void *clientInfo)
+static void didFinish(WKContextRef, WKDownloadRef wkDownload, const void* clientInfo)
{
uint64_t downloadId = toImpl(wkDownload)->downloadID();
Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), downloadId);
ASSERT(download);
- ewk_download_job_state_set(download, EWK_DOWNLOAD_JOB_STATE_FINISHED);
- ewk_view_download_job_finished(ewk_download_job_view_get(download), download);
+ download->setState(EWK_DOWNLOAD_JOB_STATE_FINISHED);
+ ewk_view_download_job_finished(download->view(), download);
ewk_context_download_job_remove(toEwkContext(clientInfo), downloadId);
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp
index 3cbf7fef0..d37da6f54 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "ewk_cookie_manager.h"
-#include "SoupCookiePersistentStorageType.h"
#include "WKAPICast.h"
#include "WKArray.h"
#include "WKString.h"
@@ -40,79 +39,117 @@
using namespace WebKit;
-static void cookiesDidChange(WKCookieManagerRef, const void* clientInfo);
-
Ewk_Cookie_Manager::Ewk_Cookie_Manager(WKCookieManagerRef cookieManagerRef)
- : wkCookieManager(cookieManagerRef)
+ : m_wkCookieManager(cookieManagerRef)
{
WKCookieManagerClient wkCookieManagerClient = {
kWKCookieManagerClientCurrentVersion,
this, // clientInfo
cookiesDidChange
};
- WKCookieManagerSetClient(wkCookieManager.get(), &wkCookieManagerClient);
+ WKCookieManagerSetClient(m_wkCookieManager.get(), &wkCookieManagerClient);
}
Ewk_Cookie_Manager::~Ewk_Cookie_Manager()
{
+ if (isWatchingForChanges())
+ WKCookieManagerStopObservingCookieChanges(m_wkCookieManager.get());
+}
+
+void Ewk_Cookie_Manager::setPersistentStorage(const String& filename, SoupCookiePersistentStorageType storage)
+{
+ bool isWatchingChanges = isWatchingForChanges();
+ if (isWatchingChanges)
+ WKCookieManagerStopObservingCookieChanges(m_wkCookieManager.get());
+
+ toImpl(m_wkCookieManager.get())->setCookiePersistentStorage(filename, storage);
+
+ if (isWatchingChanges)
+ WKCookieManagerStartObservingCookieChanges(m_wkCookieManager.get());
+}
+
+void Ewk_Cookie_Manager::setHTTPAcceptPolicy(WKHTTPCookieAcceptPolicy policy)
+{
+ WKCookieManagerSetHTTPCookieAcceptPolicy(m_wkCookieManager.get(), policy);
+}
+
+void Ewk_Cookie_Manager::clearHostnameCookies(const String& hostname)
+{
+ toImpl(m_wkCookieManager.get())->deleteCookiesForHostname(hostname);
+}
+
+void Ewk_Cookie_Manager::clearAllCookies()
+{
+ WKCookieManagerDeleteAllCookies(m_wkCookieManager.get());
+}
+
+void Ewk_Cookie_Manager::watchChanges(const Cookie_Change_Handler& changeHandler)
+{
+ m_changeHandler = changeHandler;
+
if (changeHandler.callback)
- WKCookieManagerStopObservingCookieChanges(wkCookieManager.get());
+ WKCookieManagerStartObservingCookieChanges(m_wkCookieManager.get());
+ else
+ WKCookieManagerStopObservingCookieChanges(m_wkCookieManager.get());
}
-#define EWK_COOKIE_MANAGER_WK_GET_OR_RETURN(manager, wkManager_, ...) \
- if (!(manager)) { \
- EINA_LOG_CRIT("manager is NULL."); \
- return __VA_ARGS__; \
- } \
- if (!(manager)->wkCookieManager) { \
- EINA_LOG_CRIT("manager->wkCookieManager is NULL."); \
- return __VA_ARGS__; \
- } \
- WKCookieManagerRef wkManager_ = (manager)->wkCookieManager.get()
+bool Ewk_Cookie_Manager::isWatchingForChanges() const
+{
+ return static_cast<bool>(m_changeHandler.callback);
+}
-// Ewk_Cookie_Accept_Policy enum validation
-COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_ACCEPT_POLICY_ALWAYS, kWKHTTPCookieAcceptPolicyAlways);
-COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_ACCEPT_POLICY_NEVER, kWKHTTPCookieAcceptPolicyNever);
-COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_ACCEPT_POLICY_NO_THIRD_PARTY, kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain);
+void Ewk_Cookie_Manager::getHostNamesWithCookies(WKCookieManagerGetCookieHostnamesFunction callback, void* userData) const
+{
+ WKCookieManagerGetHostnamesWithCookies(m_wkCookieManager.get(), userData, callback);
+}
-// Ewk_Cookie_Persistent_Storage enum validation
-COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_PERSISTENT_STORAGE_TEXT, SoupCookiePersistentStorageText);
-COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_PERSISTENT_STORAGE_SQLITE, SoupCookiePersistentStorageSQLite);
+void Ewk_Cookie_Manager::getHTTPAcceptPolicy(WKCookieManagerGetHTTPCookieAcceptPolicyFunction callback, void* userData) const
+{
+ WKCookieManagerGetHTTPCookieAcceptPolicy(m_wkCookieManager.get(), userData, callback);
+}
-static void cookiesDidChange(WKCookieManagerRef, const void* clientInfo)
+void Ewk_Cookie_Manager::cookiesDidChange(WKCookieManagerRef, const void* clientInfo)
{
Ewk_Cookie_Manager* manager = static_cast<Ewk_Cookie_Manager*>(const_cast<void*>(clientInfo));
- if (!manager->changeHandler.callback)
+ if (!manager->isWatchingForChanges())
return;
- manager->changeHandler.callback(manager->changeHandler.userData);
+ manager->m_changeHandler.callback(manager->m_changeHandler.userData);
}
+// Ewk_Cookie_Persistent_Storage enum validation.
+COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_PERSISTENT_STORAGE_TEXT, SoupCookiePersistentStorageText);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_PERSISTENT_STORAGE_SQLITE, SoupCookiePersistentStorageSQLite);
+
void ewk_cookie_manager_persistent_storage_set(Ewk_Cookie_Manager* manager, const char* filename, Ewk_Cookie_Persistent_Storage storage)
{
- EWK_COOKIE_MANAGER_WK_GET_OR_RETURN(manager, wkManager);
+ EINA_SAFETY_ON_NULL_RETURN(manager);
EINA_SAFETY_ON_NULL_RETURN(filename);
- if (manager->changeHandler.callback)
- WKCookieManagerStopObservingCookieChanges(wkManager);
-
- toImpl(wkManager)->setCookiePersistentStorage(String::fromUTF8(filename), storage);
-
- if (manager->changeHandler.callback)
- WKCookieManagerStartObservingCookieChanges(wkManager);
+ manager->setPersistentStorage(String::fromUTF8(filename), static_cast<SoupCookiePersistentStorageType>(storage));
}
+// Ewk_Cookie_Accept_Policy enum validation.
+COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_ACCEPT_POLICY_ALWAYS, kWKHTTPCookieAcceptPolicyAlways);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_ACCEPT_POLICY_NEVER, kWKHTTPCookieAcceptPolicyNever);
+COMPILE_ASSERT_MATCHING_ENUM(EWK_COOKIE_ACCEPT_POLICY_NO_THIRD_PARTY, kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain);
+
void ewk_cookie_manager_accept_policy_set(Ewk_Cookie_Manager* manager, Ewk_Cookie_Accept_Policy policy)
{
- EWK_COOKIE_MANAGER_WK_GET_OR_RETURN(manager, wkManager);
+ EINA_SAFETY_ON_NULL_RETURN(manager);
- WKCookieManagerSetHTTPCookieAcceptPolicy(wkManager, static_cast<WKHTTPCookieAcceptPolicy>(policy));
+ manager->setHTTPAcceptPolicy(static_cast<WKHTTPCookieAcceptPolicy>(policy));
}
struct Get_Policy_Async_Data {
Ewk_Cookie_Manager_Async_Policy_Get_Cb callback;
void* userData;
+
+ Get_Policy_Async_Data(Ewk_Cookie_Manager_Async_Policy_Get_Cb callback, void* userData)
+ : callback(callback)
+ , userData(userData)
+ { }
};
static void getAcceptPolicyCallback(WKHTTPCookieAcceptPolicy policy, WKErrorRef wkError, void* data)
@@ -127,19 +164,21 @@ static void getAcceptPolicyCallback(WKHTTPCookieAcceptPolicy policy, WKErrorRef
void ewk_cookie_manager_async_accept_policy_get(const Ewk_Cookie_Manager* manager, Ewk_Cookie_Manager_Async_Policy_Get_Cb callback, void* data)
{
- EWK_COOKIE_MANAGER_WK_GET_OR_RETURN(manager, wkManager);
+ EINA_SAFETY_ON_NULL_RETURN(manager);
EINA_SAFETY_ON_NULL_RETURN(callback);
- Get_Policy_Async_Data* callbackData = new Get_Policy_Async_Data;
- callbackData->callback = callback;
- callbackData->userData = data;
-
- WKCookieManagerGetHTTPCookieAcceptPolicy(wkManager, callbackData, getAcceptPolicyCallback);
+ Get_Policy_Async_Data* callbackData = new Get_Policy_Async_Data(callback, data);
+ manager->getHTTPAcceptPolicy(getAcceptPolicyCallback, callbackData);
}
struct Get_Hostnames_Async_Data {
Ewk_Cookie_Manager_Async_Hostnames_Get_Cb callback;
void* userData;
+
+ Get_Hostnames_Async_Data(Ewk_Cookie_Manager_Async_Hostnames_Get_Cb callback, void* userData)
+ : callback(callback)
+ , userData(userData)
+ { }
};
static void getHostnamesWithCookiesCallback(WKArrayRef wkHostnames, WKErrorRef wkError, void* context)
@@ -168,40 +207,31 @@ static void getHostnamesWithCookiesCallback(WKArrayRef wkHostnames, WKErrorRef w
void ewk_cookie_manager_async_hostnames_with_cookies_get(const Ewk_Cookie_Manager* manager, Ewk_Cookie_Manager_Async_Hostnames_Get_Cb callback, void* data)
{
- EWK_COOKIE_MANAGER_WK_GET_OR_RETURN(manager, wkManager);
+ EINA_SAFETY_ON_NULL_RETURN(manager);
EINA_SAFETY_ON_NULL_RETURN(callback);
- Get_Hostnames_Async_Data* callbackData = new Get_Hostnames_Async_Data;
- callbackData->callback = callback;
- callbackData->userData = data;
-
- WKCookieManagerGetHostnamesWithCookies(wkManager, callbackData, getHostnamesWithCookiesCallback);
+ Get_Hostnames_Async_Data* callbackData = new Get_Hostnames_Async_Data(callback, data);
+ manager->getHostNamesWithCookies(getHostnamesWithCookiesCallback, callbackData);
}
-void ewk_cookie_manager_hostname_cookies_clear(Ewk_Cookie_Manager* manager, const char* hostName)
+void ewk_cookie_manager_hostname_cookies_clear(Ewk_Cookie_Manager* manager, const char* hostname)
{
- EWK_COOKIE_MANAGER_WK_GET_OR_RETURN(manager, wkManager);
- EINA_SAFETY_ON_NULL_RETURN(hostName);
+ EINA_SAFETY_ON_NULL_RETURN(manager);
+ EINA_SAFETY_ON_NULL_RETURN(hostname);
- WKRetainPtr<WKStringRef> wkHostName(AdoptWK, WKStringCreateWithUTF8CString(hostName));
- WKCookieManagerDeleteCookiesForHostname(wkManager, wkHostName.get());
+ manager->clearHostnameCookies(String::fromUTF8(hostname));
}
void ewk_cookie_manager_cookies_clear(Ewk_Cookie_Manager* manager)
{
- EWK_COOKIE_MANAGER_WK_GET_OR_RETURN(manager, wkManager);
+ EINA_SAFETY_ON_NULL_RETURN(manager);
- WKCookieManagerDeleteAllCookies(wkManager);
+ manager->clearAllCookies();
}
void ewk_cookie_manager_changes_watch(Ewk_Cookie_Manager* manager, Ewk_Cookie_Manager_Changes_Watch_Cb callback, void* data)
{
- EWK_COOKIE_MANAGER_WK_GET_OR_RETURN(manager, wkManager);
+ EINA_SAFETY_ON_NULL_RETURN(manager);
- manager->changeHandler = Cookie_Change_Handler(callback, data);
-
- if (callback)
- WKCookieManagerStartObservingCookieChanges(wkManager);
- else
- WKCookieManagerStopObservingCookieChanges(wkManager);
+ manager->watchChanges(Cookie_Change_Handler(callback, data));
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager_private.h
index b7579aa99..8c32f891a 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager_private.h
@@ -26,6 +26,7 @@
#ifndef ewk_cookie_manager_private_h
#define ewk_cookie_manager_private_h
+#include "SoupCookiePersistentStorageType.h"
#include "WKCookieManager.h"
#include "WKRetainPtr.h"
#include "ewk_cookie_manager.h"
@@ -49,9 +50,6 @@ struct Cookie_Change_Handler {
class Ewk_Cookie_Manager {
public:
- WKRetainPtr<WKCookieManagerRef> wkCookieManager;
- Cookie_Change_Handler changeHandler;
-
static PassOwnPtr<Ewk_Cookie_Manager> create(WKCookieManagerRef cookieManagerRef)
{
return adoptPtr(new Ewk_Cookie_Manager(cookieManagerRef));
@@ -59,8 +57,26 @@ public:
~Ewk_Cookie_Manager();
+ void setPersistentStorage(const String& filename, WebKit::SoupCookiePersistentStorageType storage);
+
+ void getHTTPAcceptPolicy(WKCookieManagerGetHTTPCookieAcceptPolicyFunction callback, void* userData) const;
+ void setHTTPAcceptPolicy(WKHTTPCookieAcceptPolicy policy);
+
+ void clearHostnameCookies(const String& hostname);
+ void clearAllCookies();
+
+ void getHostNamesWithCookies(WKCookieManagerGetCookieHostnamesFunction callback, void* userData) const;
+ void watchChanges(const Cookie_Change_Handler& changeHandler);
+
private:
explicit Ewk_Cookie_Manager(WKCookieManagerRef cookieManagerRef);
+
+ bool isWatchingForChanges() const;
+
+ static void cookiesDidChange(WKCookieManagerRef, const void* clientInfo);
+
+ WKRetainPtr<WKCookieManagerRef> m_wkCookieManager;
+ Cookie_Change_Handler m_changeHandler;
};
#endif // ewk_cookie_manager_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp
index 46a198dc7..7dc3a1784 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp
@@ -31,10 +31,20 @@
#include "WKRetainPtr.h"
#include "WebURLRequest.h"
#include "ewk_download_job_private.h"
+#include "ewk_url_response_private.h"
#include <Ecore.h>
using namespace WebKit;
+Ewk_Download_Job::Ewk_Download_Job(WebKit::DownloadProxy* download, Evas_Object* ewkView)
+ : m_downloadProxy(download)
+ , m_view(ewkView)
+ , m_state(EWK_DOWNLOAD_JOB_STATE_NOT_STARTED)
+ , m_startTime(-1)
+ , m_endTime(-1)
+ , m_downloaded(0)
+{ }
+
Ewk_Download_Job* ewk_download_job_ref(Ewk_Download_Job* download)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
@@ -55,12 +65,9 @@ void ewk_download_job_unref(Ewk_Download_Job* download)
* @internal
* Queries the identifier for this download
*/
-uint64_t ewk_download_job_id_get(const Ewk_Download_Job* download)
+uint64_t Ewk_Download_Job::id() const
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
- EINA_SAFETY_ON_NULL_RETURN_VAL(download->downloadProxy, 0);
-
- return download->downloadProxy->downloadID();
+ return m_downloadProxy->downloadID();
}
/**
@@ -68,45 +75,62 @@ uint64_t ewk_download_job_id_get(const Ewk_Download_Job* download)
* Returns the view this download is attached to.
* The view is needed to send notification signals.
*/
-Evas_Object* ewk_download_job_view_get(const Ewk_Download_Job* download)
+Evas_Object* Ewk_Download_Job::view() const
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
-
- return download->view;
+ return m_view;
}
Ewk_Download_Job_State ewk_download_job_state_get(const Ewk_Download_Job* download)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(download, EWK_DOWNLOAD_JOB_STATE_UNKNOWN);
- return download->state;
+ return download->state();
+}
+
+Ewk_Download_Job_State Ewk_Download_Job::state() const
+{
+ return m_state;
}
Ewk_Url_Request* ewk_download_job_request_get(const Ewk_Download_Job* download)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
- if (!download->request) {
- EINA_SAFETY_ON_NULL_RETURN_VAL(download->downloadProxy, 0);
- WKRetainPtr<WKURLRequestRef> wkURLRequest(AdoptWK, toAPI(WebURLRequest::create(download->downloadProxy->request()).leakRef()));
- const_cast<Ewk_Download_Job*>(download)->request = Ewk_Url_Request::create(wkURLRequest.get());
+ return download->request();
+}
+
+Ewk_Url_Request* Ewk_Download_Job::request() const
+{
+ if (!m_request) {
+ WKRetainPtr<WKURLRequestRef> wkURLRequest(AdoptWK, toAPI(WebURLRequest::create(m_downloadProxy->request()).leakRef()));
+ m_request = Ewk_Url_Request::create(wkURLRequest.get());
}
- return download->request.get();
+ return m_request.get();
}
Ewk_Url_Response* ewk_download_job_response_get(const Ewk_Download_Job* download)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
- return download->response.get();
+ return download->response();
+}
+
+Ewk_Url_Response* Ewk_Download_Job::response() const
+{
+ return m_response.get();
}
const char* ewk_download_job_destination_get(const Ewk_Download_Job* download)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
- return download->destination;
+ return download->destination();
+}
+
+const char* Ewk_Download_Job::destination() const
+{
+ return m_destination;
}
Eina_Bool ewk_download_job_destination_set(Ewk_Download_Job* download, const char* destination)
@@ -114,28 +138,42 @@ Eina_Bool ewk_download_job_destination_set(Ewk_Download_Job* download, const cha
EINA_SAFETY_ON_NULL_RETURN_VAL(download, false);
EINA_SAFETY_ON_NULL_RETURN_VAL(destination, false);
- download->destination = destination;
+ download->setDestination(destination);
return true;
}
-const char *ewk_download_job_suggested_filename_get(const Ewk_Download_Job* download)
+void Ewk_Download_Job::setDestination(const char* destination)
+{
+ m_destination = destination;
+}
+
+const char* ewk_download_job_suggested_filename_get(const Ewk_Download_Job* download)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
- return download->suggestedFilename;
+ return download->suggestedFileName();
+}
+
+const char* Ewk_Download_Job::suggestedFileName() const
+{
+ return m_suggestedFilename;
}
Eina_Bool ewk_download_job_cancel(Ewk_Download_Job* download)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(download, false);
- EINA_SAFETY_ON_NULL_RETURN_VAL(download->downloadProxy, false);
- if (download->state != EWK_DOWNLOAD_JOB_STATE_DOWNLOADING)
+ return download->cancel();
+}
+
+bool Ewk_Download_Job::cancel()
+{
+ if (m_state != EWK_DOWNLOAD_JOB_STATE_DOWNLOADING)
return false;
- download->state = EWK_DOWNLOAD_JOB_STATE_CANCELLING;
- download->downloadProxy->cancel();
+ m_state = EWK_DOWNLOAD_JOB_STATE_CANCELLING;
+ m_downloadProxy->cancel();
return true;
}
@@ -143,82 +181,90 @@ double ewk_download_job_estimated_progress_get(const Ewk_Download_Job* download)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
- if (!download->response)
+ return download->estimatedProgress();
+}
+
+double Ewk_Download_Job::estimatedProgress() const
+{
+ if (!m_response)
return 0;
- const unsigned long contentLength = ewk_url_response_content_length_get(download->response.get());
+ const unsigned long contentLength = m_response->contentLength();
if (!contentLength)
return 0;
- return static_cast<double>(download->downloaded) / contentLength;
+ return static_cast<double>(m_downloaded) / contentLength;
}
double ewk_download_job_elapsed_time_get(const Ewk_Download_Job* download)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(download, 0);
+ return download->elapsedTime();
+}
+
+double Ewk_Download_Job::elapsedTime() const
+{
// Download has not started yet.
- if (download->startTime < 0)
+ if (m_startTime < 0)
return 0;
// Download had ended, return the time elapsed between the
// download start and the end event.
- if (download->endTime >= 0)
- return download->endTime - download->startTime;
+ if (m_endTime >= 0)
+ return m_endTime - m_startTime;
// Download is still going.
- return ecore_time_get() - download->startTime;
+ return ecore_time_get() - m_startTime;
}
/**
* @internal
* Sets the URL @a response for this @a download.
*/
-void ewk_download_job_response_set(Ewk_Download_Job* download, PassRefPtr<Ewk_Url_Response> response)
+void Ewk_Download_Job::setResponse(PassRefPtr<Ewk_Url_Response> response)
{
- EINA_SAFETY_ON_NULL_RETURN(download);
- EINA_SAFETY_ON_NULL_RETURN(response);
+ ASSERT(response);
- download->response = response;
+ m_response = response;
}
/**
* @internal
* Sets the suggested file name for this @a download.
*/
-void ewk_download_job_suggested_filename_set(Ewk_Download_Job* download, const char* suggestedFilename)
+void Ewk_Download_Job::setSuggestedFileName(const char* suggestedFilename)
{
- EINA_SAFETY_ON_NULL_RETURN(download);
-
- download->suggestedFilename = suggestedFilename;
+ m_suggestedFilename = suggestedFilename;
}
/**
* @internal
* Report a given amount of data was received.
*/
-void ewk_download_job_received_data(Ewk_Download_Job* download, uint64_t length)
+void Ewk_Download_Job::incrementReceivedData(uint64_t length)
{
- EINA_SAFETY_ON_NULL_RETURN(download);
-
- download->downloaded += length;
+ m_downloaded += length;
}
/**
* @internal
* Sets the state of the download.
*/
-void ewk_download_job_state_set(Ewk_Download_Job* download, Ewk_Download_Job_State state)
+void Ewk_Download_Job::setState(Ewk_Download_Job_State state)
{
- download->state = state;
-
- // Update start time if the download has started
- if (state == EWK_DOWNLOAD_JOB_STATE_DOWNLOADING)
- download->startTime = ecore_time_get();
-
- // Update end time if the download has finished (successfully or not)
- if (state == EWK_DOWNLOAD_JOB_STATE_FAILED
- || state == EWK_DOWNLOAD_JOB_STATE_CANCELLED
- || state == EWK_DOWNLOAD_JOB_STATE_FINISHED)
- download->endTime = ecore_time_get();
+ m_state = state;
+
+ switch (state) {
+ case EWK_DOWNLOAD_JOB_STATE_DOWNLOADING:
+ m_startTime = ecore_time_get();
+ break;
+ case EWK_DOWNLOAD_JOB_STATE_FAILED:
+ case EWK_DOWNLOAD_JOB_STATE_CANCELLED:
+ case EWK_DOWNLOAD_JOB_STATE_FINISHED:
+ m_endTime = ecore_time_get();
+ break;
+ default:
+ break;
+ }
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h
index 0cad5c2ed..156f29a26 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h
@@ -43,7 +43,7 @@
extern "C" {
#endif
-/** Creates a type name for Ewk_Download_Job_Job */
+/** Creates a type name for Ewk_Download_Job */
typedef struct Ewk_Download_Job Ewk_Download_Job;
/// Defines the possible states of a download.
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_download_job_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_download_job_private.h
index 5fac47db0..e2501d125 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_download_job_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_download_job_private.h
@@ -37,46 +37,48 @@ namespace WebKit {
class DownloadProxy;
}
-/**
- * \struct Ewk_Download_Job
- * @brief Contains the download data.
- */
class Ewk_Download_Job : public RefCounted<Ewk_Download_Job> {
public:
- WebKit::DownloadProxy* downloadProxy;
- Evas_Object* view;
- Ewk_Download_Job_State state;
- RefPtr<Ewk_Url_Request> request;
- RefPtr<Ewk_Url_Response> response;
- double startTime;
- double endTime;
- uint64_t downloaded; /**< length already downloaded */
- WKEinaSharedString destination;
- WKEinaSharedString suggestedFilename;
-
static PassRefPtr<Ewk_Download_Job> create(WebKit::DownloadProxy* download, Evas_Object* ewkView)
{
return adoptRef(new Ewk_Download_Job(download, ewkView));
}
-private:
- Ewk_Download_Job(WebKit::DownloadProxy* download, Evas_Object* ewkView)
- : downloadProxy(download)
- , view(ewkView)
- , state(EWK_DOWNLOAD_JOB_STATE_NOT_STARTED)
- , startTime(-1)
- , endTime(-1)
- , downloaded(0)
- { }
-};
+ uint64_t id() const;
+ Evas_Object* view() const;
+
+ Ewk_Download_Job_State state() const;
+ void setState(Ewk_Download_Job_State);
+
+ Ewk_Url_Request* request() const;
+ Ewk_Url_Response* response() const;
+ void setResponse(PassRefPtr<Ewk_Url_Response>);
-typedef struct Ewk_Error Ewk_Error;
+ const char* destination() const;
+ void setDestination(const char* destination);
-uint64_t ewk_download_job_id_get(const Ewk_Download_Job*);
-Evas_Object* ewk_download_job_view_get(const Ewk_Download_Job*);
-void ewk_download_job_state_set(Ewk_Download_Job*, Ewk_Download_Job_State);
-void ewk_download_job_received_data(Ewk_Download_Job*, uint64_t length);
-void ewk_download_job_response_set(Ewk_Download_Job*, PassRefPtr<Ewk_Url_Response>);
-void ewk_download_job_suggested_filename_set(Ewk_Download_Job*, const char* suggestedFilename);
+ const char* suggestedFileName() const;
+ void setSuggestedFileName(const char* fileName);
+
+ bool cancel();
+
+ double estimatedProgress() const;
+ double elapsedTime() const;
+ void incrementReceivedData(uint64_t length);
+
+private:
+ Ewk_Download_Job(WebKit::DownloadProxy* download, Evas_Object* ewkView);
+
+ WebKit::DownloadProxy* m_downloadProxy;
+ Evas_Object* m_view;
+ Ewk_Download_Job_State m_state;
+ mutable RefPtr<Ewk_Url_Request> m_request;
+ RefPtr<Ewk_Url_Response> m_response;
+ double m_startTime;
+ double m_endTime;
+ uint64_t m_downloaded; // length already downloaded
+ WKEinaSharedString m_destination;
+ WKEinaSharedString m_suggestedFilename;
+};
#endif // ewk_download_job_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_error.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_error.cpp
index 5bcfd81f9..c3b92fd52 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_error.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_error.cpp
@@ -37,28 +37,42 @@ using namespace WebCore;
using namespace WebKit;
Ewk_Error::Ewk_Error(WKErrorRef errorRef)
- : wkError(errorRef)
- , url(AdoptWK, WKErrorCopyFailingURL(errorRef))
- , description(AdoptWK, WKErrorCopyLocalizedDescription(errorRef))
+ : m_wkError(errorRef)
+ , m_url(AdoptWK, WKErrorCopyFailingURL(errorRef))
+ , m_description(AdoptWK, WKErrorCopyLocalizedDescription(errorRef))
{ }
-#define EWK_ERROR_WK_GET_OR_RETURN(error, wkError_, ...) \
- if (!(error)) { \
- EINA_LOG_CRIT("error is NULL."); \
- return __VA_ARGS__; \
- } \
- if (!(error)->wkError) { \
- EINA_LOG_CRIT("error->wkError is NULL."); \
- return __VA_ARGS__; \
- } \
- WKErrorRef wkError_ = (error)->wkError.get()
+const char* Ewk_Error::url() const
+{
+ return m_url;
+}
+
+const char* Ewk_Error::description() const
+{
+ return m_description;
+}
+
+String Ewk_Error::domain() const
+{
+ WKRetainPtr<WKStringRef> wkDomain(AdoptWK, WKErrorCopyDomain(m_wkError.get()));
+ return toWTFString(wkDomain.get());
+}
+
+int Ewk_Error::errorCode() const
+{
+ return WKErrorGetErrorCode(m_wkError.get());
+}
+
+bool Ewk_Error::isCancellation() const
+{
+ return toImpl(m_wkError.get())->platformError().isCancellation();
+}
Ewk_Error_Type ewk_error_type_get(const Ewk_Error* error)
{
- EWK_ERROR_WK_GET_OR_RETURN(error, wkError, EWK_ERROR_TYPE_NONE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(error, EWK_ERROR_TYPE_NONE);
- WKRetainPtr<WKStringRef> wkDomain(AdoptWK, WKErrorCopyDomain(wkError));
- WTF::String errorDomain = toWTFString(wkDomain.get());
+ String errorDomain = error->domain();
if (errorDomain == errorDomainNetwork)
return EWK_ERROR_TYPE_NETWORK;
@@ -77,26 +91,26 @@ const char* ewk_error_url_get(const Ewk_Error* error)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(error, 0);
- return error->url;
+ return error->url();
}
int ewk_error_code_get(const Ewk_Error* error)
{
- EWK_ERROR_WK_GET_OR_RETURN(error, wkError, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(error, 0);
- return WKErrorGetErrorCode(wkError);
+ return error->errorCode();
}
const char* ewk_error_description_get(const Ewk_Error* error)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(error, 0);
- return error->description;
+ return error->description();
}
Eina_Bool ewk_error_cancellation_get(const Ewk_Error* error)
{
- EWK_ERROR_WK_GET_OR_RETURN(error, wkError, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(error, false);
- return toImpl(wkError)->platformError().isCancellation();
+ return error->isCancellation();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_error_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_error_private.h
index a26e0fc4f..64fdcf75d 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_error_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_error_private.h
@@ -30,13 +30,10 @@
#include <WKError.h>
#include <WKRetainPtr.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/WTFString.h>
class Ewk_Error {
public:
- WKRetainPtr<WKErrorRef> wkError;
- WKEinaSharedString url;
- WKEinaSharedString description;
-
static PassOwnPtr<Ewk_Error> create(WKErrorRef errorRef)
{
if (!errorRef)
@@ -45,8 +42,18 @@ public:
return adoptPtr(new Ewk_Error(errorRef));
}
+ const char* url() const;
+ const char* description() const;
+ String domain() const;
+ int errorCode() const;
+ bool isCancellation() const;
+
private:
explicit Ewk_Error(WKErrorRef errorRef);
+
+ WKRetainPtr<WKErrorRef> m_wkError;
+ WKEinaSharedString m_url;
+ WKEinaSharedString m_description;
};
#endif // ewk_error_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.cpp
index 9e059e2c4..17c99c442 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.cpp
@@ -38,11 +38,8 @@
using namespace WebKit;
-static void didChangeIconForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL, const void* clientInfo);
-static void iconDataReadyForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL, const void* clientInfo);
-
Ewk_Favicon_Database::Ewk_Favicon_Database(WKIconDatabaseRef iconDatabaseRef)
- : wkIconDatabase(iconDatabaseRef)
+ : m_wkIconDatabase(iconDatabaseRef)
{
WKIconDatabaseClient iconDatabaseClient;
memset(&iconDatabaseClient, 0, sizeof(WKIconDatabaseClient));
@@ -50,26 +47,100 @@ Ewk_Favicon_Database::Ewk_Favicon_Database(WKIconDatabaseRef iconDatabaseRef)
iconDatabaseClient.clientInfo = this;
iconDatabaseClient.didChangeIconForPageURL = didChangeIconForPageURL;
iconDatabaseClient.iconDataReadyForPageURL = iconDataReadyForPageURL;
- WKIconDatabaseSetIconDatabaseClient(wkIconDatabase.get(), &iconDatabaseClient);
+ WKIconDatabaseSetIconDatabaseClient(m_wkIconDatabase.get(), &iconDatabaseClient);
+}
+
+String Ewk_Favicon_Database::iconURLForPageURL(const String& pageURL) const
+{
+ String iconURL;
+ toImpl(m_wkIconDatabase.get())->synchronousIconURLForPageURL(pageURL, iconURL);
+
+ return iconURL;
+}
+
+void Ewk_Favicon_Database::watchChanges(const IconChangeCallbackData& callbackData)
+{
+ ASSERT(callbackData.callback);
+ if (m_changeListeners.contains(callbackData.callback))
+ return;
+
+ m_changeListeners.add(callbackData.callback, callbackData);
+}
+
+void Ewk_Favicon_Database::unwatchChanges(Ewk_Favicon_Database_Icon_Change_Cb callback)
+{
+ ASSERT(callback);
+ m_changeListeners.remove(callback);
+}
+
+struct AsyncIconRequestResponse {
+ String pageURL;
+ RefPtr<cairo_surface_t> surface;
+ IconRequestCallbackData callbackData;
+
+ AsyncIconRequestResponse(const String& pageURL, PassRefPtr<cairo_surface_t> surface, const IconRequestCallbackData& callbackData)
+ : pageURL(pageURL)
+ , surface(surface)
+ , callbackData(callbackData)
+ { }
+};
+
+static Eina_Bool respond_icon_request_idle(void* data)
+{
+ AsyncIconRequestResponse* response = static_cast<AsyncIconRequestResponse*>(data);
+
+ RefPtr<Evas_Object> icon = response->surface ? WebCore::evasObjectFromCairoImageSurface(response->callbackData.evas, response->surface.get()) : 0;
+ response->callbackData.callback(response->pageURL.utf8().data(), icon.get(), response->callbackData.userData);
+
+ delete response;
+
+ return ECORE_CALLBACK_DONE;
}
-static void didChangeIconForPageURL(WKIconDatabaseRef, WKURLRef pageURLRef, const void* clientInfo)
+void Ewk_Favicon_Database::iconForPageURL(const String& pageURL, const IconRequestCallbackData& callbackData)
+{
+ WebIconDatabase* webIconDatabase = toImpl(m_wkIconDatabase.get());
+
+ // We ask for the icon directly. If we don't get the icon data now,
+ // we'll be notified later (even if the database is still importing icons).
+ RefPtr<cairo_surface_t> surface = getIconSurfaceSynchronously(pageURL);
+
+ // If there's no valid icon, but there's an iconURL registered,
+ // or it's still not registered but the import process hasn't
+ // finished yet, we need to wait for iconDataReadyForPageURL to be
+ // called before making and informed decision.
+ String iconURL = iconURLForPageURL(pageURL);
+ if (!surface && (!iconURL.isEmpty() || !webIconDatabase->isUrlImportCompleted())) {
+ PendingIconRequestVector requests = m_iconRequests.get(pageURL);
+ requests.append(callbackData);
+ m_iconRequests.set(pageURL, requests);
+ return;
+ }
+
+ // Respond when idle.
+ AsyncIconRequestResponse* response = new AsyncIconRequestResponse(pageURL, surface.release(), callbackData);
+ ecore_idler_add(respond_icon_request_idle, response);
+}
+
+void Ewk_Favicon_Database::didChangeIconForPageURL(WKIconDatabaseRef, WKURLRef pageURLRef, const void* clientInfo)
{
const Ewk_Favicon_Database* ewkIconDatabase = static_cast<const Ewk_Favicon_Database*>(clientInfo);
- if (ewkIconDatabase->changeListeners.isEmpty())
+ if (ewkIconDatabase->m_changeListeners.isEmpty())
return;
CString pageURL = toImpl(pageURLRef)->string().utf8();
- ChangeListenerMap::const_iterator it = ewkIconDatabase->changeListeners.begin();
- ChangeListenerMap::const_iterator end = ewkIconDatabase->changeListeners.end();
+ ChangeListenerMap::const_iterator it = ewkIconDatabase->m_changeListeners.begin();
+ ChangeListenerMap::const_iterator end = ewkIconDatabase->m_changeListeners.end();
for (; it != end; ++it)
it->value.callback(pageURL.data(), it->value.userData);
}
-static cairo_surface_t* getIconSurfaceSynchronously(WebIconDatabase* webIconDatabase, const String& pageURL)
+PassRefPtr<cairo_surface_t> Ewk_Favicon_Database::getIconSurfaceSynchronously(const String& pageURL) const
{
+ WebIconDatabase* webIconDatabase = toImpl(m_wkIconDatabase.get());
+
webIconDatabase->retainIconForPageURL(pageURL);
WebCore::NativeImagePtr icon = webIconDatabase->nativeImageForPageURL(pageURL);
@@ -78,21 +149,22 @@ static cairo_surface_t* getIconSurfaceSynchronously(WebIconDatabase* webIconData
return 0;
}
- return icon->surface();
+ RefPtr<cairo_surface_t> surface = icon->surface();
+
+ return surface.release();
}
-static void iconDataReadyForPageURL(WKIconDatabaseRef, WKURLRef pageURL, const void* clientInfo)
+void Ewk_Favicon_Database::iconDataReadyForPageURL(WKIconDatabaseRef, WKURLRef pageURL, const void* clientInfo)
{
Ewk_Favicon_Database* ewkIconDatabase = const_cast<Ewk_Favicon_Database*>(static_cast<const Ewk_Favicon_Database*>(clientInfo));
String urlString = toImpl(pageURL)->string();
- if (!ewkIconDatabase->iconRequests.contains(urlString))
+ if (!ewkIconDatabase->m_iconRequests.contains(urlString))
return;
- WebIconDatabase* webIconDatabase = toImpl(ewkIconDatabase->wkIconDatabase.get());
- RefPtr<cairo_surface_t> surface = getIconSurfaceSynchronously(webIconDatabase, urlString);
+ RefPtr<cairo_surface_t> surface = ewkIconDatabase->getIconSurfaceSynchronously(urlString);
- PendingIconRequestVector requestsForURL = ewkIconDatabase->iconRequests.take(urlString);
+ PendingIconRequestVector requestsForURL = ewkIconDatabase->m_iconRequests.take(urlString);
size_t requestCount = requestsForURL.size();
for (size_t i = 0; i < requestCount; ++i) {
const IconRequestCallbackData& callbackData = requestsForURL[i];
@@ -106,36 +178,11 @@ const char* ewk_favicon_database_icon_url_get(Ewk_Favicon_Database* ewkIconDatab
EINA_SAFETY_ON_NULL_RETURN_VAL(ewkIconDatabase, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(pageURL, 0);
- String iconURL;
- toImpl(ewkIconDatabase->wkIconDatabase.get())->synchronousIconURLForPageURL(pageURL, iconURL);
+ String iconURL = ewkIconDatabase->iconURLForPageURL(String::fromUTF8(pageURL));
return eina_stringshare_add(iconURL.utf8().data());
}
-struct AsyncIconRequestResponse {
- String pageURL;
- RefPtr<cairo_surface_t> surface;
- IconRequestCallbackData callbackData;
-
- AsyncIconRequestResponse(const String& _pageURL, PassRefPtr<cairo_surface_t> _surface, const IconRequestCallbackData& _callbackData)
- : pageURL(_pageURL)
- , surface(_surface)
- , callbackData(_callbackData)
- { }
-};
-
-static Eina_Bool respond_icon_request_idle(void* data)
-{
- AsyncIconRequestResponse* response = static_cast<AsyncIconRequestResponse*>(data);
-
- RefPtr<Evas_Object> icon = response->surface ? WebCore::evasObjectFromCairoImageSurface(response->callbackData.evas, response->surface.get()) : 0;
- response->callbackData.callback(response->pageURL.utf8().data(), icon.get(), response->callbackData.userData);
-
- delete response;
-
- return ECORE_CALLBACK_DONE;
-}
-
Eina_Bool ewk_favicon_database_async_icon_get(Ewk_Favicon_Database* ewkIconDatabase, const char* page_url, Evas* evas, Ewk_Favicon_Database_Async_Icon_Get_Cb callback, void* userData)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(ewkIconDatabase, false);
@@ -143,28 +190,7 @@ Eina_Bool ewk_favicon_database_async_icon_get(Ewk_Favicon_Database* ewkIconDatab
EINA_SAFETY_ON_NULL_RETURN_VAL(evas, false);
EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false);
- WebIconDatabase* webIconDatabase = toImpl(ewkIconDatabase->wkIconDatabase.get());
-
- // We ask for the icon directly. If we don't get the icon data now,
- // we'll be notified later (even if the database is still importing icons).
- RefPtr<cairo_surface_t> surface = getIconSurfaceSynchronously(webIconDatabase, page_url);
-
- // If there's no valid icon, but there's an iconURL registered,
- // or it's still not registered but the import process hasn't
- // finished yet, we need to wait for iconDataReadyForPageURL to be
- // called before making and informed decision.
- String iconURLForPageURL;
- webIconDatabase->synchronousIconURLForPageURL(page_url, iconURLForPageURL);
- if (!surface && (!iconURLForPageURL.isEmpty() || !webIconDatabase->isUrlImportCompleted())) {
- PendingIconRequestVector requests = ewkIconDatabase->iconRequests.get(page_url);
- requests.append(IconRequestCallbackData(callback, userData, evas));
- ewkIconDatabase->iconRequests.set(page_url, requests);
- return true;
- }
-
- // Respond when idle.
- AsyncIconRequestResponse* response = new AsyncIconRequestResponse(page_url, surface.release(), IconRequestCallbackData(callback, userData, evas));
- ecore_idler_add(respond_icon_request_idle, response);
+ ewkIconDatabase->iconForPageURL(String::fromUTF8(page_url), IconRequestCallbackData(callback, userData, evas));
return true;
}
@@ -174,10 +200,7 @@ void ewk_favicon_database_icon_change_callback_add(Ewk_Favicon_Database* ewkIcon
EINA_SAFETY_ON_NULL_RETURN(ewkIconDatabase);
EINA_SAFETY_ON_NULL_RETURN(callback);
- if (ewkIconDatabase->changeListeners.contains(callback))
- return;
-
- ewkIconDatabase->changeListeners.add(callback, IconChangeCallbackData(callback, userData));
+ ewkIconDatabase->watchChanges(IconChangeCallbackData(callback, userData));
}
void ewk_favicon_database_icon_change_callback_del(Ewk_Favicon_Database* ewkIconDatabase, Ewk_Favicon_Database_Icon_Change_Cb callback)
@@ -185,5 +208,5 @@ void ewk_favicon_database_icon_change_callback_del(Ewk_Favicon_Database* ewkIcon
EINA_SAFETY_ON_NULL_RETURN(ewkIconDatabase);
EINA_SAFETY_ON_NULL_RETURN(callback);
- ewkIconDatabase->changeListeners.remove(callback);
+ ewkIconDatabase->unwatchChanges(callback);
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.h b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.h
index 8ceaf5b23..89cc31f84 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.h
@@ -63,11 +63,9 @@ typedef void (*Ewk_Favicon_Database_Async_Icon_Get_Cb)(const char *page_url, Eva
* @param database database object to query
* @param page_url URL of the page to get the favicon URL for
*
- * @return the favicon URL pointer, that may be @c NULL. This pointer is
- * guaranteed to be eina_stringshare, so whenever possible
- * save yourself some cpu cycles and use
- * eina_stringshare_ref() instead of eina_stringshare_add() or
- * strdup()
+ * @return a newly allocated string guaranteed to be eina_stringshare
+ * or @c NULL in case of error or if the key does not exist.
+ * You need to call eina_stringshare_del() after use.
*/
EAPI const char *ewk_favicon_database_icon_url_get(Ewk_Favicon_Database *database, const char *page_url);
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database_private.h
index 9d90902c5..b8ba4f666 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database_private.h
@@ -71,17 +71,28 @@ typedef HashMap<String /* pageURL */, PendingIconRequestVector> PendingIconReque
class Ewk_Favicon_Database {
public:
- WKRetainPtr<WKIconDatabaseRef> wkIconDatabase;
- ChangeListenerMap changeListeners;
- PendingIconRequestMap iconRequests;
-
static PassOwnPtr<Ewk_Favicon_Database> create(WKIconDatabaseRef iconDatabaseRef)
{
return adoptPtr(new Ewk_Favicon_Database(iconDatabaseRef));
}
+ String iconURLForPageURL(const String& pageURL) const;
+ void iconForPageURL(const String& pageURL, const IconRequestCallbackData& callbackData);
+
+ void watchChanges(const IconChangeCallbackData& callbackData);
+ void unwatchChanges(Ewk_Favicon_Database_Icon_Change_Cb callback);
+
private:
explicit Ewk_Favicon_Database(WKIconDatabaseRef iconDatabaseRef);
+
+ PassRefPtr<cairo_surface_t> getIconSurfaceSynchronously(const String& pageURL) const;
+
+ static void didChangeIconForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL, const void* clientInfo);
+ static void iconDataReadyForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL, const void* clientInfo);
+
+ WKRetainPtr<WKIconDatabaseRef> m_wkIconDatabase;
+ ChangeListenerMap m_changeListeners;
+ PendingIconRequestMap m_iconRequests;
};
#endif // ewk_favicon_database_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp
index ee140f94e..76de21a4f 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp
@@ -35,6 +35,39 @@
using namespace WebKit;
+Ewk_Form_Submission_Request::Ewk_Form_Submission_Request(WKDictionaryRef values, WKFormSubmissionListenerRef listener)
+ : m_wkValues(values)
+ , m_wkListener(listener)
+ , m_handledRequest(false)
+{ }
+
+Ewk_Form_Submission_Request::~Ewk_Form_Submission_Request()
+{
+ // Make sure the request is always handled before destroying.
+ if (!m_handledRequest)
+ WKFormSubmissionListenerContinue(m_wkListener.get());
+}
+
+String Ewk_Form_Submission_Request::fieldValue(const String& fieldName) const
+{
+ ASSERT(fieldName);
+ WKRetainPtr<WKStringRef> wkFieldName = toCopiedAPI(fieldName);
+ WKStringRef wkValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(m_wkValues.get(), wkFieldName.get()));
+
+ return wkValue ? toImpl(wkValue)->string() : String();
+}
+
+WKRetainPtr<WKArrayRef> Ewk_Form_Submission_Request::fieldNames() const
+{
+ return adoptWK(WKDictionaryCopyKeys(m_wkValues.get()));
+}
+
+void Ewk_Form_Submission_Request::submit()
+{
+ WKFormSubmissionListenerContinue(m_wkListener.get());
+ m_handledRequest = true;
+}
+
Ewk_Form_Submission_Request* ewk_form_submission_request_ref(Ewk_Form_Submission_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
@@ -56,7 +89,7 @@ Eina_List* ewk_form_submission_request_field_names_get(Ewk_Form_Submission_Reque
Eina_List* names = 0;
- WKRetainPtr<WKArrayRef> wkKeys(AdoptWK, WKDictionaryCopyKeys(request->wkValues.get()));
+ WKRetainPtr<WKArrayRef> wkKeys = request->fieldNames();
const size_t numKeys = WKArrayGetSize(wkKeys.get());
for (size_t i = 0; i < numKeys; ++i) {
WKStringRef wkKey = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkKeys.get(), i));
@@ -71,18 +104,16 @@ const char* ewk_form_submission_request_field_value_get(Ewk_Form_Submission_Requ
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, 0);
- WKRetainPtr<WKStringRef> wkKey(AdoptWK, WKStringCreateWithUTF8CString(name));
- WKStringRef wkValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(request->wkValues.get(), wkKey.get()));
+ String value = request->fieldValue(String::fromUTF8(name));
- return wkValue ? eina_stringshare_add(toImpl(wkValue)->string().utf8().data()) : 0;
+ return value.isNull() ? 0 : eina_stringshare_add(value.utf8().data());
}
Eina_Bool ewk_form_submission_request_submit(Ewk_Form_Submission_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, false);
- WKFormSubmissionListenerContinue(request->wkListener.get());
- request->handledRequest = true;
+ request->submit();
return true;
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request_private.h
index 993b53357..3774e61bb 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request_private.h
@@ -31,31 +31,28 @@
#include "WKRetainPtr.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
class Ewk_Form_Submission_Request : public RefCounted<Ewk_Form_Submission_Request> {
public:
- WKRetainPtr<WKDictionaryRef> wkValues;
- WKRetainPtr<WKFormSubmissionListenerRef> wkListener;
- bool handledRequest;
-
- ~Ewk_Form_Submission_Request()
- {
- // Make sure the request is always handled before destroying.
- if (!handledRequest)
- WKFormSubmissionListenerContinue(wkListener.get());
- }
+ ~Ewk_Form_Submission_Request();
static PassRefPtr<Ewk_Form_Submission_Request> create(WKDictionaryRef values, WKFormSubmissionListenerRef listener)
{
return adoptRef(new Ewk_Form_Submission_Request(values, listener));
}
+ WKRetainPtr<WKArrayRef> fieldNames() const;
+ String fieldValue(const String& fieldName) const;
+
+ void submit();
+
private:
- Ewk_Form_Submission_Request(WKDictionaryRef values, WKFormSubmissionListenerRef listener)
- : wkValues(values)
- , wkListener(listener)
- , handledRequest(false)
- { }
+ Ewk_Form_Submission_Request(WKDictionaryRef values, WKFormSubmissionListenerRef listener);
+
+ WKRetainPtr<WKDictionaryRef> m_wkValues;
+ WKRetainPtr<WKFormSubmissionListenerRef> m_wkListener;
+ bool m_handledRequest;
};
#endif // ewk_form_submission_request_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp
index 7e5b919a1..a4fd6ef5e 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp
@@ -36,16 +36,52 @@
using namespace WebKit;
-#define EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent_, ...) \
- if (!(intent)) { \
- EINA_LOG_CRIT("intent is NULL."); \
- return __VA_ARGS__; \
- } \
- if (!(intent)->wkIntent) { \
- EINA_LOG_CRIT("intent->wkIntent is NULL."); \
- return __VA_ARGS__; \
- } \
- WKIntentDataRef wkIntent_ = (intent)->wkIntent.get()
+#if ENABLE(WEB_INTENTS)
+Ewk_Intent::Ewk_Intent(WKIntentDataRef intentRef)
+ : m_wkIntent(intentRef)
+ , m_action(AdoptWK, WKIntentDataCopyAction(intentRef))
+ , m_type(AdoptWK, WKIntentDataCopyType(intentRef))
+ , m_service(AdoptWK, WKIntentDataCopyService(intentRef))
+{ }
+
+WebIntentData* Ewk_Intent::webIntentData() const
+{
+ return toImpl(m_wkIntent.get());
+}
+
+const char* Ewk_Intent::action() const
+{
+ return m_action;
+}
+
+const char* Ewk_Intent::type() const
+{
+ return m_type;
+}
+
+const char* Ewk_Intent::service() const
+{
+ return m_service;
+}
+
+WKRetainPtr<WKArrayRef> Ewk_Intent::suggestions() const
+{
+ return adoptWK(WKIntentDataCopySuggestions(m_wkIntent.get()));
+}
+
+String Ewk_Intent::extra(const char* key) const
+{
+ WKRetainPtr<WKStringRef> keyRef = adoptWK(WKStringCreateWithUTF8CString(key));
+ WKRetainPtr<WKStringRef> wkValue(AdoptWK, WKIntentDataCopyExtraValue(m_wkIntent.get(), keyRef.get()));
+ return toImpl(wkValue.get())->string();
+}
+
+WKRetainPtr<WKArrayRef> Ewk_Intent::extraKeys() const
+{
+ WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKIntentDataCopyExtras(m_wkIntent.get()));
+ return adoptWK(WKDictionaryCopyKeys(wkExtras.get()));
+}
+#endif
Ewk_Intent* ewk_intent_ref(Ewk_Intent* intent)
{
@@ -71,30 +107,36 @@ const char* ewk_intent_action_get(const Ewk_Intent* intent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
- return intent->action;
+#if ENABLE(WEB_INTENTS)
+ return intent->action();
+#endif
}
const char* ewk_intent_type_get(const Ewk_Intent* intent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
- return intent->type;
+#if ENABLE(WEB_INTENTS)
+ return intent->type();
+#endif
}
const char* ewk_intent_service_get(const Ewk_Intent* intent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
- return intent->service;
+#if ENABLE(WEB_INTENTS)
+ return intent->service();
+#endif
}
Eina_List* ewk_intent_suggestions_get(const Ewk_Intent* intent)
{
-#if ENABLE(WEB_INTENTS)
- EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
+#if ENABLE(WEB_INTENTS)
Eina_List* listOfSuggestions = 0;
- WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKIntentDataCopySuggestions(wkIntent));
+ WKRetainPtr<WKArrayRef> wkSuggestions = intent->suggestions();
const size_t numSuggestions = WKArrayGetSize(wkSuggestions.get());
for (size_t i = 0; i < numSuggestions; ++i) {
WKURLRef wkSuggestion = static_cast<WKURLRef>(WKArrayGetItemAtIndex(wkSuggestions.get(), i));
@@ -102,6 +144,7 @@ Eina_List* ewk_intent_suggestions_get(const Ewk_Intent* intent)
}
return listOfSuggestions;
+
#else
return 0;
#endif
@@ -109,12 +152,11 @@ Eina_List* ewk_intent_suggestions_get(const Ewk_Intent* intent)
const char* ewk_intent_extra_get(const Ewk_Intent* intent, const char* key)
{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
+
#if ENABLE(WEB_INTENTS)
- EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0);
+ String value = intent->extra(key);
- WKRetainPtr<WKStringRef> keyRef = adoptWK(WKStringCreateWithUTF8CString(key));
- WKRetainPtr<WKStringRef> wkValue(AdoptWK, WKIntentDataCopyExtraValue(wkIntent, keyRef.get()));
- String value = toImpl(wkValue.get())->string();
if (value.isEmpty())
return 0;
@@ -126,12 +168,11 @@ const char* ewk_intent_extra_get(const Ewk_Intent* intent, const char* key)
Eina_List* ewk_intent_extra_names_get(const Ewk_Intent* intent)
{
-#if ENABLE(WEB_INTENTS)
- EWK_INTENT_WK_GET_OR_RETURN(intent, wkIntent, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(intent, 0);
+#if ENABLE(WEB_INTENTS)
Eina_List* listOfKeys = 0;
- WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKIntentDataCopyExtras(wkIntent));
- WKRetainPtr<WKArrayRef> wkKeys(AdoptWK, WKDictionaryCopyKeys(wkExtras.get()));
+ WKRetainPtr<WKArrayRef> wkKeys = intent->extraKeys();
const size_t numKeys = WKArrayGetSize(wkKeys.get());
for (size_t i = 0; i < numKeys; ++i) {
WKStringRef wkKey = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkKeys.get(), i));
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h
index 166a8a4f0..03af1e495 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h
@@ -34,6 +34,11 @@
#include <WebKit2/WKBase.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebKit {
+class WebIntentData;
+}
/**
* \struct Ewk_Intent
@@ -41,23 +46,26 @@
*/
class Ewk_Intent : public RefCounted<Ewk_Intent> {
public:
- WKRetainPtr<WKIntentDataRef> wkIntent;
- WKEinaSharedString action;
- WKEinaSharedString type;
- WKEinaSharedString service;
-
static PassRefPtr<Ewk_Intent> create(WKIntentDataRef intentRef)
{
return adoptRef(new Ewk_Intent(intentRef));
}
+ WebKit::WebIntentData* webIntentData() const;
+ const char* action() const;
+ const char* type() const;
+ const char* service() const;
+ WKRetainPtr<WKArrayRef> suggestions() const;
+ String extra(const char* key) const;
+ WKRetainPtr<WKArrayRef> extraKeys() const;
+
private:
- explicit Ewk_Intent(WKIntentDataRef intentRef)
- : wkIntent(intentRef)
- , action(AdoptWK, WKIntentDataCopyAction(intentRef))
- , type(AdoptWK, WKIntentDataCopyType(intentRef))
- , service(AdoptWK, WKIntentDataCopyService(intentRef))
- { }
+ explicit Ewk_Intent(WKIntentDataRef intentRef);
+
+ WKRetainPtr<WKIntentDataRef> m_wkIntent;
+ WKEinaSharedString m_action;
+ WKEinaSharedString m_type;
+ WKEinaSharedString m_service;
};
#endif // ENABLE(WEB_INTENTS)
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp
index 9702834e9..00682222b 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.cpp
@@ -35,6 +35,41 @@
using namespace WebKit;
+#if ENABLE(WEB_INTENTS_TAG)
+Ewk_Intent_Service::Ewk_Intent_Service(WKIntentServiceInfoRef serviceRef)
+ : m_action(AdoptWK, WKIntentServiceInfoCopyAction(serviceRef))
+ , m_type(AdoptWK, WKIntentServiceInfoCopyType(serviceRef))
+ , m_href(AdoptWK, WKIntentServiceInfoCopyHref(serviceRef))
+ , m_title(AdoptWK, WKIntentServiceInfoCopyTitle(serviceRef))
+ , m_disposition(AdoptWK, WKIntentServiceInfoCopyDisposition(serviceRef))
+{ }
+
+const char* Ewk_Intent_Service::action() const
+{
+ return m_action;
+}
+
+const char* Ewk_Intent_Service::type() const
+{
+ return m_type;
+}
+
+const char* Ewk_Intent_Service::href() const
+{
+ return m_href;
+}
+
+const char* Ewk_Intent_Service::title() const
+{
+ return m_title;
+}
+
+const char* Ewk_Intent_Service::disposition() const
+{
+ return m_disposition;
+}
+#endif
+
Ewk_Intent_Service* ewk_intent_service_ref(Ewk_Intent_Service* service)
{
#if ENABLE(WEB_INTENTS_TAG)
@@ -58,33 +93,43 @@ const char* ewk_intent_service_action_get(const Ewk_Intent_Service* service)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
- return service->action;
+#if ENABLE(WEB_INTENTS_TAG)
+ return service->action();
+#endif
}
const char* ewk_intent_service_type_get(const Ewk_Intent_Service* service)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
- return service->type;
+#if ENABLE(WEB_INTENTS_TAG)
+ return service->type();
+#endif
}
const char* ewk_intent_service_href_get(const Ewk_Intent_Service* service)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
- return service->href;
+#if ENABLE(WEB_INTENTS_TAG)
+ return service->href();
+#endif
}
const char* ewk_intent_service_title_get(const Ewk_Intent_Service* service)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
- return service->title;
+#if ENABLE(WEB_INTENTS_TAG)
+ return service->title();
+#endif
}
const char* ewk_intent_service_disposition_get(const Ewk_Intent_Service* service)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
- return service->disposition;
+#if ENABLE(WEB_INTENTS_TAG)
+ return service->disposition();
+#endif
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service_private.h
index 119d6703a..f2efdffdb 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service_private.h
@@ -40,25 +40,25 @@
*/
class Ewk_Intent_Service : public RefCounted<Ewk_Intent_Service> {
public:
- WKEinaSharedString action;
- WKEinaSharedString type;
- WKEinaSharedString href;
- WKEinaSharedString title;
- WKEinaSharedString disposition;
-
static PassRefPtr<Ewk_Intent_Service> create(WKIntentServiceInfoRef serviceRef)
{
return adoptRef(new Ewk_Intent_Service(serviceRef));
}
+ const char* action() const;
+ const char* type() const;
+ const char* href() const;
+ const char* title() const;
+ const char* disposition() const;
+
private:
- explicit Ewk_Intent_Service(WKIntentServiceInfoRef serviceRef)
- : action(AdoptWK, WKIntentServiceInfoCopyAction(serviceRef))
- , type(AdoptWK, WKIntentServiceInfoCopyType(serviceRef))
- , href(AdoptWK, WKIntentServiceInfoCopyHref(serviceRef))
- , title(AdoptWK, WKIntentServiceInfoCopyTitle(serviceRef))
- , disposition(AdoptWK, WKIntentServiceInfoCopyDisposition(serviceRef))
- { }
+ explicit Ewk_Intent_Service(WKIntentServiceInfoRef serviceRef);
+
+ WKEinaSharedString m_action;
+ WKEinaSharedString m_type;
+ WKEinaSharedString m_href;
+ WKEinaSharedString m_title;
+ WKEinaSharedString m_disposition;
};
#endif // ENABLE(WEB_INTENTS_TAG)
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data.cpp
index a58459eb4..3d1f05f8f 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data.cpp
@@ -30,6 +30,27 @@
using namespace WebKit;
+Ewk_Navigation_Data::Ewk_Navigation_Data(WKNavigationDataRef dataRef)
+ : m_request(Ewk_Url_Request::create(adoptWK(WKNavigationDataCopyOriginalRequest(dataRef)).get()))
+ , m_title(AdoptWK, WKNavigationDataCopyTitle(dataRef))
+ , m_url(AdoptWK, WKNavigationDataCopyURL(dataRef))
+{ }
+
+Ewk_Url_Request* Ewk_Navigation_Data::originalRequest() const
+{
+ return m_request.get();
+}
+
+const char* Ewk_Navigation_Data::title() const
+{
+ return m_title;
+}
+
+const char* Ewk_Navigation_Data::url() const
+{
+ return m_url;
+}
+
Ewk_Navigation_Data* ewk_navigation_data_ref(Ewk_Navigation_Data* data)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0);
@@ -50,19 +71,19 @@ const char* ewk_navigation_data_title_get(const Ewk_Navigation_Data* data)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0);
- return data->title;
+ return data->title();
}
Ewk_Url_Request* ewk_navigation_data_original_request_get(const Ewk_Navigation_Data* data)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0);
- return data->request.get();
+ return data->originalRequest();
}
const char* ewk_navigation_data_url_get(const Ewk_Navigation_Data* data)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(data, 0);
- return data->url;
+ return data->url();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data_private.h
index e06016da4..0d0ecb043 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data_private.h
@@ -41,21 +41,22 @@
*/
class Ewk_Navigation_Data : public RefCounted<Ewk_Navigation_Data> {
public:
- RefPtr<Ewk_Url_Request> request;
- WKEinaSharedString title;
- WKEinaSharedString url;
-
static PassRefPtr<Ewk_Navigation_Data> create(WKNavigationDataRef dataRef)
{
return adoptRef(new Ewk_Navigation_Data(dataRef));
}
+ Ewk_Url_Request* originalRequest() const;
+
+ const char* title() const;
+ const char* url() const;
+
private:
- explicit Ewk_Navigation_Data(WKNavigationDataRef dataRef)
- : request(Ewk_Url_Request::create(adoptWK(WKNavigationDataCopyOriginalRequest(dataRef)).get()))
- , title(AdoptWK, WKNavigationDataCopyTitle(dataRef))
- , url(AdoptWK, WKNavigationDataCopyURL(dataRef))
- { }
+ explicit Ewk_Navigation_Data(WKNavigationDataRef dataRef);
+
+ RefPtr<Ewk_Url_Request> m_request;
+ WKEinaSharedString m_title;
+ WKEinaSharedString m_url;
};
#endif // ewk_navigation_data_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp
index d35c07e5f..5c4f24c5b 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.cpp
@@ -32,6 +32,66 @@
using namespace WebKit;
+Ewk_Navigation_Policy_Decision::Ewk_Navigation_Policy_Decision(WKFramePolicyListenerRef listener, Ewk_Navigation_Type navigationType, Event_Mouse_Button mouseButton, Event_Modifier_Keys modifiers, PassRefPtr<Ewk_Url_Request> request, const char* frameName)
+ : m_listener(listener)
+ , m_actedUponByClient(false)
+ , m_navigationType(navigationType)
+ , m_mouseButton(mouseButton)
+ , m_modifiers(modifiers)
+ , m_request(request)
+ , m_frameName(frameName)
+{ }
+
+Ewk_Navigation_Policy_Decision::~Ewk_Navigation_Policy_Decision()
+{
+ // This is the default choice for all policy decisions in WebPageProxy.cpp.
+ if (!m_actedUponByClient)
+ WKFramePolicyListenerUse(m_listener.get());
+}
+
+Ewk_Navigation_Type Ewk_Navigation_Policy_Decision::navigationType() const
+{
+ return m_navigationType;
+}
+
+Event_Mouse_Button Ewk_Navigation_Policy_Decision::mouseButton() const
+{
+ return m_mouseButton;
+}
+
+Event_Modifier_Keys Ewk_Navigation_Policy_Decision::modifiers() const
+{
+ return m_modifiers;
+}
+
+const char* Ewk_Navigation_Policy_Decision::frameName() const
+{
+ return m_frameName;
+}
+
+Ewk_Url_Request* Ewk_Navigation_Policy_Decision::request() const
+{
+ return m_request.get();
+}
+
+void Ewk_Navigation_Policy_Decision::accept()
+{
+ WKFramePolicyListenerUse(m_listener.get());
+ m_actedUponByClient = true;
+}
+
+void Ewk_Navigation_Policy_Decision::reject()
+{
+ WKFramePolicyListenerIgnore(m_listener.get());
+ m_actedUponByClient = true;
+}
+
+void Ewk_Navigation_Policy_Decision::download()
+{
+ WKFramePolicyListenerDownload(m_listener.get());
+ m_actedUponByClient = true;
+}
+
Ewk_Navigation_Policy_Decision* ewk_navigation_policy_decision_ref(Ewk_Navigation_Policy_Decision* decision)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(decision, 0);
@@ -52,59 +112,56 @@ Ewk_Navigation_Type ewk_navigation_policy_navigation_type_get(const Ewk_Navigati
{
EINA_SAFETY_ON_NULL_RETURN_VAL(decision, EWK_NAVIGATION_TYPE_OTHER);
- return decision->navigationType;
+ return decision->navigationType();
}
Event_Mouse_Button ewk_navigation_policy_mouse_button_get(const Ewk_Navigation_Policy_Decision* decision)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(decision, EVENT_MOUSE_BUTTON_NONE);
- return decision->mouseButton;
+ return decision->mouseButton();
}
Event_Modifier_Keys ewk_navigation_policy_modifiers_get(const Ewk_Navigation_Policy_Decision* decision)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(decision, static_cast<Event_Modifier_Keys>(0));
- return decision->modifiers;
+ return decision->modifiers();
}
const char* ewk_navigation_policy_frame_name_get(const Ewk_Navigation_Policy_Decision* decision)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(decision, 0);
- return decision->frameName;
+ return decision->frameName();
}
Ewk_Url_Request* ewk_navigation_policy_request_get(const Ewk_Navigation_Policy_Decision* decision)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(decision, 0);
- return decision->request.get();
+ return decision->request();
}
void ewk_navigation_policy_decision_accept(Ewk_Navigation_Policy_Decision* decision)
{
EINA_SAFETY_ON_NULL_RETURN(decision);
- WKFramePolicyListenerUse(decision->listener.get());
- decision->actedUponByClient = true;
+ decision->accept();
}
void ewk_navigation_policy_decision_reject(Ewk_Navigation_Policy_Decision* decision)
{
EINA_SAFETY_ON_NULL_RETURN(decision);
- WKFramePolicyListenerIgnore(decision->listener.get());
- decision->actedUponByClient = true;
+ decision->reject();
}
void ewk_navigation_policy_decision_download(Ewk_Navigation_Policy_Decision* decision)
{
EINA_SAFETY_ON_NULL_RETURN(decision);
- WKFramePolicyListenerDownload(decision->listener.get());
- decision->actedUponByClient = true;
+ decision->download();
}
// Ewk_Navigation_Type enum validation
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h
index e7e454979..95a18b7c2 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h
@@ -42,20 +42,7 @@
*/
class Ewk_Navigation_Policy_Decision : public RefCounted<Ewk_Navigation_Policy_Decision> {
public:
- WKRetainPtr<WKFramePolicyListenerRef> listener;
- bool actedUponByClient;
- Ewk_Navigation_Type navigationType;
- Event_Mouse_Button mouseButton;
- Event_Modifier_Keys modifiers;
- RefPtr<Ewk_Url_Request> request;
- WKEinaSharedString frameName;
-
- ~Ewk_Navigation_Policy_Decision()
- {
- // This is the default choice for all policy decisions in WebPageProxy.cpp.
- if (!actedUponByClient)
- WKFramePolicyListenerUse(listener.get());
- }
+ ~Ewk_Navigation_Policy_Decision();
static PassRefPtr<Ewk_Navigation_Policy_Decision> create(WKFrameNavigationType navigationType, WKEventMouseButton mouseButton, WKEventModifiers modifiers, WKURLRequestRef requestRef, const char* frameName, WKFramePolicyListenerRef listener)
{
@@ -63,16 +50,26 @@ public:
return adoptRef(new Ewk_Navigation_Policy_Decision(listener, static_cast<Ewk_Navigation_Type>(navigationType), static_cast<Event_Mouse_Button>(mouseButton), static_cast<Event_Modifier_Keys>(modifiers), request.release(), frameName));
}
+ void accept();
+ void reject();
+ void download();
+
+ Ewk_Navigation_Type navigationType() const;
+ Event_Mouse_Button mouseButton() const;
+ Event_Modifier_Keys modifiers() const;
+ const char* frameName() const;
+ Ewk_Url_Request* request() const;
+
private:
- Ewk_Navigation_Policy_Decision(WKFramePolicyListenerRef listener, Ewk_Navigation_Type navigationType, Event_Mouse_Button mouseButton, Event_Modifier_Keys modifiers, PassRefPtr<Ewk_Url_Request> request, const char* frameName)
- : listener(listener)
- , actedUponByClient(false)
- , navigationType(navigationType)
- , mouseButton(mouseButton)
- , modifiers(modifiers)
- , request(request)
- , frameName(frameName)
- { }
+ Ewk_Navigation_Policy_Decision(WKFramePolicyListenerRef listener, Ewk_Navigation_Type navigationType, Event_Mouse_Button mouseButton, Event_Modifier_Keys modifiers, PassRefPtr<Ewk_Url_Request> request, const char* frameName);
+
+ WKRetainPtr<WKFramePolicyListenerRef> m_listener;
+ bool m_actedUponByClient;
+ Ewk_Navigation_Type m_navigationType;
+ Event_Mouse_Button m_mouseButton;
+ Event_Modifier_Keys m_modifiers;
+ RefPtr<Ewk_Url_Request> m_request;
+ WKEinaSharedString m_frameName;
};
#endif // ewk_navigation_policy_decision_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp
index 4b229be83..549da1839 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp
@@ -33,17 +33,62 @@
using namespace WebKit;
Ewk_Popup_Menu_Item::Ewk_Popup_Menu_Item(const WebKit::WebPopupItem& item)
- : type(static_cast<Ewk_Popup_Menu_Item_Type>(item.m_type))
- , textDirection(static_cast<Ewk_Text_Direction>(item.m_textDirection))
- , hasTextDirectionOverride(item.m_hasTextDirectionOverride)
- , isEnabled(item.m_isEnabled)
- , isLabel(item.m_isLabel)
- , isSelected(item.m_isSelected)
- , text(item.m_text.utf8().data())
- , toolTip(item.m_toolTip.utf8().data())
- , accessibilityText(item.m_accessibilityText.utf8().data())
+ : m_type(static_cast<Ewk_Popup_Menu_Item_Type>(item.m_type))
+ , m_textDirection(static_cast<Ewk_Text_Direction>(item.m_textDirection))
+ , m_hasTextDirectionOverride(item.m_hasTextDirectionOverride)
+ , m_isEnabled(item.m_isEnabled)
+ , m_isLabel(item.m_isLabel)
+ , m_isSelected(item.m_isSelected)
+ , m_text(item.m_text.utf8().data())
+ , m_tooltipText(item.m_toolTip.utf8().data())
+ , m_accessibilityText(item.m_accessibilityText.utf8().data())
{ }
+Ewk_Popup_Menu_Item_Type Ewk_Popup_Menu_Item::type() const
+{
+ return m_type;
+}
+
+Ewk_Text_Direction Ewk_Popup_Menu_Item::textDirection() const
+{
+ return m_textDirection;
+}
+
+const char* Ewk_Popup_Menu_Item::text() const
+{
+ return m_text;
+}
+
+const char* Ewk_Popup_Menu_Item::tooltipText() const
+{
+ return m_tooltipText;
+}
+
+const char* Ewk_Popup_Menu_Item::accessibilityText() const
+{
+ return m_accessibilityText;
+}
+
+bool Ewk_Popup_Menu_Item::hasTextDirectionOverride() const
+{
+ return m_hasTextDirectionOverride;
+}
+
+bool Ewk_Popup_Menu_Item::isEnabled() const
+{
+ return m_isEnabled;
+}
+
+bool Ewk_Popup_Menu_Item::isLabel() const
+{
+ return m_isLabel;
+}
+
+bool Ewk_Popup_Menu_Item::isSelected() const
+{
+ return m_isSelected;
+}
+
COMPILE_ASSERT_MATCHING_ENUM(EWK_POPUP_MENU_SEPARATOR, WebPopupItem::Separator);
COMPILE_ASSERT_MATCHING_ENUM(EWK_POPUP_MENU_ITEM, WebPopupItem::Item);
@@ -51,61 +96,61 @@ Ewk_Popup_Menu_Item_Type ewk_popup_menu_item_type_get(const Ewk_Popup_Menu_Item*
{
EINA_SAFETY_ON_NULL_RETURN_VAL(item, EWK_POPUP_MENU_UNKNOWN);
- return item->type;
+ return item->type();
}
const char* ewk_popup_menu_item_text_get(const Ewk_Popup_Menu_Item* item)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
- return item->text;
+ return item->text();
}
Ewk_Text_Direction ewk_popup_menu_item_text_direction_get(const Ewk_Popup_Menu_Item* item)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(item, EWK_TEXT_DIRECTION_LEFT_TO_RIGHT);
- return item->textDirection;
+ return item->textDirection();
}
Eina_Bool ewk_popup_menu_item_text_direction_override_get(const Ewk_Popup_Menu_Item* item)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
- return item->hasTextDirectionOverride;
+ return item->hasTextDirectionOverride();
}
const char* ewk_popup_menu_item_tooltip_get(const Ewk_Popup_Menu_Item* item)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
- return item->toolTip;
+ return item->tooltipText();
}
const char* ewk_popup_menu_item_accessibility_text_get(const Ewk_Popup_Menu_Item* item)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
- return item->accessibilityText;
+ return item->accessibilityText();
}
Eina_Bool ewk_popup_menu_item_enabled_get(const Ewk_Popup_Menu_Item* item)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
- return item->isEnabled;
+ return item->isEnabled();
}
Eina_Bool ewk_popup_menu_item_is_label_get(const Ewk_Popup_Menu_Item* item)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
- return item->isLabel;
+ return item->isLabel();
}
Eina_Bool ewk_popup_menu_item_selected_get(const Ewk_Popup_Menu_Item* item)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
- return item->isSelected;
+ return item->isSelected();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item_private.h
index ad215dcaf..660579670 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item_private.h
@@ -37,25 +37,37 @@
*/
class Ewk_Popup_Menu_Item {
public:
- Ewk_Popup_Menu_Item_Type type;
- Ewk_Text_Direction textDirection;
-
- bool hasTextDirectionOverride;
- bool isEnabled;
- bool isLabel;
- bool isSelected;
-
- WKEinaSharedString text;
- WKEinaSharedString toolTip;
- WKEinaSharedString accessibilityText;
-
static PassOwnPtr<Ewk_Popup_Menu_Item> create(const WebKit::WebPopupItem& item)
{
return adoptPtr(new Ewk_Popup_Menu_Item(item));
}
+ Ewk_Popup_Menu_Item_Type type() const;
+ Ewk_Text_Direction textDirection() const;
+
+ bool hasTextDirectionOverride() const;
+ bool isEnabled() const;
+ bool isLabel() const;
+ bool isSelected() const;
+
+ const char* text() const;
+ const char* tooltipText() const;
+ const char* accessibilityText() const;
+
private:
explicit Ewk_Popup_Menu_Item(const WebKit::WebPopupItem& item);
+
+ Ewk_Popup_Menu_Item_Type m_type;
+ Ewk_Text_Direction m_textDirection;
+
+ bool m_hasTextDirectionOverride;
+ bool m_isEnabled;
+ bool m_isLabel;
+ bool m_isSelected;
+
+ WKEinaSharedString m_text;
+ WKEinaSharedString m_tooltipText;
+ WKEinaSharedString m_accessibilityText;
};
#endif // ewk_popup_menu_item_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_resource.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_resource.cpp
index 714a48978..bbc5a10e7 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_resource.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_resource.cpp
@@ -29,6 +29,21 @@
#include "ewk_resource_private.h"
#include <wtf/text/CString.h>
+Ewk_Resource::Ewk_Resource(WKURLRef url, bool isMainResource)
+ : m_url(url)
+ , m_isMainResource(isMainResource)
+{ }
+
+const char* Ewk_Resource::url() const
+{
+ return m_url;
+}
+
+bool Ewk_Resource::isMainResource() const
+{
+ return m_isMainResource;
+}
+
Ewk_Resource* ewk_resource_ref(Ewk_Resource* resource)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(resource, 0);
@@ -49,12 +64,12 @@ const char* ewk_resource_url_get(const Ewk_Resource* resource)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(resource, 0);
- return resource->url;
+ return resource->url();
}
Eina_Bool ewk_resource_main_resource_get(const Ewk_Resource* resource)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(resource, false);
- return resource->isMainResource;
+ return resource->isMainResource();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h
index 99cc9333b..0f1fe4343 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h
@@ -35,19 +35,19 @@
class Ewk_Resource : public RefCounted<Ewk_Resource> {
public:
- WKEinaSharedString url;
- bool isMainResource;
-
static PassRefPtr<Ewk_Resource> create(WKURLRef url, bool isMainResource)
{
return adoptRef(new Ewk_Resource(url, isMainResource));
}
+ const char* url() const;
+ bool isMainResource() const;
+
private:
- Ewk_Resource(WKURLRef url, bool isMainResource)
- : url(url)
- , isMainResource(isMainResource)
- { }
+ Ewk_Resource(WKURLRef url, bool isMainResource);
+
+ WKEinaSharedString m_url;
+ bool m_isMainResource;
};
#endif // ewk_resource_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp
index ab569ccc0..55a6801ab 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.cpp
@@ -30,6 +30,27 @@
using namespace WebKit;
+Ewk_Url_Request::Ewk_Url_Request(WKURLRequestRef requestRef)
+ : m_url(AdoptWK, WKURLRequestCopyURL(requestRef))
+ , m_firstParty(AdoptWK, WKURLRequestCopyFirstPartyForCookies(requestRef))
+ , m_httpMethod(AdoptWK, WKURLRequestCopyHTTPMethod(requestRef))
+{ }
+
+const char* Ewk_Url_Request::url() const
+{
+ return m_url;
+}
+
+const char* Ewk_Url_Request::firstParty() const
+{
+ return m_firstParty;
+}
+
+const char* Ewk_Url_Request::httpMethod() const
+{
+ return m_httpMethod;
+}
+
Ewk_Url_Request* ewk_url_request_ref(Ewk_Url_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
@@ -49,19 +70,19 @@ const char* ewk_url_request_url_get(const Ewk_Url_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
- return request->url;
+ return request->url();
}
const char* ewk_request_cookies_first_party_get(const Ewk_Url_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
- return request->firstParty;
+ return request->firstParty();
}
const char* ewk_url_request_http_method_get(const Ewk_Url_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
- return request->httpMethod;
+ return request->httpMethod();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_request_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_request_private.h
index 6fafb8876..31a1bea4e 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_request_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_request_private.h
@@ -38,21 +38,21 @@
*/
class Ewk_Url_Request : public RefCounted<Ewk_Url_Request> {
public:
- WKEinaSharedString url;
- WKEinaSharedString firstParty;
- WKEinaSharedString httpMethod;
-
static PassRefPtr<Ewk_Url_Request> create(WKURLRequestRef requestRef)
{
return adoptRef(new Ewk_Url_Request(requestRef));
}
+ const char* url() const;
+ const char* firstParty() const;
+ const char* httpMethod() const;
+
private:
- explicit Ewk_Url_Request(WKURLRequestRef requestRef)
- : url(AdoptWK, WKURLRequestCopyURL(requestRef))
- , firstParty(AdoptWK, WKURLRequestCopyFirstPartyForCookies(requestRef))
- , httpMethod(AdoptWK, WKURLRequestCopyHTTPMethod(requestRef))
- { }
+ explicit Ewk_Url_Request(WKURLRequestRef requestRef);
+
+ WKEinaSharedString m_url;
+ WKEinaSharedString m_firstParty;
+ WKEinaSharedString m_httpMethod;
};
#endif // ewk_url_request_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp
index 17223044f..04e176b84 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.cpp
@@ -31,6 +31,32 @@
using namespace WebKit;
+Ewk_Url_Response::Ewk_Url_Response(const WebCore::ResourceResponse& coreResponse)
+ : m_coreResponse(coreResponse)
+ , m_url(AdoptWK, WKURLResponseCopyURL(WebKit::toAPI(coreResponse)))
+ , m_mimeType(AdoptWK, WKURLResponseCopyMIMEType(WebKit::toAPI(coreResponse)))
+{ }
+
+int Ewk_Url_Response::httpStatusCode() const
+{
+ return m_coreResponse.httpStatusCode();
+}
+
+const char* Ewk_Url_Response::url() const
+{
+ return m_url;
+}
+
+const char* Ewk_Url_Response::mimeType() const
+{
+ return m_mimeType;
+}
+
+unsigned long Ewk_Url_Response::contentLength() const
+{
+ return m_coreResponse.expectedContentLength();
+}
+
Ewk_Url_Response* ewk_url_response_ref(Ewk_Url_Response* response)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(response, 0);
@@ -50,26 +76,26 @@ const char* ewk_url_response_url_get(const Ewk_Url_Response* response)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(response, 0);
- return response->url;
+ return response->url();
}
int ewk_url_response_status_code_get(const Ewk_Url_Response* response)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(response, 0);
- return response->coreResponse.httpStatusCode();
+ return response->httpStatusCode();
}
const char* ewk_url_response_mime_type_get(const Ewk_Url_Response* response)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(response, 0);
- return response->mimeType;
+ return response->mimeType();
}
unsigned long ewk_url_response_content_length_get(const Ewk_Url_Response* response)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(response, 0);
- return response->coreResponse.expectedContentLength();
+ return response->contentLength();
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h
index 357c1c64e..2d918a8fb 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h
@@ -38,10 +38,6 @@
*/
class Ewk_Url_Response : public RefCounted<Ewk_Url_Response> {
public:
- WebCore::ResourceResponse coreResponse;
- WKEinaSharedString url;
- WKEinaSharedString mimeType;
-
static PassRefPtr<Ewk_Url_Response> create(WKURLResponseRef wkResponse)
{
if (!wkResponse)
@@ -50,12 +46,17 @@ public:
return adoptRef(new Ewk_Url_Response(WebKit::toImpl(wkResponse)->resourceResponse()));
}
+ int httpStatusCode() const;
+ const char* url() const;
+ const char* mimeType() const;
+ unsigned long contentLength() const;
+
private:
- explicit Ewk_Url_Response(const WebCore::ResourceResponse& _coreResponse)
- : coreResponse(_coreResponse)
- , url(AdoptWK, WKURLResponseCopyURL(WebKit::toAPI(coreResponse)))
- , mimeType(AdoptWK, WKURLResponseCopyMIMEType(WebKit::toAPI(coreResponse)))
- { }
+ explicit Ewk_Url_Response(const WebCore::ResourceResponse& coreResponse);
+
+ WebCore::ResourceResponse m_coreResponse;
+ WKEinaSharedString m_url;
+ WKEinaSharedString m_mimeType;
};
#endif // ewk_url_response_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp
index fac36289e..04d9118d6 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.cpp
@@ -26,12 +26,52 @@
#include "config.h"
#include "ewk_url_scheme_request.h"
+#include "GOwnPtrSoup.h"
#include "WKData.h"
#include "WKString.h"
#include "ewk_url_scheme_request_private.h"
using namespace WebKit;
+Ewk_Url_Scheme_Request::Ewk_Url_Scheme_Request(WKSoupRequestManagerRef manager, WKURLRef url, uint64_t requestID)
+ : m_wkRequestManager(manager)
+ , m_url(url)
+ , m_requestID(requestID)
+{
+ GOwnPtr<SoupURI> soupURI(soup_uri_new(m_url));
+ m_scheme = soupURI->scheme;
+ m_path = soupURI->path;
+}
+
+uint64_t Ewk_Url_Scheme_Request::id() const
+{
+ return m_requestID;
+}
+
+const char* Ewk_Url_Scheme_Request::url() const
+{
+ return m_url;
+}
+
+const char* Ewk_Url_Scheme_Request::scheme() const
+{
+ return m_scheme;
+}
+
+const char* Ewk_Url_Scheme_Request::path() const
+{
+ return m_path;
+}
+
+void Ewk_Url_Scheme_Request::finish(const void* contentData, uint64_t contentLength, const char* mimeType)
+{
+ WKRetainPtr<WKDataRef> wkData(AdoptWK, WKDataCreate(contentLength ? reinterpret_cast<const unsigned char*>(contentData) : 0, contentLength));
+ WKRetainPtr<WKStringRef> wkMimeType = mimeType ? adoptWK(WKStringCreateWithUTF8CString(mimeType)) : 0;
+
+ // In case of empty reply an empty WKDataRef is sent to the WebProcess.
+ WKSoupRequestManagerDidHandleURIRequest(m_wkRequestManager.get(), wkData.get(), contentLength, wkMimeType.get(), m_requestID);
+}
+
Ewk_Url_Scheme_Request* ewk_url_scheme_request_ref(Ewk_Url_Scheme_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
@@ -51,32 +91,28 @@ const char* ewk_url_scheme_request_scheme_get(const Ewk_Url_Scheme_Request* requ
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
- return request->scheme;
+ return request->scheme();
}
const char* ewk_url_scheme_request_url_get(const Ewk_Url_Scheme_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
- return request->url;
+ return request->url();
}
const char* ewk_url_scheme_request_path_get(const Ewk_Url_Scheme_Request* request)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
- return request->path;
+ return request->path();
}
-Eina_Bool ewk_url_scheme_request_finish(const Ewk_Url_Scheme_Request* request, const void* contentData, unsigned int contentLength, const char* mimeType)
+Eina_Bool ewk_url_scheme_request_finish(Ewk_Url_Scheme_Request* request, const void* contentData, uint64_t contentLength, const char* mimeType)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(request, false);
- WKRetainPtr<WKDataRef> wkData(AdoptWK, WKDataCreate(contentLength ? reinterpret_cast<const unsigned char*>(contentData) : 0, contentLength));
- WKRetainPtr<WKStringRef> wkMimeType = mimeType ? adoptWK(WKStringCreateWithUTF8CString(mimeType)) : 0;
-
- // In case of empty reply an empty WKDataRef is sent to the WebProcess.
- WKSoupRequestManagerDidHandleURIRequest(request->wkRequestManager.get(), wkData.get(), contentLength, wkMimeType.get(), request->requestID);
+ request->finish(contentData, contentLength, mimeType);
return true;
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h
index f36ea4fcd..ce01afc31 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h
@@ -105,7 +105,7 @@ EAPI const char *ewk_url_scheme_request_path_get(const Ewk_Url_Scheme_Request *r
* @param content_length the length of the @a content_data.
* @param mime_type the content type of the stream or %c NULL if not known
*/
-EAPI Eina_Bool ewk_url_scheme_request_finish(const Ewk_Url_Scheme_Request *request, const void *content_data, unsigned int content_length, const char *mime_type);
+EAPI Eina_Bool ewk_url_scheme_request_finish(Ewk_Url_Scheme_Request *request, const void *content_data, uint64_t content_length, const char *mime_type);
#ifdef __cplusplus
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h
index 6bcba947e..30fd6f514 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h
@@ -26,7 +26,6 @@
#ifndef ewk_url_scheme_request_private_h
#define ewk_url_scheme_request_private_h
-#include "GOwnPtrSoup.h"
#include "WKAPICast.h"
#include "WKBase.h"
#include "WKEinaSharedString.h"
@@ -38,12 +37,6 @@
* @brief Contains the URL scheme request data.
*/
struct Ewk_Url_Scheme_Request : public RefCounted<Ewk_Url_Scheme_Request> {
- WKRetainPtr<WKSoupRequestManagerRef> wkRequestManager;
- WKEinaSharedString url;
- uint64_t requestID;
- WKEinaSharedString scheme;
- WKEinaSharedString path;
-
static PassRefPtr<Ewk_Url_Scheme_Request> create(WKSoupRequestManagerRef manager, WKURLRef url, uint64_t requestID)
{
if (!manager || !url)
@@ -52,16 +45,21 @@ struct Ewk_Url_Scheme_Request : public RefCounted<Ewk_Url_Scheme_Request> {
return adoptRef(new Ewk_Url_Scheme_Request(manager, url, requestID));
}
+ uint64_t id() const;
+ const char* url() const;
+ const char* scheme() const;
+ const char* path() const;
+
+ void finish(const void* contentData, uint64_t contentLength, const char* mimeType);
+
private:
- Ewk_Url_Scheme_Request(WKSoupRequestManagerRef manager, WKURLRef urlRef, uint64_t requestID)
- : wkRequestManager(manager)
- , url(urlRef)
- , requestID(requestID)
- {
- GOwnPtr<SoupURI> soupURI(soup_uri_new(url));
- scheme = soupURI->scheme;
- path = soupURI->path;
- }
+ Ewk_Url_Scheme_Request(WKSoupRequestManagerRef manager, WKURLRef urlRef, uint64_t requestID);
+
+ WKRetainPtr<WKSoupRequestManagerRef> m_wkRequestManager;
+ WKEinaSharedString m_url;
+ uint64_t m_requestID;
+ WKEinaSharedString m_scheme;
+ WKEinaSharedString m_path;
};
#endif // ewk_url_scheme_request_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
index ee4507c9f..d8608aa48 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
@@ -41,6 +41,7 @@
#include "ewk_back_forward_list_private.h"
#include "ewk_context.h"
#include "ewk_context_private.h"
+#include "ewk_favicon_database_private.h"
#include "ewk_intent_private.h"
#include "ewk_popup_menu_item.h"
#include "ewk_popup_menu_item_private.h"
@@ -75,7 +76,7 @@
#endif
#if USE(COORDINATED_GRAPHICS)
-#include "EflViewportHandler.h"
+#include "PageViewportControllerClientEfl.h"
#endif
using namespace WebKit;
@@ -115,7 +116,7 @@ static inline void removeFromPageViewMap(const Evas_Object* ewkView)
struct Ewk_View_Private_Data {
OwnPtr<PageClientImpl> pageClient;
#if USE(COORDINATED_GRAPHICS)
- OwnPtr<EflViewportHandler> viewportHandler;
+ OwnPtr<PageViewportControllerClientEfl> pageViewportControllerClient;
#endif
RefPtr<WebPageProxy> pageProxy;
@@ -171,7 +172,7 @@ struct Ewk_View_Private_Data {
{
/* Unregister icon change callback */
Ewk_Favicon_Database* iconDatabase = ewk_context_favicon_database_get(context);
- ewk_favicon_database_icon_change_callback_del(iconDatabase, _ewk_view_on_favicon_changed);
+ iconDatabase->unwatchChanges(_ewk_view_on_favicon_changed);
void* item;
EINA_LIST_FREE(popupMenuItems, item)
@@ -623,7 +624,7 @@ bool ewk_view_accelerated_compositing_mode_enter(const Evas_Object* ewkView)
return false;
}
- priv->viewportHandler->setRendererActive(true);
+ priv->pageViewportControllerClient->setRendererActive(true);
return true;
}
@@ -667,7 +668,7 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView)
if (smartData->changed.size) {
#if USE(COORDINATED_GRAPHICS)
- priv->viewportHandler->updateViewportSize(IntSize(width, height));
+ priv->pageViewportControllerClient->updateViewportSize(IntSize(width, height));
#endif
#if USE(ACCELERATED_COMPOSITING)
needsNewSurface = priv->evasGlSurface;
@@ -824,7 +825,7 @@ static void _ewk_view_initialize(Evas_Object* ewkView, Ewk_Context* context, WKP
priv->context = ewk_context_ref(context);
#if USE(COORDINATED_GRAPHICS)
- priv->viewportHandler = EflViewportHandler::create(ewkView);
+ priv->pageViewportControllerClient = PageViewportControllerClientEfl::create(ewkView);
#endif
WKPageRef wkPage = toAPI(priv->pageProxy.get());
@@ -841,7 +842,7 @@ static void _ewk_view_initialize(Evas_Object* ewkView, Ewk_Context* context, WKP
/* Listen for favicon changes */
Ewk_Favicon_Database* iconDatabase = ewk_context_favicon_database_get(priv->context);
- ewk_favicon_database_icon_change_callback_add(iconDatabase, _ewk_view_on_favicon_changed, ewkView);
+ iconDatabase->watchChanges(IconChangeCallbackData(_ewk_view_on_favicon_changed, ewkView));
}
static Evas_Object* _ewk_view_add_with_smart(Evas* canvas, Evas_Smart* smart)
@@ -1295,7 +1296,7 @@ void ewk_view_display(Evas_Object* ewkView, const IntRect& rect)
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
evas_gl_make_current(priv->evasGl, priv->evasGlSurface, priv->evasGlContext);
- priv->viewportHandler->display(rect, IntPoint(smartData->view.x, smartData->view.y));
+ priv->pageViewportControllerClient->display(rect, IntPoint(smartData->view.x, smartData->view.y));
#endif
evas_object_image_data_update_add(smartData->image, rect.x(), rect.y(), rect.width(), rect.height());
@@ -1429,7 +1430,7 @@ Eina_Bool ewk_view_intent_deliver(Evas_Object* ewkView, Ewk_Intent* intent)
EINA_SAFETY_ON_NULL_RETURN_VAL(intent, false);
WebPageProxy* page = priv->pageProxy.get();
- page->deliverIntentToFrame(page->mainFrame(), toImpl(intent->wkIntent.get()));
+ page->deliverIntentToFrame(page->mainFrame(), intent->webIntentData());
return true;
#else
@@ -1733,7 +1734,7 @@ void ewk_view_contents_size_changed(const Evas_Object* ewkView, const IntSize& s
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
- priv->viewportHandler->didChangeContentsSize(size);
+ priv->pageViewportControllerClient->didChangeContentsSize(size);
#else
UNUSED_PARAM(ewkView);
UNUSED_PARAM(size);
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.h b/Source/WebKit2/UIProcess/API/efl/ewk_view.h
index 34a0817ba..59809fab6 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.h
@@ -526,7 +526,7 @@ EAPI Eina_Bool ewk_view_html_string_load(Evas_Object *o, const char *html, const
*
* @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
*/
-Eina_Bool ewk_view_scale_set(Evas_Object *o, double scaleFactor, int x, int y);
+EAPI Eina_Bool ewk_view_scale_set(Evas_Object *o, double scaleFactor, int x, int y);
/**
* Queries the current scale factor of the page.
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp
index 8c7a064a4..0d6d5a347 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp
@@ -126,7 +126,10 @@ static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedIt
Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
ASSERT(ewkView);
- ewk_back_forward_list_changed(ewk_view_back_forward_list_get(ewkView), addedItem, removedItems);
+ Ewk_Back_Forward_List* list = ewk_view_back_forward_list_get(ewkView);
+ ASSERT(list);
+ list->update(addedItem, removedItems);
+
ewk_view_back_forward_list_changed(ewkView);
}
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp
index e02f011ca..63d315050 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp
@@ -45,8 +45,6 @@ EWK2UnitTestBase::EWK2UnitTestBase()
void EWK2UnitTestBase::SetUp()
{
- ewk_init();
-
unsigned int width = environment->defaultWidth();
unsigned int height = environment->defaultHeight();
@@ -68,7 +66,6 @@ void EWK2UnitTestBase::TearDown()
{
evas_object_del(m_webView);
ecore_evas_free(m_ecoreEvas);
- ewk_shutdown();
}
bool EWK2UnitTestBase::loadUrlSync(const char* url, double timeoutSeconds)
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp
index 778d261e8..4f60756e1 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp
@@ -28,10 +28,16 @@ EWK2UnitTestEnvironment* environment = 0;
int main(int argc, char** argv)
{
+ ewk_init();
+
::testing::InitGoogleTest(&argc, argv);
environment = new EWK2UnitTestEnvironment();
testing::AddGlobalTestEnvironment(environment);
- return RUN_ALL_TESTS();
+ int result = RUN_ALL_TESTS();
+
+ ewk_shutdown();
+
+ return result;
}
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
index 0ab0c912e..d4bb70fbf 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
@@ -938,3 +938,24 @@ TEST_F(EWK2UnitTestBase, ewk_view_inspector)
ASSERT_FALSE(ewk_view_inspector_close(webView()));
#endif
}
+
+TEST_F(EWK2UnitTestBase, ewk_view_scale)
+{
+ ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
+
+ // Default scale value is 1.0.
+ ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));
+
+ ASSERT_TRUE(ewk_view_scale_set(webView(), 1.2, 0, 0));
+ // Reload page to check the page scale value.
+ ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
+ ASSERT_FLOAT_EQ(1.2, ewk_view_scale_get(webView()));
+
+ ASSERT_TRUE(ewk_view_scale_set(webView(), 1.5, 0, 0));
+ ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
+ ASSERT_FLOAT_EQ(1.5, ewk_view_scale_get(webView()));
+
+ ASSERT_TRUE(ewk_view_scale_set(webView(), 1, 0, 0));
+ ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
+ ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp
index d600d7816..602d37999 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp
@@ -46,6 +46,8 @@
* item or items.
*/
+using namespace WebKit;
+
enum {
CHANGED,
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h
index e3ec77a3d..540f66594 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h
@@ -29,11 +29,9 @@
#include "WebBackForwardList.h"
#include "WebKitBackForwardList.h"
-using namespace WebKit;
-
-WebKitBackForwardList* webkitBackForwardListCreate(WebBackForwardList*);
-WebKitBackForwardListItem* webkitBackForwardListItemGetOrCreate(WebBackForwardListItem*);
-WebBackForwardListItem* webkitBackForwardListItemGetItem(WebKitBackForwardListItem*);
-void webkitBackForwardListChanged(WebKitBackForwardList*, WebBackForwardListItem* webAddedItem, ImmutableArray* webRemovedItems);
+WebKitBackForwardList* webkitBackForwardListCreate(WebKit::WebBackForwardList*);
+WebKitBackForwardListItem* webkitBackForwardListItemGetOrCreate(WebKit::WebBackForwardListItem*);
+WebKit::WebBackForwardListItem* webkitBackForwardListItemGetItem(WebKitBackForwardListItem*);
+void webkitBackForwardListChanged(WebKitBackForwardList*, WebKit::WebBackForwardListItem* webAddedItem, WebKit::ImmutableArray* webRemovedItems);
#endif // WebKitBackForwardListPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp
index 510c25dbc..e65728aac 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp
@@ -25,6 +25,7 @@
#include "WebKitContextMenuItemPrivate.h"
#include "WebKitContextMenuPrivate.h"
+using namespace WebKit;
using namespace WebCore;
struct _WebKitContextMenuPrivate {
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp
index 0887f7749..a73f07575 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp
@@ -34,6 +34,7 @@
#include <wtf/gobject/GOwnPtr.h>
#include <wtf/gobject/GRefPtr.h>
+using namespace WebKit;
using namespace WebCore;
struct _WebKitContextMenuItemPrivate {
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h
index 022fcec88..18f8c1a87 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h
@@ -23,9 +23,7 @@
#include "WebKitContextMenuItem.h"
#include "WebKitPrivate.h"
-using namespace WebKit;
-
-WebKitContextMenuItem* webkitContextMenuItemCreate(WebContextMenuItem*);
+WebKitContextMenuItem* webkitContextMenuItemCreate(WebKit::WebContextMenuItem*);
GtkMenuItem* webkitContextMenuItemRelease(WebKitContextMenuItem*);
void webkitContextMenuItemSetSubMenuFromGtkMenu(WebKitContextMenuItem*, GtkMenu*);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h
index 3a39dff00..5556e9f72 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h
@@ -23,9 +23,7 @@
#include "WebKitContextMenu.h"
#include "WebKitPrivate.h"
-using namespace WebKit;
-
-WebKitContextMenu* webkitContextMenuCreate(ImmutableArray* items);
+WebKitContextMenu* webkitContextMenuCreate(WebKit::ImmutableArray* items);
void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebCore::ContextMenuItem>&);
void webkitContextMenuSetParentItem(WebKitContextMenu*, WebKitContextMenuItem*);
WebKitContextMenuItem* webkitContextMenuGetParentItem(WebKitContextMenu*);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp
index 037b69171..66db1cc5b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp
@@ -27,6 +27,8 @@
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
+using namespace WebKit;
+
enum {
CHANGED,
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h
index 528d1fa29..6be84afae 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h
@@ -23,8 +23,6 @@
#include "WebKitCookieManager.h"
#include "WebKitPrivate.h"
-using namespace WebKit;
-
-WebKitCookieManager* webkitCookieManagerCreate(WebCookieManagerProxy*);
+WebKitCookieManager* webkitCookieManagerCreate(WebKit::WebCookieManagerProxy*);
#endif // WebKitCookieManagerPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp
index 620ac96db..cc3b51f52 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp
@@ -31,6 +31,7 @@
#include <wtf/gobject/GOwnPtr.h>
#include <wtf/gobject/GRefPtr.h>
+using namespace WebKit;
using namespace WebCore;
enum {
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h
index ce429d28e..215f565d5 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h
@@ -25,9 +25,7 @@
#include <WebCore/ResourceError.h>
#include <wtf/text/CString.h>
-using namespace WebKit;
-
-WebKitDownload* webkitDownloadCreate(DownloadProxy*);
+WebKitDownload* webkitDownloadCreate(WebKit::DownloadProxy*);
bool webkitDownloadIsCancelled(WebKitDownload*);
void webkitDownloadSetResponse(WebKitDownload*, WebKitURIResponse*);
void webkitDownloadNotifyProgress(WebKitDownload*, guint64 bytesReceived);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h
index 6c50949fb..e920954e2 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h
@@ -24,9 +24,7 @@
#include "WebKitFaviconDatabase.h"
#include <wtf/text/CString.h>
-using namespace WebKit;
-
-WebKitFaviconDatabase* webkitFaviconDatabaseCreate(WebIconDatabase*);
+WebKitFaviconDatabase* webkitFaviconDatabaseCreate(WebKit::WebIconDatabase*);
cairo_surface_t* webkitFaviconDatabaseGetFavicon(WebKitFaviconDatabase*, const CString&);
#endif // WebKitFaviconDatabasePrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp
index 96b87a3ba..26ab99b44 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp
@@ -20,16 +20,18 @@
#include "config.h"
#include "WebKitFileChooserRequest.h"
+#include "ImmutableArray.h"
#include "WebKitFileChooserRequestPrivate.h"
#include "WebOpenPanelParameters.h"
+#include "WebOpenPanelResultListenerProxy.h"
#include <WebCore/FileSystem.h>
#include <glib/gi18n-lib.h>
#include <wtf/gobject/GOwnPtr.h>
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
-using namespace WebCore;
using namespace WebKit;
+using namespace WebCore;
/**
* SECTION: WebKitFileChooserRequest
@@ -57,8 +59,8 @@ using namespace WebKit;
G_DEFINE_TYPE(WebKitFileChooserRequest, webkit_file_chooser_request, G_TYPE_OBJECT)
struct _WebKitFileChooserRequestPrivate {
- WKRetainPtr<WKOpenPanelParametersRef> wkParameters;
- WKRetainPtr<WKOpenPanelResultListenerRef> wkListener;
+ RefPtr<WebOpenPanelParameters> parameters;
+ RefPtr<WebOpenPanelResultListenerProxy> listener;
GRefPtr<GtkFileFilter> filter;
GRefPtr<GPtrArray> mimeTypes;
GRefPtr<GPtrArray> selectedFiles;
@@ -179,11 +181,11 @@ static void webkit_file_chooser_request_class_init(WebKitFileChooserRequestClass
WEBKIT_PARAM_READABLE));
}
-WebKitFileChooserRequest* webkitFileChooserRequestCreate(WKOpenPanelParametersRef wkParameters, WKOpenPanelResultListenerRef wkListener)
+WebKitFileChooserRequest* webkitFileChooserRequestCreate(WebOpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener)
{
WebKitFileChooserRequest* request = WEBKIT_FILE_CHOOSER_REQUEST(g_object_new(WEBKIT_TYPE_FILE_CHOOSER_REQUEST, NULL));
- request->priv->wkParameters = wkParameters;
- request->priv->wkListener = wkListener;
+ request->priv->parameters = parameters;
+ request->priv->listener = listener;
return request;
}
@@ -210,15 +212,15 @@ const gchar* const* webkit_file_chooser_request_get_mime_types(WebKitFileChooser
if (request->priv->mimeTypes)
return reinterpret_cast<gchar**>(request->priv->mimeTypes->pdata);
- WKRetainPtr<WKArrayRef> wkMimeTypes(AdoptWK, WKOpenPanelParametersCopyAcceptedMIMETypes(request->priv->wkParameters.get()));
- size_t numOfMimeTypes = WKArrayGetSize(wkMimeTypes.get());
+ RefPtr<ImmutableArray> mimeTypes = request->priv->parameters->acceptMIMETypes();
+ size_t numOfMimeTypes = mimeTypes->size();
if (!numOfMimeTypes)
return 0;
request->priv->mimeTypes = adoptGRef(g_ptr_array_new_with_free_func(g_free));
for (size_t i = 0; i < numOfMimeTypes; ++i) {
- WKStringRef wkMimeType = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkMimeTypes.get(), i));
- String mimeTypeString = toImpl(wkMimeType)->string();
+ WebString* webMimeType = static_cast<WebString*>(mimeTypes->at(i));
+ String mimeTypeString = webMimeType->string();
if (mimeTypeString.isEmpty())
continue;
g_ptr_array_add(request->priv->mimeTypes.get(), g_strdup(mimeTypeString.utf8().data()));
@@ -251,8 +253,8 @@ GtkFileFilter* webkit_file_chooser_request_get_mime_types_filter(WebKitFileChoos
if (request->priv->filter)
return request->priv->filter.get();
- WKRetainPtr<WKArrayRef> wkMimeTypes(AdoptWK, WKOpenPanelParametersCopyAcceptedMIMETypes(request->priv->wkParameters.get()));
- size_t numOfMimeTypes = WKArrayGetSize(wkMimeTypes.get());
+ RefPtr<ImmutableArray> mimeTypes = request->priv->parameters->acceptMIMETypes();
+ size_t numOfMimeTypes = mimeTypes->size();
if (!numOfMimeTypes)
return 0;
@@ -261,8 +263,8 @@ GtkFileFilter* webkit_file_chooser_request_get_mime_types_filter(WebKitFileChoos
// sure we keep the ownership during the lifetime of the request.
request->priv->filter = gtk_file_filter_new();
for (size_t i = 0; i < numOfMimeTypes; ++i) {
- WKStringRef wkMimeType = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkMimeTypes.get(), i));
- String mimeTypeString = toImpl(wkMimeType)->string();
+ WebString* webMimeType = static_cast<WebString*>(mimeTypes->at(i));
+ String mimeTypeString = webMimeType->string();
if (mimeTypeString.isEmpty())
continue;
gtk_file_filter_add_mime_type(request->priv->filter.get(), mimeTypeString.utf8().data());
@@ -285,7 +287,7 @@ GtkFileFilter* webkit_file_chooser_request_get_mime_types_filter(WebKitFileChoos
gboolean webkit_file_chooser_request_get_select_multiple(WebKitFileChooserRequest* request)
{
g_return_val_if_fail(WEBKIT_IS_FILE_CHOOSER_REQUEST(request), FALSE);
- return WKOpenPanelParametersGetAllowsMultipleFiles(request->priv->wkParameters.get());
+ return request->priv->parameters->allowMultipleFiles();
}
/**
@@ -303,7 +305,7 @@ void webkit_file_chooser_request_select_files(WebKitFileChooserRequest* request,
g_return_if_fail(files);
GRefPtr<GPtrArray> selectedFiles = adoptGRef(g_ptr_array_new_with_free_func(g_free));
- WKRetainPtr<WKMutableArrayRef> wkChosenFiles(AdoptWK, WKMutableArrayCreate());
+ Vector<RefPtr<APIObject> > choosenFiles;
for (int i = 0; files[i]; i++) {
GRefPtr<GFile> filename = adoptGRef(g_file_new_for_path(files[i]));
@@ -311,8 +313,7 @@ void webkit_file_chooser_request_select_files(WebKitFileChooserRequest* request,
// string, with the 'file://' prefix) to WebCore otherwise the
// FileChooser won't actually choose it.
GOwnPtr<char> uri(g_file_get_uri(filename.get()));
- WKRetainPtr<WKURLRef> wkURL(AdoptWK, WKURLCreateWithUTF8CString(uri.get()));
- WKArrayAppendItem(wkChosenFiles.get(), wkURL.get());
+ choosenFiles.append(WebURL::create(String::fromUTF8(uri.get())));
// Do not use the URI here because this won't reach WebCore.
g_ptr_array_add(selectedFiles.get(), g_strdup(files[i]));
@@ -320,7 +321,7 @@ void webkit_file_chooser_request_select_files(WebKitFileChooserRequest* request,
g_ptr_array_add(selectedFiles.get(), 0);
// Select the files in WebCore and update local private attributes.
- WKOpenPanelResultListenerChooseFiles(request->priv->wkListener.get(), wkChosenFiles.get());
+ request->priv->listener->chooseFiles(ImmutableArray::adopt(choosenFiles).get());
request->priv->selectedFiles = selectedFiles;
request->priv->handledRequest = true;
}
@@ -351,7 +352,7 @@ const gchar* const* webkit_file_chooser_request_get_selected_files(WebKitFileCho
if (request->priv->selectedFiles)
return reinterpret_cast<gchar**>(request->priv->selectedFiles->pdata);
- const Vector<String> selectedFileNames = toImpl(request->priv->wkParameters.get())->selectedFileNames();
+ const Vector<String> selectedFileNames = request->priv->parameters->selectedFileNames();
size_t numOfFiles = selectedFileNames.size();
if (!numOfFiles)
return 0;
@@ -380,6 +381,6 @@ const gchar* const* webkit_file_chooser_request_get_selected_files(WebKitFileCho
void webkit_file_chooser_request_cancel(WebKitFileChooserRequest* request)
{
g_return_if_fail(WEBKIT_IS_FILE_CHOOSER_REQUEST(request));
- WKOpenPanelResultListenerCancel(request->priv->wkListener.get());
+ request->priv->listener->cancel();
request->priv->handledRequest = true;
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h
index af7224a96..45d133e5b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h
@@ -23,6 +23,6 @@
#include "WebKitFileChooserRequest.h"
#include "WebKitPrivate.h"
-WebKitFileChooserRequest* webkitFileChooserRequestCreate(WKOpenPanelParametersRef, WKOpenPanelResultListenerRef);
+WebKitFileChooserRequest* webkitFileChooserRequestCreate(WebKit::WebOpenPanelParameters*, WebKit::WebOpenPanelResultListenerProxy*);
#endif // WebKitFileChooserRequestPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp
index 3e76b2393..be3f571d6 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp
@@ -27,6 +27,7 @@
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
+using namespace WebKit;
using namespace WebCore;
enum {
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp
index fd5be3daf..75978cf13 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp
@@ -30,7 +30,7 @@ using namespace WebKit;
static void willSubmitForm(WKPageRef page, WKFrameRef frame, WKFrameRef sourceFrame, WKDictionaryRef values, WKTypeRef userData, WKFormSubmissionListenerRef listener, const void* clientInfo)
{
- GRefPtr<WebKitFormSubmissionRequest> request = adoptGRef(webkitFormSubmissionRequestCreate(values, listener));
+ GRefPtr<WebKitFormSubmissionRequest> request = adoptGRef(webkitFormSubmissionRequestCreate(toImpl(values), toImpl(listener)));
webkitWebViewSubmitFormRequest(WEBKIT_WEB_VIEW(clientInfo), request.get());
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp
index 40e2d17f1..f901e7375 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp
@@ -20,6 +20,8 @@
#include "config.h"
#include "WebKitFormSubmissionRequest.h"
+#include "ImmutableDictionary.h"
+#include "WebFormSubmissionListenerProxy.h"
#include "WebKitFormSubmissionRequestPrivate.h"
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
@@ -29,8 +31,8 @@ using namespace WebKit;
G_DEFINE_TYPE(WebKitFormSubmissionRequest, webkit_form_submission_request, G_TYPE_OBJECT)
struct _WebKitFormSubmissionRequestPrivate {
- WKRetainPtr<WKDictionaryRef> wkValues;
- WKRetainPtr<WKFormSubmissionListenerRef> wkListener;
+ RefPtr<ImmutableDictionary> webValues;
+ RefPtr<WebFormSubmissionListenerProxy> listener;
GRefPtr<GHashTable> values;
bool handledRequest;
};
@@ -61,11 +63,11 @@ static void webkit_form_submission_request_class_init(WebKitFormSubmissionReques
g_type_class_add_private(requestClass, sizeof(WebKitFormSubmissionRequestPrivate));
}
-WebKitFormSubmissionRequest* webkitFormSubmissionRequestCreate(WKDictionaryRef wkValues, WKFormSubmissionListenerRef wkListener)
+WebKitFormSubmissionRequest* webkitFormSubmissionRequestCreate(ImmutableDictionary* values, WebFormSubmissionListenerProxy* listener)
{
WebKitFormSubmissionRequest* request = WEBKIT_FORM_SUBMISSION_REQUEST(g_object_new(WEBKIT_TYPE_FORM_SUBMISSION_REQUEST, NULL));
- request->priv->wkValues = wkValues;
- request->priv->wkListener = wkListener;
+ request->priv->webValues = values;
+ request->priv->listener = listener;
return request;
}
@@ -86,19 +88,19 @@ GHashTable* webkit_form_submission_request_get_text_fields(WebKitFormSubmissionR
if (request->priv->values)
return request->priv->values.get();
- if (!WKDictionaryGetSize(request->priv->wkValues.get()))
+ if (!request->priv->webValues->size())
return 0;
request->priv->values = adoptGRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free));
- WKRetainPtr<WKArrayRef> wkKeys(AdoptWK, WKDictionaryCopyKeys(request->priv->wkValues.get()));
- for (size_t i = 0; i < WKArrayGetSize(wkKeys.get()); ++i) {
- WKStringRef wkKey = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkKeys.get(), i));
- WKStringRef wkValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(request->priv->wkValues.get(), wkKey));
- g_hash_table_insert(request->priv->values.get(), g_strdup(toImpl(wkKey)->string().utf8().data()), g_strdup(toImpl(wkValue)->string().utf8().data()));
+ const ImmutableDictionary::MapType& map = request->priv->webValues->map();
+ ImmutableDictionary::MapType::const_iterator end = map.end();
+ for (ImmutableDictionary::MapType::const_iterator it = map.begin(); it != end; ++it) {
+ WebString* value = static_cast<WebString*>(it->value.get());
+ g_hash_table_insert(request->priv->values.get(), g_strdup(it->key.utf8().data()), g_strdup(value->string().utf8().data()));
}
- request->priv->wkValues = 0;
+ request->priv->webValues = 0;
return request->priv->values.get();
}
@@ -113,6 +115,6 @@ void webkit_form_submission_request_submit(WebKitFormSubmissionRequest* request)
{
g_return_if_fail(WEBKIT_IS_FORM_SUBMISSION_REQUEST(request));
- WKFormSubmissionListenerContinue(request->priv->wkListener.get());
+ request->priv->listener->continueSubmission();
request->priv->handledRequest = true;
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h
index ad4a6190b..9fe4751d2 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h
@@ -23,6 +23,6 @@
#include "WebKitFormSubmissionRequest.h"
#include "WebKitPrivate.h"
-WebKitFormSubmissionRequest* webkitFormSubmissionRequestCreate(WKDictionaryRef, WKFormSubmissionListenerRef);
+WebKitFormSubmissionRequest* webkitFormSubmissionRequestCreate(WebKit::ImmutableDictionary* values, WebKit::WebFormSubmissionListenerProxy*);
#endif // WebKitFormSubmissionRequestPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp
index 1079af778..664293770 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp
@@ -24,6 +24,8 @@
#include "WebKitGeolocationPermissionRequestPrivate.h"
#include "WebKitPermissionRequest.h"
+using namespace WebKit;
+
/**
* SECTION: WebKitGeolocationPermissionRequest
* @Short_description: A permission request for sharing user's location
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h
index 94f5cba4a..dd0e95821 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h
@@ -23,8 +23,6 @@
#include "WebKitGeolocationPermissionRequest.h"
#include "WebKitPrivate.h"
-using namespace WebKit;
-
-WebKitGeolocationPermissionRequest* webkitGeolocationPermissionRequestCreate(GeolocationPermissionRequestProxy*);
+WebKitGeolocationPermissionRequest* webkitGeolocationPermissionRequestCreate(WebKit::GeolocationPermissionRequestProxy*);
#endif // WebKitGeolocationPermissionRequestPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp
index 36f0f23fd..cdeac917d 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp
@@ -29,6 +29,8 @@
#include "WebGeolocationManagerProxy.h"
#include "WebGeolocationPosition.h"
+using namespace WebKit;
+
#if ENABLE(GEOLOCATION)
static inline WebKitGeolocationProvider* toGeolocationProvider(const void* clientInfo)
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h
index 11c7c1a2f..e6be3eac2 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h
@@ -28,7 +28,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
-using namespace WebKit;
+namespace WebKit {
class WebKitGeolocationProvider : public RefCounted<WebKitGeolocationProvider>, public WebCore::GeolocationProviderGeoclueClient {
public:
@@ -49,6 +49,8 @@ private:
WebCore::GeolocationProviderGeoclue m_provider;
};
+} // namespace WebKit
+
#endif // ENABLE(GEOLOCATION)
#endif // WebKitGeolocationProvider_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp
index 8115d63dd..4c9486782 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp
@@ -25,6 +25,8 @@
#include <glib/gi18n-lib.h>
#include <wtf/text/CString.h>
+using namespace WebKit;
+
/**
* SECTION: WebKitHitTestResult
* @Short_description: Result of a Hit Test
@@ -52,8 +54,6 @@
*
*/
-using namespace WebKit;
-
enum {
PROP_0,
@@ -237,27 +237,27 @@ static void webkit_hit_test_result_class_init(WebKitHitTestResultClass* hitTestR
g_type_class_add_private(hitTestResultClass, sizeof(WebKitHitTestResultPrivate));
}
-WebKitHitTestResult* webkitHitTestResultCreate(WKHitTestResultRef wkHitTestResult)
+WebKitHitTestResult* webkitHitTestResultCreate(WebHitTestResult* hitTestResult)
{
unsigned context = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
- const String& linkURL = toImpl(wkHitTestResult)->absoluteLinkURL();
+ const String& linkURL = hitTestResult->absoluteLinkURL();
if (!linkURL.isEmpty())
context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK;
- const String& imageURL = toImpl(wkHitTestResult)->absoluteImageURL();
+ const String& imageURL = hitTestResult->absoluteImageURL();
if (!imageURL.isEmpty())
context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;
- const String& mediaURL = toImpl(wkHitTestResult)->absoluteMediaURL();
+ const String& mediaURL = hitTestResult->absoluteMediaURL();
if (!mediaURL.isEmpty())
context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;
- if (WKHitTestResultIsContentEditable(wkHitTestResult))
+ if (hitTestResult->isContentEditable())
context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;
- const String& linkTitle = toImpl(wkHitTestResult)->linkTitle();
- const String& linkLabel = toImpl(wkHitTestResult)->linkLabel();
+ const String& linkTitle = hitTestResult->linkTitle();
+ const String& linkLabel = hitTestResult->linkLabel();
return WEBKIT_HIT_TEST_RESULT(g_object_new(WEBKIT_TYPE_HIT_TEST_RESULT,
"context", context,
@@ -274,15 +274,15 @@ static bool stringIsEqualToCString(const String& string, const CString& cString)
return ((string.isEmpty() && cString.isNull()) || (string.utf8() == cString));
}
-bool webkitHitTestResultCompare(WebKitHitTestResult* hitTestResult, WKHitTestResultRef wkHitTestResult)
+bool webkitHitTestResultCompare(WebKitHitTestResult* hitTestResult, WebHitTestResult* webHitTestResult)
{
WebKitHitTestResultPrivate* priv = hitTestResult->priv;
- return WKHitTestResultIsContentEditable(wkHitTestResult) == webkit_hit_test_result_context_is_editable(hitTestResult)
- && stringIsEqualToCString(toImpl(wkHitTestResult)->absoluteLinkURL(), priv->linkURI)
- && stringIsEqualToCString(toImpl(wkHitTestResult)->linkTitle(), priv->linkTitle)
- && stringIsEqualToCString(toImpl(wkHitTestResult)->linkLabel(), priv->linkLabel)
- && stringIsEqualToCString(toImpl(wkHitTestResult)->absoluteImageURL(), priv->imageURI)
- && stringIsEqualToCString(toImpl(wkHitTestResult)->absoluteMediaURL(), priv->mediaURI);
+ return webHitTestResult->isContentEditable() == webkit_hit_test_result_context_is_editable(hitTestResult)
+ && stringIsEqualToCString(webHitTestResult->absoluteLinkURL(), priv->linkURI)
+ && stringIsEqualToCString(webHitTestResult->linkTitle(), priv->linkTitle)
+ && stringIsEqualToCString(webHitTestResult->linkLabel(), priv->linkLabel)
+ && stringIsEqualToCString(webHitTestResult->absoluteImageURL(), priv->imageURI)
+ && stringIsEqualToCString(webHitTestResult->absoluteMediaURL(), priv->mediaURI);
}
/**
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h
index 6088006e7..7ba2c3871 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h
@@ -23,7 +23,7 @@
#include "WebKitHitTestResult.h"
#include "WebKitPrivate.h"
-WebKitHitTestResult* webkitHitTestResultCreate(WKHitTestResultRef);
-bool webkitHitTestResultCompare(WebKitHitTestResult*, WKHitTestResultRef);
+WebKitHitTestResult* webkitHitTestResultCreate(WebKit::WebHitTestResult*);
+bool webkitHitTestResultCompare(WebKitHitTestResult*, WebKit::WebHitTestResult*);
#endif // WebKitHitTestResultPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp
index 2a1b8d5a3..9bbd3f4ed 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp
@@ -24,6 +24,8 @@
#include "WebSerializedScriptValue.h"
#include <wtf/gobject/GRefPtr.h>
+using namespace WebKit;
+
struct _WebKitJavascriptResult {
_WebKitJavascriptResult(WebKitWebView* view, WebSerializedScriptValue* serializedScriptValue)
: webView(view)
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h
index ac7578857..e47e94c1b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h
@@ -24,8 +24,6 @@
#include "WebKitPrivate.h"
#include "WebKitWebView.h"
-using namespace WebKit;
-
-WebKitJavascriptResult* webkitJavascriptResultCreate(WebKitWebView*, WebSerializedScriptValue*);
+WebKitJavascriptResult* webkitJavascriptResultCreate(WebKitWebView*, WebKit::WebSerializedScriptValue*);
#endif // WebKitJavascriptResultPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
index e40fde76e..0901d8079 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
@@ -20,9 +20,9 @@
#include "config.h"
#include "WebKitNavigationPolicyDecision.h"
+#include "WebEvent.h"
#include "WebKitEnumTypes.h"
#include "WebKitPolicyDecisionPrivate.h"
-#include "WebKitPrivate.h"
#include "WebKitURIRequestPrivate.h"
#include "WebURLRequest.h"
#include <glib/gi18n-lib.h>
@@ -30,6 +30,7 @@
#include <wtf/text/CString.h>
using namespace WebKit;
+using namespace WebCore;
/**
* SECTION: WebKitNavigationPolicyDecision
@@ -256,36 +257,20 @@ const char* webkit_navigation_policy_decision_get_frame_name(WebKitNavigationPol
return decision->priv->frameName.data();
}
-COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_LINK_CLICKED, kWKFrameNavigationTypeLinkClicked);
-COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED, kWKFrameNavigationTypeFormSubmitted);
-COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_BACK_FORWARD, kWKFrameNavigationTypeBackForward);
-COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_RELOAD, kWKFrameNavigationTypeReload);
-COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED, kWKFrameNavigationTypeFormResubmitted);
-COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_OTHER, kWKFrameNavigationTypeOther);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_LINK_CLICKED, NavigationTypeLinkClicked);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED, NavigationTypeFormSubmitted);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_BACK_FORWARD, NavigationTypeBackForward);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_RELOAD, NavigationTypeReload);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED, NavigationTypeFormResubmitted);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NAVIGATION_TYPE_OTHER, NavigationTypeOther);
-static unsigned wkEventMouseButtonToWebKitMouseButton(WKEventMouseButton wkButton)
-{
- switch (wkButton) {
- case kWKEventMouseButtonNoButton:
- return 0;
- case kWKEventMouseButtonLeftButton:
- return 1;
- case kWKEventMouseButtonMiddleButton:
- return 2;
- case kWKEventMouseButtonRightButton:
- return 3;
- }
- ASSERT_NOT_REACHED();
- return 0;
-}
-
-WebKitNavigationPolicyDecision* webkitNavigationPolicyDecisionCreate(WKFrameNavigationType navigationType, WKEventMouseButton mouseButton, WKEventModifiers modifiers, WKURLRequestRef request, const char* frameName, WKFramePolicyListenerRef listener)
+WebKitNavigationPolicyDecision* webkitNavigationPolicyDecisionCreate(WebKitNavigationType navigationType, unsigned mouseButton, unsigned modifiers, WebURLRequest* request, const char* frameName, WebFramePolicyListenerProxy* listener)
{
WebKitNavigationPolicyDecision* decision = WEBKIT_NAVIGATION_POLICY_DECISION(g_object_new(WEBKIT_TYPE_NAVIGATION_POLICY_DECISION, NULL));
- decision->priv->navigationType = static_cast<WebKitNavigationType>(navigationType);
- decision->priv->mouseButton = wkEventMouseButtonToWebKitMouseButton(mouseButton);
- decision->priv->modifiers = wkEventModifiersToGdkModifiers(modifiers);
- decision->priv->request = adoptGRef(webkitURIRequestCreateForResourceRequest(toImpl(request)->resourceRequest()));
+ decision->priv->navigationType = navigationType;
+ decision->priv->mouseButton = mouseButton;
+ decision->priv->modifiers = modifiers;
+ decision->priv->request = adoptGRef(webkitURIRequestCreateForResourceRequest(request->resourceRequest()));
decision->priv->frameName = frameName;
webkitPolicyDecisionSetListener(WEBKIT_POLICY_DECISION(decision), listener);
return decision;
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h
index f3c0e1f50..d90f1c6c8 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h
@@ -23,6 +23,6 @@
#include "WebKitNavigationPolicyDecision.h"
#include "WebKitPrivate.h"
-WebKitNavigationPolicyDecision* webkitNavigationPolicyDecisionCreate(WKFrameNavigationType, WKEventMouseButton, WKEventModifiers, WKURLRequestRef, const char* frameName, WKFramePolicyListenerRef);
+WebKitNavigationPolicyDecision* webkitNavigationPolicyDecisionCreate(WebKitNavigationType, unsigned mouseButton, unsigned modifiers, WebKit::WebURLRequest*, const char* frameName, WebKit::WebFramePolicyListenerProxy*);
#endif // WebKitNavigationPolicyDecisionPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp
index 87fe90799..72a5266cc 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp
@@ -21,24 +21,23 @@
#include "WebKitPolicyClient.h"
#include "WebKitNavigationPolicyDecisionPrivate.h"
-#include "WebKitPolicyDecision.h"
-#include "WebKitPrivate.h"
#include "WebKitResponsePolicyDecisionPrivate.h"
#include "WebKitWebViewBasePrivate.h"
#include "WebKitWebViewPrivate.h"
#include <wtf/gobject/GRefPtr.h>
+#include <wtf/text/CString.h>
using namespace WebKit;
static void decidePolicyForNavigationActionCallback(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
{
GRefPtr<WebKitNavigationPolicyDecision> decision =
- adoptGRef(webkitNavigationPolicyDecisionCreate(navigationType,
- mouseButton,
- modifiers,
- request,
+ adoptGRef(webkitNavigationPolicyDecisionCreate(static_cast<WebKitNavigationType>(navigationType),
+ wkEventMouseButtonToWebKitMouseButton(mouseButton),
+ wkEventModifiersToGdkModifiers(modifiers),
+ toImpl(request),
0, /* frame name */
- listener));
+ toImpl(listener)));
webkitWebViewMakePolicyDecision(WEBKIT_WEB_VIEW(clientInfo),
WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION,
WEBKIT_POLICY_DECISION(decision.get()));
@@ -47,12 +46,12 @@ static void decidePolicyForNavigationActionCallback(WKPageRef page, WKFrameRef f
static void decidePolicyForNewWindowActionCallback(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
{
GRefPtr<WebKitNavigationPolicyDecision> decision =
- adoptGRef(webkitNavigationPolicyDecisionCreate(navigationType,
- mouseButton,
- modifiers,
- request,
+ adoptGRef(webkitNavigationPolicyDecisionCreate(static_cast<WebKitNavigationType>(navigationType),
+ wkEventMouseButtonToWebKitMouseButton(mouseButton),
+ wkEventModifiersToGdkModifiers(modifiers),
+ toImpl(request),
toImpl(frameName)->string().utf8().data(),
- listener));
+ toImpl(listener)));
webkitWebViewMakePolicyDecision(WEBKIT_WEB_VIEW(clientInfo),
WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION,
WEBKIT_POLICY_DECISION(decision.get()));
@@ -61,13 +60,13 @@ static void decidePolicyForNewWindowActionCallback(WKPageRef page, WKFrameRef fr
static void decidePolicyForResponseCallback(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
{
GRefPtr<WebKitResponsePolicyDecision> decision =
- adoptGRef(webkitResponsePolicyDecisionCreate(request, response, listener));
+ adoptGRef(webkitResponsePolicyDecisionCreate(toImpl(request), toImpl(response), toImpl(listener)));
webkitWebViewMakePolicyDecision(WEBKIT_WEB_VIEW(clientInfo),
WEBKIT_POLICY_DECISION_TYPE_RESPONSE,
WEBKIT_POLICY_DECISION(decision.get()));
}
-void attachPolicyClientToPage(WebKitWebView* webView)
+void attachPolicyClientToView(WebKitWebView* webView)
{
WKPagePolicyClient policyClient = {
kWKPagePolicyClientCurrentVersion,
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h b/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h
index 90d8d62cc..23dfcbb52 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h
@@ -22,6 +22,6 @@
#include "WebKitWebView.h"
-void attachPolicyClientToPage(WebKitWebView*);
+void attachPolicyClientToView(WebKitWebView*);
#endif // WebKitPolicyClient_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp
index 6b6759012..3e9ef3fbf 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp
@@ -20,9 +20,10 @@
#include "config.h"
#include "WebKitPolicyDecision.h"
+#include "WebFramePolicyListenerProxy.h"
#include "WebKitPolicyDecisionPrivate.h"
-#include "WebKitPrivate.h"
+using namespace WebKit;
/**
* SECTION: WebKitPolicyDecision
@@ -43,7 +44,7 @@
G_DEFINE_ABSTRACT_TYPE(WebKitPolicyDecision, webkit_policy_decision, G_TYPE_OBJECT)
struct _WebKitPolicyDecisionPrivate {
- WKRetainPtr<WKFramePolicyListenerRef> listener;
+ RefPtr<WebFramePolicyListenerProxy> listener;
bool madePolicyDecision;
};
@@ -60,13 +61,13 @@ static void webkitPolicyDecisionFinalize(GObject* object)
// This is the default choice for all policy decisions in WebPageProxy.cpp.
if (!priv->madePolicyDecision)
- WKFramePolicyListenerUse(priv->listener.get());
+ priv->listener->use();
priv->~WebKitPolicyDecisionPrivate();
G_OBJECT_CLASS(webkit_policy_decision_parent_class)->finalize(object);
}
-void webkitPolicyDecisionSetListener(WebKitPolicyDecision* decision, WKFramePolicyListenerRef listener)
+void webkitPolicyDecisionSetListener(WebKitPolicyDecision* decision, WebFramePolicyListenerProxy* listener)
{
decision->priv->listener = listener;
}
@@ -87,7 +88,7 @@ static void webkit_policy_decision_class_init(WebKitPolicyDecisionClass* decisio
void webkit_policy_decision_use(WebKitPolicyDecision* decision)
{
g_return_if_fail(WEBKIT_IS_POLICY_DECISION(decision));
- WKFramePolicyListenerUse(decision->priv->listener.get());
+ decision->priv->listener->use();
decision->priv->madePolicyDecision = true;
}
@@ -101,7 +102,7 @@ void webkit_policy_decision_use(WebKitPolicyDecision* decision)
void webkit_policy_decision_ignore(WebKitPolicyDecision* decision)
{
g_return_if_fail(WEBKIT_IS_POLICY_DECISION(decision));
- WKFramePolicyListenerIgnore(decision->priv->listener.get());
+ decision->priv->listener->ignore();
decision->priv->madePolicyDecision = true;
}
@@ -114,6 +115,6 @@ void webkit_policy_decision_ignore(WebKitPolicyDecision* decision)
void webkit_policy_decision_download(WebKitPolicyDecision* decision)
{
g_return_if_fail(WEBKIT_IS_POLICY_DECISION(decision));
- WKFramePolicyListenerDownload(decision->priv->listener.get());
+ decision->priv->listener->download();
decision->priv->madePolicyDecision = true;
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h
index e02caab64..0af6081ed 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h
@@ -21,8 +21,8 @@
#define WebKitPolicyDecisionPrivate_h
#include "WebKitPolicyDecision.h"
-#include <WebKit2/WebKit2_C.h>
+#include "WebKitPrivate.h"
-void webkitPolicyDecisionSetListener(WebKitPolicyDecision*, WKFramePolicyListenerRef);
+void webkitPolicyDecisionSetListener(WebKitPolicyDecision*, WebKit::WebFramePolicyListenerProxy*);
#endif // WebKitResponsePolicyDecisionPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp
index 998c3abfa..d34b9c471 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp
@@ -35,3 +35,19 @@ unsigned wkEventModifiersToGdkModifiers(WKEventModifiers wkModifiers)
modifiers |= GDK_META_MASK;
return modifiers;
}
+
+unsigned wkEventMouseButtonToWebKitMouseButton(WKEventMouseButton wkButton)
+{
+ switch (wkButton) {
+ case kWKEventMouseButtonNoButton:
+ return 0;
+ case kWKEventMouseButtonLeftButton:
+ return 1;
+ case kWKEventMouseButtonMiddleButton:
+ return 2;
+ case kWKEventMouseButtonRightButton:
+ return 3;
+ }
+ ASSERT_NOT_REACHED();
+ return 0;
+}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h
index 9ceafecb6..5aabcbc2e 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h
@@ -67,5 +67,6 @@ static void destroy##structName(structName* data) \
}
unsigned wkEventModifiersToGdkModifiers(WKEventModifiers);
+unsigned wkEventMouseButtonToWebKitMouseButton(WKEventMouseButton);
#endif // WebKitPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp
index adfcdfdd7..ab5f38c97 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp
@@ -150,11 +150,11 @@ WebKitURIResponse* webkit_response_policy_decision_get_response(WebKitResponsePo
return decision->priv->response.get();
}
-WebKitResponsePolicyDecision* webkitResponsePolicyDecisionCreate(WKURLRequestRef request, WKURLResponseRef response, WKFramePolicyListenerRef listener)
+WebKitResponsePolicyDecision* webkitResponsePolicyDecisionCreate(WebURLRequest* request, WebURLResponse* response, WebFramePolicyListenerProxy* listener)
{
WebKitResponsePolicyDecision* decision = WEBKIT_RESPONSE_POLICY_DECISION(g_object_new(WEBKIT_TYPE_RESPONSE_POLICY_DECISION, NULL));
- decision->priv->request = adoptGRef(webkitURIRequestCreateForResourceRequest(toImpl(request)->resourceRequest()));
- decision->priv->response = adoptGRef(webkitURIResponseCreateForResourceResponse(toImpl(response)->resourceResponse()));
+ decision->priv->request = adoptGRef(webkitURIRequestCreateForResourceRequest(request->resourceRequest()));
+ decision->priv->response = adoptGRef(webkitURIResponseCreateForResourceResponse(response->resourceResponse()));
webkitPolicyDecisionSetListener(WEBKIT_POLICY_DECISION(decision), listener);
return decision;
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h
index b508aa525..3e7e59e65 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h
@@ -23,6 +23,6 @@
#include "WebKitPrivate.h"
#include "WebKitResponsePolicyDecision.h"
-WebKitResponsePolicyDecision* webkitResponsePolicyDecisionCreate(WKURLRequestRef, WKURLResponseRef, WKFramePolicyListenerRef);
+WebKitResponsePolicyDecision* webkitResponsePolicyDecisionCreate(WebKit::WebURLRequest*, WebKit::WebURLResponse*, WebKit::WebFramePolicyListenerProxy*);
#endif // WebKitResponsePolicyDecisionPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
index 17d4c881b..005aaae78 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
@@ -33,14 +33,17 @@
#include "WebKitPrivate.h"
#include "WebKitSettingsPrivate.h"
+#include "WebPageGroup.h"
#include "WebPageProxy.h"
#include "WebPreferences.h"
#include <WebCore/UserAgentGtk.h>
#include <glib/gi18n-lib.h>
#include <wtf/text/CString.h>
+using namespace WebKit;
+
struct _WebKitSettingsPrivate {
- WKRetainPtr<WKPreferencesRef> preferences;
+ RefPtr<WebPreferences> preferences;
CString defaultFontFamily;
CString monospaceFontFamily;
CString serifFontFamily;
@@ -959,7 +962,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitSettings:media-playback-allows-inline
+ * WebKitSettings:media-playback-allows-inline:
*
* Whether media playback is full-screen only or inline playback is allowed.
* This is %TRUE by default, so media playback can be inline. Setting it to
@@ -1069,42 +1072,23 @@ static void webkit_settings_init(WebKitSettings* settings)
settings->priv = priv;
new (priv) WebKitSettingsPrivate();
- priv->preferences = adoptWK(WKPreferencesCreate());
-
- WKRetainPtr<WKStringRef> defaultFontFamilyRef = adoptWK(WKPreferencesCopyStandardFontFamily(priv->preferences.get()));
- priv->defaultFontFamily = WebKit::toImpl(defaultFontFamilyRef.get())->string().utf8();
-
- WKRetainPtr<WKStringRef> monospaceFontFamilyRef = adoptWK(WKPreferencesCopyFixedFontFamily(priv->preferences.get()));
- priv->monospaceFontFamily = WebKit::toImpl(monospaceFontFamilyRef.get())->string().utf8();
-
- WKRetainPtr<WKStringRef> serifFontFamilyRef = adoptWK(WKPreferencesCopySerifFontFamily(priv->preferences.get()));
- priv->serifFontFamily = WebKit::toImpl(serifFontFamilyRef.get())->string().utf8();
-
- WKRetainPtr<WKStringRef> sansSerifFontFamilyRef = adoptWK(WKPreferencesCopySansSerifFontFamily(priv->preferences.get()));
- priv->sansSerifFontFamily = WebKit::toImpl(sansSerifFontFamilyRef.get())->string().utf8();
-
- WKRetainPtr<WKStringRef> cursiveFontFamilyRef = adoptWK(WKPreferencesCopyCursiveFontFamily(priv->preferences.get()));
- priv->cursiveFontFamily = WebKit::toImpl(cursiveFontFamilyRef.get())->string().utf8();
-
- WKRetainPtr<WKStringRef> fantasyFontFamilyRef = adoptWK(WKPreferencesCopyFantasyFontFamily(priv->preferences.get()));
- priv->fantasyFontFamily = WebKit::toImpl(fantasyFontFamilyRef.get())->string().utf8();
-
- WKRetainPtr<WKStringRef> pictographFontFamilyRef = adoptWK(WKPreferencesCopyPictographFontFamily(priv->preferences.get()));
- priv->pictographFontFamily = WebKit::toImpl(pictographFontFamilyRef.get())->string().utf8();
+ priv->preferences = WebPreferences::create();
+ priv->defaultFontFamily = priv->preferences->standardFontFamily().utf8();
+ priv->monospaceFontFamily = priv->preferences->fixedFontFamily().utf8();
+ priv->serifFontFamily = priv->preferences->serifFontFamily().utf8();
+ priv->sansSerifFontFamily = priv->preferences->sansSerifFontFamily().utf8();
+ priv->cursiveFontFamily = priv->preferences->cursiveFontFamily().utf8();
+ priv->fantasyFontFamily = priv->preferences->fantasyFontFamily().utf8();
+ priv->pictographFontFamily = priv->preferences->pictographFontFamily().utf8();
+ priv->defaultCharset = priv->preferences->defaultTextEncodingName().utf8();
- WKRetainPtr<WKStringRef> defaultCharsetRef = adoptWK(WKPreferencesCopyDefaultTextEncodingName(priv->preferences.get()));
- priv->defaultCharset = WebKit::toImpl(defaultCharsetRef.get())->string().utf8();
}
-void webkitSettingsAttachSettingsToPage(WebKitSettings* settings, WKPageRef wkPage)
+void webkitSettingsAttachSettingsToPage(WebKitSettings* settings, WebPageProxy* page)
{
- WebKitSettingsPrivate* priv = settings->priv;
- WKPageGroupSetPreferences(WKPageGetPageGroup(wkPage), priv->preferences.get());
- WebKit::toImpl(wkPage)->setCanRunModal(priv->allowModalDialogs);
-
- ASSERT(!priv->userAgent.isNull());
- WKRetainPtr<WKStringRef> userAgent = adoptWK(WKStringCreateWithUTF8CString(priv->userAgent.data()));
- WKPageSetCustomUserAgent(wkPage, userAgent.get());
+ page->pageGroup()->setPreferences(settings->priv->preferences.get());
+ page->setCanRunModal(settings->priv->allowModalDialogs);
+ page->setCustomUserAgent(String::fromUTF8(settings->priv->userAgent.data()));
}
/**
@@ -1153,7 +1137,7 @@ gboolean webkit_settings_get_enable_javascript(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetJavaScriptEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->javaScriptEnabled();
}
/**
@@ -1168,11 +1152,11 @@ void webkit_settings_set_enable_javascript(WebKitSettings* settings, gboolean en
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetJavaScriptEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->javaScriptEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetJavaScriptEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setJavaScriptEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-javascript");
}
@@ -1188,7 +1172,7 @@ gboolean webkit_settings_get_auto_load_images(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetLoadsImagesAutomatically(settings->priv->preferences.get());
+ return settings->priv->preferences->loadsImagesAutomatically();
}
/**
@@ -1203,11 +1187,11 @@ void webkit_settings_set_auto_load_images(WebKitSettings* settings, gboolean ena
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetLoadsImagesAutomatically(priv->preferences.get());
+ bool currentValue = priv->preferences->loadsImagesAutomatically();
if (currentValue == enabled)
return;
- WKPreferencesSetLoadsImagesAutomatically(priv->preferences.get(), enabled);
+ priv->preferences->setLoadsImagesAutomatically(enabled);
g_object_notify(G_OBJECT(settings), "auto-load-images");
}
@@ -1223,7 +1207,7 @@ gboolean webkit_settings_get_load_icons_ignoring_image_load_setting(WebKitSettin
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference(settings->priv->preferences.get());
+ return settings->priv->preferences->loadsSiteIconsIgnoringImageLoadingPreference();
}
/**
@@ -1238,11 +1222,11 @@ void webkit_settings_set_load_icons_ignoring_image_load_setting(WebKitSettings*
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference(priv->preferences.get());
+ bool currentValue = priv->preferences->loadsSiteIconsIgnoringImageLoadingPreference();
if (currentValue == enabled)
return;
- WKPreferencesSetLoadsSiteIconsIgnoringImageLoadingPreference(priv->preferences.get(), enabled);
+ priv->preferences->setLoadsSiteIconsIgnoringImageLoadingPreference(enabled);
g_object_notify(G_OBJECT(settings), "load-icons-ignoring-image-load-setting");
}
@@ -1258,7 +1242,7 @@ gboolean webkit_settings_get_enable_offline_web_application_cache(WebKitSettings
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetOfflineWebApplicationCacheEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->offlineWebApplicationCacheEnabled();
}
/**
@@ -1273,11 +1257,11 @@ void webkit_settings_set_enable_offline_web_application_cache(WebKitSettings* se
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetOfflineWebApplicationCacheEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->offlineWebApplicationCacheEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetOfflineWebApplicationCacheEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setOfflineWebApplicationCacheEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-offline-web-application-cache");
}
@@ -1293,7 +1277,7 @@ gboolean webkit_settings_get_enable_html5_local_storage(WebKitSettings* settings
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetLocalStorageEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->localStorageEnabled();
}
/**
@@ -1308,11 +1292,11 @@ void webkit_settings_set_enable_html5_local_storage(WebKitSettings* settings, gb
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetLocalStorageEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->localStorageEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetLocalStorageEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setLocalStorageEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-html5-local-storage");
}
@@ -1328,7 +1312,7 @@ gboolean webkit_settings_get_enable_html5_database(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetDatabasesEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->databasesEnabled();
}
/**
@@ -1343,11 +1327,11 @@ void webkit_settings_set_enable_html5_database(WebKitSettings* settings, gboolea
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetDatabasesEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->databasesEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetDatabasesEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setDatabasesEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-html5-database");
}
@@ -1363,7 +1347,7 @@ gboolean webkit_settings_get_enable_xss_auditor(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetXSSAuditorEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->xssAuditorEnabled();
}
/**
@@ -1378,11 +1362,11 @@ void webkit_settings_set_enable_xss_auditor(WebKitSettings* settings, gboolean e
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetXSSAuditorEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->xssAuditorEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetXSSAuditorEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setXSSAuditorEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-xss-auditor");
}
@@ -1399,7 +1383,7 @@ gboolean webkit_settings_get_enable_frame_flattening(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetFrameFlatteningEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->frameFlatteningEnabled();
}
/**
@@ -1414,11 +1398,11 @@ void webkit_settings_set_enable_frame_flattening(WebKitSettings* settings, gbool
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetFrameFlatteningEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->frameFlatteningEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetFrameFlatteningEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setFrameFlatteningEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-frame-flattening");
}
@@ -1434,7 +1418,7 @@ gboolean webkit_settings_get_enable_plugins(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetPluginsEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->pluginsEnabled();
}
/**
@@ -1449,11 +1433,11 @@ void webkit_settings_set_enable_plugins(WebKitSettings* settings, gboolean enabl
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetPluginsEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->pluginsEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetPluginsEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setPluginsEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-plugins");
}
@@ -1469,7 +1453,7 @@ gboolean webkit_settings_get_enable_java(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetJavaEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->javaEnabled();
}
/**
@@ -1484,11 +1468,11 @@ void webkit_settings_set_enable_java(WebKitSettings* settings, gboolean enabled)
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetJavaEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->javaEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetJavaEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setJavaEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-java");
}
@@ -1504,7 +1488,7 @@ gboolean webkit_settings_get_javascript_can_open_windows_automatically(WebKitSet
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetJavaScriptCanOpenWindowsAutomatically(settings->priv->preferences.get());
+ return settings->priv->preferences->javaScriptCanOpenWindowsAutomatically();
}
/**
@@ -1519,11 +1503,11 @@ void webkit_settings_set_javascript_can_open_windows_automatically(WebKitSetting
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetJavaScriptCanOpenWindowsAutomatically(priv->preferences.get());
+ bool currentValue = priv->preferences->javaScriptCanOpenWindowsAutomatically();
if (currentValue == enabled)
return;
- WKPreferencesSetJavaScriptCanOpenWindowsAutomatically(priv->preferences.get(), enabled);
+ priv->preferences->setJavaScriptCanOpenWindowsAutomatically(enabled);
g_object_notify(G_OBJECT(settings), "javascript-can-open-windows-automatically");
}
@@ -1539,7 +1523,7 @@ gboolean webkit_settings_get_enable_hyperlink_auditing(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetHyperlinkAuditingEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->hyperlinkAuditingEnabled();
}
/**
@@ -1554,11 +1538,11 @@ void webkit_settings_set_enable_hyperlink_auditing(WebKitSettings* settings, gbo
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetHyperlinkAuditingEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->hyperlinkAuditingEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetHyperlinkAuditingEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setHyperlinkAuditingEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-hyperlink-auditing");
}
@@ -1593,10 +1577,9 @@ void webkit_settings_set_default_font_family(WebKitSettings* settings, const gch
if (!g_strcmp0(priv->defaultFontFamily.data(), defaultFontFamily))
return;
- WKRetainPtr<WKStringRef> standardFontFamilyRef = adoptWK(WKStringCreateWithUTF8CString(defaultFontFamily));
- WKPreferencesSetStandardFontFamily(priv->preferences.get(), standardFontFamilyRef.get());
- priv->defaultFontFamily = WebKit::toImpl(standardFontFamilyRef.get())->string().utf8();
-
+ String standardFontFamily = String::fromUTF8(defaultFontFamily);
+ priv->preferences->setStandardFontFamily(standardFontFamily);
+ priv->defaultFontFamily = standardFontFamily.utf8();
g_object_notify(G_OBJECT(settings), "default-font-family");
}
@@ -1631,10 +1614,9 @@ void webkit_settings_set_monospace_font_family(WebKitSettings* settings, const g
if (!g_strcmp0(priv->monospaceFontFamily.data(), monospaceFontFamily))
return;
- WKRetainPtr<WKStringRef> fixedFontFamilyRef = adoptWK(WKStringCreateWithUTF8CString(monospaceFontFamily));
- WKPreferencesSetFixedFontFamily(priv->preferences.get(), fixedFontFamilyRef.get());
- priv->monospaceFontFamily = WebKit::toImpl(fixedFontFamilyRef.get())->string().utf8();
-
+ String fixedFontFamily = String::fromUTF8(monospaceFontFamily);
+ priv->preferences->setFixedFontFamily(fixedFontFamily);
+ priv->monospaceFontFamily = fixedFontFamily.utf8();
g_object_notify(G_OBJECT(settings), "monospace-font-family");
}
@@ -1669,10 +1651,9 @@ void webkit_settings_set_serif_font_family(WebKitSettings* settings, const gchar
if (!g_strcmp0(priv->serifFontFamily.data(), serifFontFamily))
return;
- WKRetainPtr<WKStringRef> serifFontFamilyRef = adoptWK(WKStringCreateWithUTF8CString(serifFontFamily));
- WKPreferencesSetSerifFontFamily(priv->preferences.get(), serifFontFamilyRef.get());
- priv->serifFontFamily = WebKit::toImpl(serifFontFamilyRef.get())->string().utf8();
-
+ String serifFontFamilyString = String::fromUTF8(serifFontFamily);
+ priv->preferences->setSerifFontFamily(serifFontFamilyString);
+ priv->serifFontFamily = serifFontFamilyString.utf8();
g_object_notify(G_OBJECT(settings), "serif-font-family");
}
@@ -1707,10 +1688,9 @@ void webkit_settings_set_sans_serif_font_family(WebKitSettings* settings, const
if (!g_strcmp0(priv->sansSerifFontFamily.data(), sansSerifFontFamily))
return;
- WKRetainPtr<WKStringRef> sansSerifFontFamilyRef = adoptWK(WKStringCreateWithUTF8CString(sansSerifFontFamily));
- WKPreferencesSetSansSerifFontFamily(priv->preferences.get(), sansSerifFontFamilyRef.get());
- priv->sansSerifFontFamily = WebKit::toImpl(sansSerifFontFamilyRef.get())->string().utf8();
-
+ String sansSerifFontFamilyString = String::fromUTF8(sansSerifFontFamily);
+ priv->preferences->setSansSerifFontFamily(sansSerifFontFamilyString);
+ priv->sansSerifFontFamily = sansSerifFontFamilyString.utf8();
g_object_notify(G_OBJECT(settings), "sans-serif-font-family");
}
@@ -1745,10 +1725,9 @@ void webkit_settings_set_cursive_font_family(WebKitSettings* settings, const gch
if (!g_strcmp0(priv->cursiveFontFamily.data(), cursiveFontFamily))
return;
- WKRetainPtr<WKStringRef> cursiveFontFamilyRef = adoptWK(WKStringCreateWithUTF8CString(cursiveFontFamily));
- WKPreferencesSetCursiveFontFamily(priv->preferences.get(), cursiveFontFamilyRef.get());
- priv->cursiveFontFamily = WebKit::toImpl(cursiveFontFamilyRef.get())->string().utf8();
-
+ String cursiveFontFamilyString = String::fromUTF8(cursiveFontFamily);
+ priv->preferences->setCursiveFontFamily(cursiveFontFamilyString);
+ priv->cursiveFontFamily = cursiveFontFamilyString.utf8();
g_object_notify(G_OBJECT(settings), "cursive-font-family");
}
@@ -1783,10 +1762,9 @@ void webkit_settings_set_fantasy_font_family(WebKitSettings* settings, const gch
if (!g_strcmp0(priv->fantasyFontFamily.data(), fantasyFontFamily))
return;
- WKRetainPtr<WKStringRef> fantasyFontFamilyRef = adoptWK(WKStringCreateWithUTF8CString(fantasyFontFamily));
- WKPreferencesSetFantasyFontFamily(priv->preferences.get(), fantasyFontFamilyRef.get());
- priv->fantasyFontFamily = WebKit::toImpl(fantasyFontFamilyRef.get())->string().utf8();
-
+ String fantasyFontFamilyString = String::fromUTF8(fantasyFontFamily);
+ priv->preferences->setFantasyFontFamily(fantasyFontFamilyString);
+ priv->fantasyFontFamily = fantasyFontFamilyString.utf8();
g_object_notify(G_OBJECT(settings), "fantasy-font-family");
}
@@ -1821,10 +1799,9 @@ void webkit_settings_set_pictograph_font_family(WebKitSettings* settings, const
if (!g_strcmp0(priv->pictographFontFamily.data(), pictographFontFamily))
return;
- WKRetainPtr<WKStringRef> pictographFontFamilyRef = adoptWK(WKStringCreateWithUTF8CString(pictographFontFamily));
- WKPreferencesSetPictographFontFamily(priv->preferences.get(), pictographFontFamilyRef.get());
- priv->pictographFontFamily = WebKit::toImpl(pictographFontFamilyRef.get())->string().utf8();
-
+ String pictographFontFamilyString = String::fromUTF8(pictographFontFamily);
+ priv->preferences->setPictographFontFamily(pictographFontFamilyString);
+ priv->pictographFontFamily = pictographFontFamilyString.utf8();
g_object_notify(G_OBJECT(settings), "pictograph-font-family");
}
@@ -1840,7 +1817,7 @@ guint32 webkit_settings_get_default_font_size(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
- return WKPreferencesGetDefaultFontSize(settings->priv->preferences.get());
+ return settings->priv->preferences->defaultFontSize();
}
/**
@@ -1855,12 +1832,11 @@ void webkit_settings_set_default_font_size(WebKitSettings* settings, guint32 fon
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
-
- uint32_t currentSize = WKPreferencesGetDefaultFontSize(priv->preferences.get());
+ uint32_t currentSize = priv->preferences->defaultFontSize();
if (currentSize == fontSize)
return;
- WKPreferencesSetDefaultFontSize(priv->preferences.get(), fontSize);
+ priv->preferences->setDefaultFontSize(fontSize);
g_object_notify(G_OBJECT(settings), "default-font-size");
}
@@ -1876,7 +1852,7 @@ guint32 webkit_settings_get_default_monospace_font_size(WebKitSettings* settings
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
- return WKPreferencesGetDefaultFixedFontSize(settings->priv->preferences.get());
+ return settings->priv->preferences->defaultFixedFontSize();
}
/**
@@ -1891,12 +1867,11 @@ void webkit_settings_set_default_monospace_font_size(WebKitSettings* settings, g
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
-
- uint32_t currentSize = WKPreferencesGetDefaultFixedFontSize(priv->preferences.get());
+ uint32_t currentSize = priv->preferences->defaultFixedFontSize();
if (currentSize == fontSize)
return;
- WKPreferencesSetDefaultFixedFontSize(priv->preferences.get(), fontSize);
+ priv->preferences->setDefaultFixedFontSize(fontSize);
g_object_notify(G_OBJECT(settings), "default-monospace-font-size");
}
@@ -1912,7 +1887,7 @@ guint32 webkit_settings_get_minimum_font_size(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
- return WKPreferencesGetMinimumFontSize(settings->priv->preferences.get());
+ return settings->priv->preferences->minimumFontSize();
}
/**
@@ -1927,12 +1902,11 @@ void webkit_settings_set_minimum_font_size(WebKitSettings* settings, guint32 fon
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
-
- uint32_t currentSize = WKPreferencesGetMinimumFontSize(priv->preferences.get());
+ uint32_t currentSize = priv->preferences->minimumFontSize();
if (currentSize == fontSize)
return;
- WKPreferencesSetMinimumFontSize(priv->preferences.get(), fontSize);
+ priv->preferences->setMinimumFontSize(fontSize);
g_object_notify(G_OBJECT(settings), "minimum-font-size");
}
@@ -1967,10 +1941,9 @@ void webkit_settings_set_default_charset(WebKitSettings* settings, const gchar*
if (!g_strcmp0(priv->defaultCharset.data(), defaultCharset))
return;
- WKRetainPtr<WKStringRef> defaultCharsetRef = adoptWK(WKStringCreateWithUTF8CString(defaultCharset));
- WKPreferencesSetDefaultTextEncodingName(priv->preferences.get(), defaultCharsetRef.get());
- priv->defaultCharset = WebKit::toImpl(defaultCharsetRef.get())->string().utf8();
-
+ String defaultCharsetString = String::fromUTF8(defaultCharset);
+ priv->preferences->setDefaultTextEncodingName(defaultCharsetString);
+ priv->defaultCharset = defaultCharsetString.utf8();
g_object_notify(G_OBJECT(settings), "default-charset");
}
@@ -1986,7 +1959,7 @@ gboolean webkit_settings_get_enable_private_browsing(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetPrivateBrowsingEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->privateBrowsingEnabled();
}
/**
@@ -2001,11 +1974,11 @@ void webkit_settings_set_enable_private_browsing(WebKitSettings* settings, gbool
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetPrivateBrowsingEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->privateBrowsingEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetPrivateBrowsingEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setPrivateBrowsingEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-private-browsing");
}
@@ -2021,7 +1994,7 @@ gboolean webkit_settings_get_enable_developer_extras(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetDeveloperExtrasEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->developerExtrasEnabled();
}
/**
@@ -2036,11 +2009,11 @@ void webkit_settings_set_enable_developer_extras(WebKitSettings* settings, gbool
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetDeveloperExtrasEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->developerExtrasEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetDeveloperExtrasEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setDeveloperExtrasEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-developer-extras");
}
@@ -2056,7 +2029,7 @@ gboolean webkit_settings_get_enable_resizable_text_areas(WebKitSettings* setting
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetTextAreasAreResizable(settings->priv->preferences.get());
+ return settings->priv->preferences->textAreasAreResizable();
}
/**
@@ -2071,11 +2044,11 @@ void webkit_settings_set_enable_resizable_text_areas(WebKitSettings* settings, g
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetTextAreasAreResizable(priv->preferences.get());
+ bool currentValue = priv->preferences->textAreasAreResizable();
if (currentValue == enabled)
return;
- WKPreferencesSetTextAreasAreResizable(priv->preferences.get(), enabled);
+ priv->preferences->setTextAreasAreResizable(enabled);
g_object_notify(G_OBJECT(settings), "enable-resizable-text-areas");
}
@@ -2091,7 +2064,7 @@ gboolean webkit_settings_get_enable_tabs_to_links(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetTabsToLinks(settings->priv->preferences.get());
+ return settings->priv->preferences->tabsToLinks();
}
/**
@@ -2106,11 +2079,11 @@ void webkit_settings_set_enable_tabs_to_links(WebKitSettings* settings, gboolean
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetTabsToLinks(priv->preferences.get());
+ bool currentValue = priv->preferences->tabsToLinks();
if (currentValue == enabled)
return;
- WKPreferencesSetTabsToLinks(priv->preferences.get(), enabled);
+ priv->preferences->setTabsToLinks(enabled);
g_object_notify(G_OBJECT(settings), "enable-tabs-to-links");
}
@@ -2126,7 +2099,7 @@ gboolean webkit_settings_get_enable_dns_prefetching(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetDNSPrefetchingEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->dnsPrefetchingEnabled();
}
/**
@@ -2141,11 +2114,11 @@ void webkit_settings_set_enable_dns_prefetching(WebKitSettings* settings, gboole
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetDNSPrefetchingEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->dnsPrefetchingEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetDNSPrefetchingEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setDNSPrefetchingEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-dns-prefetching");
}
@@ -2161,7 +2134,7 @@ gboolean webkit_settings_get_enable_caret_browsing(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetCaretBrowsingEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->caretBrowsingEnabled();
}
/**
@@ -2176,11 +2149,11 @@ void webkit_settings_set_enable_caret_browsing(WebKitSettings* settings, gboolea
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetCaretBrowsingEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->caretBrowsingEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetCaretBrowsingEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setCaretBrowsingEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-caret-browsing");
}
@@ -2196,7 +2169,7 @@ gboolean webkit_settings_get_enable_fullscreen(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetFullScreenEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->fullScreenEnabled();
}
/**
@@ -2211,11 +2184,11 @@ void webkit_settings_set_enable_fullscreen(WebKitSettings* settings, gboolean en
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetFullScreenEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->fullScreenEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetFullScreenEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setFullScreenEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-fullscreen");
}
@@ -2231,7 +2204,7 @@ gboolean webkit_settings_get_print_backgrounds(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetShouldPrintBackgrounds(settings->priv->preferences.get());
+ return settings->priv->preferences->shouldPrintBackgrounds();
}
/**
@@ -2246,11 +2219,11 @@ void webkit_settings_set_print_backgrounds(WebKitSettings* settings, gboolean pr
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetShouldPrintBackgrounds(priv->preferences.get());
+ bool currentValue = priv->preferences->shouldPrintBackgrounds();
if (currentValue == printBackgrounds)
return;
- WKPreferencesSetShouldPrintBackgrounds(priv->preferences.get(), printBackgrounds);
+ priv->preferences->setShouldPrintBackgrounds(printBackgrounds);
g_object_notify(G_OBJECT(settings), "print-backgrounds");
}
@@ -2266,7 +2239,7 @@ gboolean webkit_settings_get_enable_webaudio(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetWebAudioEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->webAudioEnabled();
}
/**
@@ -2281,11 +2254,11 @@ void webkit_settings_set_enable_webaudio(WebKitSettings* settings, gboolean enab
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetWebAudioEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->webAudioEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetWebAudioEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setWebAudioEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-webaudio");
}
@@ -2301,7 +2274,7 @@ gboolean webkit_settings_get_enable_webgl(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetWebGLEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->webGLEnabled();
}
/**
@@ -2316,15 +2289,29 @@ void webkit_settings_set_enable_webgl(WebKitSettings* settings, gboolean enabled
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetWebGLEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->webGLEnabled();
if (currentValue == enabled)
return;
- WKPreferencesSetWebGLEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setWebGLEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-webgl");
}
/**
+ * webkit_settings_get_allow_modal_dialogs:
+ * @settings: a #WebKitSettings
+ *
+ * Get the #WebKitSettings:allow-modal-dialogs property.
+ *
+ * Returns: %TRUE if it's allowed to create and run modal dialogs or %FALSE otherwise.
+ */
+gboolean webkit_settings_get_allow_modal_dialogs(WebKitSettings* settings)
+{
+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
+ return settings->priv->allowModalDialogs;
+}
+
+/**
* webkit_settings_set_allow_modal_dialogs:
* @settings: a #WebKitSettings
* @allowed: Value to be set
@@ -2344,17 +2331,19 @@ void webkit_settings_set_allow_modal_dialogs(WebKitSettings* settings, gboolean
}
/**
- * webkit_settings_get_allow_modal_dialogs:
+ * webkit_settings_get_zoom_text_only:
* @settings: a #WebKitSettings
*
- * Get the #WebKitSettings:allow-modal-dialogs property.
+ * Get the #WebKitSettings:zoom-text-only property.
*
- * Returns: %TRUE if it's allowed to create and run modal dialogs or %FALSE otherwise.
+ * Returns: %TRUE If zoom level of the view should only affect the text
+ * or %FALSE if all view contents should be scaled.
*/
-gboolean webkit_settings_get_allow_modal_dialogs(WebKitSettings* settings)
+gboolean webkit_settings_get_zoom_text_only(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return settings->priv->allowModalDialogs;
+
+ return settings->priv->zoomTextOnly;
}
/**
@@ -2377,22 +2366,6 @@ void webkit_settings_set_zoom_text_only(WebKitSettings* settings, gboolean zoomT
}
/**
- * webkit_settings_get_zoom_text_only:
- * @settings: a #WebKitSettings
- *
- * Get the #WebKitSettings:zoom-text-only property.
- *
- * Returns: %TRUE If zoom level of the view should only affect the text
- * or %FALSE if all view contents should be scaled.
- */
-gboolean webkit_settings_get_zoom_text_only(WebKitSettings* settings)
-{
- g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
-
- return settings->priv->zoomTextOnly;
-}
-
-/**
* webkit_settings_get_javascript_can_access_clipboard:
* @settings: a #WebKitSettings
*
@@ -2404,8 +2377,8 @@ gboolean webkit_settings_get_javascript_can_access_clipboard(WebKitSettings* set
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetJavaScriptCanAccessClipboard(settings->priv->preferences.get())
- && WKPreferencesGetDOMPasteAllowed(settings->priv->preferences.get());
+ return settings->priv->preferences->javaScriptCanAccessClipboard()
+ && settings->priv->preferences->domPasteAllowed();
}
/**
@@ -2420,39 +2393,16 @@ void webkit_settings_set_javascript_can_access_clipboard(WebKitSettings* setting
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetJavaScriptCanAccessClipboard(priv->preferences.get())
- && WKPreferencesGetDOMPasteAllowed(priv->preferences.get());
+ bool currentValue = priv->preferences->javaScriptCanAccessClipboard() && priv->preferences->domPasteAllowed();
if (currentValue == enabled)
return;
- WKPreferencesSetJavaScriptCanAccessClipboard(priv->preferences.get(), enabled);
- WKPreferencesSetDOMPasteAllowed(priv->preferences.get(), enabled);
-
+ priv->preferences->setJavaScriptCanAccessClipboard(enabled);
+ priv->preferences->setDOMPasteAllowed(enabled);
g_object_notify(G_OBJECT(settings), "javascript-can-access-clipboard");
}
/**
- * webkit_settings_set_media_playback_requires_user_gesture:
- * @settings: a #WebKitSettings
- * @enabled: Value to be set
- *
- * Set the #WebKitSettings:media-playback-requires-user-gesture property.
- */
-void webkit_settings_set_media_playback_requires_user_gesture(WebKitSettings* settings, gboolean enabled)
-{
- g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
-
- WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetMediaPlaybackRequiresUserGesture(priv->preferences.get());
- if (currentValue == enabled)
- return;
-
- WKPreferencesSetMediaPlaybackRequiresUserGesture(priv->preferences.get(), enabled);
-
- g_object_notify(G_OBJECT(settings), "media-playback-requires-user-gesture");
-}
-
-/**
* webkit_settings_get_media_playback_requires_user_gesture:
* @settings: a #WebKitSettings
*
@@ -2465,28 +2415,27 @@ gboolean webkit_settings_get_media_playback_requires_user_gesture(WebKitSettings
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetMediaPlaybackRequiresUserGesture(settings->priv->preferences.get());
+ return settings->priv->preferences->mediaPlaybackRequiresUserGesture();
}
/**
- * webkit_settings_set_media_playback_allows_inline:
+ * webkit_settings_set_media_playback_requires_user_gesture:
* @settings: a #WebKitSettings
* @enabled: Value to be set
*
- * Set the #WebKitSettings:media-playback-allows-inline property.
+ * Set the #WebKitSettings:media-playback-requires-user-gesture property.
*/
-void webkit_settings_set_media_playback_allows_inline(WebKitSettings* settings, gboolean enabled)
+void webkit_settings_set_media_playback_requires_user_gesture(WebKitSettings* settings, gboolean enabled)
{
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetMediaPlaybackAllowsInline(priv->preferences.get());
+ bool currentValue = priv->preferences->mediaPlaybackRequiresUserGesture();
if (currentValue == enabled)
return;
- WKPreferencesSetMediaPlaybackAllowsInline(priv->preferences.get(), enabled);
-
- g_object_notify(G_OBJECT(settings), "media-playback-allows-inline");
+ priv->preferences->setMediaPlaybackRequiresUserGesture(enabled);
+ g_object_notify(G_OBJECT(settings), "media-playback-requires-user-gesture");
}
/**
@@ -2502,28 +2451,27 @@ gboolean webkit_settings_get_media_playback_allows_inline(WebKitSettings* settin
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), TRUE);
- return WKPreferencesGetMediaPlaybackAllowsInline(settings->priv->preferences.get());
+ return settings->priv->preferences->mediaPlaybackAllowsInline();
}
/**
- * webkit_settings_set_draw_compositing_indicators:
+ * webkit_settings_set_media_playback_allows_inline:
* @settings: a #WebKitSettings
* @enabled: Value to be set
*
- * Set the #WebKitSettings:draw-compositing-indicators property.
+ * Set the #WebKitSettings:media-playback-allows-inline property.
*/
-void webkit_settings_set_draw_compositing_indicators(WebKitSettings* settings, gboolean enabled)
+void webkit_settings_set_media_playback_allows_inline(WebKitSettings* settings, gboolean enabled)
{
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- if (WKPreferencesGetCompositingBordersVisible(priv->preferences.get()) == enabled
- && WKPreferencesGetCompositingRepaintCountersVisible(priv->preferences.get()) == enabled)
+ bool currentValue = priv->preferences->mediaPlaybackAllowsInline();
+ if (currentValue == enabled)
return;
- WKPreferencesSetCompositingBordersVisible(priv->preferences.get(), enabled);
- WKPreferencesSetCompositingRepaintCountersVisible(priv->preferences.get(), enabled);
- g_object_notify(G_OBJECT(settings), "draw-compositing-indicators");
+ priv->preferences->setMediaPlaybackAllowsInline(enabled);
+ g_object_notify(G_OBJECT(settings), "media-playback-allows-inline");
}
/**
@@ -2537,8 +2485,29 @@ void webkit_settings_set_draw_compositing_indicators(WebKitSettings* settings, g
gboolean webkit_settings_get_draw_compositing_indicators(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetCompositingBordersVisible(settings->priv->preferences.get())
- && WKPreferencesGetCompositingRepaintCountersVisible(settings->priv->preferences.get());
+ return settings->priv->preferences->compositingBordersVisible()
+ && settings->priv->preferences->compositingRepaintCountersVisible();
+}
+
+/**
+ * webkit_settings_set_draw_compositing_indicators:
+ * @settings: a #WebKitSettings
+ * @enabled: Value to be set
+ *
+ * Set the #WebKitSettings:draw-compositing-indicators property.
+ */
+void webkit_settings_set_draw_compositing_indicators(WebKitSettings* settings, gboolean enabled)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ if (priv->preferences->compositingBordersVisible() == enabled
+ && priv->preferences->compositingRepaintCountersVisible() == enabled)
+ return;
+
+ priv->preferences->setCompositingBordersVisible(enabled);
+ priv->preferences->setCompositingRepaintCountersVisible(enabled);
+ g_object_notify(G_OBJECT(settings), "draw-compositing-indicators");
}
/**
@@ -2553,7 +2522,7 @@ gboolean webkit_settings_get_enable_site_specific_quirks(WebKitSettings* setting
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetNeedsSiteSpecificQuirks(settings->priv->preferences.get());
+ return settings->priv->preferences->needsSiteSpecificQuirks();
}
/**
@@ -2568,11 +2537,11 @@ void webkit_settings_set_enable_site_specific_quirks(WebKitSettings* settings, g
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetNeedsSiteSpecificQuirks(priv->preferences.get());
+ bool currentValue = priv->preferences->needsSiteSpecificQuirks();
if (currentValue == enabled)
return;
- WKPreferencesSetNeedsSiteSpecificQuirks(priv->preferences.get(), enabled);
+ priv->preferences->setNeedsSiteSpecificQuirks(enabled);
g_object_notify(G_OBJECT(settings), "enable-site-specific-quirks");
}
@@ -2588,7 +2557,7 @@ gboolean webkit_settings_get_enable_page_cache(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WKPreferencesGetPageCacheEnabled(settings->priv->preferences.get());
+ return settings->priv->preferences->usesPageCache();
}
/**
@@ -2603,11 +2572,11 @@ void webkit_settings_set_enable_page_cache(WebKitSettings* settings, gboolean en
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WKPreferencesGetPageCacheEnabled(priv->preferences.get());
+ bool currentValue = priv->preferences->usesPageCache();
if (currentValue == enabled)
return;
- WKPreferencesSetPageCacheEnabled(priv->preferences.get(), enabled);
+ priv->preferences->setUsesPageCache(enabled);
g_object_notify(G_OBJECT(settings), "enable-page-cache");
}
@@ -2678,7 +2647,7 @@ gboolean webkit_settings_get_enable_smooth_scrolling(WebKitSettings* settings)
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return WebKit::toImpl(settings->priv->preferences.get())->scrollAnimatorEnabled();
+ return settings->priv->preferences->scrollAnimatorEnabled();
}
/**
@@ -2693,10 +2662,10 @@ void webkit_settings_set_enable_smooth_scrolling(WebKitSettings* settings, gbool
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = WebKit::toImpl(priv->preferences.get())->scrollAnimatorEnabled();
+ bool currentValue = priv->preferences->scrollAnimatorEnabled();
if (currentValue == enabled)
return;
- WebKit::toImpl(priv->preferences.get())->setScrollAnimatorEnabled(enabled);
+ priv->preferences->setScrollAnimatorEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-smooth-scrolling");
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h
index 4e5d23217..1ec252bc2 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h
@@ -27,8 +27,7 @@
#define WebKitSettingsPrivate_h
#include "WebKitSettings.h"
-#include <WebKit2/WebKit2_C.h>
-void webkitSettingsAttachSettingsToPage(WebKitSettings*, WKPageRef);
+void webkitSettingsAttachSettingsToPage(WebKitSettings*, WebKit::WebPageProxy*);
#endif // WebKitSettingsPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
index 1ca453b2e..00d65ed34 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
@@ -142,7 +142,7 @@ static void printFrame(WKPageRef page, WKFrameRef frame, const void*)
static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void *clientInfo)
{
- GRefPtr<WebKitFileChooserRequest> request = adoptGRef(webkitFileChooserRequestCreate(parameters, listener));
+ GRefPtr<WebKitFileChooserRequest> request = adoptGRef(webkitFileChooserRequestCreate(toImpl(parameters), toImpl(listener)));
webkitWebViewRunFileChooserRequest(WEBKIT_WEB_VIEW(clientInfo), request.get());
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp
index 29811fc6a..d4404147b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp
@@ -27,6 +27,9 @@
#include <glib/gi18n-lib.h>
#include <wtf/text/CString.h>
+using namespace WebKit;
+using namespace WebCore;
+
enum {
PROP_0,
@@ -37,13 +40,10 @@ enum {
PROP_SUGGESTED_FILENAME
};
-using namespace WebKit;
-using namespace WebCore;
-
G_DEFINE_TYPE(WebKitURIResponse, webkit_uri_response, G_TYPE_OBJECT)
struct _WebKitURIResponsePrivate {
- WebCore::ResourceResponse resourceResponse;
+ ResourceResponse resourceResponse;
CString uri;
CString mimeType;
CString suggestedFilename;
@@ -282,9 +282,9 @@ const WebCore::ResourceResponse& webkitURIResponseGetResourceResponse(WebKitURIR
return uriResponse->priv->resourceResponse;
}
-void webkitURIResponseSetCertificateInfo(WebKitURIResponse* response, WKCertificateInfoRef wkCertificate)
+void webkitURIResponseSetCertificateInfo(WebKitURIResponse* response, WebCertificateInfo* certificate)
{
- const PlatformCertificateInfo& certificateInfo = toImpl(wkCertificate)->platformCertificateInfo();
+ const PlatformCertificateInfo& certificateInfo = certificate->platformCertificateInfo();
response->priv->resourceResponse.setSoupMessageCertificate(certificateInfo.certificate());
response->priv->resourceResponse.setSoupMessageTLSErrors(certificateInfo.tlsErrors());
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h
index 957c9ce77..b111b71fa 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h
@@ -31,6 +31,6 @@
WebKitURIResponse* webkitURIResponseCreateForResourceResponse(const WebCore::ResourceResponse&);
const WebCore::ResourceResponse& webkitURIResponseGetResourceResponse(WebKitURIResponse*);
-void webkitURIResponseSetCertificateInfo(WebKitURIResponse*, WKCertificateInfoRef);
+void webkitURIResponseSetCertificateInfo(WebKitURIResponse*, WebKit::WebCertificateInfo*);
#endif // WebKitURIResponsePrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp
index 6f46dbeda..e2542e844 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp
@@ -31,6 +31,8 @@
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
+using namespace WebKit;
+
static const unsigned int gReadBufferSize = 8192;
G_DEFINE_TYPE(WebKitURISchemeRequest, webkit_uri_scheme_request, G_TYPE_OBJECT)
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h
index ef3dd53d6..3baebd1fe 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h
@@ -24,9 +24,7 @@
#include "WebKitURISchemeRequest.h"
#include "WebKitWebContext.h"
-using namespace WebKit;
-
-WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext*, WebSoupRequestManagerProxy*, WebURL*, WebPageProxy*, uint64_t requestID);
+WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext*, WebKit::WebSoupRequestManagerProxy*, WebKit::WebURL*, WebKit::WebPageProxy*, uint64_t requestID);
uint64_t webkitURISchemeRequestGetID(WebKitURISchemeRequest*);
void webkitURISchemeRequestCancel(WebKitURISchemeRequest*);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
index 0c29b2440..ca60a5dc2 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
@@ -44,6 +44,8 @@
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
+using namespace WebKit;
+
enum {
DOWNLOAD_STARTED,
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h
index 67be48d5c..ace23df4f 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h
@@ -33,13 +33,11 @@
#include "WebKitWebContext.h"
#include "WebSoupRequestManagerProxy.h"
-using namespace WebKit;
-
-WebContext* webkitWebContextGetContext(WebKitWebContext*);
-WebKitDownload* webkitWebContextGetOrCreateDownload(DownloadProxy*);
-void webkitWebContextRemoveDownload(DownloadProxy*);
+WebKit::WebContext* webkitWebContextGetContext(WebKitWebContext*);
+WebKitDownload* webkitWebContextGetOrCreateDownload(WebKit::DownloadProxy*);
+void webkitWebContextRemoveDownload(WebKit::DownloadProxy*);
void webkitWebContextDownloadStarted(WebKitWebContext*, WebKitDownload*);
-WebSoupRequestManagerProxy* webkitWebContextGetRequestManager(WebKitWebContext*);
+WebKit::WebSoupRequestManagerProxy* webkitWebContextGetRequestManager(WebKitWebContext*);
void webkitWebContextReceivedURIRequest(WebKitWebContext*, WebKitURISchemeRequest*);
void webkitWebContextDidFailToLoadURIRequest(WebKitWebContext*, uint64_t requestID);
void webkitWebContextDidFinishURIRequest(WebKitWebContext*, uint64_t requestID);
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp
index d384ac067..b788f1771 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp
@@ -27,6 +27,8 @@
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
+using namespace WebKit;
+
enum {
OPEN_WINDOW,
BRING_TO_FRONT,
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspectorPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspectorPrivate.h
index 5424e6006..2f5e99f8e 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspectorPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspectorPrivate.h
@@ -23,8 +23,6 @@
#include "WebKitPrivate.h"
#include "WebKitWebInspector.h"
-using namespace WebKit;
-
-WebKitWebInspector* webkitWebInspectorCreate(WebInspectorProxy*);
+WebKitWebInspector* webkitWebInspectorCreate(WebKit::WebInspectorProxy*);
#endif // WebKitWebInspectorPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp
index 5ca5e989d..73736f68f 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp
@@ -20,6 +20,8 @@
#include "config.h"
#include "WebKitWebResource.h"
+#include "WebData.h"
+#include "WebFrameProxy.h"
#include "WebKitMarshal.h"
#include "WebKitURIRequest.h"
#include "WebKitWebResourcePrivate.h"
@@ -47,7 +49,7 @@ enum {
struct _WebKitWebResourcePrivate {
- WKRetainPtr<WKFrameRef> wkFrame;
+ RefPtr<WebFrameProxy> frame;
CString uri;
GRefPtr<WebKitURIResponse> response;
bool isMainResource;
@@ -205,11 +207,11 @@ static void webkitWebResourceUpdateURI(WebKitWebResource* resource, const CStrin
g_object_notify(G_OBJECT(resource), "uri");
}
-WebKitWebResource* webkitWebResourceCreate(WKFrameRef wkFrame, WebKitURIRequest* request, bool isMainResource)
+WebKitWebResource* webkitWebResourceCreate(WebFrameProxy* frame, WebKitURIRequest* request, bool isMainResource)
{
- ASSERT(wkFrame);
+ ASSERT(frame);
WebKitWebResource* resource = WEBKIT_WEB_RESOURCE(g_object_new(WEBKIT_TYPE_WEB_RESOURCE, NULL));
- resource->priv->wkFrame = wkFrame;
+ resource->priv->frame = frame;
resource->priv->uri = webkit_uri_request_get_uri(request);
resource->priv->isMainResource = isMainResource;
return resource;
@@ -243,9 +245,9 @@ void webkitWebResourceFailed(WebKitWebResource* resource, GError* error)
g_signal_emit(resource, signals[FINISHED], 0, NULL);
}
-WKFrameRef webkitWebResourceGetFrame(WebKitWebResource* resource)
+WebFrameProxy* webkitWebResourceGetFrame(WebKitWebResource* resource)
{
- return resource->priv->wkFrame.get();
+ return resource->priv->frame.get();
}
/**
@@ -307,7 +309,7 @@ WebKitURIResponse* webkit_web_resource_get_response(WebKitWebResource* resource)
}
struct ResourceGetDataAsyncData {
- WKDataRef wkData;
+ RefPtr<WebData> webData;
GRefPtr<GCancellable> cancellable;
};
WEBKIT_DEFINE_ASYNC_DATA_STRUCT(ResourceGetDataAsyncData)
@@ -320,7 +322,7 @@ static void resourceDataCallback(WKDataRef wkData, WKErrorRef, void* context)
if (g_cancellable_set_error_if_cancelled(data->cancellable.get(), &error))
g_simple_async_result_take_error(result.get(), error);
else
- data->wkData = wkData;
+ data->webData = toImpl(wkData);
g_simple_async_result_complete(result.get());
}
@@ -346,10 +348,10 @@ void webkit_web_resource_get_data(WebKitWebResource* resource, GCancellable* can
data->cancellable = cancellable;
g_simple_async_result_set_op_res_gpointer(result, data, reinterpret_cast<GDestroyNotify>(destroyResourceGetDataAsyncData));
if (resource->priv->isMainResource)
- WKFrameGetMainResourceData(resource->priv->wkFrame.get(), resourceDataCallback, result);
+ resource->priv->frame->getMainResourceData(DataCallback::create(result, resourceDataCallback));
else {
- WKRetainPtr<WKURLRef> url(AdoptWK, WKURLCreateWithUTF8CString(resource->priv->uri.data()));
- WKFrameGetResourceData(resource->priv->wkFrame.get(), url.get(), resourceDataCallback, result);
+ String url = String::fromUTF8(resource->priv->uri.data());
+ resource->priv->frame->getResourceData(WebURL::create(url).get(), DataCallback::create(result, resourceDataCallback));
}
}
@@ -378,6 +380,6 @@ guchar* webkit_web_resource_get_data_finish(WebKitWebResource* resource, GAsyncR
ResourceGetDataAsyncData* data = static_cast<ResourceGetDataAsyncData*>(g_simple_async_result_get_op_res_gpointer(simple));
if (length)
- *length = WKDataGetSize(data->wkData);
- return static_cast<guchar*>(g_memdup(WKDataGetBytes(data->wkData), WKDataGetSize(data->wkData)));
+ *length = data->webData->size();
+ return static_cast<guchar*>(g_memdup(data->webData->bytes(), data->webData->size()));
}
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h
index ed1fe02f1..82e2d8f5a 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h
@@ -23,13 +23,13 @@
#include "WebKitPrivate.h"
#include "WebKitWebResource.h"
-WebKitWebResource* webkitWebResourceCreate(WKFrameRef, WebKitURIRequest*, bool isMainResource);
+WebKitWebResource* webkitWebResourceCreate(WebKit::WebFrameProxy*, WebKitURIRequest*, bool isMainResource);
void webkitWebResourceSentRequest(WebKitWebResource*, WebKitURIRequest*, WebKitURIResponse*);
void webkitWebResourceSetResponse(WebKitWebResource*, WebKitURIResponse*);
void webkitWebResourceNotifyProgress(WebKitWebResource*, guint64 bytesReceived);
void webkitWebResourceFinished(WebKitWebResource*);
void webkitWebResourceFailed(WebKitWebResource*, GError*);
-WKFrameRef webkitWebResourceGetFrame(WebKitWebResource*);
+WebKit::WebFrameProxy* webkitWebResourceGetFrame(WebKitWebResource*);
#endif // WebKitWebResourcePrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
index 46c4bd464..de0f28dce 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
@@ -63,6 +63,7 @@
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
+using namespace WebKit;
using namespace WebCore;
enum {
@@ -301,7 +302,7 @@ static void iconReadyCallback(WebKitFaviconDatabase* database, const char* uri,
static void webkitWebViewSetSettings(WebKitWebView* webView, WebKitSettings* settings)
{
webView->priv->settings = settings;
- webkitSettingsAttachSettingsToPage(webView->priv->settings.get(), toAPI(getPage(webView)));
+ webkitSettingsAttachSettingsToPage(webView->priv->settings.get(), getPage(webView));
g_signal_connect(settings, "notify::allow-modal-dialogs", G_CALLBACK(allowModalDialogsChanged), webView);
g_signal_connect(settings, "notify::zoom-text-only", G_CALLBACK(zoomTextOnlyChanged), webView);
g_signal_connect(settings, "notify::user-agent", G_CALLBACK(userAgentChanged), webView);
@@ -402,7 +403,7 @@ static void webkitWebViewConstructed(GObject* object)
attachLoaderClientToView(webView);
attachUIClientToView(webView);
- attachPolicyClientToPage(webView);
+ attachPolicyClientToView(webView);
attachResourceLoadClientToView(webView);
attachFullScreenClientToView(webView);
attachContextMenuClientToView(webView);
@@ -1231,7 +1232,7 @@ static void setCertificateToMainResource(WebKitWebView* webView)
ASSERT(priv->mainResource.get());
webkitURIResponseSetCertificateInfo(webkit_web_resource_get_response(priv->mainResource.get()),
- WKFrameGetCertificateInfo(webkitWebResourceGetFrame(priv->mainResource.get())));
+ webkitWebResourceGetFrame(priv->mainResource.get())->certificateInfo());
}
static void webkitWebViewEmitLoadChanged(WebKitWebView* webView, WebKitLoadEvent loadEvent)
@@ -1355,7 +1356,7 @@ WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView* webView, ImmutableDictio
if (!newWebView)
return 0;
- webkitWindowPropertiesUpdateFromWKWindowFeatures(newWebView->priv->windowProperties.get(), toAPI(windowFeatures));
+ webkitWindowPropertiesUpdateFromWebWindowFeatures(newWebView->priv->windowProperties.get(), windowFeatures);
RefPtr<WebPageProxy> newPage = getPage(newWebView);
return newPage.release().leakRef();
@@ -1423,11 +1424,11 @@ void webkitWebViewMouseTargetChanged(WebKitWebView* webView, WebHitTestResult* h
WebKitWebViewPrivate* priv = webView->priv;
if (priv->mouseTargetHitTestResult
&& priv->mouseTargetModifiers == modifiers
- && webkitHitTestResultCompare(priv->mouseTargetHitTestResult.get(), toAPI(hitTestResult)))
+ && webkitHitTestResultCompare(priv->mouseTargetHitTestResult.get(), hitTestResult))
return;
priv->mouseTargetModifiers = modifiers;
- priv->mouseTargetHitTestResult = adoptGRef(webkitHitTestResultCreate(toAPI(hitTestResult)));
+ priv->mouseTargetHitTestResult = adoptGRef(webkitHitTestResultCreate(hitTestResult));
g_signal_emit(webView, signals[MOUSE_TARGET_CHANGED], 0, priv->mouseTargetHitTestResult.get(), modifiers);
}
@@ -1467,7 +1468,7 @@ void webkitWebViewResourceLoadStarted(WebKitWebView* webView, WebFrameProxy* fra
{
WebKitWebViewPrivate* priv = webView->priv;
bool isMainResource = frame->isMainFrame() && !priv->mainResource;
- WebKitWebResource* resource = webkitWebResourceCreate(toAPI(frame), request, isMainResource);
+ WebKitWebResource* resource = webkitWebResourceCreate(frame, request, isMainResource);
if (isMainResource) {
priv->mainResource = resource;
waitForMainResourceResponseIfWaitingForResource(webView);
@@ -1581,7 +1582,7 @@ void webkitWebViewPopulateContextMenu(WebKitWebView* webView, ImmutableArray* pr
if (webHitTestResult->isContentEditable())
webkitWebViewCreateAndAppendInputMethodsMenuItem(webView, contextMenu.get());
- GRefPtr<WebKitHitTestResult> hitTestResult = adoptGRef(webkitHitTestResultCreate(toAPI(webHitTestResult)));
+ GRefPtr<WebKitHitTestResult> hitTestResult = adoptGRef(webkitHitTestResultCreate(webHitTestResult));
GOwnPtr<GdkEvent> contextMenuEvent(webkitWebViewBaseTakeContextMenuEvent(webViewBase));
gboolean returnValue;
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
index 4bf2886e5..ddb3e1451 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
@@ -33,23 +33,21 @@
#include "WebKitWebViewBase.h"
#include "WebPageProxy.h"
-using namespace WebKit;
-
-WebKitWebViewBase* webkitWebViewBaseCreate(WebContext*, WebPageGroup*);
+WebKitWebViewBase* webkitWebViewBaseCreate(WebKit::WebContext*, WebKit::WebPageGroup*);
GtkIMContext* webkitWebViewBaseGetIMContext(WebKitWebViewBase*);
-WebPageProxy* webkitWebViewBaseGetPage(WebKitWebViewBase*);
-void webkitWebViewBaseCreateWebPage(WebKitWebViewBase*, WebContext*, WebPageGroup*);
+WebKit::WebPageProxy* webkitWebViewBaseGetPage(WebKitWebViewBase*);
+void webkitWebViewBaseCreateWebPage(WebKitWebViewBase*, WebKit::WebContext*, WebKit::WebPageGroup*);
void webkitWebViewBaseSetTooltipText(WebKitWebViewBase*, const char*);
void webkitWebViewBaseSetTooltipArea(WebKitWebViewBase*, const WebCore::IntRect&);
void webkitWebViewBaseForwardNextKeyEvent(WebKitWebViewBase*);
-void webkitWebViewBaseStartDrag(WebKitWebViewBase*, const WebCore::DragData&, PassRefPtr<ShareableBitmap> dragImage);
+void webkitWebViewBaseStartDrag(WebKitWebViewBase*, const WebCore::DragData&, PassRefPtr<WebKit::ShareableBitmap> dragImage);
void webkitWebViewBaseChildMoveResize(WebKitWebViewBase*, GtkWidget*, const WebCore::IntRect&);
void webkitWebViewBaseEnterFullScreen(WebKitWebViewBase*);
void webkitWebViewBaseExitFullScreen(WebKitWebViewBase*);
void webkitWebViewBaseInitializeFullScreenClient(WebKitWebViewBase*, const WKFullScreenClientGtk*);
void webkitWebViewBaseSetInspectorViewHeight(WebKitWebViewBase*, unsigned height);
-void webkitWebViewBaseSetActiveContextMenuProxy(WebKitWebViewBase*, WebContextMenuProxyGtk*);
-WebContextMenuProxyGtk* webkitWebViewBaseGetActiveContextMenuProxy(WebKitWebViewBase*);
+void webkitWebViewBaseSetActiveContextMenuProxy(WebKitWebViewBase*, WebKit::WebContextMenuProxyGtk*);
+WebKit::WebContextMenuProxyGtk* webkitWebViewBaseGetActiveContextMenuProxy(WebKitWebViewBase*);
GdkEvent* webkitWebViewBaseTakeContextMenuEvent(WebKitWebViewBase*);
#if USE(TEXTURE_MAPPER_GL)
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h
index 6aa965d1c..2e1fed30e 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h
@@ -30,14 +30,12 @@
#include "WebKitWebView.h"
#include <wtf/text/CString.h>
-using namespace WebKit;
-
void webkitWebViewLoadChanged(WebKitWebView*, WebKitLoadEvent);
void webkitWebViewLoadFailed(WebKitWebView*, WebKitLoadEvent, const char* failingURI, GError*);
void webkitWebViewSetEstimatedLoadProgress(WebKitWebView*, double estimatedLoadProgress);
void webkitWebViewSetTitle(WebKitWebView*, const CString&);
void webkitWebViewUpdateURI(WebKitWebView*);
-WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView*, ImmutableDictionary* windowFeatures);
+WebKit::WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView*, WebKit::ImmutableDictionary* windowFeatures);
void webkitWebViewReadyToShowPage(WebKitWebView*);
void webkitWebViewRunAsModal(WebKitWebView*);
void webkitWebViewClosePage(WebKitWebView*);
@@ -46,16 +44,16 @@ bool webkitWebViewRunJavaScriptConfirm(WebKitWebView*, const CString& message);
CString webkitWebViewRunJavaScriptPrompt(WebKitWebView*, const CString& message, const CString& defaultText);
void webkitWebViewMakePermissionRequest(WebKitWebView*, WebKitPermissionRequest*);
void webkitWebViewMakePolicyDecision(WebKitWebView*, WebKitPolicyDecisionType, WebKitPolicyDecision*);
-void webkitWebViewMouseTargetChanged(WebKitWebView*, WebHitTestResult*, unsigned modifiers);
-void webkitWebViewPrintFrame(WebKitWebView*, WebFrameProxy*);
-void webkitWebViewResourceLoadStarted(WebKitWebView*, WebFrameProxy*, uint64_t resourceIdentifier, WebKitURIRequest*);
+void webkitWebViewMouseTargetChanged(WebKitWebView*, WebKit::WebHitTestResult*, unsigned modifiers);
+void webkitWebViewPrintFrame(WebKitWebView*, WebKit::WebFrameProxy*);
+void webkitWebViewResourceLoadStarted(WebKitWebView*, WebKit::WebFrameProxy*, uint64_t resourceIdentifier, WebKitURIRequest*);
void webkitWebViewRunFileChooserRequest(WebKitWebView*, WebKitFileChooserRequest*);
WebKitWebResource* webkitWebViewGetLoadingWebResource(WebKitWebView*, uint64_t resourceIdentifier);
void webkitWebViewRemoveLoadingWebResource(WebKitWebView*, uint64_t resourceIdentifier);
WebKitWebResource* webkitWebViewResourceLoadFinished(WebKitWebView*, uint64_t resourceIdentifier);
bool webkitWebViewEnterFullScreen(WebKitWebView*);
bool webkitWebViewLeaveFullScreen(WebKitWebView*);
-void webkitWebViewPopulateContextMenu(WebKitWebView*, ImmutableArray* proposedMenu, WebHitTestResult*);
+void webkitWebViewPopulateContextMenu(WebKitWebView*, WebKit::ImmutableArray* proposedMenu, WebKit::WebHitTestResult*);
void webkitWebViewSubmitFormRequest(WebKitWebView*, WebKitFormSubmissionRequest*);
#endif // WebKitWebViewPrivate_h
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp
index 242b753e8..930cf8676 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp
@@ -20,12 +20,17 @@
#include "config.h"
#include "WebKitWindowProperties.h"
+#include "ImmutableDictionary.h"
#include "WebKitPrivate.h"
#include "WebKitWindowPropertiesPrivate.h"
+#include "WebNumber.h"
#include "WebURLRequest.h"
#include <WebCore/IntRect.h>
#include <glib/gi18n-lib.h>
+using namespace WebKit;
+using namespace WebCore;
+
/**
* SECTION: WebKitWindowProperties
* @short_description: Window properties of a #WebKitWebView
@@ -101,8 +106,6 @@ enum {
PROP_FULLSCREEN
};
-using namespace WebCore;
-
G_DEFINE_TYPE(WebKitWindowProperties, webkit_window_properties, G_TYPE_OBJECT)
struct _WebKitWindowPropertiesPrivate {
@@ -388,56 +391,54 @@ void webkitWindowPropertiesSetFullscreen(WebKitWindowProperties* windowPropertie
g_object_notify(G_OBJECT(windowProperties), "fullscreen");
}
-void webkitWindowPropertiesUpdateFromWKWindowFeatures(WebKitWindowProperties* windowProperties, WKDictionaryRef wkFeatures)
+void webkitWindowPropertiesUpdateFromWebWindowFeatures(WebKitWindowProperties* windowProperties, ImmutableDictionary* features)
{
GdkRectangle geometry = windowProperties->priv->geometry;
- WKDoubleRef doubleValue;
- WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("x"));
- if (doubleValue = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(wkFeatures, xKey.get())))
- geometry.x = WKDoubleGetValue(doubleValue);
+ WebDouble* doubleValue = static_cast<WebDouble*>(features->get("x"));
+ if (doubleValue)
+ geometry.x = doubleValue->value();
- WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("y"));
- if (doubleValue = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(wkFeatures, yKey.get())))
- geometry.y = WKDoubleGetValue(doubleValue);
+ doubleValue = static_cast<WebDouble*>(features->get("y"));
+ if (doubleValue)
+ geometry.y = doubleValue->value();
- WKRetainPtr<WKStringRef> widthKey(AdoptWK, WKStringCreateWithUTF8CString("width"));
- if (doubleValue = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(wkFeatures, widthKey.get())))
- geometry.width = WKDoubleGetValue(doubleValue);
+ doubleValue = static_cast<WebDouble*>(features->get("width"));
+ if (doubleValue)
+ geometry.width = doubleValue->value();
- WKRetainPtr<WKStringRef> heightKey(AdoptWK, WKStringCreateWithUTF8CString("height"));
- if (doubleValue = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(wkFeatures, heightKey.get())))
- geometry.height = WKDoubleGetValue(doubleValue);
+ doubleValue = static_cast<WebDouble*>(features->get("height"));
+ if (doubleValue)
+ geometry.height = doubleValue->value();
webkitWindowPropertiesSetGeometry(windowProperties, &geometry);
- WKBooleanRef booleanValue;
- WKRetainPtr<WKStringRef> menuBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("menuBarVisible"));
- if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, menuBarVisibleKey.get())))
- webkitWindowPropertiesSetMenubarVisible(windowProperties, WKBooleanGetValue(booleanValue));
+ WebBoolean* booleanValue = static_cast<WebBoolean*>(features->get("menuBarVisible"));
+ if (booleanValue)
+ webkitWindowPropertiesSetMenubarVisible(windowProperties, booleanValue->value());
- WKRetainPtr<WKStringRef> statusBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("statusBarVisible"));
- if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, statusBarVisibleKey.get())))
- webkitWindowPropertiesSetStatusbarVisible(windowProperties, WKBooleanGetValue(booleanValue));
+ booleanValue = static_cast<WebBoolean*>(features->get("statusBarVisible"));
+ if (booleanValue)
+ webkitWindowPropertiesSetStatusbarVisible(windowProperties, booleanValue->value());
- WKRetainPtr<WKStringRef> toolBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("toolBarVisible"));
- if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, toolBarVisibleKey.get())))
- webkitWindowPropertiesSetToolbarVisible(windowProperties, WKBooleanGetValue(booleanValue));
+ booleanValue = static_cast<WebBoolean*>(features->get("toolBarVisible"));
+ if (booleanValue)
+ webkitWindowPropertiesSetToolbarVisible(windowProperties, booleanValue->value());
- WKRetainPtr<WKStringRef> locationBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("locationBarVisible"));
- if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, locationBarVisibleKey.get())))
- webkitWindowPropertiesSetLocationbarVisible(windowProperties, WKBooleanGetValue(booleanValue));
+ booleanValue = static_cast<WebBoolean*>(features->get("locationBarVisible"));
+ if (booleanValue)
+ webkitWindowPropertiesSetLocationbarVisible(windowProperties, booleanValue->value());
- WKRetainPtr<WKStringRef> scrollbarsVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("scrollbarsVisible"));
- if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, scrollbarsVisibleKey.get())))
- webkitWindowPropertiesSetScrollbarsVisible(windowProperties, WKBooleanGetValue(booleanValue));
+ booleanValue = static_cast<WebBoolean*>(features->get("scrollbarsVisible"));
+ if (booleanValue)
+ webkitWindowPropertiesSetScrollbarsVisible(windowProperties, booleanValue->value());
- WKRetainPtr<WKStringRef> resizableKey(AdoptWK, WKStringCreateWithUTF8CString("resizable"));
- if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, resizableKey.get())))
- webkitWindowPropertiesSetResizable(windowProperties, WKBooleanGetValue(booleanValue));
+ booleanValue = static_cast<WebBoolean*>(features->get("resizable"));
+ if (booleanValue)
+ webkitWindowPropertiesSetResizable(windowProperties, booleanValue->value());
- WKRetainPtr<WKStringRef> fullscreenKey(AdoptWK, WKStringCreateWithUTF8CString("fullscreen"));
- if (booleanValue = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(wkFeatures, fullscreenKey.get())))
- webkitWindowPropertiesSetFullscreen(windowProperties, WKBooleanGetValue(booleanValue));
+ booleanValue = static_cast<WebBoolean*>(features->get("fullscreen"));
+ if (booleanValue)
+ webkitWindowPropertiesSetFullscreen(windowProperties, booleanValue->value());
}
/**
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h
index 7b178953d..8ec17b4ea 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h
@@ -27,11 +27,11 @@
#ifndef WebKitWindowPropertiesPrivate_h
#define WebKitWindowPropertiesPrivate_h
+#include "WebKitPrivate.h"
#include "WebKitWindowProperties.h"
-#include <WebKit2/WKBase.h>
WebKitWindowProperties* webkitWindowPropertiesCreate();
-void webkitWindowPropertiesUpdateFromWKWindowFeatures(WebKitWindowProperties*, WKDictionaryRef wkFeatures);
+void webkitWindowPropertiesUpdateFromWebWindowFeatures(WebKitWindowProperties*, WebKit::ImmutableDictionary* features);
void webkitWindowPropertiesSetGeometry(WebKitWindowProperties*, GdkRectangle*);
void webkitWindowPropertiesSetToolbarVisible(WebKitWindowProperties*, bool toolbarsVisible);
void webkitWindowPropertiesSetMenubarVisible(WebKitWindowProperties*, bool menuBarVisible);
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am b/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
index 06ea1af7c..734024250 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
@@ -31,6 +31,7 @@ webkit2_tests_cppflags = \
-DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs\" \
-DWEBKIT_SRC_DIR=\"${shell pwd}/${srcdir}\" \
-DWEBKIT_DERIVED_SRC_DIR=\"${shell pwd}/${top_builddir}/DerivedSources\" \
+ -DWEBKIT_TEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
$(javascriptcore_cppflags) \
-I$(srcdir)/Source/JavaScriptCore \
-I$(srcdir)/Source \
@@ -57,7 +58,7 @@ webkit2_tests_ldflags = \
-no-install \
-no-fast-install
-DerivedSources/WebKit2/webkit2gtk-tests-resources.gresource: Source/WebKit2/UIProcess/API/gtk/tests/resources/webkit2gtk-tests.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(srcdir)/Source/WebKit2/UIProcess/API/gtk/tests/resources/webkit2gtk-tests.gresource.xml)
+DerivedSources/WebKit2/webkit2gtk-tests-resources.gresource: Source/WebKit2/UIProcess/API/gtk/tests/resources/webkit2gtk-tests.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/Source/WebKit2/UIProcess/API/gtk/tests/resources/webkit2gtk-tests.gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) $<
DISTCLEANFILES += DerivedSources/WebKit2/webkit2gtk-tests-resources.gresource
@@ -83,9 +84,7 @@ EXTRA_DIST += \
Programs_WebKit2APITests_TestWebKitWebContext_SOURCES = \
Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
-Programs_WebKit2APITests_TestWebKitWebContext_CPPFLAGS = \
- -DWEBKIT_TEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
- $(webkit2_tests_cppflags)
+Programs_WebKit2APITests_TestWebKitWebContext_CPPFLAGS = $(webkit2_tests_cppflags)
Programs_WebKit2APITests_TestWebKitWebContext_LDADD = $(webkit2_tests_ldadd)
Programs_WebKit2APITests_TestWebKitWebContext_LDFLAGS = $(webkit2_tests_ldflags)
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestCookieManager.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestCookieManager.cpp
index 94aeef6e1..adc6b5b9b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestCookieManager.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestCookieManager.cpp
@@ -132,6 +132,17 @@ public:
return m_domains;
}
+ bool hasDomain(const char* domain)
+ {
+ if (!m_domains)
+ return false;
+
+ for (size_t i = 0; m_domains[i]; ++i)
+ if (g_str_equal(m_domains[i], domain))
+ return true;
+ return false;
+ }
+
void deleteCookiesForDomain(const char* domain)
{
webkit_cookie_manager_delete_cookies_for_domain(m_cookieManager, domain);
@@ -178,8 +189,8 @@ static void testCookieManagerAcceptPolicy(CookieManagerTest* test, gconstpointer
domains = test->getDomains();
g_assert(domains);
g_assert_cmpint(g_strv_length(domains), ==, 2);
- g_assert_cmpstr(domains[0], ==, kFirstPartyDomain);
- g_assert_cmpstr(domains[1], ==, kThirdPartyDomain);
+ g_assert(test->hasDomain(kFirstPartyDomain));
+ g_assert(test->hasDomain(kThirdPartyDomain));
test->deleteAllCookies();
test->setAcceptPolicy(WEBKIT_COOKIE_POLICY_ACCEPT_NEVER);
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
index f5197b936..55350e6c2 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
@@ -857,6 +857,12 @@ static void testWebViewCanShowMIMEType(WebViewTest* test, gconstpointer)
g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/pdf"));
g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/zip"));
g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/octet-stream"));
+
+ // Plugins are only supported when enabled.
+ webkit_web_context_set_additional_plugins_directory(webkit_web_view_get_context(test->m_webView), WEBKIT_TEST_PLUGIN_DIR);
+ g_assert(webkit_web_view_can_show_mime_type(test->m_webView, "application/x-webkit-test-netscape"));
+ webkit_settings_set_enable_plugins(webkit_web_view_get_settings(test->m_webView), FALSE);
+ g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/x-webkit-test-netscape"));
}
class FormClientTest: public WebViewTest {
diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm
index e4a6e6b4b..cd2de8d25 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm
@@ -1921,6 +1921,8 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
- (void)viewDidMoveToWindow
{
+ [self removeAllToolTips];
+
// We want to make sure to update the active state while hidden, so if the view is about to become visible, we
// update the active state first and then make it visible. If the view is about to be hidden, we hide it first and then
// update the active state.
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
index 07ed832ce..9a0433b66 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
@@ -440,7 +440,8 @@ void QQuickWebViewPrivate::setNeedsDisplay()
{
Q_Q(QQuickWebView);
if (renderToOffscreenBuffer()) {
- // TODO: we can maintain a real image here and use it for pixel tests. Right now this is used only for running the rendering code-path while running tests.
+ // This is used only to mantain the rendering synchronisation between the UI and
+ // the web process when running tests even if the render loop is not active.
QImage dummyImage(1, 1, QImage::Format_ARGB32);
QPainter painter(&dummyImage);
q->page()->d->paint(&painter);
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
index b1ef401a4..3738ea4c3 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
@@ -23,6 +23,7 @@
#if USE(COORDINATED_GRAPHICS)
#include "BackingStore.h"
+#include "CoordinatedGraphicsArgumentCoders.h"
#include "DrawingAreaProxy.h"
#include "Region.h"
#include "SurfaceUpdateInfo.h"
@@ -60,7 +61,7 @@ public:
#endif
void deleteCompositingLayer(WebLayerID);
void setRootCompositingLayer(WebLayerID);
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void purgeGLResources();
void setContentsSize(const WebCore::FloatSize&);
void setVisibleContentsRect(const WebCore::FloatRect&, float scale, const WebCore::FloatPoint& trajectoryVector);
@@ -70,7 +71,7 @@ public:
void removeTileForLayer(int layerID, int tileID);
void createDirectlyCompositedImage(int64_t, const WebKit::ShareableBitmap::Handle&);
void destroyDirectlyCompositedImage(int64_t);
- void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void updateViewport();
void renderNextFrame();
void didChangeScrollPosition(const WebCore::IntPoint& position);
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
index e84f3236e..82e58f3f2 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
@@ -360,7 +360,7 @@ void LayerTreeRenderer::createImage(int64_t imageID, PassRefPtr<ShareableBitmap>
RefPtr<ShareableBitmap> bitmap = weakBitmap;
RefPtr<TextureMapperTiledBackingStore> backingStore = TextureMapperTiledBackingStore::create();
m_directlyCompositedImages.set(imageID, backingStore);
- backingStore->updateContents(m_textureMapper.get(), bitmap->createImage().get());
+ backingStore->updateContents(m_textureMapper.get(), bitmap->createImage().get(), BitmapTexture::UpdateCannotModifyOriginalImageData);
}
void LayerTreeRenderer::destroyImage(int64_t imageID)
diff --git a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h
index c1eda1fd1..7108e272d 100644
--- a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h
+++ b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h
@@ -61,8 +61,8 @@ public:
void invalidate();
void processDidClose();
- void didReceiveDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
#if PLATFORM(QT)
void startTransfer(const String& filename);
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
index 2d26f4818..900d6a588 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
@@ -69,7 +69,7 @@ WebCore::IntRect DrawingAreaProxy::contentsRect() const
return IntRect(IntPoint::zero(), m_webPageProxy->viewSize());
}
-void DrawingAreaProxy::didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*)
+void DrawingAreaProxy::didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&)
{
}
#endif
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.h b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
index a3891badc..450816a34 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
@@ -44,8 +44,8 @@ typedef struct _cairo cairo_t;
#endif
namespace CoreIPC {
- class ArgumentDecoder;
class Connection;
+ class MessageDecoder;
class MessageID;
}
@@ -70,7 +70,7 @@ public:
DrawingAreaType type() const { return m_type; }
- void didReceiveDrawingAreaProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveDrawingAreaProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
virtual void deviceScaleFactorDidChange() = 0;
@@ -100,7 +100,7 @@ public:
virtual void createTileForLayer(int /* layerID */, int /* tileID */, const WebKit::UpdateInfo&) { }
virtual void updateTileForLayer(int /* layerID */, int /* tileID */, const WebKit::UpdateInfo&) { }
virtual void removeTileForLayer(int /* layerID */, int /* tileID */) { }
- virtual void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
WebPageProxy* page() { return m_webPageProxy; }
#endif
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
index 966ac6b3c..138f4c887 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
@@ -366,10 +366,10 @@ void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(const LayerTreeContex
}
#if USE(COORDINATED_GRAPHICS)
-void DrawingAreaProxyImpl::didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void DrawingAreaProxyImpl::didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
if (m_layerTreeCoordinatorProxy)
- m_layerTreeCoordinatorProxy->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, arguments);
+ m_layerTreeCoordinatorProxy->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, decoder);
}
void DrawingAreaProxyImpl::setVisibleContentsRect(const WebCore::FloatRect& visibleContentsRect, float scale, const WebCore::FloatPoint& trajectoryVector)
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
index 762e35c69..fe0510ef8 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
@@ -84,7 +84,7 @@ private:
void updateAcceleratedCompositingMode(const LayerTreeContext&);
#if USE(COORDINATED_GRAPHICS)
virtual void setVisibleContentsRect(const WebCore::FloatRect& visibleContentsRect, float scale, const WebCore::FloatPoint& trajectory);
- void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveLayerTreeCoordinatorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
#endif
#else
bool isInAcceleratedCompositingMode() const { return false; }
diff --git a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp
index 771a6eef7..ee4e3c38b 100644
--- a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp
+++ b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -73,12 +73,16 @@ const char* ProcessLauncher::processTypeAsString(ProcessType processType)
switch (processType) {
case WebProcess:
return "webprocess";
+#if ENABLE(PLUGIN_PROCESS)
case PluginProcess:
return "pluginprocess";
+#endif
case NetworkProcess:
return "networkprocess";
+#if ENABLE(SHARED_WORKER_PROCESS)
case SharedWorkerProcess:
return "sharedworkerprocess";
+#endif
}
ASSERT_NOT_REACHED();
@@ -92,20 +96,24 @@ bool ProcessLauncher::getProcessTypeFromString(const char* string, ProcessType&
return true;
}
+#if ENABLE(PLUGIN_PROCESS)
if (!strcmp(string, "pluginprocess")) {
processType = PluginProcess;
return true;
}
+#endif
if (!strcmp(string, "networkprocess")) {
processType = NetworkProcess;
return true;
}
+#if ENABLE(SHARED_WORKER_PROCESS)
if (!strcmp(string, "sharedworkerprocess")) {
processType = SharedWorkerProcess;
return true;
}
+#endif
return false;
}
diff --git a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h
index 5983a76a7..dd4f45d39 100644
--- a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h
+++ b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -48,9 +48,13 @@ public:
enum ProcessType {
WebProcess,
+#if ENABLE(PLUGIN_PROCESS)
PluginProcess,
+#endif
NetworkProcess,
+#if ENABLE(SHARED_WORKER_PROCESS)
SharedWorkerProcess
+#endif
};
struct LaunchOptions {
diff --git a/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm b/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
index a9c20da32..af010e9d4 100644
--- a/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
+++ b/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
@@ -111,14 +111,21 @@ static void addDYLDEnvironmentAdditions(const ProcessLauncher::LaunchOptions& la
if (isWebKitDevelopmentBuild)
environmentVariables.appendValue("DYLD_FRAMEWORK_PATH", [frameworksPath fileSystemRepresentation], ':');
- NSString *processPath = [webKit2Bundle pathForAuxiliaryExecutable:(launchOptions.processType == ProcessLauncher::PluginProcess ? @"PluginProcess.app" : @"WebProcess.app")];
- NSString *processAppExecutablePath = [[NSBundle bundleWithPath:processPath] executablePath];
-
NSString *processShimPathNSString = nil;
- if (launchOptions.processType == ProcessLauncher::PluginProcess)
+#if ENABLE(PLUGIN_PROCESS)
+ if (launchOptions.processType == ProcessLauncher::PluginProcess) {
+ NSString *processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"PluginProcess.app"];
+ NSString *processAppExecutablePath = [[NSBundle bundleWithPath:processPath] executablePath];
+
processShimPathNSString = [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"PluginProcessShim.dylib"];
- else if (launchOptions.processType == ProcessLauncher::WebProcess)
+ } else
+#endif // ENABLE(PLUGIN_PROCESS)
+ if (launchOptions.processType == ProcessLauncher::WebProcess) {
+ NSString *processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"WebProcess.app"];
+ NSString *processAppExecutablePath = [[NSBundle bundleWithPath:processPath] executablePath];
+
processShimPathNSString = [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"WebProcessShim.dylib"];
+ }
// Make sure that the shim library file exists and insert it.
if (processShimPathNSString) {
@@ -372,17 +379,21 @@ static void createProcess(const ProcessLauncher::LaunchOptions& launchOptions, b
case ProcessLauncher::WebProcess:
processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"WebProcess.app"];
break;
+#if ENABLE(PLUGIN_PROCESS)
case ProcessLauncher::PluginProcess:
processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"PluginProcess.app"];
break;
+#endif
#if ENABLE(NETWORK_PROCESS)
case ProcessLauncher::NetworkProcess:
processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"NetworkProcess.app"];
break;
#endif
+#if ENABLE(SHARED_WORKER_PROCESS)
case ProcessLauncher::SharedWorkerProcess:
processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"SharedWorkerProcess.app"];
break;
+#endif
}
NSString *frameworkExecutablePath = [webKit2Bundle executablePath];
diff --git a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp b/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp
index 60cde5fa0..0b6ee1bd5 100644
--- a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp
+++ b/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp
@@ -113,9 +113,11 @@ void ProcessLauncher::launchProcess()
if (m_launchOptions.processType == WebProcess) {
QByteArray webProcessPrefix = qgetenv("QT_WEBKIT2_WP_CMD_PREFIX");
commandLine = commandLine.arg(QLatin1String(webProcessPrefix.constData())).arg(QString(executablePathOfWebProcess()));
+#if ENABLE(PLUGIN_PROCESS)
} else if (m_launchOptions.processType == PluginProcess) {
QByteArray pluginProcessPrefix = qgetenv("QT_WEBKIT2_PP_CMD_PREFIX");
commandLine = commandLine.arg(QLatin1String(pluginProcessPrefix.constData())).arg(QString(executablePathOfPluginProcess()));
+#endif
} else
ASSERT_NOT_REACHED();
diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessManager.cpp b/Source/WebKit2/UIProcess/Network/NetworkProcessManager.cpp
new file mode 100644
index 000000000..00f16f457
--- /dev/null
+++ b/Source/WebKit2/UIProcess/Network/NetworkProcessManager.cpp
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NetworkProcessManager.h"
+
+#include "NetworkProcessProxy.h"
+
+namespace WebKit {
+
+NetworkProcessManager& NetworkProcessManager::shared()
+{
+ DEFINE_STATIC_LOCAL(NetworkProcessManager, networkProcessManager, ());
+ return networkProcessManager;
+}
+
+NetworkProcessManager::NetworkProcessManager()
+{
+}
+
+void NetworkProcessManager::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
+{
+ ASSERT(reply);
+
+ ensureNetworkProcess();
+ ASSERT(m_networkProcess);
+
+ m_networkProcess->getNetworkProcessConnection(reply);
+}
+
+void NetworkProcessManager::ensureNetworkProcess()
+{
+ if (m_networkProcess)
+ return;
+
+ m_networkProcess = NetworkProcessProxy::create(this);
+}
+
+void NetworkProcessManager::removeNetworkProcessProxy(NetworkProcessProxy* networkProcessProxy)
+{
+ ASSERT(m_networkProcess);
+ ASSERT(networkProcessProxy == m_networkProcess.get());
+
+ m_networkProcess = 0;
+}
+
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessManager.h b/Source/WebKit2/UIProcess/Network/NetworkProcessManager.h
new file mode 100644
index 000000000..08d422b25
--- /dev/null
+++ b/Source/WebKit2/UIProcess/Network/NetworkProcessManager.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NetworkProcessManager_h
+#define NetworkProcessManager_h
+
+#include "Connection.h"
+#include "WebProcessProxyMessages.h"
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebKit {
+
+class NetworkProcessConnection;
+class NetworkProcessProxy;
+class WebProcessProxy;
+
+class NetworkProcessManager {
+ WTF_MAKE_NONCOPYABLE(NetworkProcessManager);
+public:
+ static NetworkProcessManager& shared();
+
+ void ensureNetworkProcess();
+
+ void getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>);
+
+ void removeNetworkProcessProxy(NetworkProcessProxy*);
+
+private:
+ NetworkProcessManager();
+
+ RefPtr<NetworkProcessProxy> m_networkProcess;
+};
+
+} // namespace WebKit
+
+#endif // NetworkProcessManager_h
diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
index fe528351a..d1a0135f5 100644
--- a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
+++ b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
@@ -27,7 +27,10 @@
#include "NetworkProcessProxy.h"
#include "NetworkProcessCreationParameters.h"
+#include "NetworkProcessManager.h"
#include "NetworkProcessMessages.h"
+#include "WebContext.h"
+#include "WebProcessMessages.h"
#include <WebCore/RunLoop.h>
#if ENABLE(NETWORK_PROCESS)
@@ -36,12 +39,14 @@ using namespace WebCore;
namespace WebKit {
-PassRefPtr<NetworkProcessProxy> NetworkProcessProxy::create()
+PassRefPtr<NetworkProcessProxy> NetworkProcessProxy::create(NetworkProcessManager* manager)
{
- return adoptRef(new NetworkProcessProxy);
+ return adoptRef(new NetworkProcessProxy(manager));
}
-NetworkProcessProxy::NetworkProcessProxy()
+NetworkProcessProxy::NetworkProcessProxy(NetworkProcessManager* manager)
+ : m_networkProcessManager(manager)
+ , m_numPendingConnectionRequests(0)
{
ProcessLauncher::LaunchOptions launchOptions;
launchOptions.processType = ProcessLauncher::NetworkProcess;
@@ -62,14 +67,49 @@ NetworkProcessProxy::~NetworkProcessProxy()
}
-void NetworkProcessProxy::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*)
+void NetworkProcessProxy::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
{
+ m_pendingConnectionReplies.append(reply);
+ if (m_processLauncher->isLaunching()) {
+ m_numPendingConnectionRequests++;
+ return;
+ }
+
+ m_connection->send(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess(), 0, CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply);
+}
+
+void NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch()
+{
+ // The network process must have crashed or exited, send any pending sync replies we might have.
+ while (!m_pendingConnectionReplies.isEmpty()) {
+ RefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply = m_pendingConnectionReplies.takeFirst();
+
+#if PLATFORM(MAC)
+ reply->send(CoreIPC::Attachment(0, MACH_MSG_TYPE_MOVE_SEND));
+#else
+ notImplemented();
+#endif
+ }
+
+ // Tell the network process manager to forget about this network process proxy. This may cause us to be deleted.
+ m_networkProcessManager->removeNetworkProcessProxy(this);
+}
+
+void NetworkProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
+{
+ didReceiveNetworkProcessProxyMessage(connection, messageID, decoder);
}
void NetworkProcessProxy::didClose(CoreIPC::Connection*)
{
+ // Notify all WebProcesses that the NetworkProcess crashed.
+ const Vector<WebContext*>& contexts = WebContext::allContexts();
+ for (size_t i = 0; i < contexts.size(); ++i)
+ contexts[i]->sendToAllProcesses(Messages::WebProcess::NetworkProcessCrashed());
+ // This may cause us to be deleted.
+ networkProcessCrashedOrFailedToLaunch();
}
void NetworkProcessProxy::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID)
@@ -82,6 +122,20 @@ void NetworkProcessProxy::syncMessageSendTimedOut(CoreIPC::Connection*)
}
+void NetworkProcessProxy::didCreateNetworkConnectionToWebProcess(const CoreIPC::Attachment& connectionIdentifier)
+{
+ ASSERT(!m_pendingConnectionReplies.isEmpty());
+
+ // Grab the first pending connection reply.
+ RefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply = m_pendingConnectionReplies.takeFirst();
+
+#if PLATFORM(MAC)
+ reply->send(CoreIPC::Attachment(connectionIdentifier.port(), MACH_MSG_TYPE_MOVE_SEND));
+#else
+ notImplemented();
+#endif
+}
+
void NetworkProcessProxy::didFinishLaunching(ProcessLauncher*, CoreIPC::Connection::Identifier connectionIdentifier)
{
ASSERT(!m_connection);
@@ -103,6 +157,11 @@ void NetworkProcessProxy::didFinishLaunching(ProcessLauncher*, CoreIPC::Connecti
// Initialize the network host process.
m_connection->send(Messages::NetworkProcess::InitializeNetworkProcess(parameters), 0);
+
+ for (unsigned i = 0; i < m_numPendingConnectionRequests; ++i)
+ m_connection->send(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess(), 0);
+
+ m_numPendingConnectionRequests = 0;
}
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h
index 57e37e653..1840a8e91 100644
--- a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h
+++ b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h
@@ -35,24 +35,33 @@
namespace WebKit {
+class NetworkProcessManager;
struct NetworkProcessCreationParameters;
class NetworkProcessProxy : public RefCounted<NetworkProcessProxy>, CoreIPC::Connection::Client, ProcessLauncher::Client {
public:
- static PassRefPtr<NetworkProcessProxy> create();
+ static PassRefPtr<NetworkProcessProxy> create(NetworkProcessManager*);
~NetworkProcessProxy();
+ void getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>);
+
private:
- NetworkProcessProxy();
+ NetworkProcessProxy(NetworkProcessManager*);
void platformInitializeNetworkProcess(NetworkProcessCreationParameters&);
+ void networkProcessCrashedOrFailedToLaunch();
+
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
virtual void syncMessageSendTimedOut(CoreIPC::Connection*);
+ // Message handlers
+ void didReceiveNetworkProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didCreateNetworkConnectionToWebProcess(const CoreIPC::Attachment&);
+
// ProcessLauncher::Client
virtual void didFinishLaunching(ProcessLauncher*, CoreIPC::Connection::Identifier);
@@ -62,6 +71,10 @@ private:
// The process launcher for the network process.
RefPtr<ProcessLauncher> m_processLauncher;
+ NetworkProcessManager* m_networkProcessManager;
+
+ unsigned m_numPendingConnectionRequests;
+ Deque<RefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> > m_pendingConnectionReplies;
};
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in
new file mode 100644
index 000000000..379b10864
--- /dev/null
+++ b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in
@@ -0,0 +1,29 @@
+# Copyright (C) 2012 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#if ENABLE(NETWORK_PROCESS)
+
+messages -> NetworkProcessProxy {
+ DidCreateNetworkConnectionToWebProcess(CoreIPC::Attachment connectionIdentifier)
+}
+
+#endif // ENABLE(NETWORK_PROCESS)
diff --git a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
index 07e1f8497..08009b9da 100644
--- a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
@@ -47,7 +47,7 @@ PassRefPtr<WebNotificationManagerProxy> WebNotificationManagerProxy::create(WebC
WebNotificationManagerProxy::WebNotificationManagerProxy(WebContext* context)
: m_context(context)
{
- m_context->addMessageReceiver(CoreIPC::MessageClassWebNotificationManagerProxy, this);
+ m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebNotificationManagerProxy, this);
}
void WebNotificationManagerProxy::invalidate()
@@ -72,9 +72,9 @@ void WebNotificationManagerProxy::populateCopyOfNotificationPermissions(HashMap<
}
}
-void WebNotificationManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebNotificationManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebNotificationManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebNotificationManagerProxyMessage(connection, messageID, decoder);
}
void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID)
diff --git a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
index 620915d14..d54338769 100644
--- a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
+++ b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
@@ -68,8 +68,8 @@ private:
virtual Type type() const { return APIType; }
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- void didReceiveWebNotificationManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ void didReceiveWebNotificationManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
// Message handlers
void cancel(uint64_t notificationID);
diff --git a/Source/WebKit2/UIProcess/PageViewportController.cpp b/Source/WebKit2/UIProcess/PageViewportController.cpp
index 02fd3b699..e010a6e52 100644
--- a/Source/WebKit2/UIProcess/PageViewportController.cpp
+++ b/Source/WebKit2/UIProcess/PageViewportController.cpp
@@ -66,8 +66,9 @@ PageViewportController::PageViewportController(WebKit::WebPageProxy* proxy, Page
, m_hadUserInteraction(false)
, m_effectiveScale(1)
{
- // Initializing Viewport Raw Attributes to avoid random negative scale factors
+ // Initializing Viewport Raw Attributes to avoid random negative or infinity scale factors
// if there is a race condition between the first layout and setting the viewport attributes for the first time.
+ m_rawAttributes.devicePixelRatio = 1;
m_rawAttributes.initialScale = 1;
m_rawAttributes.minimumScale = 1;
m_rawAttributes.maximumScale = 1;
diff --git a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
index bff8fa941..804455490 100644
--- a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
+++ b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,6 +26,8 @@
#include "config.h"
#include "PluginInfoStore.h"
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
#include "PluginModuleInfo.h"
#include <WebCore/KURL.h>
#include <WebCore/MIMETypeRegistry.h>
@@ -247,3 +249,5 @@ PluginModuleInfo PluginInfoStore::infoForPluginWithPath(const String& pluginPath
}
} // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
index 1b2082dbb..287ec9262 100644
--- a/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
+++ b/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,6 +26,8 @@
#ifndef PluginInfoStore_h
#define PluginInfoStore_h
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
#include "PluginModuleInfo.h"
#include <wtf/ThreadingPrimitives.h>
@@ -94,4 +96,6 @@ private:
} // namespace WebKit
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
#endif // PluginInfoStore_h
diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
index 10f58b9bb..e51eed7df 100644
--- a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
+++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
@@ -156,9 +156,9 @@ void PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch()
m_pluginProcessManager->removePluginProcessProxy(this);
}
-void PluginProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void PluginProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceivePluginProcessProxyMessage(connection, messageID, arguments);
+ didReceivePluginProcessProxyMessage(connection, messageID, decoder);
}
void PluginProcessProxy::didClose(CoreIPC::Connection*)
diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
index 132bb74bf..bdade27e5 100644
--- a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
+++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
@@ -98,15 +98,15 @@ private:
void pluginProcessCrashedOrFailedToLaunch();
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didClose(CoreIPC::Connection*);
- virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didClose(CoreIPC::Connection*) OVERRIDE;
+ virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID) OVERRIDE;
// ProcessLauncher::Client
virtual void didFinishLaunching(ProcessLauncher*, CoreIPC::Connection::Identifier);
// Message handlers
- void didReceivePluginProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceivePluginProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void didCreateWebProcessConnection(const CoreIPC::Attachment&, bool supportsAsynchronousPluginInitialization);
void didGetSitesWithData(const Vector<String>& sites, uint64_t callbackID);
void didClearSiteData(uint64_t callbackID);
diff --git a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp
index 246eeb447..ff96ab96c 100644
--- a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp
+++ b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,6 +26,8 @@
#include "config.h"
#include "WebPluginSiteDataManager.h"
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
#include "ImmutableArray.h"
#include "PluginProcessManager.h"
#include "WebContext.h"
@@ -291,3 +293,4 @@ void WebPluginSiteDataManager::didClearSiteDataForAllPlugins(uint64_t callbackID
} // namespace WebKit
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h
index 9efa17513..9b025cc38 100644
--- a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h
+++ b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,6 +26,8 @@
#ifndef WebPluginSiteDataManagerh
#define WebPluginSiteDataManager_h
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
#include "APIObject.h"
#include "Arguments.h"
#include "GenericCallback.h"
@@ -85,4 +87,6 @@ private:
} // namespace WebKit
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
#endif // WebPluginSiteDataManager_h
diff --git a/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm b/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
index 29c744ffd..5bacc2c2a 100644
--- a/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
+++ b/Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,6 +26,8 @@
#import "config.h"
#import "PluginInfoStore.h"
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
#import "NetscapePluginModule.h"
#import "WebKitSystemInterface.h"
#import <WebCore/WebCoreNSStringExtras.h>
@@ -73,13 +75,7 @@ Vector<String> PluginInfoStore::individualPluginPaths()
bool PluginInfoStore::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin)
{
-#if ENABLE(NETSCAPE_PLUGIN_API)
return NetscapePluginModule::getPluginInfo(pluginPath, plugin);
-#else
- UNUSED_PARAM(pluginPath);
- UNUSED_PARAM(plugin);
- return false;
-#endif
}
static size_t findPluginWithBundleIdentifier(const Vector<PluginModuleInfo>& plugins, const String& bundleIdentifier)
@@ -155,3 +151,5 @@ String PluginInfoStore::getMIMETypeForExtension(const String& extension)
}
} // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp b/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
index afaed6d21..d4c9ec2c5 100644
--- a/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
+++ b/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
@@ -26,6 +26,9 @@
// Note: this file is only for UNIX. On other platforms we can reuse the native implementation.
#include "config.h"
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
#include "PluginInfoStore.h"
#include "NetscapePluginModule.h"
@@ -95,13 +98,7 @@ Vector<String> PluginInfoStore::individualPluginPaths()
bool PluginInfoStore::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin)
{
-#if ENABLE(NETSCAPE_PLUGIN_API)
return NetscapePluginModule::getPluginInfo(pluginPath, plugin);
-#else
- UNUSED_PARAM(pluginPath);
- UNUSED_PARAM(plugin);
- return false;
-#endif
}
bool PluginInfoStore::shouldUsePlugin(Vector<PluginModuleInfo>& /*alreadyLoadedPlugins*/, const PluginModuleInfo& /*plugin*/)
@@ -111,3 +108,5 @@ bool PluginInfoStore::shouldUsePlugin(Vector<PluginModuleInfo>& /*alreadyLoadedP
}
} // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp b/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
index c7a8922e1..64c7bc485 100644
--- a/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
+++ b/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
@@ -43,7 +43,7 @@ using namespace WebCore;
namespace WebKit {
-void PluginProcessProxy::platformInitializeLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginModuleInfo& pluginInfo)
+void PluginProcessProxy::platformInitializeLaunchOptions(ProcessLauncher::LaunchOptions&, const PluginModuleInfo&)
{
}
diff --git a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.cpp b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.cpp
index 4e2fe1617..f91efd9ed 100644
--- a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.cpp
+++ b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "SharedWorkerProcessManager.h"
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#include "SharedWorkerProcessProxy.h"
#include "WebContext.h"
#include <wtf/StdLibExtras.h>
@@ -70,3 +72,5 @@ SharedWorkerProcessProxy* SharedWorkerProcessManager::getOrCreateSharedWorkerPro
}
} // namespace WebKit
+
+#endif // ENABLE(SHARED_WORKER_PROCESS)
diff --git a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.h b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.h
index c0bc66210..ba06c7cbb 100644
--- a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.h
+++ b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessManager.h
@@ -26,6 +26,8 @@
#ifndef SharedWorkerProcessManager_h
#define SharedWorkerProcessManager_h
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#include "PluginModuleInfo.h"
#include "WebProcessProxyMessages.h"
#include <wtf/Forward.h>
@@ -61,4 +63,6 @@ private:
} // namespace WebKit
+#endif // ENABLE(SHARED_WORKER_PROCESS)
+
#endif // SharedWorkerProcessManager_h
diff --git a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.cpp b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.cpp
index 5a7967572..3247dc131 100644
--- a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.cpp
+++ b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "SharedWorkerProcessProxy.h"
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#include "SharedWorkerProcessCreationParameters.h"
#include "SharedWorkerProcessManager.h"
#include "SharedWorkerProcessMessages.h"
@@ -113,9 +115,9 @@ void SharedWorkerProcessProxy::sharedWorkerProcessCrashedOrFailedToLaunch()
m_sharedWorkerProcessManager->removeSharedWorkerProcessProxy(this);
}
-void SharedWorkerProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void SharedWorkerProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveSharedWorkerProcessProxyMessage(connection, messageID, arguments);
+ didReceiveSharedWorkerProcessProxyMessage(connection, messageID, decoder);
}
void SharedWorkerProcessProxy::didClose(CoreIPC::Connection*)
@@ -181,3 +183,5 @@ void SharedWorkerProcessProxy::didCreateWebProcessConnection(const CoreIPC::Atta
}
} // namespace WebKit
+
+#endif // ENABLE(SHARED_WORKER_PROCESS)
diff --git a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.h b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.h
index 477482f9e..f20551425 100644
--- a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.h
+++ b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.h
@@ -26,6 +26,8 @@
#ifndef SharedWorkerProcessProxy_h
#define SharedWorkerProcessProxy_h
+#if ENABLE(SHARED_WORKER_PROCESS)
+
#include "Connection.h"
#include "ProcessLauncher.h"
#include "WebProcessProxyMessages.h"
@@ -60,7 +62,7 @@ private:
void sharedWorkerProcessCrashedOrFailedToLaunch();
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
@@ -68,7 +70,7 @@ private:
virtual void didFinishLaunching(ProcessLauncher*, CoreIPC::Connection::Identifier);
// Message handlers
- void didReceiveSharedWorkerProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveSharedWorkerProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void didCreateWebProcessConnection(const CoreIPC::Attachment&);
void platformInitializeSharedWorkerProcess(SharedWorkerProcessCreationParameters&);
@@ -91,4 +93,6 @@ private:
} // namespace WebKit
+#endif // ENABLE(SHARED_WORKER_PROCESS)
+
#endif // SharedWorkerProcessProxy_h
diff --git a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.messages.in b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.messages.in
index e55c8c044..ec98b6d4c 100644
--- a/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.messages.in
+++ b/Source/WebKit2/UIProcess/SharedWorkers/SharedWorkerProcessProxy.messages.in
@@ -20,6 +20,10 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#if ENABLE(SHARED_WORKER_PROCESS)
+
messages -> SharedWorkerProcessProxy {
DidCreateWebProcessConnection(CoreIPC::Attachment connectionIdentifier)
}
+
+#endif // ENABLE(SHARED_WORKER_PROCESS)
diff --git a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
index 4fc41ba21..de668ab0e 100644
--- a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
@@ -41,7 +41,7 @@ PassRefPtr<WebApplicationCacheManagerProxy> WebApplicationCacheManagerProxy::cre
WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy(WebContext* context)
: m_webContext(context)
{
- m_webContext->addMessageReceiver(CoreIPC::MessageClassWebApplicationCacheManagerProxy, this);
+ m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebApplicationCacheManagerProxy, this);
}
WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy()
@@ -58,9 +58,9 @@ bool WebApplicationCacheManagerProxy::shouldTerminate(WebProcessProxy*) const
return m_arrayCallbacks.isEmpty();
}
-void WebApplicationCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebApplicationCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebApplicationCacheManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebApplicationCacheManagerProxyMessage(connection, messageID, decoder);
}
void WebApplicationCacheManagerProxy::getApplicationCacheOrigins(PassRefPtr<ArrayCallback> prpCallback)
diff --git a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h
index 464621856..32538b3d3 100644
--- a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h
@@ -35,7 +35,6 @@
#include <wtf/Vector.h>
namespace CoreIPC {
- class ArgumentDecoder;
class Connection;
class MessageID;
}
@@ -73,8 +72,8 @@ private:
void didGetApplicationCacheOrigins(const Vector<SecurityOriginData>&, uint64_t callbackID);
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- void didReceiveWebApplicationCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ void didReceiveWebApplicationCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
WebContext* m_webContext;
HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
diff --git a/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp b/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp
index b42b7b021..44b5aca0a 100644
--- a/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp
@@ -42,7 +42,7 @@ WebBatteryManagerProxy::WebBatteryManagerProxy(WebContext* context)
: m_isUpdating(false)
, m_context(context)
{
- m_context->addMessageReceiver(CoreIPC::MessageClassWebBatteryManagerProxy, this);
+ m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebBatteryManagerProxy, this);
}
WebBatteryManagerProxy::~WebBatteryManagerProxy()
@@ -59,9 +59,9 @@ void WebBatteryManagerProxy::initializeProvider(const WKBatteryProvider* provide
m_provider.initialize(provider);
}
-void WebBatteryManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebBatteryManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebBatteryManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebBatteryManagerProxyMessage(connection, messageID, decoder);
}
void WebBatteryManagerProxy::startUpdating()
diff --git a/Source/WebKit2/UIProcess/WebBatteryManagerProxy.h b/Source/WebKit2/UIProcess/WebBatteryManagerProxy.h
index 65c6614da..83e2128ac 100644
--- a/Source/WebKit2/UIProcess/WebBatteryManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebBatteryManagerProxy.h
@@ -59,10 +59,10 @@ private:
virtual Type type() const { return APIType; }
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
// Implemented in generated WebBatteryManagerProxyMessageReceiver.cpp
- void didReceiveWebBatteryManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebBatteryManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void startUpdating();
void stopUpdating();
diff --git a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
index 86ba91c08..ff43b3411 100644
--- a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
+++ b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
@@ -52,14 +52,14 @@ WebConnectionToWebProcess::WebConnectionToWebProcess(WebProcessProxy* process, C
// WebConnection
-void WebConnectionToWebProcess::encodeMessageBody(CoreIPC::ArgumentEncoder* argumentEncoder, APIObject* messageBody)
+void WebConnectionToWebProcess::encodeMessageBody(CoreIPC::ArgumentEncoder& encoder, APIObject* messageBody)
{
- argumentEncoder->encode(WebContextUserMessageEncoder(messageBody));
+ encoder.encode(WebContextUserMessageEncoder(messageBody));
}
-bool WebConnectionToWebProcess::decodeMessageBody(CoreIPC::ArgumentDecoder* argumentDecoder, RefPtr<APIObject>& messageBody)
+bool WebConnectionToWebProcess::decodeMessageBody(CoreIPC::ArgumentDecoder& decoder, RefPtr<APIObject>& messageBody)
{
- if (!argumentDecoder->decode(WebContextUserMessageDecoder(messageBody, m_process)))
+ if (!decoder.decode(WebContextUserMessageDecoder(messageBody, m_process)))
return false;
return true;
@@ -67,19 +67,19 @@ bool WebConnectionToWebProcess::decodeMessageBody(CoreIPC::ArgumentDecoder* argu
// CoreIPC::Connection::Client
-void WebConnectionToWebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebConnectionToWebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
if (messageID.is<CoreIPC::MessageClassWebConnection>()) {
- didReceiveWebConnectionMessage(connection, messageID, arguments);
+ didReceiveWebConnectionMessage(connection, messageID, decoder);
return;
}
- m_process->didReceiveMessage(connection, messageID, arguments);
+ m_process->didReceiveMessage(connection, messageID, decoder);
}
-void WebConnectionToWebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebConnectionToWebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- m_process->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ m_process->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
}
void WebConnectionToWebProcess::didClose(CoreIPC::Connection* connection)
diff --git a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.h b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.h
index 160813247..0b1fc09f8 100644
--- a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.h
+++ b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.h
@@ -42,12 +42,12 @@ private:
WebConnectionToWebProcess(WebProcessProxy*, CoreIPC::Connection::Identifier, WebCore::RunLoop*);
// WebConnection
- virtual void encodeMessageBody(CoreIPC::ArgumentEncoder*, APIObject*) OVERRIDE;
- virtual bool decodeMessageBody(CoreIPC::ArgumentDecoder*, RefPtr<APIObject>&) OVERRIDE;
+ virtual void encodeMessageBody(CoreIPC::ArgumentEncoder&, APIObject*) OVERRIDE;
+ virtual bool decodeMessageBody(CoreIPC::ArgumentDecoder&, RefPtr<APIObject>&) OVERRIDE;
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
#if PLATFORM(WIN)
diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp
index 81e7bc477..76cb514b9 100644
--- a/Source/WebKit2/UIProcess/WebContext.cpp
+++ b/Source/WebKit2/UIProcess/WebContext.cpp
@@ -69,6 +69,10 @@
#include "WebNetworkInfoManagerProxy.h"
#endif
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessManager.h"
+#endif
+
#if USE(SOUP)
#include "WebSoupRequestManagerProxy.h"
#endif
@@ -129,9 +133,9 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
, m_usesNetworkProcess(false)
#endif
{
- addMessageReceiver(CoreIPC::MessageClassWebContext, this);
- addMessageReceiver(CoreIPC::MessageClassDownloadProxy, this);
- addMessageReceiver(CoreIPC::MessageClassWebContextLegacy, this);
+ deprecatedAddMessageReceiver(CoreIPC::MessageClassWebContext, this);
+ deprecatedAddMessageReceiver(CoreIPC::MessageClassDownloadProxy, this);
+ deprecatedAddMessageReceiver(CoreIPC::MessageClassWebContextLegacy, this);
// NOTE: These sub-objects must be initialized after m_messageReceiverMap..
m_applicationCacheManagerProxy = WebApplicationCacheManagerProxy::create(this);
@@ -150,7 +154,9 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
m_networkInfoManagerProxy = WebNetworkInfoManagerProxy::create(this);
#endif
m_notificationManagerProxy = WebNotificationManagerProxy::create(this);
+#if ENABLE(NETSCAPE_PLUGIN_API)
m_pluginSiteDataManager = WebPluginSiteDataManager::create(this);
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
m_resourceCacheManagerProxy = WebResourceCacheManagerProxy::create(this);
#if USE(SOUP)
m_soupRequestManagerProxy = WebSoupRequestManagerProxy::create(this);
@@ -221,8 +227,10 @@ WebContext::~WebContext()
m_notificationManagerProxy->invalidate();
m_notificationManagerProxy->clearContext();
+#if ENABLE(NETSCAPE_PLUGIN_API)
m_pluginSiteDataManager->invalidate();
m_pluginSiteDataManager->clearContext();
+#endif
m_resourceCacheManagerProxy->invalidate();
m_resourceCacheManagerProxy->clearContext();
@@ -332,7 +340,7 @@ PassRefPtr<WebProcessProxy> WebContext::createNewWebProcess()
{
#if ENABLE(NETWORK_PROCESS)
if (m_usesNetworkProcess)
- ensureNetworkProcess();
+ NetworkProcessManager::shared().ensureNetworkProcess();
#endif
RefPtr<WebProcessProxy> process = WebProcessProxy::create(this);
@@ -392,6 +400,10 @@ PassRefPtr<WebProcessProxy> WebContext::createNewWebProcess()
m_notificationManagerProxy->populateCopyOfNotificationPermissions(parameters.notificationPermissions);
#endif
+#if ENABLE(NETWORK_PROCESS)
+ parameters.usesNetworkProcess = m_usesNetworkProcess;
+#endif
+
// Add any platform specific parameters
platformInitializeWebProcess(parameters);
@@ -431,16 +443,6 @@ void WebContext::warmInitialProcess()
m_haveInitialEmptyProcess = true;
}
-#if ENABLE(NETWORK_PROCESS)
-void WebContext::ensureNetworkProcess()
-{
- if (m_networkProcess)
- return;
-
- m_networkProcess = NetworkProcessProxy::create();
-}
-#endif
-
void WebContext::enableProcessTermination()
{
m_processTerminationEnabled = true;
@@ -473,8 +475,10 @@ bool WebContext::shouldTerminate(WebProcessProxy* process)
return false;
if (!m_mediaCacheManagerProxy->shouldTerminate(process))
return false;
+#if ENABLE(NETSCAPE_PLUGIN_API)
if (!m_pluginSiteDataManager->shouldTerminate(process))
return false;
+#endif
if (!m_resourceCacheManagerProxy->shouldTerminate(process))
return false;
@@ -551,7 +555,7 @@ void WebContext::disconnectProcess(WebProcessProxy* process)
// When out of process plug-ins are enabled, we don't want to invalidate the plug-in site data
// manager just because the web process crashes since it's not involved.
-#if !ENABLE(PLUGIN_PROCESS)
+#if ENABLE(NETSCAPE_PLUGIN_API) && !ENABLE(PLUGIN_PROCESS)
m_pluginSiteDataManager->invalidate();
#endif
@@ -663,6 +667,7 @@ WebContext::Statistics& WebContext::statistics()
return statistics;
}
+#if ENABLE(NETSCAPE_PLUGIN_API)
void WebContext::setAdditionalPluginsDirectory(const String& directory)
{
Vector<String> directories;
@@ -670,6 +675,7 @@ void WebContext::setAdditionalPluginsDirectory(const String& directory)
m_pluginInfoStore.setAdditionalPluginsDirectories(directories);
}
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
void WebContext::setAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
{
@@ -741,7 +747,7 @@ void WebContext::addVisitedLink(const String& visitedURL)
if (visitedURL.isEmpty())
return;
- LinkHash linkHash = visitedLinkHash(visitedURL.characters(), visitedURL.length());
+ LinkHash linkHash = visitedLinkHash(visitedURL);
addVisitedLinkHash(linkHash);
}
@@ -777,31 +783,31 @@ HashSet<String, CaseFoldingHash> WebContext::pdfAndPostScriptMIMETypes()
return mimeTypes;
}
-void WebContext::addMessageReceiver(CoreIPC::MessageClass messageClass, CoreIPC::MessageReceiver* messageReceiver)
+void WebContext::deprecatedAddMessageReceiver(CoreIPC::MessageClass messageClass, CoreIPC::MessageReceiver* messageReceiver)
{
- m_messageReceiverMap.addMessageReceiver(messageClass, messageReceiver);
+ m_messageReceiverMap.deprecatedAddMessageReceiver(messageClass, messageReceiver);
}
-bool WebContext::dispatchMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* argumentDecoder)
+bool WebContext::dispatchMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- return m_messageReceiverMap.dispatchMessage(connection, messageID, argumentDecoder);
+ return m_messageReceiverMap.dispatchMessage(connection, messageID, decoder);
}
-bool WebContext::dispatchSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* argumentDecoder, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+bool WebContext::dispatchSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- return m_messageReceiverMap.dispatchSyncMessage(connection, messageID, argumentDecoder, reply);
+ return m_messageReceiverMap.dispatchSyncMessage(connection, messageID, decoder, replyEncoder);
}
-void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
if (messageID.is<CoreIPC::MessageClassWebContext>()) {
- didReceiveWebContextMessage(connection, messageID, arguments);
+ didReceiveWebContextMessage(connection, messageID, decoder);
return;
}
if (messageID.is<CoreIPC::MessageClassDownloadProxy>()) {
- if (DownloadProxy* downloadProxy = m_downloads.get(arguments->destinationID()).get())
- downloadProxy->didReceiveDownloadProxyMessage(connection, messageID, arguments);
+ if (DownloadProxy* downloadProxy = m_downloads.get(decoder.destinationID()).get())
+ downloadProxy->didReceiveDownloadProxyMessage(connection, messageID, decoder);
return;
}
@@ -811,7 +817,7 @@ void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
String messageName;
RefPtr<APIObject> messageBody;
WebContextUserMessageDecoder messageDecoder(messageBody, WebProcessProxy::fromConnection(connection));
- if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder)))
+ if (!decoder.decode(CoreIPC::Out(messageName, messageDecoder)))
return;
didReceiveMessageFromInjectedBundle(messageName, messageBody.get());
@@ -824,16 +830,16 @@ void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
ASSERT_NOT_REACHED();
}
-void WebContext::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebContext::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
if (messageID.is<CoreIPC::MessageClassWebContext>()) {
- didReceiveSyncWebContextMessage(connection, messageID, arguments, reply);
+ didReceiveSyncWebContextMessage(connection, messageID, decoder, replyEncoder);
return;
}
if (messageID.is<CoreIPC::MessageClassDownloadProxy>()) {
- if (DownloadProxy* downloadProxy = m_downloads.get(arguments->destinationID()).get())
- downloadProxy->didReceiveSyncDownloadProxyMessage(connection, messageID, arguments, reply);
+ if (DownloadProxy* downloadProxy = m_downloads.get(decoder.destinationID()).get())
+ downloadProxy->didReceiveSyncDownloadProxyMessage(connection, messageID, decoder, replyEncoder);
return;
}
@@ -844,12 +850,12 @@ void WebContext::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC:
String messageName;
RefPtr<APIObject> messageBody;
WebContextUserMessageDecoder messageDecoder(messageBody, WebProcessProxy::fromConnection(connection));
- if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder)))
+ if (!decoder.decode(CoreIPC::Out(messageName, messageDecoder)))
return;
RefPtr<APIObject> returnData;
didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody.get(), returnData);
- reply->encode(CoreIPC::In(WebContextUserMessageEncoder(returnData.get())));
+ replyEncoder->encode(CoreIPC::In(WebContextUserMessageEncoder(returnData.get())));
return;
}
case WebContextLegacyMessage::PostMessage:
diff --git a/Source/WebKit2/UIProcess/WebContext.h b/Source/WebKit2/UIProcess/WebContext.h
index 9e8d8054a..e3f6a69db 100644
--- a/Source/WebKit2/UIProcess/WebContext.h
+++ b/Source/WebKit2/UIProcess/WebContext.h
@@ -46,10 +46,6 @@
#include <wtf/text/StringHash.h>
#include <wtf/text/WTFString.h>
-#if ENABLE(NETWORK_PROCESS)
-#include "NetworkProcessProxy.h"
-#endif
-
namespace WebKit {
class DownloadProxy;
@@ -90,9 +86,9 @@ public:
static const Vector<WebContext*>& allContexts();
- void addMessageReceiver(CoreIPC::MessageClass, CoreIPC::MessageReceiver*);
- bool dispatchMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- bool dispatchSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void deprecatedAddMessageReceiver(CoreIPC::MessageClass, CoreIPC::MessageReceiver*);
+ bool dispatchMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ bool dispatchSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void initializeInjectedBundleClient(const WKContextInjectedBundleClient*);
void initializeConnectionClient(const WKContextConnectionClient*);
@@ -130,10 +126,12 @@ public:
void didReceiveSynchronousMessageFromInjectedBundle(const String&, APIObject*, RefPtr<APIObject>& returnData);
void populateVisitedLinks();
-
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
void setAdditionalPluginsDirectory(const String&);
PluginInfoStore& pluginInfoStore() { return m_pluginInfoStore; }
+#endif
String applicationCacheDirectory();
void setAlwaysUsesComplexTextCodePath(bool);
@@ -151,8 +149,8 @@ public:
void addVisitedLinkHash(WebCore::LinkHash);
// MessageReceiver.
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&) OVERRIDE;
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
void setCacheModel(CacheModel);
CacheModel cacheModel() const { return m_cacheModel; }
@@ -195,7 +193,9 @@ public:
WebNetworkInfoManagerProxy* networkInfoManagerProxy() const { return m_networkInfoManagerProxy.get(); }
#endif
WebNotificationManagerProxy* notificationManagerProxy() const { return m_notificationManagerProxy.get(); }
+#if ENABLE(NETSCAPE_PLUGIN_API)
WebPluginSiteDataManager* pluginSiteDataManager() const { return m_pluginSiteDataManager.get(); }
+#endif
WebResourceCacheManagerProxy* resourceCacheManagerProxy() const { return m_resourceCacheManagerProxy.get(); }
#if USE(SOUP)
WebSoupRequestManagerProxy* soupRequestManagerProxy() const { return m_soupRequestManagerProxy.get(); }
@@ -253,10 +253,6 @@ private:
void platformInitializeWebProcess(WebProcessCreationParameters&);
void platformInvalidateContext();
-#if ENABLE(NETWORK_PROCESS)
- void ensureNetworkProcess();
-#endif
-
#if PLATFORM(MAC)
void getPasteboardTypes(const String& pasteboardName, Vector<String>& pasteboardTypes);
void getPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, Vector<String>& pathnames);
@@ -283,8 +279,8 @@ private:
void didGetWebCoreStatistics(const StatisticsData&, uint64_t callbackID);
// Implemented in generated WebContextMessageReceiver.cpp
- void didReceiveWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
static void languageChanged(void* context);
void languageChanged();
@@ -315,10 +311,12 @@ private:
WebContextInjectedBundleClient m_injectedBundleClient;
WebContextConnectionClient m_connectionClient;
-
+
WebHistoryClient m_historyClient;
+#if ENABLE(NETSCAPE_PLUGIN_API)
PluginInfoStore m_pluginInfoStore;
+#endif
VisitedLinkProvider m_visitedLinkProvider;
HashSet<String> m_schemesToRegisterAsEmptyDocument;
@@ -360,7 +358,9 @@ private:
RefPtr<WebNetworkInfoManagerProxy> m_networkInfoManagerProxy;
#endif
RefPtr<WebNotificationManagerProxy> m_notificationManagerProxy;
+#if ENABLE(NETSCAPE_PLUGIN_API)
RefPtr<WebPluginSiteDataManager> m_pluginSiteDataManager;
+#endif
RefPtr<WebResourceCacheManagerProxy> m_resourceCacheManagerProxy;
#if USE(SOUP)
RefPtr<WebSoupRequestManagerProxy> m_soupRequestManagerProxy;
@@ -387,7 +387,6 @@ private:
bool m_processTerminationEnabled;
#if ENABLE(NETWORK_PROCESS)
- RefPtr<NetworkProcessProxy> m_networkProcess;
bool m_usesNetworkProcess;
#endif
diff --git a/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp b/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
index aa33ce62f..6f876cfcc 100644
--- a/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
@@ -41,7 +41,7 @@ PassRefPtr<WebCookieManagerProxy> WebCookieManagerProxy::create(WebContext* cont
WebCookieManagerProxy::WebCookieManagerProxy(WebContext* context)
: m_webContext(context)
{
- m_webContext->addMessageReceiver(CoreIPC::MessageClassWebCookieManagerProxy, this);
+ m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebCookieManagerProxy, this);
}
WebCookieManagerProxy::~WebCookieManagerProxy()
@@ -64,9 +64,9 @@ void WebCookieManagerProxy::initializeClient(const WKCookieManagerClient* client
m_client.initialize(client);
}
-void WebCookieManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebCookieManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebCookieManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebCookieManagerProxyMessage(connection, messageID, decoder);
}
void WebCookieManagerProxy::getHostnamesWithCookies(PassRefPtr<ArrayCallback> prpCallback)
diff --git a/Source/WebKit2/UIProcess/WebCookieManagerProxy.h b/Source/WebKit2/UIProcess/WebCookieManagerProxy.h
index 6981c0d06..c0168e28c 100644
--- a/Source/WebKit2/UIProcess/WebCookieManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebCookieManagerProxy.h
@@ -36,7 +36,6 @@
#include <wtf/Vector.h>
namespace CoreIPC {
- class ArgumentDecoder;
class Connection;
class MessageID;
}
@@ -88,8 +87,8 @@ private:
void cookiesDidChange();
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- void didReceiveWebCookieManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ void didReceiveWebCookieManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
#if PLATFORM(MAC)
void persistHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy);
diff --git a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
index a3fda6556..8f24028cb 100644
--- a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
@@ -94,7 +94,7 @@ PassRefPtr<WebDatabaseManagerProxy> WebDatabaseManagerProxy::create(WebContext*
WebDatabaseManagerProxy::WebDatabaseManagerProxy(WebContext* webContext)
: m_webContext(webContext)
{
- m_webContext->addMessageReceiver(CoreIPC::MessageClassWebDatabaseManagerProxy, this);
+ m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebDatabaseManagerProxy, this);
}
WebDatabaseManagerProxy::~WebDatabaseManagerProxy()
@@ -232,9 +232,9 @@ void WebDatabaseManagerProxy::didModifyDatabase(const String& originIdentifier,
m_client.didModifyDatabase(this, origin.get(), databaseIdentifier);
}
-void WebDatabaseManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebDatabaseManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebDatabaseManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebDatabaseManagerProxyMessage(connection, messageID, decoder);
}
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h
index b724a847d..7c695fcbb 100644
--- a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h
@@ -81,8 +81,8 @@ private:
virtual Type type() const { return APIType; }
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- void didReceiveWebDatabaseManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ void didReceiveWebDatabaseManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
// Message handlers.
void didGetDatabasesByOrigin(const Vector<OriginAndDatabases>& originAndDatabases, uint64_t callbackID);
diff --git a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp
index fe71ecaa4..e49ad86ef 100644
--- a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp
@@ -54,14 +54,14 @@ void WebFullScreenManagerProxy::setWebView(PlatformWebView* webView)
m_webView = webView;
}
-void WebFullScreenManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebFullScreenManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebFullScreenManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebFullScreenManagerProxyMessage(connection, messageID, decoder);
}
-void WebFullScreenManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebFullScreenManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- didReceiveSyncWebFullScreenManagerProxyMessage(connection, messageID, arguments, reply);
+ didReceiveSyncWebFullScreenManagerProxyMessage(connection, messageID, decoder, replyEncoder);
}
void WebFullScreenManagerProxy::willEnterFullScreen()
diff --git a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h
index b83af5476..04aed9a3f 100644
--- a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h
@@ -79,8 +79,8 @@ public:
bool isFullScreen();
void close();
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void willEnterFullScreen();
void didEnterFullScreen();
@@ -101,8 +101,8 @@ private:
WebPageProxy* m_page;
PlatformWebView* m_webView;
- void didReceiveWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
+ void didReceiveWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
};
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp b/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
index e20d1eebd..6cccd849c 100644
--- a/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
@@ -40,7 +40,7 @@ WebGeolocationManagerProxy::WebGeolocationManagerProxy(WebContext* context)
: m_isUpdating(false)
, m_context(context)
{
- m_context->addMessageReceiver(CoreIPC::MessageClassWebGeolocationManagerProxy, this);
+ m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebGeolocationManagerProxy, this);
}
WebGeolocationManagerProxy::~WebGeolocationManagerProxy()
@@ -73,9 +73,9 @@ void WebGeolocationManagerProxy::providerDidFailToDeterminePosition(const String
m_context->sendToAllProcesses(Messages::WebGeolocationManager::DidFailToDeterminePosition(errorMessage));
}
-void WebGeolocationManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebGeolocationManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebGeolocationManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebGeolocationManagerProxyMessage(connection, messageID, decoder);
}
void WebGeolocationManagerProxy::startUpdating()
diff --git a/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h b/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h
index 8f4102b61..81fc19e8e 100644
--- a/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h
@@ -57,10 +57,10 @@ private:
virtual Type type() const { return APIType; }
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
// Implemented in generated WebGeolocationManagerProxyMessageReceiver.cpp
- void didReceiveWebGeolocationManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebGeolocationManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void startUpdating();
void stopUpdating();
diff --git a/Source/WebKit2/UIProcess/WebIconDatabase.cpp b/Source/WebKit2/UIProcess/WebIconDatabase.cpp
index 8b71e89e0..1092b9ac5 100644
--- a/Source/WebKit2/UIProcess/WebIconDatabase.cpp
+++ b/Source/WebKit2/UIProcess/WebIconDatabase.cpp
@@ -54,7 +54,7 @@ WebIconDatabase::WebIconDatabase(WebContext* context)
, m_urlImportCompleted(false)
, m_databaseCleanupDisabled(false)
{
- m_webContext->addMessageReceiver(CoreIPC::MessageClassWebIconDatabase, this);
+ m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebIconDatabase, this);
}
void WebIconDatabase::invalidate()
@@ -284,14 +284,14 @@ void WebIconDatabase::didFinishURLImport()
m_urlImportCompleted = true;
}
-void WebIconDatabase::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* decoder)
+void WebIconDatabase::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
didReceiveWebIconDatabaseMessage(connection, messageID, decoder);
}
-void WebIconDatabase::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* decoder, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebIconDatabase::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- didReceiveSyncWebIconDatabaseMessage(connection, messageID, decoder, reply);
+ didReceiveSyncWebIconDatabaseMessage(connection, messageID, decoder, replyEncoder);
}
void WebIconDatabase::notifyIconDataReadyForPageURL(const String& pageURL)
diff --git a/Source/WebKit2/UIProcess/WebIconDatabase.h b/Source/WebKit2/UIProcess/WebIconDatabase.h
index 8643a481d..0947ec00b 100644
--- a/Source/WebKit2/UIProcess/WebIconDatabase.h
+++ b/Source/WebKit2/UIProcess/WebIconDatabase.h
@@ -103,11 +103,11 @@ private:
virtual void didFinishURLImport();
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&) OVERRIDE;
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
- void didReceiveWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void notifyIconDataReadyForPageURL(const String&);
diff --git a/Source/WebKit2/UIProcess/WebInspectorProxy.h b/Source/WebKit2/UIProcess/WebInspectorProxy.h
index 6922b7d73..88575a3cc 100644
--- a/Source/WebKit2/UIProcess/WebInspectorProxy.h
+++ b/Source/WebKit2/UIProcess/WebInspectorProxy.h
@@ -125,8 +125,8 @@ public:
#if ENABLE(INSPECTOR)
// Implemented in generated WebInspectorProxyMessageReceiver.cpp
- void didReceiveWebInspectorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebInspectorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveWebInspectorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebInspectorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
#endif
static bool isInspectorPage(WebPageProxy*);
diff --git a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp
index 454d082f5..5c3088d98 100644
--- a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp
@@ -41,7 +41,7 @@ PassRefPtr<WebKeyValueStorageManagerProxy> WebKeyValueStorageManagerProxy::creat
WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy(WebContext* context)
: m_webContext(context)
{
- m_webContext->addMessageReceiver(CoreIPC::MessageClassWebKeyValueStorageManagerProxy, this);
+ m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebKeyValueStorageManagerProxy, this);
}
WebKeyValueStorageManagerProxy::~WebKeyValueStorageManagerProxy()
@@ -58,9 +58,9 @@ bool WebKeyValueStorageManagerProxy::shouldTerminate(WebProcessProxy*) const
return m_arrayCallbacks.isEmpty();
}
-void WebKeyValueStorageManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebKeyValueStorageManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebKeyValueStorageManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebKeyValueStorageManagerProxyMessage(connection, messageID, decoder);
}
void WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins(PassRefPtr<ArrayCallback> prpCallback)
diff --git a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h
index 9c63142f6..ba392bb2e 100644
--- a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h
@@ -67,8 +67,8 @@ private:
void didGetKeyValueStorageOrigins(const Vector<SecurityOriginData>&, uint64_t callbackID);
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- void didReceiveWebKeyValueStorageManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ void didReceiveWebKeyValueStorageManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
WebContext* m_webContext;
HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
diff --git a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
index 81cf98f56..39cf73a89 100644
--- a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
@@ -40,7 +40,7 @@ PassRefPtr<WebMediaCacheManagerProxy> WebMediaCacheManagerProxy::create(WebConte
WebMediaCacheManagerProxy::WebMediaCacheManagerProxy(WebContext* context)
: m_webContext(context)
{
- m_webContext->addMessageReceiver(CoreIPC::MessageClassWebMediaCacheManagerProxy, this);
+ m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebMediaCacheManagerProxy, this);
}
WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy()
@@ -57,9 +57,9 @@ bool WebMediaCacheManagerProxy::shouldTerminate(WebProcessProxy*) const
return m_arrayCallbacks.isEmpty();
}
-void WebMediaCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebMediaCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebMediaCacheManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebMediaCacheManagerProxyMessage(connection, messageID, decoder);
}
void WebMediaCacheManagerProxy::getHostnamesWithMediaCache(PassRefPtr<ArrayCallback> prpCallback)
diff --git a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h
index 48e88e0fc..4531a7210 100644
--- a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h
@@ -65,8 +65,8 @@ private:
void didGetHostnamesWithMediaCache(const Vector<String>&, uint64_t callbackID);
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- void didReceiveWebMediaCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ void didReceiveWebMediaCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
WebContext* m_webContext;
HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
diff --git a/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp b/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp
index 21a399bc0..7f30a5340 100644
--- a/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp
@@ -43,7 +43,7 @@ WebNetworkInfoManagerProxy::WebNetworkInfoManagerProxy(WebContext* context)
: m_isUpdating(false)
, m_context(context)
{
- m_context->addMessageReceiver(CoreIPC::MessageClassWebNetworkInfoManagerProxy, this);
+ m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebNetworkInfoManagerProxy, this);
}
WebNetworkInfoManagerProxy::~WebNetworkInfoManagerProxy()
@@ -68,14 +68,14 @@ void WebNetworkInfoManagerProxy::providerDidChangeNetworkInformation(const Atomi
m_context->sendToAllProcesses(Messages::WebNetworkInfoManager::DidChangeNetworkInformation(eventType, networkInformation->data()));
}
-void WebNetworkInfoManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebNetworkInfoManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebNetworkInfoManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebNetworkInfoManagerProxyMessage(connection, messageID, decoder);
}
-void WebNetworkInfoManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebNetworkInfoManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- didReceiveSyncWebNetworkInfoManagerProxyMessage(connection, messageID, arguments, reply);
+ didReceiveSyncWebNetworkInfoManagerProxyMessage(connection, messageID, decoder, replyEncoder);
}
void WebNetworkInfoManagerProxy::startUpdating()
diff --git a/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.h b/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.h
index 2c4ef7c67..456010c25 100644
--- a/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.h
@@ -58,12 +58,12 @@ private:
virtual Type type() const { return APIType; }
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&) OVERRIDE;
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
// Implemented in generated WebNetworkInfoManagerProxyMessageReceiver.cpp
- void didReceiveWebNetworkInfoManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebNetworkInfoManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveWebNetworkInfoManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebNetworkInfoManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void startUpdating();
void stopUpdating();
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 7ef4a249f..56c7cfea5 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -722,11 +722,11 @@ void WebPageProxy::shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGo
shouldGoToBackForwardItem = item && m_loaderClient.shouldGoToBackForwardListItem(this, item);
}
-void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
if (WebBackForwardListItem* item = m_process->webBackForwardItem(itemID))
@@ -779,11 +779,12 @@ bool WebPageProxy::canShowMIMEType(const String& mimeType) const
if (MIMETypeRegistry::canShowMIMEType(mimeType))
return true;
+#if ENABLE(NETSCAPE_PLUGIN_API)
String newMimeType = mimeType;
PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
- if (!plugin.path.isNull())
+ if (!plugin.path.isNull() && m_pageGroup->preferences()->pluginsEnabled())
return true;
-
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
return false;
}
@@ -1835,16 +1836,16 @@ void WebPageProxy::preferencesDidChange()
m_process->send(Messages::WebPage::PreferencesDidChange(pageGroup()->preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
-void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
- m_drawingArea->didReceiveDrawingAreaProxyMessage(connection, messageID, arguments);
+ m_drawingArea->didReceiveDrawingAreaProxyMessage(connection, messageID, decoder);
return;
}
#if USE(COORDINATED_GRAPHICS)
if (messageID.is<CoreIPC::MessageClassLayerTreeCoordinatorProxy>()) {
- m_drawingArea->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, arguments);
+ m_drawingArea->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, decoder);
return;
}
#endif
@@ -1852,40 +1853,40 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
#if ENABLE(INSPECTOR)
if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
if (WebInspectorProxy* inspector = this->inspector())
- inspector->didReceiveWebInspectorProxyMessage(connection, messageID, arguments);
+ inspector->didReceiveWebInspectorProxyMessage(connection, messageID, decoder);
return;
}
#endif
#if ENABLE(FULLSCREEN_API)
if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
- fullScreenManager()->didReceiveMessage(connection, messageID, arguments);
+ fullScreenManager()->didReceiveMessage(connection, messageID, decoder);
return;
}
#endif
- didReceiveWebPageProxyMessage(connection, messageID, arguments);
+ didReceiveWebPageProxyMessage(connection, messageID, decoder);
}
-void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
#if ENABLE(INSPECTOR)
if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
if (WebInspectorProxy* inspector = this->inspector())
- inspector->didReceiveSyncWebInspectorProxyMessage(connection, messageID, arguments, reply);
+ inspector->didReceiveSyncWebInspectorProxyMessage(connection, messageID, decoder, replyEncoder);
return;
}
#endif
#if ENABLE(FULLSCREEN_API)
if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
- fullScreenManager()->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ fullScreenManager()->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
return;
}
#endif
// FIXME: Do something with reply.
- didReceiveSyncWebPageProxyMessage(connection, messageID, arguments, reply);
+ didReceiveSyncWebPageProxyMessage(connection, messageID, decoder, replyEncoder);
}
void WebPageProxy::didCreateMainFrame(uint64_t frameID)
@@ -1990,11 +1991,11 @@ void WebPageProxy::didFinishProgress()
}
#if ENABLE(WEB_INTENTS_TAG)
-void WebPageProxy::registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo& serviceInfo, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo& serviceInfo, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2005,13 +2006,13 @@ void WebPageProxy::registerIntentServiceForFrame(uint64_t frameID, const IntentS
}
#endif
-void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::MessageDecoder& decoder)
{
clearPendingAPIRequestURL();
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2024,11 +2025,11 @@ void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const Strin
m_loaderClient.didStartProvisionalLoadForFrame(this, frame, userData.get());
}
-void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String& url, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String& url, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2040,11 +2041,11 @@ void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t f
m_loaderClient.didReceiveServerRedirectForProvisionalLoadForFrame(this, frame, userData.get());
}
-void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2068,11 +2069,11 @@ void WebPageProxy::clearLoadDependentCallbacks()
}
}
-void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo& certificateInfo, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo& certificateInfo, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2110,11 +2111,11 @@ void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeTyp
m_loaderClient.didCommitLoadForFrame(this, frame, userData.get());
}
-void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2123,11 +2124,11 @@ void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::Argu
m_loaderClient.didFinishDocumentLoadForFrame(this, frame, userData.get());
}
-void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2138,11 +2139,11 @@ void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDeco
m_loaderClient.didFinishLoadForFrame(this, frame, userData.get());
}
-void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2155,11 +2156,11 @@ void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& er
m_loaderClient.didFailLoadWithErrorForFrame(this, frame, error, userData.get());
}
-void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t opaqueSameDocumentNavigationType, const String& url, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t opaqueSameDocumentNavigationType, const String& url, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2172,11 +2173,11 @@ void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t
m_loaderClient.didSameDocumentNavigationForFrame(this, frame, static_cast<SameDocumentNavigationType>(opaqueSameDocumentNavigationType), userData.get());
}
-void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2187,11 +2188,11 @@ void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title
m_loaderClient.didReceiveTitleForFrame(this, title, frame, userData.get());
}
-void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2200,11 +2201,11 @@ void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDec
m_loaderClient.didFirstLayoutForFrame(this, frame, userData.get());
}
-void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2213,31 +2214,31 @@ void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, Core
m_loaderClient.didFirstVisuallyNonEmptyLayoutForFrame(this, frame, userData.get());
}
-void WebPageProxy::didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didNewFirstVisuallyNonEmptyLayout(CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
m_loaderClient.didNewFirstVisuallyNonEmptyLayout(this, userData.get());
}
-void WebPageProxy::didLayout(uint32_t layoutMilestones, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didLayout(uint32_t layoutMilestones, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
m_loaderClient.didLayout(this, static_cast<LayoutMilestones>(layoutMilestones), userData.get());
}
-void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2248,11 +2249,11 @@ void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::Argume
m_loaderClient.didRemoveFrameFromHierarchy(this, frame, userData.get());
}
-void WebPageProxy::didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2261,11 +2262,11 @@ void WebPageProxy::didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::
m_loaderClient.didDisplayInsecureContentForFrame(this, frame, userData.get());
}
-void WebPageProxy::didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2274,11 +2275,11 @@ void WebPageProxy::didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::Argu
m_loaderClient.didRunInsecureContentForFrame(this, frame, userData.get());
}
-void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2288,11 +2289,11 @@ void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, CoreIPC::ArgumentDecod
}
#if ENABLE(WEB_INTENTS)
-void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData& intentData, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData& intentData, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2314,11 +2315,11 @@ void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
}
// PolicyClient
-void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, uint32_t opaqueNavigationType, uint32_t opaqueModifiers, int32_t opaqueMouseButton, const ResourceRequest& request, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
+void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, uint32_t opaqueNavigationType, uint32_t opaqueModifiers, int32_t opaqueMouseButton, const ResourceRequest& request, uint64_t listenerID, CoreIPC::MessageDecoder& decoder, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
if (request.url() != pendingAPIRequestURL())
@@ -2352,11 +2353,11 @@ void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, uint32_t op
}
}
-void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, uint32_t opaqueNavigationType, uint32_t opaqueModifiers, int32_t opaqueMouseButton, const ResourceRequest& request, const String& frameName, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, uint32_t opaqueNavigationType, uint32_t opaqueModifiers, int32_t opaqueMouseButton, const ResourceRequest& request, const String& frameName, uint64_t listenerID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2372,11 +2373,11 @@ void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, uint32_t opa
listener->use();
}
-void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const ResourceResponse& response, const ResourceRequest& request, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
+void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const ResourceResponse& response, const ResourceRequest& request, uint64_t listenerID, CoreIPC::MessageDecoder& decoder, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2404,11 +2405,11 @@ void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const ResourceRespo
}
}
-void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError& error, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2419,11 +2420,11 @@ void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError
// FormClient
-void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebFrameProxy* frame = m_process->webFrame(frameID);
@@ -2562,11 +2563,11 @@ void WebPageProxy::setStatusText(const String& text)
m_uiClient.setStatusText(this, text);
}
-void WebPageProxy::mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t opaqueModifiers, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t opaqueModifiers, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
@@ -3012,19 +3013,19 @@ void WebPageProxy::hidePopupMenu()
}
#if ENABLE(CONTEXT_MENUS)
-void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::MessageDecoder& decoder)
{
- internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, arguments);
+ internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, decoder);
// No matter the result of internalShowContextMenu, always notify the WebProcess that the menu is hidden so it starts handling mouse events again.
m_process->send(Messages::WebPage::ContextMenuHidden(), m_pageID);
}
-void WebPageProxy::internalShowContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
+void WebPageProxy::internalShowContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::MessageDecoder& decoder)
{
RefPtr<APIObject> userData;
WebContextUserMessageDecoder messageDecoder(userData, m_process.get());
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
m_activeContextMenuHitTestResultData = hitTestResultData;
@@ -3884,13 +3885,14 @@ void WebPageProxy::didFailToInitializePlugin(const String& mimeType)
m_loaderClient.didFailToInitializePlugin(this, mimeType);
}
+// FIXME: ENABLE(NETSCAPE_PLUGIN_API)
void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType, const String& urlString)
{
String pluginIdentifier;
String pluginVersion;
String newMimeType = mimeType;
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && ENABLE(NETSCAPE_PLUGIN_API)
PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
pluginIdentifier = plugin.bundleIdentifier;
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index eede6b96f..95528ab7f 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -304,7 +304,7 @@ public:
void tryRestoreScrollPosition();
void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<APIObject> >* removedItems);
void shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardListItem);
- void willGoToBackForwardListItem(uint64_t itemID, CoreIPC::ArgumentDecoder* arguments);
+ void willGoToBackForwardListItem(uint64_t itemID, CoreIPC::MessageDecoder&);
String activeURL() const;
String provisionalURL() const;
@@ -591,8 +591,8 @@ public:
#endif
#endif
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void processDidBecomeUnresponsive();
void interactionOccurredWhileProcessUnresponsive();
@@ -752,49 +752,49 @@ private:
#endif
// Implemented in generated WebPageProxyMessageReceiver.cpp
- void didReceiveWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void didCreateMainFrame(uint64_t frameID);
void didCreateSubframe(uint64_t frameID, uint64_t parentFrameID);
void didSaveFrameToPageCache(uint64_t frameID);
void didRestoreFrameFromPageCache(uint64_t frameID, uint64_t parentFrameID);
- void didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::ArgumentDecoder*);
- void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String&, CoreIPC::ArgumentDecoder*);
- void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::ArgumentDecoder*);
- void didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo&, CoreIPC::ArgumentDecoder*);
- void didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
- void didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
- void didFailLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::ArgumentDecoder*);
- void didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t sameDocumentNavigationType, const String&, CoreIPC::ArgumentDecoder*);
- void didReceiveTitleForFrame(uint64_t frameID, const String&, CoreIPC::ArgumentDecoder*);
- void didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
- void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
- void didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder*);
- void didLayout(uint32_t layoutMilestones, CoreIPC::ArgumentDecoder*);
- void didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder*);
- void didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
- void didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
- void didDetectXSSForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
+ void didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::MessageDecoder&);
+ void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String&, CoreIPC::MessageDecoder&);
+ void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
+ void didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo&, CoreIPC::MessageDecoder&);
+ void didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
+ void didFinishLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
+ void didFailLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
+ void didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t sameDocumentNavigationType, const String&, CoreIPC::MessageDecoder&);
+ void didReceiveTitleForFrame(uint64_t frameID, const String&, CoreIPC::MessageDecoder&);
+ void didFirstLayoutForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
+ void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
+ void didNewFirstVisuallyNonEmptyLayout(CoreIPC::MessageDecoder&);
+ void didLayout(uint32_t layoutMilestones, CoreIPC::MessageDecoder&);
+ void didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::MessageDecoder&);
+ void didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
+ void didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
+ void didDetectXSSForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
void frameDidBecomeFrameSet(uint64_t frameID, bool);
void didStartProgress();
void didChangeProgress(double);
void didFinishProgress();
#if ENABLE(WEB_INTENTS)
- void didReceiveIntentForFrame(uint64_t frameID, const IntentData&, CoreIPC::ArgumentDecoder*);
+ void didReceiveIntentForFrame(uint64_t frameID, const IntentData&, CoreIPC::MessageDecoder&);
#endif
#if ENABLE(WEB_INTENTS_TAG)
- void registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo&, CoreIPC::ArgumentDecoder*);
+ void registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo&, CoreIPC::MessageDecoder&);
#endif
- void decidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::ArgumentDecoder*, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
- void decidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, CoreIPC::ArgumentDecoder*);
- void decidePolicyForResponse(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
- void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::ArgumentDecoder* arguments);
+ void decidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
+ void decidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, CoreIPC::MessageDecoder&);
+ void decidePolicyForResponse(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
+ void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
- void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::ArgumentDecoder*);
+ void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::MessageDecoder&);
// Resource load client
void didInitiateLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const WebCore::ResourceRequest&, bool pageIsProvisionallyLoading);
@@ -813,7 +813,7 @@ private:
void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, String& result);
void shouldInterruptJavaScript(bool& result);
void setStatusText(const String&);
- void mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t modifiers, CoreIPC::ArgumentDecoder*);
+ void mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t modifiers, CoreIPC::MessageDecoder&);
void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL);
void setToolbarsAreVisible(bool toolbarsAreVisible);
void getToolbarsAreVisible(bool& toolbarsAreVisible);
@@ -912,8 +912,8 @@ private:
#if ENABLE(CONTEXT_MENUS)
// Context Menu.
- void showContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::ArgumentDecoder*);
- void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::ArgumentDecoder*);
+ void showContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::MessageDecoder&);
+ void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::MessageDecoder&);
#endif
// Search popup results
diff --git a/Source/WebKit2/UIProcess/WebPreferences.cpp b/Source/WebKit2/UIProcess/WebPreferences.cpp
index ca00bb963..bbc2380d1 100644
--- a/Source/WebKit2/UIProcess/WebPreferences.cpp
+++ b/Source/WebKit2/UIProcess/WebPreferences.cpp
@@ -92,6 +92,12 @@ void WebPreferences::updateDoubleValueForKey(const String& key, double value)
update(); // FIXME: Only send over the changed key and value.
}
+void WebPreferences::updateFloatValueForKey(const String& key, float value)
+{
+ platformUpdateFloatValueForKey(key, value);
+ update(); // FIXME: Only send over the changed key and value.
+}
+
#define DEFINE_PREFERENCE_GETTER_AND_SETTERS(KeyUpper, KeyLower, TypeName, Type, DefaultValue) \
void WebPreferences::set##KeyUpper(const Type& value) \
{ \
diff --git a/Source/WebKit2/UIProcess/WebPreferences.h b/Source/WebKit2/UIProcess/WebPreferences.h
index 81d9580a4..50bc0258b 100644
--- a/Source/WebKit2/UIProcess/WebPreferences.h
+++ b/Source/WebKit2/UIProcess/WebPreferences.h
@@ -92,10 +92,12 @@ private:
void updateBoolValueForKey(const String& key, bool value);
void updateUInt32ValueForKey(const String& key, uint32_t value);
void updateDoubleValueForKey(const String& key, double value);
+ void updateFloatValueForKey(const String& key, float value);
void platformUpdateStringValueForKey(const String& key, const String& value);
void platformUpdateBoolValueForKey(const String& key, bool value);
void platformUpdateUInt32ValueForKey(const String& key, uint32_t value);
void platformUpdateDoubleValueForKey(const String& key, double value);
+ void platformUpdateFloatValueForKey(const String& key, float value);
HashSet<WebPageGroup*> m_pageGroups;
WebPreferencesStore m_store;
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.cpp b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
index b88323830..f75616563 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
@@ -45,6 +45,10 @@
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessManager.h"
+#endif
+
#if PLATFORM(MAC)
#include "SimplePDFPlugin.h"
#if ENABLE(PDFKIT_PLUGIN)
@@ -72,11 +76,13 @@ static uint64_t generatePageID()
return uniquePageID++;
}
+#if ENABLE(NETSCAPE_PLUGIN_API)
static WorkQueue& pluginWorkQueue()
{
DEFINE_STATIC_LOCAL(WorkQueue, queue, ("com.apple.CoreIPC.PluginQueue"));
return queue;
}
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
PassRefPtr<WebProcessProxy> WebProcessProxy::create(PassRefPtr<WebContext> context)
{
@@ -309,6 +315,7 @@ void WebProcessProxy::addBackForwardItem(uint64_t itemID, const String& original
result.iterator->value->setBackForwardData(backForwardData.data(), backForwardData.size());
}
+#if ENABLE(NETSCAPE_PLUGIN_API)
void WebProcessProxy::sendDidGetPlugins(uint64_t requestID, PassOwnPtr<Vector<PluginInfo> > pluginInfos)
{
ASSERT(isMainThread());
@@ -336,9 +343,11 @@ void WebProcessProxy::handleGetPlugins(uint64_t requestID, bool refresh)
OwnPtr<Vector<PluginInfo> > pluginInfos = adoptPtr(new Vector<PluginInfo>);
- Vector<PluginModuleInfo> plugins = m_context->pluginInfoStore().plugins();
- for (size_t i = 0; i < plugins.size(); ++i)
- pluginInfos->append(plugins[i].info);
+ {
+ Vector<PluginModuleInfo> plugins = m_context->pluginInfoStore().plugins();
+ for (size_t i = 0; i < plugins.size(); ++i)
+ pluginInfos->append(plugins[i].info);
+ }
// NOTE: We have to pass the PluginInfo vector to the secondary thread via a pointer as otherwise
// we'd end up with a deref() race on all the WTF::Strings it contains.
@@ -368,6 +377,7 @@ void WebProcessProxy::getPluginPath(const String& mimeType, const String& urlStr
pluginPath = plugin.path;
}
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
#if ENABLE(PLUGIN_PROCESS)
@@ -376,7 +386,7 @@ void WebProcessProxy::getPluginProcessConnection(const String& pluginPath, PassR
PluginProcessManager::shared().getPluginProcessConnection(m_context->pluginInfoStore(), pluginPath, reply);
}
-#else
+#elif ENABLE(NETSCAPE_PLUGIN_API)
void WebProcessProxy::didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID)
{
@@ -390,22 +400,31 @@ void WebProcessProxy::didClearPluginSiteData(uint64_t callbackID)
#endif
+#if ENABLE(SHARED_WORKER_PROCESS)
void WebProcessProxy::getSharedWorkerProcessConnection(const String& /* url */, const String& /* name */, PassRefPtr<Messages::WebProcessProxy::GetSharedWorkerProcessConnection::DelayedReply>)
{
// FIXME: Implement
}
+#endif // ENABLE(SHARED_WORKER_PROCESS)
+
+#if ENABLE(NETWORK_PROCESS)
+void WebProcessProxy::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
+{
+ NetworkProcessManager::shared().getNetworkProcessConnection(reply);
+}
+#endif // ENABLE(NETWORK_PROCESS)
-void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- if (m_context->dispatchMessage(connection, messageID, arguments))
+ if (m_context->dispatchMessage(connection, messageID, decoder))
return;
if (messageID.is<CoreIPC::MessageClassWebProcessProxy>()) {
- didReceiveWebProcessProxyMessage(connection, messageID, arguments);
+ didReceiveWebProcessProxyMessage(connection, messageID, decoder);
return;
}
- uint64_t pageID = arguments->destinationID();
+ uint64_t pageID = decoder.destinationID();
if (!pageID)
return;
@@ -413,20 +432,20 @@ void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC
if (!pageProxy)
return;
- pageProxy->didReceiveMessage(connection, messageID, arguments);
+ pageProxy->didReceiveMessage(connection, messageID, decoder);
}
-void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- if (m_context->dispatchSyncMessage(connection, messageID, arguments, reply))
+ if (m_context->dispatchSyncMessage(connection, messageID, decoder, replyEncoder))
return;
if (messageID.is<CoreIPC::MessageClassWebProcessProxy>()) {
- didReceiveSyncWebProcessProxyMessage(connection, messageID, arguments, reply);
+ didReceiveSyncWebProcessProxyMessage(connection, messageID, decoder, replyEncoder);
return;
}
- uint64_t pageID = arguments->destinationID();
+ uint64_t pageID = decoder.destinationID();
if (!pageID)
return;
@@ -434,13 +453,13 @@ void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, Cor
if (!pageProxy)
return;
- pageProxy->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ pageProxy->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
}
-void WebProcessProxy::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)
+void WebProcessProxy::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, bool& didHandleMessage)
{
if (messageID.is<CoreIPC::MessageClassWebProcessProxy>())
- didReceiveWebProcessProxyMessageOnConnectionWorkQueue(connection, messageID, arguments, didHandleMessage);
+ didReceiveWebProcessProxyMessageOnConnectionWorkQueue(connection, messageID, decoder, didHandleMessage);
}
void WebProcessProxy::didClose(CoreIPC::Connection*)
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.h b/Source/WebKit2/UIProcess/WebProcessProxy.h
index 7524df2ff..29dc5498f 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.h
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.h
@@ -141,19 +141,24 @@ private:
void shouldTerminate(bool& shouldTerminate);
// Plugins
+#if ENABLE(NETSCAPE_PLUGIN_API)
void getPlugins(CoreIPC::Connection*, uint64_t requestID, bool refresh);
void getPluginPath(const String& mimeType, const String& urlString, String& pluginPath, bool& blocked);
+ void handleGetPlugins(uint64_t requestID, bool refresh);
+ void sendDidGetPlugins(uint64_t requestID, PassOwnPtr<Vector<WebCore::PluginInfo> >);
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
#if ENABLE(PLUGIN_PROCESS)
void getPluginProcessConnection(const String& pluginPath, PassRefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>);
-#else
+#elif ENABLE(NETSCAPE_PLUGIN_API)
void didGetSitesWithPluginData(const Vector<String>& sites, uint64_t callbackID);
void didClearPluginSiteData(uint64_t callbackID);
#endif
-
- void handleGetPlugins(uint64_t requestID, bool refresh);
- void sendDidGetPlugins(uint64_t requestID, PassOwnPtr<Vector<WebCore::PluginInfo> >);
-
+#if ENABLE(NETWORK_PROCESS)
+ void getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>);
+#endif
+#if ENABLE(SHARED_WORKER_PROCESS)
void getSharedWorkerProcessConnection(const String& url, const String& name, PassRefPtr<Messages::WebProcessProxy::GetSharedWorkerProcessConnection::DelayedReply>);
+#endif
#if USE(SECURITY_FRAMEWORK)
void secItemRequest(CoreIPC::Connection*, uint64_t requestID, const SecItemRequestData&);
@@ -162,8 +167,8 @@ private:
// CoreIPC::Connection::Client
friend class WebConnectionToWebProcess;
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
#if PLATFORM(WIN)
@@ -171,7 +176,7 @@ private:
#endif
// CoreIPC::Connection::QueueClient
- virtual void didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, bool& didHandleMessage);
+ virtual void didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, bool& didHandleMessage) OVERRIDE;
// ResponsivenessTimer::Client
void didBecomeUnresponsive(ResponsivenessTimer*) OVERRIDE;
@@ -190,9 +195,9 @@ private:
void didUpdateHistoryTitle(uint64_t pageID, const String& title, const String& url, uint64_t frameID);
// Implemented in generated WebProcessProxyMessageReceiver.cpp
- void didReceiveWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
- void didReceiveWebProcessProxyMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage);
+ void didReceiveWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
+ void didReceiveWebProcessProxyMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, bool& didHandleMessage);
ResponsivenessTimer m_responsivenessTimer;
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.messages.in b/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
index 67e7b2dde..e72138893 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
@@ -34,16 +34,23 @@ messages -> WebProcessProxy {
ShouldTerminate() -> (bool shouldTerminate)
# Plugin messages.
+#if ENABLE(NETSCAPE_PLUGIN_API)
GetPlugins(uint64_t requestID, bool refresh) DispatchOnConnectionQueue
GetPluginPath(WTF::String mimeType, WTF::String urlString) -> (WTF::String pluginPath, bool blocked)
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
#if ENABLE(PLUGIN_PROCESS)
GetPluginProcessConnection(WTF::String pluginPath) -> (CoreIPC::Attachment connectionHandle, bool supportsAsynchronousInitialization) Delayed
#endif
-#if !ENABLE(PLUGIN_PROCESS)
+#if ENABLE(NETSCAPE_PLUGIN_API) && !ENABLE(PLUGIN_PROCESS)
void DidGetSitesWithPluginData(Vector<WTF::String> sites, uint64_t callbackID)
void DidClearPluginSiteData(uint64_t callbackID)
#endif
+#if ENABLE(NETWORK_PROCESS)
+ GetNetworkProcessConnection() -> (CoreIPC::Attachment connectionHandle) Delayed
+#endif
+#if ENABLE(SHARED_WORKER_PROCESS)
GetSharedWorkerProcessConnection(WTF::String url, WTF::String name) -> (CoreIPC::Attachment connectionHandle) Delayed
+#endif
#if USE(SECURITY_FRAMEWORK)
SecItemRequest(uint64_t requestID, WebKit::SecItemRequestData request) DispatchOnConnectionQueue
diff --git a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
index 3c2980797..fcb056db0 100644
--- a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
@@ -45,7 +45,7 @@ PassRefPtr<WebResourceCacheManagerProxy> WebResourceCacheManagerProxy::create(We
WebResourceCacheManagerProxy::WebResourceCacheManagerProxy(WebContext* webContext)
: m_webContext(webContext)
{
- m_webContext->addMessageReceiver(CoreIPC::MessageClassWebResourceCacheManagerProxy, this);
+ m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebResourceCacheManagerProxy, this);
}
WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy()
@@ -95,9 +95,9 @@ void WebResourceCacheManagerProxy::clearCacheForAllOrigins(ResourceCachesToClear
m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForAllOrigins(cachesToClear));
}
-void WebResourceCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebResourceCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebResourceCacheManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebResourceCacheManagerProxyMessage(connection, messageID, decoder);
}
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h
index 9e59b641f..1c620707b 100644
--- a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h
+++ b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h
@@ -65,8 +65,8 @@ private:
virtual Type type() const { return APIType; }
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- void didReceiveWebResourceCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ void didReceiveWebResourceCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
// Message handlers.
void didGetCacheOrigins(const Vector<SecurityOriginData>& originIdentifiers, uint64_t callbackID);
diff --git a/Source/WebKit2/UIProcess/WebVibrationProxy.cpp b/Source/WebKit2/UIProcess/WebVibrationProxy.cpp
index 0590f30cc..6b0717c18 100644
--- a/Source/WebKit2/UIProcess/WebVibrationProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebVibrationProxy.cpp
@@ -40,7 +40,7 @@ PassRefPtr<WebVibrationProxy> WebVibrationProxy::create(WebContext* context)
WebVibrationProxy::WebVibrationProxy(WebContext* context)
: m_context(context)
{
- m_context->addMessageReceiver(CoreIPC::MessageClassWebVibrationProxy, this);
+ m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebVibrationProxy, this);
}
WebVibrationProxy::~WebVibrationProxy()
@@ -57,9 +57,9 @@ void WebVibrationProxy::initializeProvider(const WKVibrationProvider* provider)
m_provider.initialize(provider);
}
-void WebVibrationProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebVibrationProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebVibrationProxyMessage(connection, messageID, arguments);
+ didReceiveWebVibrationProxyMessage(connection, messageID, decoder);
}
void WebVibrationProxy::vibrate(uint64_t vibrationTime)
diff --git a/Source/WebKit2/UIProcess/WebVibrationProxy.h b/Source/WebKit2/UIProcess/WebVibrationProxy.h
index 676d3a497..5c6de17d7 100644
--- a/Source/WebKit2/UIProcess/WebVibrationProxy.h
+++ b/Source/WebKit2/UIProcess/WebVibrationProxy.h
@@ -55,10 +55,10 @@ private:
virtual Type type() const { return APIType; }
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
// Implemented in generated WebVibrationProxyMessageReceiver.cpp
- void didReceiveWebVibrationProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebVibrationProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void vibrate(uint64_t vibrationTime);
void cancelVibration();
diff --git a/Source/WebKit2/UIProcess/cf/WebPreferencesCF.cpp b/Source/WebKit2/UIProcess/cf/WebPreferencesCF.cpp
index 5f6ca9d27..d61b98c60 100644
--- a/Source/WebKit2/UIProcess/cf/WebPreferencesCF.cpp
+++ b/Source/WebKit2/UIProcess/cf/WebPreferencesCF.cpp
@@ -141,6 +141,15 @@ void WebPreferences::platformUpdateDoubleValueForKey(const String& key, double v
CFPreferencesSetAppValue(makeKey(m_identifier, key).get(), number.get(), kCFPreferencesCurrentApplication);
}
+void WebPreferences::platformUpdateFloatValueForKey(const String& key, float value)
+{
+ if (!m_identifier)
+ return;
+
+ RetainPtr<CFNumberRef> number(AdoptCF, CFNumberCreate(0, kCFNumberFloatType, &value));
+ CFPreferencesSetAppValue(makeKey(m_identifier, key).get(), number.get(), kCFPreferencesCurrentApplication);
+}
+
} // namespace WebKit
#endif // !PLATFORM(MAC)
diff --git a/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp
index a24dc3430..ffd6aa5f9 100644
--- a/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp
@@ -133,9 +133,13 @@ bool WebInspectorProxy::platformIsFront()
return false;
}
-void WebInspectorProxy::platformInspectedURLChanged(const String&)
+void WebInspectorProxy::platformInspectedURLChanged(const String& url)
{
- notImplemented();
+ if (!m_inspectorWindow)
+ return;
+
+ String title = "WebInspector - " + url;
+ ecore_evas_title_set(m_inspectorWindow, title.utf8().data());
}
String WebInspectorProxy::inspectorPageURL() const
@@ -149,11 +153,11 @@ String WebInspectorProxy::inspectorPageURL() const
String WebInspectorProxy::inspectorBaseURL() const
{
- String inspectorFilesPath = ASCIILiteral("file://" WEB_INSPECTOR_INSTALL_DIR);
+ String inspectorFilesPath = WEB_INSPECTOR_INSTALL_DIR;
if (access(inspectorFilesPath.utf8().data(), R_OK))
- inspectorFilesPath = ASCIILiteral("file://" WEB_INSPECTOR_DIR);
+ inspectorFilesPath = WEB_INSPECTOR_DIR;
- return inspectorFilesPath;
+ return "file://" + inspectorFilesPath;
}
unsigned WebInspectorProxy::platformInspectedWindowHeight()
diff --git a/Source/WebKit2/UIProcess/efl/WebPreferencesEfl.cpp b/Source/WebKit2/UIProcess/efl/WebPreferencesEfl.cpp
index b49ad2998..dd2108452 100644
--- a/Source/WebKit2/UIProcess/efl/WebPreferencesEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebPreferencesEfl.cpp
@@ -55,4 +55,9 @@ void WebPreferences::platformUpdateDoubleValueForKey(const String&, double)
notImplemented();
}
+void WebPreferences::platformUpdateFloatValueForKey(const String&, float)
+{
+ notImplemented();
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp b/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp
index c69820416..321a9cfcc 100644
--- a/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp
+++ b/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp
@@ -56,4 +56,9 @@ void WebPreferences::platformUpdateDoubleValueForKey(const String&, double)
notImplemented();
}
+void WebPreferences::platformUpdateFloatValueForKey(const String&, float)
+{
+ notImplemented();
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/mac/WebPreferencesMac.mm b/Source/WebKit2/UIProcess/mac/WebPreferencesMac.mm
index 6fd41d389..f19a6c708 100644
--- a/Source/WebKit2/UIProcess/mac/WebPreferencesMac.mm
+++ b/Source/WebKit2/UIProcess/mac/WebPreferencesMac.mm
@@ -125,4 +125,12 @@ void WebPreferences::platformUpdateDoubleValueForKey(const String& key, double v
[[NSUserDefaults standardUserDefaults] setDouble:value forKey:makeKey(m_identifier, key)];
}
+void WebPreferences::platformUpdateFloatValueForKey(const String& key, float value)
+{
+ if (!m_identifier)
+ return;
+
+ [[NSUserDefaults standardUserDefaults] setFloat:value forKey:makeKey(m_identifier, key)];
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp b/Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp
index d8f1c7801..35dc7ebb9 100644
--- a/Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp
+++ b/Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp
@@ -76,4 +76,8 @@ void WebPreferences::platformUpdateDoubleValueForKey(const String&, double)
{
}
+void WebPreferences::platformUpdateFloatValueForKey(const String&, float)
+{
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp b/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp
index e2bf3423d..679be2bed 100644
--- a/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp
@@ -35,7 +35,7 @@ WebSoupRequestManagerProxy::WebSoupRequestManagerProxy(WebContext* context)
: m_webContext(context)
, m_loadFailed(false)
{
- m_webContext->addMessageReceiver(CoreIPC::MessageClassWebSoupRequestManagerProxy, this);
+ m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebSoupRequestManagerProxy, this);
}
WebSoupRequestManagerProxy::~WebSoupRequestManagerProxy()
@@ -51,9 +51,9 @@ void WebSoupRequestManagerProxy::initializeClient(const WKSoupRequestManagerClie
m_client.initialize(client);
}
-void WebSoupRequestManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebSoupRequestManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebSoupRequestManagerProxyMessage(connection, messageID, arguments);
+ didReceiveWebSoupRequestManagerProxyMessage(connection, messageID, decoder);
}
void WebSoupRequestManagerProxy::registerURIScheme(const String& scheme)
diff --git a/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.h b/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.h
index 6a3d6e826..e4b8cce37 100644
--- a/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.h
+++ b/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.h
@@ -57,8 +57,8 @@ private:
virtual Type type() const { return APIType; }
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- void didReceiveWebSoupRequestManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ void didReceiveWebSoupRequestManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
WebContext* m_webContext;
WebSoupRequestManagerClient m_client;
diff --git a/Source/WebKit2/WebKit2.pri b/Source/WebKit2/WebKit2.pri
index 536b779ba..80cb2fb8e 100644
--- a/Source/WebKit2/WebKit2.pri
+++ b/Source/WebKit2/WebKit2.pri
@@ -16,6 +16,7 @@ INCLUDEPATH += \
$$SOURCE_DIR/Platform/qt \
$$SOURCE_DIR/Shared \
$$SOURCE_DIR/Shared/API/c \
+ $$SOURCE_DIR/Shared/CoordinatedGraphics \
$$SOURCE_DIR/Shared/CoreIPCSupport \
$$SOURCE_DIR/Shared/Plugins \
$$SOURCE_DIR/Shared/Plugins/Netscape \
diff --git a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
index f2d3b4d77..6c87cde72 100644
--- a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -348,6 +348,8 @@
3F87B9C0158940D80090FF62 /* WebColorChooserProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F87B9BF158940D80090FF62 /* WebColorChooserProxy.h */; };
4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F601430155C5A32001FBDE0 /* BlockingResponseMap.h */; };
51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */; };
+ 5105B0DD162F7E9D00E27709 /* NetworkProcessManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5105B0DB162F7E9D00E27709 /* NetworkProcessManager.cpp */; };
+ 5105B0DE162F7E9D00E27709 /* NetworkProcessManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5105B0DC162F7E9D00E27709 /* NetworkProcessManager.h */; };
510CC8491613C85C00D03ED3 /* NetworkProcess.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 510CC80E1613C79900D03ED3 /* NetworkProcess.app */; };
510CC84F1613C92C00D03ED3 /* MainMacProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FA31011E3921E00DB1371 /* MainMacProcess.cpp */; };
510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */; };
@@ -406,6 +408,12 @@
512F58FA12A88A5400629530 /* WKCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F58F212A88A5400629530 /* WKCredential.h */; settings = {ATTRIBUTES = (Private, ); }; };
512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F58F312A88A5400629530 /* WKProtectionSpace.cpp */; };
512F58FC12A88A5400629530 /* WKProtectionSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F58F412A88A5400629530 /* WKProtectionSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 5136183D163126DA00A99DDE /* ConnectionStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5136183B163126DA00A99DDE /* ConnectionStack.cpp */; };
+ 5136183E163126DA00A99DDE /* ConnectionStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 5136183C163126DA00A99DDE /* ConnectionStack.h */; };
+ 513A163C163088F6005D7D22 /* NetworkProcessProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 513A163A163088F6005D7D22 /* NetworkProcessProxyMessageReceiver.cpp */; };
+ 513A163D163088F6005D7D22 /* NetworkProcessProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 513A163B163088F6005D7D22 /* NetworkProcessProxyMessages.h */; };
+ 513A164C1630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 513A16491630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp */; };
+ 513A164D1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 513A164A1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h */; };
5153569C1291B1D2000749DC /* WebPageContextMenuClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5153569A1291B1D2000749DC /* WebPageContextMenuClient.cpp */; };
5153569D1291B1D2000749DC /* WebPageContextMenuClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5153569B1291B1D2000749DC /* WebPageContextMenuClient.h */; };
51578B831209ECEF00A37C4A /* WebData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51578B821209ECEF00A37C4A /* WebData.h */; };
@@ -426,6 +434,7 @@
51834592134532E90092B696 /* WebIconDatabaseClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51834590134532E80092B696 /* WebIconDatabaseClient.cpp */; };
51834593134532E90092B696 /* WebIconDatabaseClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51834591134532E80092B696 /* WebIconDatabaseClient.h */; };
5183B3921379F7B800E8754E /* WebProcessShim.dylib in Copy Web Process Shim */ = {isa = PBXBuildFile; fileRef = 510031F61379CACB00C8DFE4 /* WebProcessShim.dylib */; };
+ 5183DDEC1630BDFC008BE5C7 /* NetworkProcessConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5105B0D4162F7A7A00E27709 /* NetworkProcessConnection.cpp */; };
51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51871B59127CB89D00F76232 /* WebContextMenu.cpp */; };
51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 51871B5A127CB89D00F76232 /* WebContextMenu.h */; };
518ACAEA12AEE6BB00B04B83 /* WKProtectionSpaceTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1503,6 +1512,11 @@
4F601430155C5A32001FBDE0 /* BlockingResponseMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockingResponseMap.h; sourceTree = "<group>"; };
510031F61379CACB00C8DFE4 /* WebProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = WebProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClientMac.mm; sourceTree = "<group>"; };
+ 5105B0D4162F7A7A00E27709 /* NetworkProcessConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessConnection.cpp; path = Network/NetworkProcessConnection.cpp; sourceTree = "<group>"; };
+ 5105B0D5162F7A7A00E27709 /* NetworkProcessConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessConnection.h; path = Network/NetworkProcessConnection.h; sourceTree = "<group>"; };
+ 5105B0DB162F7E9D00E27709 /* NetworkProcessManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkProcessManager.cpp; sourceTree = "<group>"; };
+ 5105B0DC162F7E9D00E27709 /* NetworkProcessManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkProcessManager.h; sourceTree = "<group>"; };
+ 5105B0F31630872E00E27709 /* NetworkProcessProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = NetworkProcessProxy.messages.in; sourceTree = "<group>"; };
510CC7DD16138E2900D03ED3 /* NetworkProcessMainMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkProcessMainMac.mm; sourceTree = "<group>"; };
510CC7DF16138E2900D03ED3 /* NetworkProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcess.cpp; path = NetworkProcess/NetworkProcess.cpp; sourceTree = "<group>"; };
510CC7E016138E2900D03ED3 /* NetworkProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcess.h; path = NetworkProcess/NetworkProcess.h; sourceTree = "<group>"; };
@@ -1569,6 +1583,13 @@
512F58F212A88A5400629530 /* WKCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKCredential.h; sourceTree = "<group>"; };
512F58F312A88A5400629530 /* WKProtectionSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKProtectionSpace.cpp; sourceTree = "<group>"; };
512F58F412A88A5400629530 /* WKProtectionSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProtectionSpace.h; sourceTree = "<group>"; };
+ 5136183B163126DA00A99DDE /* ConnectionStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConnectionStack.cpp; sourceTree = "<group>"; };
+ 5136183C163126DA00A99DDE /* ConnectionStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectionStack.h; sourceTree = "<group>"; };
+ 513A163A163088F6005D7D22 /* NetworkProcessProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkProcessProxyMessageReceiver.cpp; sourceTree = "<group>"; };
+ 513A163B163088F6005D7D22 /* NetworkProcessProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkProcessProxyMessages.h; sourceTree = "<group>"; };
+ 513A16491630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkConnectionToWebProcess.cpp; path = NetworkProcess/NetworkConnectionToWebProcess.cpp; sourceTree = "<group>"; };
+ 513A164A1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkConnectionToWebProcess.h; path = NetworkProcess/NetworkConnectionToWebProcess.h; sourceTree = "<group>"; };
+ 513A164B1630A9BF005D7D22 /* NetworkConnectionToWebProcess.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NetworkConnectionToWebProcess.messages.in; path = NetworkProcess/NetworkConnectionToWebProcess.messages.in; sourceTree = "<group>"; };
5153569A1291B1D2000749DC /* WebPageContextMenuClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageContextMenuClient.cpp; sourceTree = "<group>"; };
5153569B1291B1D2000749DC /* WebPageContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageContextMenuClient.h; sourceTree = "<group>"; };
51578B821209ECEF00A37C4A /* WebData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebData.h; sourceTree = "<group>"; };
@@ -2611,6 +2632,8 @@
1A2D956E12848564001EB962 /* ChildProcess.cpp */,
1A2D956D12848564001EB962 /* ChildProcess.h */,
1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */,
+ 5136183B163126DA00A99DDE /* ConnectionStack.cpp */,
+ 5136183C163126DA00A99DDE /* ConnectionStack.h */,
BCE81D96131AE02000241910 /* DictionaryPopupInfo.cpp */,
BCE81D97131AE02100241910 /* DictionaryPopupInfo.h */,
C517388012DF8F4F00EE3F47 /* DragControllerAction.h */,
@@ -2918,10 +2941,22 @@
name = cf;
sourceTree = "<group>";
};
+ 5105B0D2162F7A5E00E27709 /* Network */ = {
+ isa = PBXGroup;
+ children = (
+ 5105B0D4162F7A7A00E27709 /* NetworkProcessConnection.cpp */,
+ 5105B0D5162F7A7A00E27709 /* NetworkProcessConnection.h */,
+ );
+ name = Network;
+ sourceTree = "<group>";
+ };
510CC7DA16138E0100D03ED3 /* NetworkProcess */ = {
isa = PBXGroup;
children = (
510CC7DC16138E2900D03ED3 /* mac */,
+ 513A16491630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp */,
+ 513A164A1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h */,
+ 513A164B1630A9BF005D7D22 /* NetworkConnectionToWebProcess.messages.in */,
510CC7DF16138E2900D03ED3 /* NetworkProcess.cpp */,
510CC7E016138E2900D03ED3 /* NetworkProcess.h */,
51A8A6171627F5BB000D90E9 /* NetworkProcess.messages.in */,
@@ -2944,8 +2979,11 @@
isa = PBXGroup;
children = (
516319931628980E00E22F00 /* mac */,
+ 5105B0DB162F7E9D00E27709 /* NetworkProcessManager.cpp */,
+ 5105B0DC162F7E9D00E27709 /* NetworkProcessManager.h */,
510CC7EA16138E7200D03ED3 /* NetworkProcessProxy.cpp */,
510CC7EB16138E7200D03ED3 /* NetworkProcessProxy.h */,
+ 5105B0F31630872E00E27709 /* NetworkProcessProxy.messages.in */,
);
path = Network;
sourceTree = "<group>";
@@ -3112,6 +3150,7 @@
51A9E0FB1315CC0E009E7031 /* KeyValueStorage */,
1A6FA01C11E1526300DB1371 /* mac */,
33D3A3BD1339609800709BE4 /* MediaCache */,
+ 5105B0D2162F7A5E00E27709 /* Network */,
31099974146C8AA80029DEB9 /* Notifications (User) */,
1A6FB7AA11E64B4900DB1371 /* Plugins */,
3336762B130C9978006C9DE2 /* ResourceCache */,
@@ -4001,6 +4040,8 @@
1AA576001496B7C000A4EE06 /* EventDispatcherMessages.h */,
51ACC9341628064800342550 /* NetworkProcessMessageReceiver.cpp */,
51ACC9351628064800342550 /* NetworkProcessMessages.h */,
+ 513A163A163088F6005D7D22 /* NetworkProcessProxyMessageReceiver.cpp */,
+ 513A163B163088F6005D7D22 /* NetworkProcessProxyMessages.h */,
1A2D8437127F65D5001EB962 /* NPObjectMessageReceiverMessageReceiver.cpp */,
1A2D8438127F65D5001EB962 /* NPObjectMessageReceiverMessages.h */,
1A8EF96C1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp */,
@@ -4691,6 +4732,10 @@
29501724162A4504004A9D71 /* WKWebProcessPlugInBrowserContextControllerPrivate.h in Headers */,
1A2328FF162C866A00D82F7A /* MessageEncoder.h in Headers */,
1A232903162C867300D82F7A /* MessageDecoder.h in Headers */,
+ 5136183E163126DA00A99DDE /* ConnectionStack.h in Headers */,
+ 5105B0DE162F7E9D00E27709 /* NetworkProcessManager.h in Headers */,
+ 513A163D163088F6005D7D22 /* NetworkProcessProxyMessages.h in Headers */,
+ 513A164D1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5636,6 +5681,11 @@
E1EDFE151628DD7A0039ECDA /* SharedWorkerProcessProxy.cpp in Sources */,
1A2328FE162C866A00D82F7A /* MessageEncoder.cpp in Sources */,
1A232902162C867300D82F7A /* MessageDecoder.cpp in Sources */,
+ 5136183D163126DA00A99DDE /* ConnectionStack.cpp in Sources */,
+ 5105B0DD162F7E9D00E27709 /* NetworkProcessManager.cpp in Sources */,
+ 513A163C163088F6005D7D22 /* NetworkProcessProxyMessageReceiver.cpp in Sources */,
+ 513A164C1630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp in Sources */,
+ 5183DDEC1630BDFC008BE5C7 /* NetworkProcessConnection.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebKit2/WebKit2Prefix.h b/Source/WebKit2/WebKit2Prefix.h
index b57e00039..8f6b099f1 100644
--- a/Source/WebKit2/WebKit2Prefix.h
+++ b/Source/WebKit2/WebKit2Prefix.h
@@ -57,7 +57,13 @@
#endif // PLATFORM(MAC)
-#if !PLATFORM(WIN)
+#if PLATFORM(MAC)
+
+#if ENABLE(PLUGIN_PROCESS)
+#define ENABLE_SHARED_WORKER_PROCESS 1
+#endif
+
+#elif !PLATFORM(WIN)
#define ENABLE_SHARED_WORKER_PROCESS 1
#endif
diff --git a/Source/WebKit2/WebProcess.pro b/Source/WebKit2/WebProcess.pro
index 5eba7ac42..fd766c17d 100644
--- a/Source/WebKit2/WebProcess.pro
+++ b/Source/WebKit2/WebProcess.pro
@@ -11,13 +11,10 @@ DESTDIR = $${ROOT_BUILD_DIR}/bin
SOURCES += qt/MainQt.cpp
-QT += network webkitwidgets widgets
+QT += network webkitwidgets
macx: QT += xml
-contains(QT_CONFIG, opengl) {
- QT += opengl
- DEFINES += QT_CONFIGURED_WITH_OPENGL
-}
+haveQtModule(widgets): QT += widgets
INSTALLS += target
diff --git a/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp b/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp
index 9c1ad8798..0bdfb0132 100644
--- a/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp
+++ b/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp
@@ -49,9 +49,9 @@ WebApplicationCacheManager::WebApplicationCacheManager()
{
}
-void WebApplicationCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebApplicationCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebApplicationCacheManagerMessage(connection, messageID, arguments);
+ didReceiveWebApplicationCacheManagerMessage(connection, messageID, decoder);
}
void WebApplicationCacheManager::getApplicationCacheOrigins(uint64_t callbackID)
diff --git a/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h b/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h
index 38d48e119..3258469ba 100644
--- a/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h
+++ b/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h
@@ -30,9 +30,9 @@
#include <wtf/text/WTFString.h>
namespace CoreIPC {
- class ArgumentDecoder;
- class Connection;
- class MessageID;
+class Connection;
+class MessageDecoder;
+class MessageID;
}
namespace WebKit {
@@ -45,7 +45,7 @@ class WebApplicationCacheManager {
public:
static WebApplicationCacheManager& shared();
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void deleteAllEntries();
void setAppCacheMaximumSize(uint64_t);
@@ -55,7 +55,7 @@ private:
void getApplicationCacheOrigins(uint64_t callbackID);
void deleteEntriesForOrigin(const SecurityOriginData&);
- void didReceiveWebApplicationCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebApplicationCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp b/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp
index a6858ac28..f5d8e62f4 100644
--- a/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp
+++ b/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp
@@ -55,12 +55,12 @@ AuthenticationManager& AuthenticationManager::shared()
AuthenticationManager::AuthenticationManager()
{
- WebProcess::shared().connection()->addMessageReceiver(CoreIPC::MessageClassAuthenticationManager, this);
+ WebProcess::shared().connection()->deprecatedAddMessageReceiver(CoreIPC::MessageClassAuthenticationManager, this);
}
-void AuthenticationManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void AuthenticationManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveAuthenticationManagerMessage(connection, messageID, arguments);
+ didReceiveAuthenticationManagerMessage(connection, messageID, decoder);
}
void AuthenticationManager::didReceiveAuthenticationChallenge(WebFrame* frame, const AuthenticationChallenge& authenticationChallenge)
diff --git a/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h b/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h
index 93afe446b..16708ce6b 100644
--- a/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h
+++ b/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h
@@ -63,8 +63,8 @@ private:
AuthenticationManager();
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
- void didReceiveAuthenticationManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ void didReceiveAuthenticationManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
bool tryUsePlatformCertificateInfoForChallenge(const WebCore::AuthenticationChallenge&, const PlatformCertificateInfo&);
diff --git a/Source/WebKit2/WebProcess/Battery/WebBatteryManager.cpp b/Source/WebKit2/WebProcess/Battery/WebBatteryManager.cpp
index 04dec8640..0892f2178 100644
--- a/Source/WebKit2/WebProcess/Battery/WebBatteryManager.cpp
+++ b/Source/WebKit2/WebProcess/Battery/WebBatteryManager.cpp
@@ -48,9 +48,9 @@ WebBatteryManager::~WebBatteryManager()
{
}
-void WebBatteryManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebBatteryManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebBatteryManagerMessage(connection, messageID, arguments);
+ didReceiveWebBatteryManagerMessage(connection, messageID, decoder);
}
void WebBatteryManager::registerWebPage(WebPage* page)
diff --git a/Source/WebKit2/WebProcess/Battery/WebBatteryManager.h b/Source/WebKit2/WebProcess/Battery/WebBatteryManager.h
index 509718d42..45fab18c1 100644
--- a/Source/WebKit2/WebProcess/Battery/WebBatteryManager.h
+++ b/Source/WebKit2/WebProcess/Battery/WebBatteryManager.h
@@ -36,8 +36,8 @@
#include <wtf/text/AtomicString.h>
namespace CoreIPC {
-class ArgumentDecoder;
class Connection;
+class MessageDecoder;
}
namespace WebKit {
@@ -58,11 +58,11 @@ public:
void didChangeBatteryStatus(const WTF::AtomicString& eventType, const WebBatteryStatus::Data&);
void updateBatteryStatus(const WebBatteryStatus::Data&);
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
private:
// Implemented in generated WebBatteryManagerMessageReceiver.cpp
- void didReceiveWebBatteryManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebBatteryManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
WebProcess* m_process;
HashSet<WebPage*> m_pageSet;
diff --git a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp
index 6f3af1d10..e5000d4ac 100644
--- a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp
+++ b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp
@@ -46,9 +46,9 @@ WebCookieManager::WebCookieManager()
{
}
-void WebCookieManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebCookieManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebCookieManagerMessage(connection, messageID, arguments);
+ didReceiveWebCookieManagerMessage(connection, messageID, decoder);
}
void WebCookieManager::getHostnamesWithCookies(uint64_t callbackID)
diff --git a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h
index cf78a114e..aac04192b 100644
--- a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h
+++ b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h
@@ -35,8 +35,8 @@
#endif
namespace CoreIPC {
- class ArgumentDecoder;
class Connection;
+ class MessageDecoder;
class MessageID;
}
@@ -47,7 +47,7 @@ class WebCookieManager {
public:
static WebCookieManager& shared();
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void dispatchCookiesDidChange();
@@ -71,7 +71,7 @@ private:
void setCookiePersistentStorage(const String& storagePath, uint32_t storageType);
#endif
- void didReceiveWebCookieManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebCookieManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
index 1c7a78db0..0323698ce 100644
--- a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
+++ b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
@@ -78,9 +78,9 @@ WebCore::Element* WebFullScreenManager::element()
return m_element.get();
}
-void WebFullScreenManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebFullScreenManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebFullScreenManagerMessage(connection, messageID, arguments);
+ didReceiveWebFullScreenManagerMessage(connection, messageID, decoder);
}
bool WebFullScreenManager::supportsFullScreen(bool withKeyboard)
diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h
index 396a4adb1..8c049225b 100644
--- a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h
+++ b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h
@@ -32,8 +32,8 @@
#include <wtf/RefPtr.h>
namespace CoreIPC {
-class ArgumentDecoder;
class Connection;
+class MessageDecoder;
class MessageID;
}
@@ -52,7 +52,7 @@ public:
static PassRefPtr<WebFullScreenManager> create(WebPage*);
virtual ~WebFullScreenManager();
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
bool supportsFullScreen(bool withKeyboard);
void enterFullScreenForElement(WebCore::Element*);
@@ -73,7 +73,7 @@ protected:
void setAnimatingFullScreen(bool);
void requestExitFullScreen();
- void didReceiveWebFullScreenManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebFullScreenManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
WebCore::IntRect m_initialFrame;
WebCore::IntRect m_finalFrame;
diff --git a/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp b/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp
index 2aec5a727..4bd627c2f 100644
--- a/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp
+++ b/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp
@@ -49,15 +49,15 @@ WebGeolocationManager::~WebGeolocationManager()
{
}
-void WebGeolocationManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebGeolocationManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebGeolocationManagerMessage(connection, messageID, arguments);
+ didReceiveWebGeolocationManagerMessage(connection, messageID, decoder);
}
void WebGeolocationManager::registerWebPage(WebPage* page)
{
if (!m_didAddMessageReceiver) {
- m_process->connection()->addMessageReceiver(CoreIPC::MessageClassWebGeolocationManager, this);
+ m_process->connection()->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebGeolocationManager, this);
m_didAddMessageReceiver = true;
}
diff --git a/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h b/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h
index 8a1405d14..6e245570d 100644
--- a/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h
+++ b/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h
@@ -55,10 +55,10 @@ public:
private:
// CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) OVERRIDE;
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
// Implemented in generated WebGeolocationManagerMessageReceiver.cpp
- void didReceiveWebGeolocationManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebGeolocationManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void didChangePosition(const WebGeolocationPosition::Data&);
void didFailToDeterminePosition(const String& errorMessage);
diff --git a/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp
index 217f1e80a..a04793eb4 100644
--- a/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp
+++ b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp
@@ -143,9 +143,9 @@ void WebIconDatabaseProxy::urlImportFinished()
{
}
-void WebIconDatabaseProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebIconDatabaseProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebIconDatabaseProxyMessage(connection, messageID, arguments);
+ didReceiveWebIconDatabaseProxyMessage(connection, messageID, decoder);
}
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h
index 2096aba4c..cd9f7176e 100644
--- a/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h
+++ b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h
@@ -36,8 +36,8 @@
#include <wtf/Vector.h>
namespace CoreIPC {
-class ArgumentDecoder;
class Connection;
+class MessageDecoder;
class MessageID;
}
@@ -70,10 +70,10 @@ public:
void receivedIconLoadDecision(int decision, uint64_t callbackID);
virtual void iconDataForIconURL(const String&, PassRefPtr<WebCore::IconDataCallback>);
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
private:
- void didReceiveWebIconDatabaseProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebIconDatabaseProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
// Callbacks from the UIProcess
void urlImportFinished();
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
index fe6d79ed8..24188fff2 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
@@ -27,6 +27,7 @@
#include "WKBundleFrame.h"
#include "WKBundleFramePrivate.h"
+#include "InjectedBundleHitTestResult.h"
#include "WKAPICast.h"
#include "WKBundleAPICast.h"
#include "WKData.h"
@@ -280,3 +281,8 @@ bool WKBundleFrameCallShouldCloseOnWebView(WKBundleFrameRef frameRef)
return coreFrame->loader()->shouldClose();
}
+
+WKBundleHitTestResultRef WKBundleFrameCreateHitTestResult(WKBundleFrameRef frameRef, WKPoint point)
+{
+ return toAPI(toImpl(frameRef)->hitTest(toIntPoint(point)).leakRef());
+}
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
index b4710445f..d2286ff89 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
@@ -55,6 +55,8 @@ WK_EXPORT bool WKBundleFrameContainsAnyFormElements(WKBundleFrameRef frame);
WK_EXPORT void WKBundleFrameSetTextDirection(WKBundleFrameRef frame, WKStringRef);
WK_EXPORT bool WKBundleFrameCallShouldCloseOnWebView(WKBundleFrameRef frame);
+WK_EXPORT WKBundleHitTestResultRef WKBundleFrameCreateHitTestResult(WKBundleFrameRef frame, WKPoint point);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp b/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp
index 1137bae21..2fdf4ed5a 100644
--- a/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp
+++ b/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp
@@ -49,9 +49,9 @@ WebKeyValueStorageManager::WebKeyValueStorageManager()
{
}
-void WebKeyValueStorageManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebKeyValueStorageManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebKeyValueStorageManagerMessage(connection, messageID, arguments);
+ didReceiveWebKeyValueStorageManagerMessage(connection, messageID, decoder);
}
static void keyValueStorageOriginIdentifiers(Vector<SecurityOriginData>& identifiers)
diff --git a/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h b/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h
index e8de0adc2..72a44c126 100644
--- a/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h
+++ b/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h
@@ -31,9 +31,9 @@
#include <wtf/text/WTFString.h>
namespace CoreIPC {
- class ArgumentDecoder;
- class Connection;
- class MessageID;
+class Connection;
+class MessageDecoder;
+class MessageID;
}
namespace WebKit {
@@ -46,7 +46,7 @@ class WebKeyValueStorageManager : public WebCore::StorageTrackerClient {
public:
static WebKeyValueStorageManager& shared();
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
private:
WebKeyValueStorageManager();
@@ -59,7 +59,7 @@ private:
virtual void dispatchDidModifyOrigin(const String&) OVERRIDE;
virtual void didFinishLoadingOrigins() OVERRIDE;
- void didReceiveWebKeyValueStorageManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebKeyValueStorageManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
Vector<uint64_t> m_originsRequestCallbackIDs;
bool m_originsLoaded;
diff --git a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp
index 4a5d7f95e..b09d6414d 100644
--- a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp
+++ b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp
@@ -46,9 +46,9 @@ WebMediaCacheManager::WebMediaCacheManager()
{
}
-void WebMediaCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebMediaCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebMediaCacheManagerMessage(connection, messageID, arguments);
+ didReceiveWebMediaCacheManagerMessage(connection, messageID, decoder);
}
void WebMediaCacheManager::getHostnamesWithMediaCache(uint64_t callbackID)
diff --git a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h
index 909be97ba..fc62be4ad 100644
--- a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h
+++ b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h
@@ -30,9 +30,9 @@
#include <wtf/text/WTFString.h>
namespace CoreIPC {
- class ArgumentDecoder;
- class Connection;
- class MessageID;
+class Connection;
+class MessageDecoder;
+class MessageID;
}
namespace WebKit {
@@ -43,7 +43,7 @@ class WebMediaCacheManager {
public:
static WebMediaCacheManager& shared();
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
private:
WebMediaCacheManager();
@@ -52,7 +52,7 @@ private:
void clearCacheForHostname(const String&);
void clearCacheForAllHostnames();
- void didReceiveWebMediaCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebMediaCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp b/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp
new file mode 100644
index 000000000..dd9d6cbbc
--- /dev/null
+++ b/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NetworkProcessConnection.h"
+
+#include "WebProcess.h"
+
+#if ENABLE(NETWORK_PROCESS)
+
+namespace WebKit {
+
+NetworkProcessConnection::NetworkProcessConnection(CoreIPC::Connection::Identifier connectionIdentifier)
+{
+ m_connection = CoreIPC::Connection::createClientConnection(connectionIdentifier, this, WebProcess::shared().runLoop());
+ m_connection->open();
+}
+
+NetworkProcessConnection::~NetworkProcessConnection()
+{
+}
+
+void NetworkProcessConnection::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&)
+{
+}
+
+void NetworkProcessConnection::didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&)
+{
+}
+
+void NetworkProcessConnection::didClose(CoreIPC::Connection*)
+{
+ // The NetworkProcess probably crashed.
+ WebProcess::shared().networkProcessConnectionClosed(this);
+}
+
+void NetworkProcessConnection::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID)
+{
+}
+
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
diff --git a/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h b/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h
new file mode 100644
index 000000000..65e259843
--- /dev/null
+++ b/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NetworkProcessConnection_h
+#define NetworkProcessConnection_h
+
+#include "Connection.h"
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+#if ENABLE(NETWORK_PROCESS)
+
+namespace WebKit {
+
+class NetworkProcessConnection : public RefCounted<NetworkProcessConnection>, CoreIPC::Connection::Client {
+public:
+ static PassRefPtr<NetworkProcessConnection> create(CoreIPC::Connection::Identifier connectionIdentifier)
+ {
+ return adoptRef(new NetworkProcessConnection(connectionIdentifier));
+ }
+ ~NetworkProcessConnection();
+
+ CoreIPC::Connection* connection() const { return m_connection.get(); }
+
+private:
+ NetworkProcessConnection(CoreIPC::Connection::Identifier);
+
+ // CoreIPC::Connection::Client
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
+ virtual void didClose(CoreIPC::Connection*);
+ virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
+
+ // The connection from the web process to the network process.
+ RefPtr<CoreIPC::Connection> m_connection;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
+
+
+#endif // NetworkProcessConnection_h
diff --git a/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.cpp b/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.cpp
index 8c10371fd..631f02234 100644
--- a/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.cpp
+++ b/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.cpp
@@ -48,9 +48,9 @@ WebNetworkInfoManager::~WebNetworkInfoManager()
{
}
-void WebNetworkInfoManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebNetworkInfoManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebNetworkInfoManagerMessage(connection, messageID, arguments);
+ didReceiveWebNetworkInfoManagerMessage(connection, messageID, decoder);
}
void WebNetworkInfoManager::registerWebPage(WebPage* page)
diff --git a/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.h b/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.h
index d3dab844c..dfe9afa95 100644
--- a/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.h
+++ b/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.h
@@ -36,8 +36,8 @@
#include <wtf/text/AtomicString.h>
namespace CoreIPC {
-class ArgumentDecoder;
class Connection;
+class MessageDecoder;
}
namespace WebKit {
@@ -57,11 +57,11 @@ public:
double bandwidth(WebPage*) const;
bool metered(WebPage*) const;
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
private:
// Implemented in generated WebNetworkInfoManagerMessageReceiver.cpp
- void didReceiveWebNetworkInfoManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebNetworkInfoManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void didChangeNetworkInformation(const AtomicString& eventType, const WebNetworkInfo::Data&);
diff --git a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
index 7b68912fe..fb42bcc43 100644
--- a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
+++ b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
@@ -63,9 +63,9 @@ WebNotificationManager::~WebNotificationManager()
{
}
-void WebNotificationManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebNotificationManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebNotificationManagerMessage(connection, messageID, arguments);
+ didReceiveWebNotificationManagerMessage(connection, messageID, decoder);
}
void WebNotificationManager::initialize(const HashMap<String, bool>& permissions)
diff --git a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
index 6a70fc60c..a3f658f24 100644
--- a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
+++ b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
@@ -35,8 +35,8 @@
#include <wtf/text/StringHash.h>
namespace CoreIPC {
-class ArgumentDecoder;
class Connection;
+class MessageDecoder;
}
namespace WebCore {
@@ -63,7 +63,7 @@ public:
// This callback comes from WebCore, not messaged from the UI process.
void didDestroyNotification(WebCore::Notification*, WebPage*);
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void didUpdateNotificationDecision(const String& originString, bool allowed);
// Looks in local cache for permission. If not found, returns DefaultDenied.
@@ -74,7 +74,7 @@ public:
private:
// Implemented in generated WebNotificationManagerMessageReceiver.cpp
- void didReceiveWebNotificationManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebNotificationManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void didShowNotification(uint64_t notificationID);
void didClickNotification(uint64_t notificationID);
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp b/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
index fdb7e5e1f..fcfb249ad 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
@@ -87,28 +87,28 @@ void PluginProcessConnection::removePluginProxy(PluginProxy* plugin)
m_pluginProcessConnectionManager->removePluginProcessConnection(this);
}
-void PluginProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void PluginProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- ASSERT(arguments->destinationID());
+ ASSERT(decoder.destinationID());
- PluginProxy* pluginProxy = m_plugins.get(arguments->destinationID());
+ PluginProxy* pluginProxy = m_plugins.get(decoder.destinationID());
if (!pluginProxy)
return;
- pluginProxy->didReceivePluginProxyMessage(connection, messageID, arguments);
+ pluginProxy->didReceivePluginProxyMessage(connection, messageID, decoder);
}
-void PluginProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void PluginProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
if (messageID.is<CoreIPC::MessageClassNPObjectMessageReceiver>()) {
- m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
return;
}
- uint64_t destinationID = arguments->destinationID();
+ uint64_t destinationID = decoder.destinationID();
if (!destinationID) {
- didReceiveSyncPluginProcessConnectionMessage(connection, messageID, arguments, reply);
+ didReceiveSyncPluginProcessConnectionMessage(connection, messageID, decoder, replyEncoder);
return;
}
@@ -116,7 +116,7 @@ void PluginProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connect
if (!pluginProxy)
return;
- pluginProxy->didReceiveSyncPluginProxyMessage(connection, messageID, arguments, reply);
+ pluginProxy->didReceiveSyncPluginProxyMessage(connection, messageID, decoder, replyEncoder);
}
void PluginProcessConnection::didClose(CoreIPC::Connection*)
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h b/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h
index b9bf81c71..2dc2cca59 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h
+++ b/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h
@@ -64,13 +64,13 @@ private:
PluginProcessConnection(PluginProcessConnectionManager*, const String& pluginPath, CoreIPC::Connection::Identifier connectionIdentifier, bool supportsAsynchronousInitialization);
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
// Message handlers.
- void didReceiveSyncPluginProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveSyncPluginProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void setException(const String&);
PluginProcessConnectionManager* m_pluginProcessConnectionManager;
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProxy.h b/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
index 02fa1ab57..8104af204 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
+++ b/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
@@ -60,8 +60,8 @@ public:
uint64_t pluginInstanceID() const { return m_pluginInstanceID; }
void pluginProcessCrashed();
- void didReceivePluginProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments);
- void didReceiveSyncPluginProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceivePluginProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncPluginProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
bool isBeingAsynchronouslyInitialized() const { return m_waitingOnAsynchronousInitialization; }
diff --git a/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp b/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp
index e88696371..6810f0abd 100644
--- a/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp
+++ b/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp
@@ -56,9 +56,9 @@ WebResourceCacheManager::~WebResourceCacheManager()
{
}
-void WebResourceCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebResourceCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebResourceCacheManagerMessage(connection, messageID, arguments);
+ didReceiveWebResourceCacheManagerMessage(connection, messageID, decoder);
}
diff --git a/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h b/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h
index 01723894c..83a1cc304 100644
--- a/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h
+++ b/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h
@@ -33,8 +33,8 @@
#include <wtf/text/WTFString.h>
namespace CoreIPC {
-class ArgumentDecoder;
class Connection;
+class MessageDecoder;
class MessageID;
}
@@ -47,14 +47,14 @@ class WebResourceCacheManager {
public:
static WebResourceCacheManager& shared();
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
private:
WebResourceCacheManager();
virtual ~WebResourceCacheManager();
// Implemented in generated WebResourceCacheManagerMessageReceiver.cpp
- void didReceiveWebResourceCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebResourceCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void getCacheOrigins(uint64_t callbackID) const;
void clearCacheForOrigin(SecurityOriginData, uint32_t cachesToClear) const;
diff --git a/Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp b/Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp
index 5e152ee98..e39ba39d2 100644
--- a/Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp
+++ b/Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp
@@ -49,34 +49,33 @@ WebConnectionToUIProcess::WebConnectionToUIProcess(WebProcess* process, CoreIPC:
// WebConnection
-void WebConnectionToUIProcess::encodeMessageBody(CoreIPC::ArgumentEncoder* argumentEncoder, APIObject* messageBody)
+void WebConnectionToUIProcess::encodeMessageBody(CoreIPC::ArgumentEncoder& encoder, APIObject* messageBody)
{
- argumentEncoder->encode(InjectedBundleUserMessageEncoder(messageBody));
+ encoder.encode(InjectedBundleUserMessageEncoder(messageBody));
}
-bool WebConnectionToUIProcess::decodeMessageBody(CoreIPC::ArgumentDecoder* argumentDecoder, RefPtr<APIObject>& messageBody)
+bool WebConnectionToUIProcess::decodeMessageBody(CoreIPC::ArgumentDecoder& decoder, RefPtr<APIObject>& messageBody)
{
- if (!argumentDecoder->decode(InjectedBundleUserMessageDecoder(messageBody)))
+ if (!decoder.decode(InjectedBundleUserMessageDecoder(messageBody)))
return false;
return true;
}
// CoreIPC::Connection::Client
-
-void WebConnectionToUIProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebConnectionToUIProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
if (messageID.is<CoreIPC::MessageClassWebConnection>()) {
- didReceiveWebConnectionMessage(connection, messageID, arguments);
+ didReceiveWebConnectionMessage(connection, messageID, decoder);
return;
}
- m_process->didReceiveMessage(connection, messageID, arguments);
+ m_process->didReceiveMessage(connection, messageID, decoder);
}
-void WebConnectionToUIProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebConnectionToUIProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- m_process->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ m_process->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
}
void WebConnectionToUIProcess::didClose(CoreIPC::Connection* connection)
diff --git a/Source/WebKit2/WebProcess/WebConnectionToUIProcess.h b/Source/WebKit2/WebProcess/WebConnectionToUIProcess.h
index cdff4ac27..af591115b 100644
--- a/Source/WebKit2/WebProcess/WebConnectionToUIProcess.h
+++ b/Source/WebKit2/WebProcess/WebConnectionToUIProcess.h
@@ -41,14 +41,14 @@ private:
WebConnectionToUIProcess(WebProcess*, CoreIPC::Connection::Identifier, WebCore::RunLoop*);
// WebConnection
- virtual void encodeMessageBody(CoreIPC::ArgumentEncoder*, APIObject*) OVERRIDE;
- virtual bool decodeMessageBody(CoreIPC::ArgumentDecoder*, RefPtr<APIObject>&) OVERRIDE;
+ virtual void encodeMessageBody(CoreIPC::ArgumentEncoder&, APIObject*) OVERRIDE;
+ virtual bool decodeMessageBody(CoreIPC::ArgumentDecoder&, RefPtr<APIObject>&) OVERRIDE;
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
virtual void didClose(CoreIPC::Connection*);
- virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
+ virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID) OVERRIDE;
#if PLATFORM(WIN)
virtual Vector<HWND> windowsToReceiveSentMessagesWhileWaitingForSyncReply();
#endif
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp
index 53d3895cd..05b75a1cb 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp
@@ -62,9 +62,9 @@ WebDatabaseManager::~WebDatabaseManager()
{
}
-void WebDatabaseManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebDatabaseManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebDatabaseManagerMessage(connection, messageID, arguments);
+ didReceiveWebDatabaseManagerMessage(connection, messageID, decoder);
}
void WebDatabaseManager::getDatabasesByOrigin(uint64_t callbackID) const
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h
index 60ffb10cd..adb4d4b83 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h
@@ -34,7 +34,7 @@
#include <wtf/text/WTFString.h>
namespace CoreIPC {
-class ArgumentDecoder;
+class MessageDecoder;
class Connection;
class MessageID;
}
@@ -47,7 +47,7 @@ public:
static WebDatabaseManager& shared();
static void initialize(const String& databaseDirectory);
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void setQuotaForOrigin(const String& originIdentifier, unsigned long long quota) const;
public:
@@ -58,7 +58,7 @@ private:
virtual ~WebDatabaseManager();
// Implemented in generated WebDatabaseManagerMessageReceiver.cpp
- void didReceiveWebDatabaseManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebDatabaseManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void getDatabasesByOrigin(uint64_t callbackID) const;
void getDatabaseOrigins(uint64_t callbackID) const;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
index fe4e9d32a..1c8c0b7b5 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
@@ -484,7 +484,7 @@ void WebEditorClient::requestCheckingOfString(WTF::PassRefPtr<WebCore::TextCheck
bool WebEditorClient::supportsGlobalSelection()
{
-#if PLATFORM(QT)
+#if PLATFORM(QT) && !defined(QT_NO_CLIPBOARD)
return qApp->clipboard()->supportsSelection();
#elif PLATFORM(GTK) && PLATFORM(X11)
return true;
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index c29463f46..1a1206a4b 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -1226,16 +1226,14 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
Color backgroundColor = webPage->drawsTransparentBackground() ? Color::transparent : Color::white;
bool isMainFrame = webPage->mainWebFrame() == m_frame;
bool shouldUseFixedLayout = isMainFrame && webPage->useFixedLayout();
- IntRect currentVisibleContentBounds = m_frame->visibleContentBounds();
+ IntRect currentFixedVisibleContentRect = m_frame->coreFrame()->view() ? m_frame->coreFrame()->view()->fixedVisibleContentRect() : IntRect();
const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
m_frameHasCustomRepresentation = isMainFrame && webPage->shouldUseCustomRepresentationForResponse(response);
m_frameCameFromPageCache = false;
- m_frame->coreFrame()->createView(webPage->size(), backgroundColor, /* transparent */ false, IntSize(), shouldUseFixedLayout);
+ m_frame->coreFrame()->createView(webPage->size(), backgroundColor, /* transparent */ false, IntSize(), currentFixedVisibleContentRect, shouldUseFixedLayout);
m_frame->coreFrame()->view()->setTransparent(!webPage->drawsBackground());
- if (shouldUseFixedLayout && !currentVisibleContentBounds.isEmpty())
- m_frame->coreFrame()->view()->setFixedVisibleContentRect(currentVisibleContentBounds);
}
void WebFrameLoaderClient::didSaveToPageCache()
@@ -1314,10 +1312,8 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement* pluginElement, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
ASSERT(paramNames.size() == paramValues.size());
-
- WebPage* webPage = m_frame->page();
- ASSERT(webPage);
-
+ ASSERT(m_frame->page());
+
Plugin::Parameters parameters;
parameters.url = url;
parameters.names = paramNames;
@@ -1326,7 +1322,7 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugIn
parameters.isFullFramePlugin = loadManually;
parameters.shouldUseManualLoader = parameters.isFullFramePlugin && !m_frameCameFromPageCache;
#if PLATFORM(MAC)
- parameters.layerHostingMode = webPage->layerHostingMode();
+ parameters.layerHostingMode = m_frame->page()->layerHostingMode();
#endif
#if PLUGIN_ARCHITECTURE(X11)
@@ -1346,21 +1342,27 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugIn
}
#endif
- RefPtr<Plugin> plugin = webPage->createPlugin(m_frame, pluginElement, parameters);
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ RefPtr<Plugin> plugin = m_frame->page()->createPlugin(m_frame, pluginElement, parameters);
if (!plugin)
return 0;
-
+
return PluginView::create(pluginElement, plugin.release(), parameters);
+#else
+ return 0;
+#endif
}
void WebFrameLoaderClient::recreatePlugin(Widget* widget)
{
+#if ENABLE(NETSCAPE_PLUGIN_API)
ASSERT(widget && widget->isPluginViewBase());
ASSERT(m_frame->page());
PluginView* pluginView = static_cast<PluginView*>(widget);
RefPtr<Plugin> plugin = m_frame->page()->createPlugin(m_frame, pluginView->pluginElement(), pluginView->initialParameters());
pluginView->recreateAndInitialize(plugin.release());
+#endif
}
void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
@@ -1531,7 +1533,11 @@ void WebFrameLoaderClient::registerForIconNotification(bool /*listen*/)
RemoteAXObjectRef WebFrameLoaderClient::accessibilityRemoteObject()
{
- return m_frame->page()->accessibilityRemoteObject();
+ WebPage* webPage = m_frame->page();
+ if (!webPage)
+ return 0;
+
+ return webPage->accessibilityRemoteObject();
}
NSCachedURLResponse* WebFrameLoaderClient::willCacheResponse(DocumentLoader*, unsigned long identifier, NSCachedURLResponse* response) const
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
index 5d250ea59..62f900400 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -56,8 +56,10 @@ void WebPlatformStrategies::initialize()
}
WebPlatformStrategies::WebPlatformStrategies()
+#if ENABLE(NETSCAPE_PLUGIN_API)
: m_pluginCacheIsPopulated(false)
, m_shouldRefreshPlugins(false)
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
{
}
@@ -92,19 +94,24 @@ void WebPlatformStrategies::notifyCookiesChanged()
void WebPlatformStrategies::refreshPlugins()
{
+#if ENABLE(NETSCAPE_PLUGIN_API)
m_cachedPlugins.clear();
m_pluginCacheIsPopulated = false;
m_shouldRefreshPlugins = true;
populatePluginCache();
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
}
void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>& plugins)
{
+#if ENABLE(NETSCAPE_PLUGIN_API)
populatePluginCache();
plugins = m_cachedPlugins;
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
}
+#if ENABLE(NETSCAPE_PLUGIN_API)
static BlockingResponseMap<Vector<WebCore::PluginInfo> >& responseMap()
{
AtomicallyInitializedStatic(BlockingResponseMap<Vector<WebCore::PluginInfo> >&, responseMap = *new BlockingResponseMap<Vector<WebCore::PluginInfo> >);
@@ -138,6 +145,7 @@ void WebPlatformStrategies::populatePluginCache()
m_shouldRefreshPlugins = false;
m_pluginCacheIsPopulated = true;
}
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
// VisitedLinkStrategy
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
index 412a75bce..dfbcc334c 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -55,7 +55,6 @@ private:
// WebCore::PluginStrategy
virtual void refreshPlugins() OVERRIDE;
virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&) OVERRIDE;
- void populatePluginCache();
// WebCore::VisitedLinkStrategy
virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash, const WebCore::KURL& baseURL, const WTF::AtomicString& attributeURL) OVERRIDE;
@@ -80,12 +79,18 @@ private:
virtual void setStringForType(const String&, const String& pasteboardType, const String& pasteboardName) OVERRIDE;
#endif
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ // WebCore::PluginStrategy implementation.
+ void populatePluginCache();
bool m_pluginCacheIsPopulated;
bool m_shouldRefreshPlugins;
Vector<WebCore::PluginInfo> m_cachedPlugins;
+#endif // ENABLE(PLUGIN_PROCESS)
};
+#if ENABLE(NETSCAPE_PLUGIN_API)
void handleDidGetPlugins(uint64_t requestID, const Vector<WebCore::PluginInfo>&);
+#endif // ENABLE(PLUGIN_PROCESS)
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebKitMain.cpp b/Source/WebKit2/WebProcess/WebKitMain.cpp
index 706dad256..c3fa98ebe 100644
--- a/Source/WebKit2/WebProcess/WebKitMain.cpp
+++ b/Source/WebKit2/WebProcess/WebKitMain.cpp
@@ -56,11 +56,9 @@ static int WebKitMain(const CommandLine& commandLine)
switch (processType) {
case ProcessLauncher::WebProcess:
return WebProcessMain(commandLine);
- case ProcessLauncher::PluginProcess:
#if ENABLE(PLUGIN_PROCESS)
+ case ProcessLauncher::PluginProcess:
return PluginProcessMain(commandLine);
-#else
- break;
#endif
case ProcessLauncher::NetworkProcess:
#if ENABLE(NETWORK_PROCESS)
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
index a19715e7e..aaa1c38d5 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
@@ -29,6 +29,7 @@
#if USE(COORDINATED_GRAPHICS)
#include "LayerTreeCoordinator.h"
+#include "CoordinatedGraphicsArgumentCoders.h"
#include "CoordinatedGraphicsLayer.h"
#include "DrawingAreaImpl.h"
#include "GraphicsContext.h"
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
index dbebd386a..776a8d97e 100644
--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
@@ -79,7 +79,7 @@ public:
virtual void purgeBackingStores();
virtual bool layerTreeTileUpdatesAllowed() const;
virtual void setVisibleContentsRect(const WebCore::IntRect&, float scale, const WebCore::FloatPoint&);
- virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() OVERRIDE;
virtual void syncLayerState(WebLayerID, const WebLayerInfo&);
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
index ca476179e..c8e96c3c0 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
@@ -34,8 +34,8 @@
#include <wtf/PassOwnPtr.h>
namespace CoreIPC {
- class ArgumentDecoder;
class Connection;
+ class MessageDecoder;
class MessageID;
}
@@ -63,7 +63,7 @@ public:
static PassOwnPtr<DrawingArea> create(WebPage*, const WebPageCreationParameters&);
virtual ~DrawingArea();
- void didReceiveDrawingAreaMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveDrawingAreaMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
virtual void setNeedsDisplay(const WebCore::IntRect&) = 0;
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) = 0;
@@ -94,7 +94,7 @@ public:
#endif
#if USE(COORDINATED_GRAPHICS)
- virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) = 0;
+ virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) = 0;
#endif
#if PLATFORM(WIN)
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
index d6cef142f..71916909d 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
@@ -727,10 +727,10 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo)
}
#if USE(COORDINATED_GRAPHICS)
-void DrawingAreaImpl::didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void DrawingAreaImpl::didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
if (m_layerTreeHost)
- m_layerTreeHost->didReceiveLayerTreeCoordinatorMessage(connection, messageID, arguments);
+ m_layerTreeHost->didReceiveLayerTreeCoordinatorMessage(connection, messageID, decoder);
}
#endif
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
index 8babe0108..ba93954f9 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
@@ -81,7 +81,7 @@ private:
#endif
#if USE(COORDINATED_GRAPHICS)
- virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
#endif
// CoreIPC message handlers.
diff --git a/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp b/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp
index 54f9372d1..b7269caa1 100644
--- a/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp
@@ -52,42 +52,42 @@ void EncoderAdapter::encodeBytes(const uint8_t* bytes, size_t size)
void EncoderAdapter::encodeBool(bool value)
{
- m_encoder->encodeBool(value);
+ m_encoder->encode(value);
}
void EncoderAdapter::encodeUInt16(uint16_t value)
{
- m_encoder->encodeUInt16(value);
+ m_encoder->encode(value);
}
void EncoderAdapter::encodeUInt32(uint32_t value)
{
- m_encoder->encodeUInt32(value);
+ m_encoder->encode(value);
}
void EncoderAdapter::encodeUInt64(uint64_t value)
{
- m_encoder->encodeUInt64(value);
+ m_encoder->encode(value);
}
void EncoderAdapter::encodeInt32(int32_t value)
{
- m_encoder->encodeInt32(value);
+ m_encoder->encode(value);
}
void EncoderAdapter::encodeInt64(int64_t value)
{
- m_encoder->encodeInt64(value);
+ m_encoder->encode(value);
}
void EncoderAdapter::encodeFloat(float value)
{
- m_encoder->encodeFloat(value);
+ m_encoder->encode(value);
}
void EncoderAdapter::encodeDouble(double value)
{
- m_encoder->encodeDouble(value);
+ m_encoder->encode(value);
}
void EncoderAdapter::encodeString(const String& value)
@@ -100,7 +100,7 @@ void EncoderAdapter::encodeString(const String& value)
// Special case the null string.
if (value.isNull()) {
- m_encoder->encodeUInt32(std::numeric_limits<uint32_t>::max());
+ m_encoder->encode(std::numeric_limits<uint32_t>::max());
return;
}
diff --git a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
index a53220610..2a7e7f493 100644
--- a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
@@ -72,10 +72,10 @@ void EventDispatcher::removeScrollingTreeForPage(WebPage* webPage)
}
#endif
-void EventDispatcher::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)
+void EventDispatcher::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, bool& didHandleMessage)
{
if (messageID.is<CoreIPC::MessageClassEventDispatcher>()) {
- didReceiveEventDispatcherMessageOnConnectionWorkQueue(connection, messageID, arguments, didHandleMessage);
+ didReceiveEventDispatcherMessageOnConnectionWorkQueue(connection, messageID, decoder, didHandleMessage);
return;
}
}
diff --git a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
index aa70a93e5..a4f9b99ce 100644
--- a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
+++ b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
@@ -60,10 +60,10 @@ public:
private:
// CoreIPC::Connection::QueueClient
- virtual void didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, bool& didHandleMessage) OVERRIDE;
+ virtual void didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, bool& didHandleMessage) OVERRIDE;
// Implemented in generated EventDispatcherMessageReceiver.cpp
- void didReceiveEventDispatcherMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage);
+ void didReceiveEventDispatcherMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, bool& didHandleMessage);
// Message handlers
void wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent&, bool canGoBack, bool canGoForward);
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
index 95dc8e9ca..68d158236 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
@@ -31,8 +31,8 @@
#include <wtf/RefCounted.h>
namespace CoreIPC {
-class ArgumentDecoder;
class Connection;
+class MessageDecoder;
class MessageID;
}
@@ -94,7 +94,7 @@ public:
virtual void setVisibleContentsRectForLayer(int /* layerID */, const WebCore::IntRect&) { }
virtual void renderNextFrame() { }
virtual void purgeBackingStores() { }
- virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) = 0;
+ virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) = 0;
#endif
#if PLATFORM(WIN)
diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
index 8ae9ef028..6840914b4 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
@@ -27,6 +27,7 @@
#include "WebFrame.h"
#include "DownloadManager.h"
+#include "InjectedBundleHitTestResult.h"
#include "InjectedBundleNodeHandle.h"
#include "InjectedBundleRangeHandle.h"
#include "InjectedBundleScriptWorld.h"
@@ -617,6 +618,14 @@ bool WebFrame::hasVerticalScrollbar() const
return view->verticalScrollbar();
}
+PassRefPtr<InjectedBundleHitTestResult> WebFrame::hitTest(const IntPoint point) const
+{
+ if (!m_coreFrame)
+ return 0;
+
+ return InjectedBundleHitTestResult::create(m_coreFrame->eventHandler()->hitTestResultAtPoint(point, false, true));
+}
+
bool WebFrame::getDocumentBackgroundColor(double* red, double* green, double* blue, double* alpha)
{
if (!m_coreFrame)
diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.h b/Source/WebKit2/WebProcess/WebPage/WebFrame.h
index 6691dce33..a719e2447 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebFrame.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.h
@@ -42,6 +42,7 @@
namespace WebCore {
class Frame;
class HTMLFrameOwnerElement;
+class IntPoint;
class IntRect;
#if ENABLE(WEB_INTENTS)
class Intent;
@@ -51,6 +52,7 @@ class KURL;
namespace WebKit {
+class InjectedBundleHitTestResult;
class InjectedBundleNodeHandle;
class InjectedBundleRangeHandle;
class InjectedBundleScriptWorld;
@@ -111,6 +113,7 @@ public:
WebCore::IntSize scrollOffset() const;
bool hasHorizontalScrollbar() const;
bool hasVerticalScrollbar() const;
+ PassRefPtr<InjectedBundleHitTestResult> hitTest(const WebCore::IntPoint) const;
bool getDocumentBackgroundColor(double* red, double* green, double* blue, double* alpha);
bool containsAnyFormElements() const;
void stopLoading();
diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspector.h b/Source/WebKit2/WebProcess/WebPage/WebInspector.h
index c041546a8..2f1047589 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebInspector.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebInspector.h
@@ -53,7 +53,7 @@ public:
WebPage* inspectorPage() const { return m_inspectorPage; }
// Implemented in generated WebInspectorMessageReceiver.cpp
- void didReceiveWebInspectorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebInspectorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
// Called by WebInspector messages
void show();
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index e82e65c06..1afe3e324 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -451,6 +451,7 @@ void WebPage::initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagno
m_logDiagnosticMessageClient.initialize(client);
}
+#if ENABLE(NETSCAPE_PLUGIN_API)
PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* pluginElement, const Plugin::Parameters& parameters)
{
String pluginPath;
@@ -488,13 +489,12 @@ PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* plu
#if ENABLE(PLUGIN_PROCESS)
return PluginProxy::create(pluginPath);
-#elif ENABLE(NETSCAPE_PLUGIN_API)
+#else
NetscapePlugin::setSetExceptionFunction(NPRuntimeObjectMap::setGlobalException);
return NetscapePlugin::create(NetscapePluginModule::getOrCreate(pluginPath));
-#else
- return 0;
#endif
}
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
EditorState WebPage::editorState() const
{
@@ -1215,14 +1215,14 @@ void WebPage::setGapBetweenPages(double gap)
m_page->setPagination(pagination);
}
-void WebPage::postInjectedBundleMessage(const String& messageName, CoreIPC::ArgumentDecoder* argumentDecoder)
+void WebPage::postInjectedBundleMessage(const String& messageName, CoreIPC::MessageDecoder& decoder)
{
InjectedBundle* injectedBundle = WebProcess::shared().injectedBundle();
if (!injectedBundle)
return;
RefPtr<APIObject> messageBody;
- if (!argumentDecoder->decode(InjectedBundleUserMessageDecoder(messageBody)))
+ if (!decoder.decode(InjectedBundleUserMessageDecoder(messageBody)))
return;
injectedBundle->didReceiveMessageToPage(this, messageName, messageBody.get());
@@ -2763,18 +2763,18 @@ bool WebPage::windowAndWebPageAreFocused() const
return m_page->focusController()->isFocused() && m_page->focusController()->isActive();
}
-void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
if (messageID.is<CoreIPC::MessageClassDrawingArea>()) {
if (m_drawingArea)
- m_drawingArea->didReceiveDrawingAreaMessage(connection, messageID, arguments);
+ m_drawingArea->didReceiveDrawingAreaMessage(connection, messageID, decoder);
return;
}
#if USE(TILED_BACKING_STORE) && USE(ACCELERATED_COMPOSITING)
if (messageID.is<CoreIPC::MessageClassLayerTreeCoordinator>()) {
if (m_drawingArea)
- m_drawingArea->didReceiveLayerTreeCoordinatorMessage(connection, messageID, arguments);
+ m_drawingArea->didReceiveLayerTreeCoordinatorMessage(connection, messageID, decoder);
return;
}
#endif
@@ -2782,24 +2782,24 @@ void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Messag
#if ENABLE(INSPECTOR)
if (messageID.is<CoreIPC::MessageClassWebInspector>()) {
if (WebInspector* inspector = this->inspector())
- inspector->didReceiveWebInspectorMessage(connection, messageID, arguments);
+ inspector->didReceiveWebInspectorMessage(connection, messageID, decoder);
return;
}
#endif
#if ENABLE(FULLSCREEN_API)
if (messageID.is<CoreIPC::MessageClassWebFullScreenManager>()) {
- fullScreenManager()->didReceiveMessage(connection, messageID, arguments);
+ fullScreenManager()->didReceiveMessage(connection, messageID, decoder);
return;
}
#endif
- didReceiveWebPageMessage(connection, messageID, arguments);
+ didReceiveWebPageMessage(connection, messageID, decoder);
}
-void WebPage::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebPage::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- didReceiveSyncWebPageMessage(connection, messageID, arguments, reply);
+ didReceiveSyncWebPageMessage(connection, messageID, decoder, replyEncoder);
}
InjectedBundleBackForwardList* WebPage::backForwardList()
@@ -3446,6 +3446,7 @@ void WebPage::setScrollingPerformanceLoggingEnabled(bool enabled)
static bool canPluginHandleResponse(const ResourceResponse& response)
{
+#if ENABLE(NETSCAPE_PLUGIN_API)
String pluginPath;
bool blocked;
@@ -3453,6 +3454,9 @@ static bool canPluginHandleResponse(const ResourceResponse& response)
return false;
return !blocked && !pluginPath.isEmpty();
+#else
+ return false;
+#endif
}
bool WebPage::shouldUseCustomRepresentationForResponse(const ResourceResponse& response) const
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index 0a5f2bbb7..74be313e7 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -239,8 +239,8 @@ public:
void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
// -- Called from WebProcess.
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
// -- InjectedBundle methods
#if ENABLE(CONTEXT_MENUS)
@@ -280,7 +280,9 @@ public:
WebCore::Frame* mainFrame() const; // May return 0.
WebCore::FrameView* mainFrameView() const; // May return 0.
+#if ENABLE(NETSCAPE_PLUGIN_API)
PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&);
+#endif
EditorState editorState() const;
@@ -320,7 +322,7 @@ public:
void setPageLength(double);
void setGapBetweenPages(double);
- void postInjectedBundleMessage(const String& messageName, CoreIPC::ArgumentDecoder*);
+ void postInjectedBundleMessage(const String& messageName, CoreIPC::MessageDecoder&);
bool drawsBackground() const { return m_drawsBackground; }
bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
@@ -612,8 +614,8 @@ private:
void platformInitialize();
- void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
#if !PLATFORM(MAC)
static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp b/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp
index f59fbbaf5..340c5430e 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp
@@ -47,9 +47,9 @@ WebPageGroupProxy::~WebPageGroupProxy()
{
}
-void WebPageGroupProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebPageGroupProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebPageGroupProxyMessage(connection, messageID, arguments);
+ didReceiveWebPageGroupProxyMessage(connection, messageID, decoder);
}
WebPageGroupProxy::WebPageGroupProxy(const WebPageGroupData& data)
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h b/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h
index cbb079421..00da64b24 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h
@@ -31,8 +31,8 @@
#include <wtf/PassRefPtr.h>
namespace CoreIPC {
-class ArgumentDecoder;
class Connection;
+class MessageDecoder;
class MessageID;
}
@@ -54,14 +54,14 @@ public:
bool isVisibleToInjectedBundle() const { return m_data.visibleToInjectedBundle; }
bool isVisibleToHistoryClient() const { return m_data.visibleToHistoryClient; }
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
private:
WebPageGroupProxy(const WebPageGroupData&);
virtual Type type() const { return APIType; }
- void didReceiveWebPageGroupProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebPageGroupProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void addUserStyleSheet(const WebCore::UserStyleSheet&);
void addUserScript(const WebCore::UserScript&);
diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp
index 43ed16b1a..43e7d7021 100644
--- a/Source/WebKit2/WebProcess/WebProcess.cpp
+++ b/Source/WebKit2/WebProcess/WebProcess.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -86,6 +86,10 @@
#include "WebNetworkInfoManagerMessages.h"
#endif
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessConnection.h"
+#endif
+
#if !OS(WINDOWS)
#include <unistd.h>
#endif
@@ -158,6 +162,9 @@ WebProcess::WebProcess()
, m_notificationManager(this)
#endif
, m_iconDatabaseProxy(this)
+#if ENABLE(NETWORK_PROCESS)
+ , m_usesNetworkProcess(false)
+#endif
#if USE(SOUP)
, m_soupRequestManager(this)
#endif
@@ -187,17 +194,17 @@ void WebProcess::initialize(CoreIPC::Connection::Identifier serverIdentifier, Ru
startRandomCrashThreadIfRequested();
}
-void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder* arguments)
+void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::MessageDecoder& decoder)
{
ASSERT(m_pageMap.isEmpty());
- platformInitializeWebProcess(parameters, arguments);
+ platformInitializeWebProcess(parameters, decoder);
memoryPressureHandler().install();
RefPtr<APIObject> injectedBundleInitializationUserData;
InjectedBundleUserMessageDecoder messageDecoder(injectedBundleInitializationUserData);
- if (!arguments->decode(messageDecoder))
+ if (!decoder.decode(messageDecoder))
return;
if (!parameters.injectedBundlePath.isEmpty()) {
@@ -256,9 +263,40 @@ void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parame
WebCore::ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase(parameters.uiProcessBundleIdentifier);
#endif
+#if ENABLE(NETWORK_PROCESS)
+ m_usesNetworkProcess = parameters.usesNetworkProcess;
+ ensureNetworkProcessConnection();
+#endif
setTerminationTimeout(parameters.terminationTimeout);
}
+#if ENABLE(NETWORK_PROCESS)
+void WebProcess::ensureNetworkProcessConnection()
+{
+ if (!m_usesNetworkProcess)
+ return;
+
+ if (m_networkProcessConnection)
+ return;
+
+ CoreIPC::Attachment encodedConnectionIdentifier;
+
+ if (!connection()->sendSync(Messages::WebProcessProxy::GetNetworkProcessConnection(),
+ Messages::WebProcessProxy::GetNetworkProcessConnection::Reply(encodedConnectionIdentifier), 0))
+ return;
+
+#if PLATFORM(MAC)
+ CoreIPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
+ if (CoreIPC::Connection::identifierIsNull(connectionIdentifier))
+ return;
+#else
+ ASSERT_NOT_REACHED();
+#endif
+
+ RefPtr<NetworkProcessConnection> m_networkProcessConnection = NetworkProcessConnection::create(connectionIdentifier);
+}
+#endif // ENABLE(NETWORK_PROCESS)
+
void WebProcess::setShouldTrackVisitedLinks(bool shouldTrackVisitedLinks)
{
m_shouldTrackVisitedLinks = shouldTrackVisitedLinks;
@@ -606,9 +644,9 @@ void WebProcess::terminate()
m_runLoop->stop();
}
-void WebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- uint64_t pageID = arguments->destinationID();
+ uint64_t pageID = decoder.destinationID();
if (!pageID)
return;
@@ -616,83 +654,83 @@ void WebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC:
if (!page)
return;
- page->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ page->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
}
-void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
if (messageID.is<CoreIPC::MessageClassWebProcess>()) {
- didReceiveWebProcessMessage(connection, messageID, arguments);
+ didReceiveWebProcessMessage(connection, messageID, decoder);
return;
}
if (messageID.is<CoreIPC::MessageClassWebApplicationCacheManager>()) {
- WebApplicationCacheManager::shared().didReceiveMessage(connection, messageID, arguments);
+ WebApplicationCacheManager::shared().didReceiveMessage(connection, messageID, decoder);
return;
}
if (messageID.is<CoreIPC::MessageClassWebCookieManager>()) {
- WebCookieManager::shared().didReceiveMessage(connection, messageID, arguments);
+ WebCookieManager::shared().didReceiveMessage(connection, messageID, decoder);
return;
}
#if ENABLE(SQL_DATABASE)
if (messageID.is<CoreIPC::MessageClassWebDatabaseManager>()) {
- WebDatabaseManager::shared().didReceiveMessage(connection, messageID, arguments);
+ WebDatabaseManager::shared().didReceiveMessage(connection, messageID, decoder);
return;
}
#endif
#if ENABLE(BATTERY_STATUS)
if (messageID.is<CoreIPC::MessageClassWebBatteryManager>()) {
- m_batteryManager.didReceiveMessage(connection, messageID, arguments);
+ m_batteryManager.didReceiveMessage(connection, messageID, decoder);
return;
}
#endif
#if ENABLE(NETWORK_INFO)
if (messageID.is<CoreIPC::MessageClassWebNetworkInfoManager>()) {
- m_networkInfoManager.didReceiveMessage(connection, messageID, arguments);
+ m_networkInfoManager.didReceiveMessage(connection, messageID, decoder);
return;
}
#endif
if (messageID.is<CoreIPC::MessageClassWebIconDatabaseProxy>()) {
- m_iconDatabaseProxy.didReceiveMessage(connection, messageID, arguments);
+ m_iconDatabaseProxy.didReceiveMessage(connection, messageID, decoder);
return;
}
if (messageID.is<CoreIPC::MessageClassWebKeyValueStorageManager>()) {
- WebKeyValueStorageManager::shared().didReceiveMessage(connection, messageID, arguments);
+ WebKeyValueStorageManager::shared().didReceiveMessage(connection, messageID, decoder);
return;
}
if (messageID.is<CoreIPC::MessageClassWebMediaCacheManager>()) {
- WebMediaCacheManager::shared().didReceiveMessage(connection, messageID, arguments);
+ WebMediaCacheManager::shared().didReceiveMessage(connection, messageID, decoder);
return;
}
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
if (messageID.is<CoreIPC::MessageClassWebNotificationManager>()) {
- m_notificationManager.didReceiveMessage(connection, messageID, arguments);
+ m_notificationManager.didReceiveMessage(connection, messageID, decoder);
return;
}
#endif
if (messageID.is<CoreIPC::MessageClassWebResourceCacheManager>()) {
- WebResourceCacheManager::shared().didReceiveMessage(connection, messageID, arguments);
+ WebResourceCacheManager::shared().didReceiveMessage(connection, messageID, decoder);
return;
}
#if USE(SOUP)
if (messageID.is<CoreIPC::MessageClassWebSoupRequestManager>()) {
- m_soupRequestManager.didReceiveMessage(connection, messageID, arguments);
+ m_soupRequestManager.didReceiveMessage(connection, messageID, decoder);
return;
}
#endif
if (messageID.is<CoreIPC::MessageClassWebPageGroupProxy>()) {
- uint64_t pageGroupID = arguments->destinationID();
+ uint64_t pageGroupID = decoder.destinationID();
if (!pageGroupID)
return;
@@ -700,10 +738,10 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
if (!pageGroupProxy)
return;
- pageGroupProxy->didReceiveMessage(connection, messageID, arguments);
+ pageGroupProxy->didReceiveMessage(connection, messageID, decoder);
}
- uint64_t pageID = arguments->destinationID();
+ uint64_t pageID = decoder.destinationID();
if (!pageID)
return;
@@ -711,7 +749,7 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
if (!page)
return;
- page->didReceiveMessage(connection, messageID, arguments);
+ page->didReceiveMessage(connection, messageID, decoder);
}
void WebProcess::didClose(CoreIPC::Connection*)
@@ -743,10 +781,10 @@ void WebProcess::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::Message
// we'll let it slide.
}
-void WebProcess::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)
+void WebProcess::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, bool& didHandleMessage)
{
if (messageID.is<CoreIPC::MessageClassWebProcess>()) {
- didReceiveWebProcessMessageOnConnectionWorkQueue(connection, messageID, arguments, didHandleMessage);
+ didReceiveWebProcessMessageOnConnectionWorkQueue(connection, messageID, decoder, didHandleMessage);
return;
}
}
@@ -832,7 +870,7 @@ void WebProcess::clearApplicationCache()
cacheStorage().empty();
}
-#if !ENABLE(PLUGIN_PROCESS)
+#if ENABLE(NETSCAPE_PLUGIN_API) && !ENABLE(PLUGIN_PROCESS)
void WebProcess::getSitesWithPluginData(const Vector<String>& pluginPaths, uint64_t callbackID)
{
LocalTerminationDisabler terminationDisabler(*this);
@@ -1024,6 +1062,23 @@ void WebProcess::postInjectedBundleMessage(const CoreIPC::DataReference& message
injectedBundle->didReceiveMessage(messageName, messageBody.get());
}
+#if ENABLE(NETWORK_PROCESS)
+void WebProcess::networkProcessConnectionClosed(NetworkProcessConnection* connection)
+{
+ ASSERT(m_networkProcessConnection);
+ ASSERT(m_networkProcessConnection == connection);
+
+ m_networkProcessConnection = 0;
+}
+
+void WebProcess::networkProcessCrashed(CoreIPC::Connection*)
+{
+ ASSERT(m_networkProcessConnection);
+
+ networkProcessConnectionClosed(m_networkProcessConnection.get());
+}
+#endif
+
#if ENABLE(PLUGIN_PROCESS)
void WebProcess::pluginProcessCrashed(CoreIPC::Connection*, const String& pluginPath)
{
@@ -1093,6 +1148,7 @@ void WebProcess::setTextCheckerState(const TextCheckerState& textCheckerState)
}
}
+#if ENABLE(NETSCAPE_PLUGIN_API)
void WebProcess::didGetPlugins(CoreIPC::Connection*, uint64_t requestID, const Vector<WebCore::PluginInfo>& plugins)
{
#if USE(PLATFORM_STRATEGIES)
@@ -1100,5 +1156,6 @@ void WebProcess::didGetPlugins(CoreIPC::Connection*, uint64_t requestID, const V
handleDidGetPlugins(requestID, plugins);
#endif
}
+#endif // ENABLE(PLUGIN_PROCESS)
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebProcess.h b/Source/WebKit2/WebProcess/WebProcess.h
index eccbb8d60..ac6455250 100644
--- a/Source/WebKit2/WebProcess/WebProcess.h
+++ b/Source/WebKit2/WebProcess/WebProcess.h
@@ -95,6 +95,10 @@ struct WebPageGroupData;
struct WebPreferencesStore;
struct WebProcessCreationParameters;
+#if ENABLE(NETWORK_PROCESS)
+class NetworkProcessConnection;
+#endif
+
#if USE(SECURITY_FRAMEWORK)
class SecItemResponseData;
class SecKeychainItemResponseData;
@@ -188,11 +192,15 @@ public:
WebSoupRequestManager& soupRequestManager() { return m_soupRequestManager; }
#endif
+#if ENABLE(NETWORK_PROCESS)
+ void networkProcessConnectionClosed(NetworkProcessConnection*);
+#endif
+
private:
WebProcess();
- void initializeWebProcess(const WebProcessCreationParameters&, CoreIPC::ArgumentDecoder*);
- void platformInitializeWebProcess(const WebProcessCreationParameters&, CoreIPC::ArgumentDecoder*);
+ void initializeWebProcess(const WebProcessCreationParameters&, CoreIPC::MessageDecoder&);
+ void platformInitializeWebProcess(const WebProcessCreationParameters&, CoreIPC::MessageDecoder&);
void platformTerminate();
void registerURLSchemeAsEmptyDocument(const String&);
void registerURLSchemeAsSecure(const String&) const;
@@ -228,7 +236,10 @@ private:
void getSitesWithPluginData(const Vector<String>& pluginPaths, uint64_t callbackID);
void clearPluginSiteData(const Vector<String>& pluginPaths, const Vector<String>& sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID);
#endif
-
+
+#if ENABLE(NETWORK_PROCESS)
+ void networkProcessCrashed(CoreIPC::Connection*);
+#endif
#if ENABLE(PLUGIN_PROCESS)
void pluginProcessCrashed(CoreIPC::Connection*, const String& pluginPath);
#endif
@@ -261,8 +272,8 @@ private:
// CoreIPC::Connection::Client
friend class WebConnectionToUIProcess;
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
#if PLATFORM(WIN)
@@ -270,13 +281,15 @@ private:
#endif
// CoreIPC::Connection::QueueClient
- virtual void didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, bool& didHandleMessage) OVERRIDE;
+ virtual void didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, bool& didHandleMessage) OVERRIDE;
// Implemented in generated WebProcessMessageReceiver.cpp
- void didReceiveWebProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveWebProcessMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, bool& didHandleMessage);
+ void didReceiveWebProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveWebProcessMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, bool& didHandleMessage);
+#if ENABLE(NETSCAPE_PLUGIN_API)
void didGetPlugins(CoreIPC::Connection*, uint64_t requestID, const Vector<WebCore::PluginInfo>&);
+#endif
RefPtr<WebConnectionToUIProcess> m_connection;
@@ -333,6 +346,12 @@ private:
String m_localStorageDirectory;
+#if ENABLE(NETWORK_PROCESS)
+ void ensureNetworkProcessConnection();
+ RefPtr<NetworkProcessConnection> m_networkProcessConnection;
+ bool m_usesNetworkProcess;
+#endif
+
#if ENABLE(PLUGIN_PROCESS)
PluginProcessConnectionManager m_pluginProcessConnectionManager;
#endif
diff --git a/Source/WebKit2/WebProcess/WebProcess.messages.in b/Source/WebKit2/WebProcess/WebProcess.messages.in
index d10a7b536..2cc1e6280 100644
--- a/Source/WebKit2/WebProcess/WebProcess.messages.in
+++ b/Source/WebKit2/WebProcess/WebProcess.messages.in
@@ -56,12 +56,17 @@ messages -> WebProcess {
#endif
# Plug-ins.
-#if !ENABLE(PLUGIN_PROCESS)
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ DidGetPlugins(uint64_t requestID, Vector<WebCore::PluginInfo> plugins) DispatchOnConnectionQueue
+#endif
+#if ENABLE(NETSCAPE_PLUGIN_API) && !ENABLE(PLUGIN_PROCESS)
GetSitesWithPluginData(Vector<WTF::String> pluginPaths, uint64_t callbackID)
ClearPluginSiteData(Vector<WTF::String> pluginPaths, Vector<WTF::String> sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID)
#endif
- DidGetPlugins(uint64_t requestID, Vector<WebCore::PluginInfo> plugins) DispatchOnConnectionQueue
+#if ENABLE(NETWORK_PROCESS)
+ NetworkProcessCrashed() DispatchOnConnectionQueue
+#endif
#if ENABLE(PLUGIN_PROCESS)
PluginProcessCrashed(String pluginProcess) DispatchOnConnectionQueue
diff --git a/Source/WebKit2/WebProcess/mac/WebProcessMac.mm b/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
index fcc42e964..10766d2cc 100644
--- a/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
+++ b/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
@@ -251,7 +251,7 @@ static id NSApplicationAccessibilityFocusedUIElement(NSApplication*, SEL)
return [page->accessibilityRemoteObject() accessibilityFocusedUIElement];
}
-void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder*)
+void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::MessageDecoder&)
{
SandboxExtension::consumePermanently(parameters.uiProcessBundleResourcePathExtensionHandle);
SandboxExtension::consumePermanently(parameters.localStorageDirectoryExtensionHandle);
diff --git a/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp b/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp
index cfd2c1a2d..92caebe29 100644
--- a/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp
+++ b/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp
@@ -135,7 +135,7 @@ static void parentProcessDiedCallback(void*)
}
#endif
-void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder* arguments)
+void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::MessageDecoder&)
{
m_networkAccessManager = new QtNetworkAccessManager(this);
ASSERT(!parameters.cookieStorageDirectory.isEmpty() && !parameters.cookieStorageDirectory.isNull());
diff --git a/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp b/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
index 51ef3a7b2..bdbaf7d43 100644
--- a/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
+++ b/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
@@ -161,7 +161,7 @@ static void languageChanged(void*)
setSoupSessionAcceptLanguage(WebCore::userPreferredLanguages());
}
-void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder*)
+void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::MessageDecoder&)
{
if (!parameters.languages.isEmpty())
setSoupSessionAcceptLanguage(parameters.languages);
diff --git a/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp b/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp
index 7406d685e..b9b3587f4 100644
--- a/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp
+++ b/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.cpp
@@ -86,9 +86,9 @@ WebSoupRequestManager::~WebSoupRequestManager()
{
}
-void WebSoupRequestManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebSoupRequestManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceiveWebSoupRequestManagerMessage(connection, messageID, arguments);
+ didReceiveWebSoupRequestManagerMessage(connection, messageID, decoder);
}
void WebSoupRequestManager::registerURIScheme(const String& scheme)
diff --git a/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.h b/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.h
index 765446653..cae652ecf 100644
--- a/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.h
+++ b/Source/WebKit2/WebProcess/soup/WebSoupRequestManager.h
@@ -30,9 +30,9 @@ typedef struct _GInputStream GInputStream;
typedef struct _GSimpleAsyncResult GSimpleAsyncResult;
namespace CoreIPC {
-class ArgumentDecoder;
class Connection;
class DataReference;
+class MessageDecoder;
class MessageID;
}
@@ -50,10 +50,10 @@ public:
void send(GSimpleAsyncResult*, GCancellable*);
GInputStream* finish(GSimpleAsyncResult*);
- void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
private:
- void didReceiveWebSoupRequestManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceiveWebSoupRequestManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void registerURIScheme(const String& scheme);
void didHandleURIRequest(const CoreIPC::DataReference&, uint64_t contentLength, const String& mimeType, uint64_t requestID);
diff --git a/Source/WebKit2/WebProcess/win/WebProcessWin.cpp b/Source/WebKit2/WebProcess/win/WebProcessWin.cpp
index f0c1955a5..25dbc36c4 100644
--- a/Source/WebKit2/WebProcess/win/WebProcessWin.cpp
+++ b/Source/WebKit2/WebProcess/win/WebProcessWin.cpp
@@ -133,7 +133,7 @@ void WebProcess::platformClearResourceCaches(ResourceCachesToClear cachesToClear
#endif // USE(CFNETWORK)
}
-void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder*)
+void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::MessageDecoder&)
{
setShouldPaintNativeControls(parameters.shouldPaintNativeControls);
diff --git a/Source/WebKit2/efl/ewebkit2.pc.in b/Source/WebKit2/efl/ewebkit2.pc.in
index 6b0a2e165..b0182caae 100644
--- a/Source/WebKit2/efl/ewebkit2.pc.in
+++ b/Source/WebKit2/efl/ewebkit2.pc.in
@@ -2,7 +2,7 @@ prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
-datadir=${prefix}/share/@WebKit2_LIBRARY_NAME@-@PROJECT_VERSION_MAJOR@
+datadir=${prefix}/@DATA_INSTALL_DIR@
Name: WebKit2-EFL
Description: Web content engine for EFL applications
diff --git a/Source/WebKit2/qt/MainQt.cpp b/Source/WebKit2/qt/MainQt.cpp
index 3f0dce22f..56b328908 100644
--- a/Source/WebKit2/qt/MainQt.cpp
+++ b/Source/WebKit2/qt/MainQt.cpp
@@ -24,7 +24,15 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <qglobal.h>
+
+#if defined(QT_NO_WIDGETS)
+#include <QGuiApplication>
+typedef QGuiApplication ApplicationType;
+#else
#include <QApplication>
+typedef QApplication ApplicationType;
+#endif
#include <stdio.h>
#if !defined(NDEBUG) && defined(Q_OS_UNIX)
@@ -84,5 +92,5 @@ int main(int argc, char** argv)
if (!suppressOutput.isEmpty() && suppressOutput != "0")
qInstallMessageHandler(messageHandler);
- return WebKit::WebProcessMainQt(new QApplication(argc, argv));
+ return WebKit::WebProcessMainQt(new ApplicationType(argc, argv));
}
diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def
index 196bbf059..5db44471c 100644
--- a/Source/WebKit2/win/WebKit2.def
+++ b/Source/WebKit2/win/WebKit2.def
@@ -167,7 +167,6 @@ EXPORTS
?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z
?create@ShadowRoot@WebCore@@SA?AV?$PassRefPtr@VShadowRoot@WebCore@@@WTF@@PAVElement@2@AAH@Z
?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
- ?distributedNodes@InsertionPoint@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@XZ
?documentState@HistoryItem@WebCore@@QBEABV?$Vector@VString@WTF@@$0A@@WTF@@XZ
?equal@WTF@@YA_NPBVStringImpl@1@PBE@Z
?equal@WTF@@YA_NPBVStringImpl@1@0@Z
@@ -305,8 +304,7 @@ EXPORTS
?moveWindowBy@InspectorFrontendClientLocal@WebCore@@UAEXMM@Z
?open@DOMWindow@WebCore@@QAE?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@ABVString@4@ABVAtomicString@4@0PAV12@2@Z
?openInNewTab@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@@Z
- ?requestAttachWindow@InspectorFrontendClientLocal@WebCore@@UAEXXZ
- ?requestDetachWindow@InspectorFrontendClientLocal@WebCore@@UAEXXZ
+ ?requestSetDockSide@InspectorFrontendClientLocal@WebCore@@UAEXW4DockSide@InspectorFrontendClient@2@@Z
?sendMessageToBackend@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@@Z
?setInspectorFrontendClient@InspectorController@WebCore@@QAEXV?$PassOwnPtr@VInspectorFrontendClient@WebCore@@@WTF@@@Z
?setProperty@Settings@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@0@Z
diff --git a/Source/WebKit2/win/WebKit2CFLite.def b/Source/WebKit2/win/WebKit2CFLite.def
index d6fd9fb6f..cada54a94 100644
--- a/Source/WebKit2/win/WebKit2CFLite.def
+++ b/Source/WebKit2/win/WebKit2CFLite.def
@@ -293,8 +293,7 @@ EXPORTS
?moveWindowBy@InspectorFrontendClientLocal@WebCore@@UAEXMM@Z
?open@DOMWindow@WebCore@@QAE?AV?$PassRefPtr@VDOMWindow@WebCore@@@WTF@@ABVString@4@ABVAtomicString@4@0PAV12@2@Z
?openInNewTab@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@@Z
- ?requestAttachWindow@InspectorFrontendClientLocal@WebCore@@UAEXXZ
- ?requestDetachWindow@InspectorFrontendClientLocal@WebCore@@UAEXXZ
+ ?requestSetDockSide@InspectorFrontendClientLocal@WebCore@@UAEXW4DockSide@InspectorFrontendClient@2@@Z
?sendMessageToBackend@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@@Z
?setInspectorFrontendClient@InspectorController@WebCore@@QAEXV?$PassOwnPtr@VInspectorFrontendClient@WebCore@@@WTF@@@Z
?setProperty@Settings@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@0@Z
diff --git a/Source/autotools/symbols.filter b/Source/autotools/symbols.filter
index aed54af21..e81a66a8e 100644
--- a/Source/autotools/symbols.filter
+++ b/Source/autotools/symbols.filter
@@ -99,8 +99,7 @@ _ZN7WebCore25jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10St
_ZN7WebCore28InspectorFrontendClientLocal12moveWindowByEff;
_ZN7WebCore28InspectorFrontendClientLocal12openInNewTabERKN3WTF6StringE;
_ZN7WebCore28InspectorFrontendClientLocal14frontendLoadedEv;
-_ZN7WebCore28InspectorFrontendClientLocal19requestAttachWindowEv;
-_ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv;
+_ZN7WebCore28InspectorFrontendClientLocal18requestSetDockSideENS_23InspectorFrontendClient8DockSideE;
_ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv;
_ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKN3WTF6StringE;
_ZN7WebCore28InspectorFrontendClientLocal26changeAttachedWindowHeightEj;
diff --git a/Source/cmake/OptionsEfl.cmake b/Source/cmake/OptionsEfl.cmake
index c87656ada..0f366d798 100644
--- a/Source/cmake/OptionsEfl.cmake
+++ b/Source/cmake/OptionsEfl.cmake
@@ -55,7 +55,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ANIMATION_API ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BATTERY_STATUS ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BLOB ON)
-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS3_TEXT_DECORATION ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS3_TEXT ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_IMAGE_SET ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_STICKY_POSITION ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_VARIABLES ON)
@@ -125,7 +125,7 @@ SET(WTF_USE_HARFBUZZ_NG 1)
ADD_DEFINITIONS(-DWTF_USE_FREETYPE=1)
ADD_DEFINITIONS(-DWTF_USE_HARFBUZZ_NG=1)
-IF (ENABLE_WEBKIT2)
+IF (ENABLE_WEBKIT2 AND ENABLE_NETSCAPE_PLUGIN_API)
SET(ENABLE_PLUGIN_PROCESS 1)
ENDIF ()
diff --git a/Source/cmake/WebKitFeatures.cmake b/Source/cmake/WebKitFeatures.cmake
index b7f75d84f..adefd884e 100644
--- a/Source/cmake/WebKitFeatures.cmake
+++ b/Source/cmake/WebKitFeatures.cmake
@@ -20,7 +20,8 @@ MACRO (WEBKIT_OPTION_BEGIN)
WEBKIT_OPTION_DEFINE(ENABLE_BLOB "Toggle Blob support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_CHANNEL_MESSAGING "Toggle MessageChannel and MessagePort support" ON)
WEBKIT_OPTION_DEFINE(ENABLE_CSP_NEXT "Toggle Content Security Policy 1.1 support" OFF)
- WEBKIT_OPTION_DEFINE(ENABLE_CSS3_TEXT_DECORATION "Toggle CSS3 Text Decoration support" OFF)
+ WEBKIT_OPTION_DEFINE(ENABLE_CSS3_CONDITIONAL_RULES "Toggle CSS3 Conditional Rules support" OFF)
+ WEBKIT_OPTION_DEFINE(ENABLE_CSS3_TEXT "Toggle CSS3 Text support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_CSS_BOX_DECORATION_BREAK "Toggle Box Decoration Break (CSS Backgrounds and Borders) support" ON)
WEBKIT_OPTION_DEFINE(ENABLE_CSS_COMPOSITING "Toggle CSS COMPOSITING support" OFF)
WEBKIT_OPTION_DEFINE(ENABLE_CSS_EXCLUSIONS "Toggle CSS Exclusion support" OFF)
diff --git a/Source/cmakeconfig.h.cmake b/Source/cmakeconfig.h.cmake
index 20505cb94..5966b45fb 100644
--- a/Source/cmakeconfig.h.cmake
+++ b/Source/cmakeconfig.h.cmake
@@ -13,7 +13,7 @@
#cmakedefine01 ENABLE_CHANNEL_MESSAGING
#cmakedefine01 ENABLE_CLIENT_BASED_GEOLOCATION
#cmakedefine01 ENABLE_CSP_NEXT
-#cmakedefine01 ENABLE_CSS3_TEXT_DECORATION
+#cmakedefine01 ENABLE_CSS3_TEXT
#cmakedefine01 ENABLE_CSS_BOX_DECORATION_BREAK
#cmakedefine01 ENABLE_CSS_COMPOSITING
#cmakedefine01 ENABLE_CSS_EXCLUSIONS
@@ -26,6 +26,7 @@
#cmakedefine01 ENABLE_CSS_SHADERS
#cmakedefine01 ENABLE_CSS_STICKY_POSITION
#cmakedefine01 ENABLE_CSS_VARIABLES
+#cmakedefine01 ENABLE_CSS3_CONDITIONAL_RULES
#cmakedefine01 ENABLE_CUSTOM_SCHEME_HANDLER
#cmakedefine01 ENABLE_DATALIST_ELEMENT
#cmakedefine01 ENABLE_DATA_TRANSFER_ITEMS
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js
index 1e56994ae..92fa03a00 100644
--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js
+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js
@@ -72,6 +72,8 @@ config.kPlatforms = {
'WebKit Mac10.6': {version: 'snowleopard'},
'WebKit Mac10.6 (dbg)': {version: 'snowleopard', debug: true},
'WebKit Mac10.7': {version: 'lion'},
+ 'WebKit Mac10.7 (dbg)': {version: 'lion', debug: true},
+ 'WebKit Mac10.8': {version: 'mountainlion'},
},
haveBuilderAccumulatedResults : true,
useDirectoryListingForOldBuilds: true,
@@ -86,7 +88,12 @@ config.kPlatforms = {
// FIXME: Should garden-o-matic show these? I can imagine showing the deps bots being useful at least so
// that the gardener only need to look at garden-o-matic and never at the waterfall. Not really sure who
// watches the GPU bots.
- return builderName.indexOf('GPU') == -1 && builderName.indexOf('deps') == -1 && builderName.indexOf('ASAN') == -1 && builderName.indexOf('Content Shell') == -1;
+ // The 10.8 Tests bot is really an FYI bot at this point
+ return builderName.indexOf('GPU') == -1 &&
+ builderName.indexOf('deps') == -1 &&
+ builderName.indexOf('ASAN') == -1 &&
+ builderName.indexOf('Content Shell') == -1 &&
+ builderName.indexOf('Mac10.8 Tests') == -1;
},
},
'gtk' : {
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index ceabcd3f1..180b6b275 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,783 @@
+2012-10-22 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Fix compilation after r132059.
+
+ * TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp:
+
+2012-10-22 Dominik Röttsches <dominik.rottsches@intel.com>
+
+ Adding Cairo and Harfbuzz watchlist entries
+
+ Unreviewed watchlist update.
+
+ Added myself to these new ones and SVG.
+
+ * Scripts/webkitpy/common/config/watchlist:
+
+2012-10-22 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: do not double count memory of objects with multiple ancestors
+ https://bugs.webkit.org/show_bug.cgi?id=99958
+
+ Reviewed by Alexander Pavlov.
+
+ * TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp: Test that there
+ is no double counting in case of multiple inheritance.
+
+2012-10-22 Allan Sandfeld Jensen <allan.jensen@digia.com>
+
+ [Qt] Basic gesture event handling
+ https://bugs.webkit.org/show_bug.cgi?id=66173
+
+ Reviewed by Simon Hausmann.
+
+ Add support for eventSender.gestureLongPress.
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::EventSender):
+ (EventSender::gestureLongPress):
+ * DumpRenderTree/qt/EventSenderQt.h:
+ (EventSender):
+
+2012-10-22 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+
+ [WTR] Properly initialize TestRunner::m_dumpSelectionRect.
+ https://bugs.webkit.org/show_bug.cgi?id=99970
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Follow-up to r131476: actually initialize m_dumpSelectionRect to
+ some value to avoid some flakyness in the tests.
+
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::TestRunner):
+
+2012-10-22 Tor Arne Vestbø <tor.arne.vestbo@digia.com>
+
+ [Qt] Don't build any of the tools in production_build
+
+ Reviewed by Simon Hausmann.
+
+ * Tools.pro:
+ * qmake/mkspecs/features/configure.prf:
+
+2012-10-22 Tor Arne Vestbø <tor.arne.vestbo@digia.com>
+
+ [Qt] Move OBJECTS_DIR and friends to default_pre.prf
+
+ The introduction of load(qt_build_config) in .qmake.conf meant
+ that we started loading qtmodule.pri, which in turn set both
+ MOC_DIR, RCC_DIR, and OBJECTS_DIR.
+
+ We were setting OBJECTS_DIR in default_post under a isEmpty() guard
+ so that project files could override the objects dir. Instead of
+ using the isEmpty() check we move it to defaul_pre, which will
+ override the qtmodule.pri settings, but still allow project files
+ to override it.
+
+ Reviewed by Ossy.
+
+ * qmake/mkspecs/features/default_post.prf:
+ * qmake/mkspecs/features/default_pre.prf:
+
+2012-10-22 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ WebKitTestRunner needs testRunner.queueLoadingScript and testRunner.queueNonLoadingScript
+ https://bugs.webkit.org/show_bug.cgi?id=42675
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added implementation of testRunner.queueLoadingScript and testRunner.queueNonLoadingScript.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::queueLoadingScript):
+ (WTR):
+ (WTR::InjectedBundle::queueNonLoadingScript):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (InjectedBundle):
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::queueLoadingScript):
+ (WTR):
+ (WTR::TestRunner::queueNonLoadingScript):
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ (TestRunner):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+ * WebKitTestRunner/WorkQueueManager.cpp:
+ (WTR):
+ (WTR::runJavaScriptFunction):
+ (ScriptItem):
+ (WTR::ScriptItem::ScriptItem):
+ (WTR::ScriptItem::invoke):
+ (WTR::WorkQueueManager::queueBackNavigation):
+ (WTR::WorkQueueManager::queueLoadingScript):
+ (WTR::WorkQueueManager::queueNonLoadingScript):
+ * WebKitTestRunner/WorkQueueManager.h:
+ (WorkQueueManager):
+
+2012-10-22 Zan Dobersek <zandobersek@gmail.com>
+
+ Unreviewed, a follow-up to r132034 where I forgot to address
+ Ojan's review comment about the race condition in handleLocationChange.
+
+ * TestResultServer/static-dashboards/dashboard_base.js:
+ (handleLocationChange):
+
+2012-10-22 Zan Dobersek <zandobersek@gmail.com>
+
+ [TestResultServer] Move the resource loading into a dedicated class
+ https://bugs.webkit.org/show_bug.cgi?id=99246
+
+ Reviewed by Ojan Vafai.
+
+ A new 'loader' namespace is created, containing the request method (previously located in dashboard_base.js)
+ and the new Loader object, which handles the loading of all the necessary data the dashboard might require.
+
+ * TestResultServer/static-dashboards/aggregate_results.html: Include the loader.js source file.
+ * TestResultServer/static-dashboards/builders.js:
+ (requestBuilderList): Use the request method located in the loader namespace instead of the removed doXHR method.
+ (onBuilderListLoad): Now parses the response text of the passed-in XHR. When all the builder lists are loaded the
+ resource loader object is notified appropriately.
+ (onErrorLoadingBuilderList): The partial function that calls this function also adds an XHR parameter.
+ * TestResultServer/static-dashboards/dashboard_base.js: Much of the resource loading-related code is moved to loader.js.
+ The Loader object is now used to load all the required resources.
+ (parseParameters): Don't push the 'builder' parameter into the current state if the unit tests are being run.
+ (resourceLoadingComplete): This method gets called when all the resources are loaded and the dashboard should
+ proceed with generating the page.
+ (handleLocationChange):
+ * TestResultServer/static-dashboards/flakiness_dashboard.html: Include the loader.js source file.
+ * TestResultServer/static-dashboards/flakiness_dashboard.js: The request method has been relocated to the loader namespace.
+ * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js: The affected test cases are modified appropriately.
+ (test):
+ * TestResultServer/static-dashboards/loader.js: Added.
+ (.): A new namespace is introduced, publicly exporting the request method that performs an XHR operation and a Loader object
+ which oversees resource loading. The loading is done in steps, first loading the builders list, after that the results files
+ the current dashboard needs, and lastly the TestExpectations files if they are required by the dashboard. When done the loader
+ calls the resourceLoadingComplete method located in dashboard_base.js. This signals the dashboard all resources are available
+ and it can proceed with generating the dashboard page.
+ * TestResultServer/static-dashboards/loader_unittests.js: Added. Contains unit tests for the Loader object, covering the
+ incremental loading and the loading of results files and TestExpectations files. The builders list loading is currently not
+ tested as the unit tests page overrides related methods that possibly affect other tests' behavior.
+ * TestResultServer/static-dashboards/run-unittests.html: Now includes the loader.js and loader_unittests.js source file.
+ Refactors the code a bit due to changes in how onBuilderListLoad behaves.
+ * TestResultServer/static-dashboards/timeline_explorer.html: Now includes the loader.js source file.
+ * TestResultServer/static-dashboards/treemap.html: Ditto. Also refactors the code to take into account
+ that all the test files are now loaded before generating the dashboard page.
+
+2012-10-21 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] introduce a public API for the TestRunner library
+ https://bugs.webkit.org/show_bug.cgi?id=99904
+
+ Reviewed by Adam Barth.
+
+ The API decouples the public API from the underlying implementation, so
+ embedders can depend on it. I'm also changing DRT to consume the
+ TestRunner API through the public API, except for DRTTestRunner and all
+ places that require Task.h. These two will be migrated in later changes.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * DumpRenderTree/DumpRenderTree.gypi:
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
+ * DumpRenderTree/chromium/DRTDevToolsClient.h:
+ * DumpRenderTree/chromium/MockSpellCheck.cpp:
+ (MockSpellCheck::fillSuggestionList):
+ * DumpRenderTree/chromium/MockSpellCheck.h:
+ (MockSpellCheck):
+ * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h:
+ * DumpRenderTree/chromium/MockWebSpeechInputController.h:
+ * DumpRenderTree/chromium/MockWebSpeechRecognizer.h:
+ * DumpRenderTree/chromium/TestRunner/public/WebAccessibilityController.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h.
+ (WebKit):
+ (WebTestRunner):
+ (WebAccessibilityController):
+ * DumpRenderTree/chromium/TestRunner/public/WebEventSender.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h.
+ (WebKit):
+ (WebTestRunner):
+ (WebEventSender):
+ * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h.
+ (WebKit):
+ (WebTestRunner):
+ (WebTestDelegate):
+ * DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h.
+ (WebKit):
+ (WebTestRunner):
+ (WebTestInterfaces):
+ * DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp:
+ (WebTestRunner):
+ * DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h:
+ (WebTestRunner):
+ * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp:
+ (WebTestRunner):
+ (WebTestRunner::makeMenuItemStringsFor):
+ * DumpRenderTree/chromium/TestRunner/src/EventSender.h:
+ (WebTestRunner):
+ * DumpRenderTree/chromium/TestRunner/src/TestDelegate.h:
+ (TestDelegate):
+ * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:
+ * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h:
+ (TestInterfaces):
+ * DumpRenderTree/chromium/TestRunner/src/WebAccessibilityController.cpp: Copied from Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h.
+ (WebTestRunner):
+ (WebTestRunner::WebAccessibilityController::WebAccessibilityController):
+ (WebTestRunner::WebAccessibilityController::setFocusedElement):
+ (WebTestRunner::WebAccessibilityController::notificationReceived):
+ (WebTestRunner::WebAccessibilityController::shouldLogAccessibilityEvents):
+ * DumpRenderTree/chromium/TestRunner/src/WebEventSender.cpp: Copied from Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h.
+ (WebTestRunner):
+ (WebTestRunner::WebEventSender::WebEventSender):
+ (WebTestRunner::WebEventSender::doDragDrop):
+ * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp: Added.
+ (WebTestRunner):
+ (WebTestInterfaces::Internal):
+ (WebTestRunner::WebTestInterfaces::Internal::testInterfaces):
+ (WebTestRunner::WebTestInterfaces::Internal::accessibilityController):
+ (WebTestRunner::WebTestInterfaces::Internal::eventSender):
+ (WebTestRunner::WebTestInterfaces::Internal::Internal):
+ (WebTestRunner::WebTestInterfaces::Internal::~Internal):
+ (WebTestRunner::WebTestInterfaces::Internal::setDelegate):
+ (WebTestRunner::WebTestInterfaces::Internal::clearContextMenuData):
+ (WebTestRunner::WebTestInterfaces::Internal::clearEditCommand):
+ (WebTestRunner::WebTestInterfaces::Internal::fillSpellingSuggestionList):
+ (WebTestRunner::WebTestInterfaces::Internal::setEditCommand):
+ (WebTestRunner::WebTestInterfaces::Internal::lastContextMenuData):
+ (WebTestRunner::WebTestInterfaces::Internal::setGamepadData):
+ (WebTestRunner::WebTestInterfaces::WebTestInterfaces):
+ (WebTestRunner::WebTestInterfaces::~WebTestInterfaces):
+ (WebTestRunner::WebTestInterfaces::setWebView):
+ (WebTestRunner::WebTestInterfaces::setDelegate):
+ (WebTestRunner::WebTestInterfaces::bindTo):
+ (WebTestRunner::WebTestInterfaces::resetAll):
+ (WebTestRunner::WebTestInterfaces::accessibilityController):
+ (WebTestRunner::WebTestInterfaces::eventSender):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::initialize):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::eventSender):
+ (TestShell::accessibilityController):
+ (TestShell):
+ * DumpRenderTree/chromium/WebUserMediaClientMock.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::finishLastTextCheck):
+ (WebViewHost::fillSpellingSuggestionList):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost):
+
+2012-10-21 Viatcheslav Ostapenko <v.ostapenko@samsung.com>
+
+ Unreviewed. Updating my emails.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2012-10-20 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+
+ [EFL][DRT] Implement tracking and painting repaint rectangles.
+ https://bugs.webkit.org/show_bug.cgi?id=99838
+
+ Reviewed by Gyuyoung Kim.
+
+ Implement displayWebView() and start tracking/painting the repaint
+ rectangles for the repaint tests that rely on it.
+
+ * DumpRenderTree/efl/DumpRenderTree.cpp:
+ (displayWebView):
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+ * DumpRenderTree/efl/PixelDumpSupportEfl.cpp:
+ (createBitmapContextFromWebView):
+
+2012-10-19 Dan Bernstein <mitz@apple.com>
+
+ Add bundle API for hit-testing
+ https://bugs.webkit.org/show_bug.cgi?id=99907
+
+ Reviewed by Sam Weinig.
+
+ Added an API test for WKBundleFrameCreateHitTest().
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added InjectedBundleFrameHitTest.cpp,
+ InjectedBundleFrameHitTest_bundle.cpp, and link-with-title.html.
+
+ * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp: Added.
+ (TestWebKitAPI::didReceiveMessageFromInjectedBundle): Checks that the message contains the
+ title of the link in link-with-title.html.
+ (TestWebKitAPI::setInjectedBundleClient):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp: Added.
+ (TestWebKitAPI::InjectedBundleFrameHitTestTest::InjectedBundleFrameHitTestTest):
+ (TestWebKitAPI::didFinishLoadForFrameCallback): Hit tests at (50, 50) and sends the link title
+ from the result back to the UI process.
+ (TestWebKitAPI::InjectedBundleFrameHitTestTest::didCreatePage):
+ (TestWebKitAPI::InjectedBundleFrameHitTestTest::frameLoadFinished):
+ * TestWebKitAPI/Tests/WebKit2/link-with-title.html: Added.
+
+2012-10-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r131944.
+ http://trac.webkit.org/changeset/131944
+ https://bugs.webkit.org/show_bug.cgi?id=99891
+
+ On second thoughts, not such a great idea (Requested by jamesr
+ on #webkit).
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::createNewWindow):
+
+2012-10-19 Alexandre Elias <aelias@chromium.org>
+
+ [chromium] API to pass impl thread via WebLayerTreeView
+ https://bugs.webkit.org/show_bug.cgi?id=99863
+
+ Reviewed by James Robinson.
+
+ This adds an API to pass the compositor impl thread via WebView and
+ WebLayerTreeView. This is currently a no-op change, but in the future
+ this codepath will supercede WebCompositor. The goal is to avoid statics
+ in compositor initialization.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::createNewWindow):
+
+2012-10-19 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+
+ [Cairo][WTR] Implement the painting of repaint rectangles.
+ https://bugs.webkit.org/show_bug.cgi?id=99839
+
+ Reviewed by Martin Robinson.
+
+ Implement the required code to paint the gray overlay with
+ transparent regions for the repaint rectangles, as other ports
+ already do and as is already done in most WK1 ports.
+
+ * WebKitTestRunner/cairo/TestInvocationCairo.cpp:
+ (WTR::paintRepaintRectOverlay):
+ (WTR::TestInvocation::dumpPixelsAndCompareWithExpected):
+
+2012-09-08 Alpha Lam <hclam@chromium.org>
+
+ [chromium] Implement deferred image decoding
+ https://bugs.webkit.org/show_bug.cgi?id=94240
+
+ Reviewed by Stephen White.
+
+ Add --enable-deferred-image-decoding to DRT.
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ (TestShell::resetWebSettings):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::setDeferredImageDecodingEnabled):
+ (TestShell):
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ (WebPreferences::applyTo):
+ * DumpRenderTree/chromium/WebPreferences.h:
+ (WebPreferences):
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ (ChromiumPort.virtual_test_suites):
+
+2012-10-19 Dongwoo Joshua Im <dw.im@samsung.com>
+
+ Rename ENABLE_CSS3_TEXT_DECORATION to ENABLE_CSS3_TEXT
+ https://bugs.webkit.org/show_bug.cgi?id=99804
+
+ Reviewed by Julien Chaffraix.
+
+ CSS3 text related properties will be implemented under this flag,
+ including text decoration, text-align-last, and text-justify.
+
+ * Scripts/webkitperl/FeatureList.pm:
+ * qmake/mkspecs/features/features.pri:
+
+2012-10-19 Balazs Kelemen <kbalazs@webkit.org>
+
+ [Qt][WTR] renderToOffscreenBuffer should not be set if the real render loop is active
+ https://bugs.webkit.org/show_bug.cgi?id=99831
+
+ Reviewed by Jocelyn Turcotte.
+
+ Do not set renderToOffscreenBuffer if we have called setRenderWithoutShowing.
+ We do not need it in this case and these things are actually conflicting.
+
+ * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+ (WTR::WrapperWindow::handleStatusChanged):
+ (WTR::PlatformWebView::PlatformWebView):
+ (WTR::PlatformWebView::windowShapshotEnabled): Added a comment
+ describing why this workaround is needed.
+
+2012-10-19 Zan Dobersek <zandobersek@gmail.com>
+
+ [WK2][GTK] Fullscreen tests timing out in bots
+ https://bugs.webkit.org/show_bug.cgi?id=93973
+
+ Reviewed by Philippe Normand.
+
+ Add webcore_cppflags to the CPPFLAGS for WebKitTestRunner and the
+ injected bundle library. webcore_cppflags contains all the feature
+ defines' macros so the ENABE(*) compilation guards should now work
+ properly (i.e. enable the code behind them when the feature is enabled).
+
+ * WebKitTestRunner/GNUmakefile.am:
+
+2012-10-19 Simon Hausmann <simon.hausmann@digia.com>
+
+ Unreviewed, rolling out r131734.
+ http://trac.webkit.org/changeset/131734
+
+ Broke ANGLE build where we end up with @echo foo && @echo -n
+
+ * qmake/mkspecs/features/default_post.prf:
+
+2012-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ REGRESSION (r130640 - r130644): TestCookieManager API test is failing
+ https://bugs.webkit.org/show_bug.cgi?id=98738
+
+ Reviewed by Philippe Normand.
+
+ * Scripts/run-gtk-tests:
+ (TestRunner): Unskip /webkit2/WebKitCookieManager/accept-policy.
+
+2012-10-19 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Update the RuntimeEnabledFeatures flags
+ https://bugs.webkit.org/show_bug.cgi?id=99714
+
+ Reviewed by Adam Barth.
+
+ Enabling the DeprecatedPeerConnection so that all tests still run.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+
+2012-10-18 Dominic Mazzoni <dmazzoni@google.com>
+
+ AX: labelForElement is slow when there are a lot of DOM elements
+ https://bugs.webkit.org/show_bug.cgi?id=97825
+
+ Reviewed by Ryosuke Niwa.
+
+ Implement titleUIElement in the chromium port of DRT, and
+ fix getAccessibleElementById so that it ensures the backing store
+ is up-to-date.
+
+ * DumpRenderTree/chromium/TestRunner/AccessibilityControllerChromium.cpp:
+ (AccessibilityController::getAccessibleElementById):
+ * DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:
+ (AccessibilityUIElement::titleUIElementCallback):
+
+2012-10-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Web Inspector: NMI provide data for mixing with tcmalloc heap dumps.
+ https://bugs.webkit.org/show_bug.cgi?id=99457
+
+ Reviewed by Yury Semikhatsky.
+
+ countObjectSize now requires pointer to object as the first argument.
+
+ * TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp:
+
+2012-10-18 Dirk Pranke <dpranke@chromium.org>
+
+ make move_overwritten_baselines_to work again while rebaselining
+ https://bugs.webkit.org/show_bug.cgi?id=99793
+
+ Reviewed by Ojan Vafai.
+
+ We used to have code that would help when rebaselining results
+ for new ports (e.g., when moving from Lion to Mountain Lion) but
+ it appears that code bitrotted during all the refactoring since
+ the last time we needed this. This patch makes things work
+ again, adds more tests that will hopefully make clearer what
+ is supposed to work, and renames various parameters to be
+ consistent.
+
+ * Scripts/webkitpy/layout_tests/port/builders.py:
+ (move_overwritten_baselines_to):
+ (builder_path_for_port_name):
+ * Scripts/webkitpy/tool/commands/rebaseline.py:
+ (RebaselineTest.__init__):
+ (RebaselineTest._copy_existing_baseline):
+ (RebaselineTest._rebaseline_test):
+ (RebaselineTest.execute):
+ (AbstractParallelRebaselineCommand._rebaseline_commands):
+ * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
+ (test_rebaseline_json_with_move_overwritten_baselines_to):
+ (test_rebaseline_test_internal_with_move_overwritten_baselines_to):
+ * Scripts/webkitpy/tool/servers/gardeningserver_unittest.py:
+ (GardeningServerTest.test_rebaselineall):
+
+2012-10-18 Roger Fong <roger_fong@apple.com>
+
+ Unreviewed. Skip really old flaky failing jscore date test.
+ There's a bug tracking it here: https://bugs.webkit.org/show_bug.cgi?id=53712.
+
+ * Scripts/run-javascriptcore-tests:
+
+2012-10-18 Byungwoo Lee <bw80.lee@samsung.com>
+
+ Fix build warning.
+ https://bugs.webkit.org/show_bug.cgi?id=99788
+
+ Reviewed by Kentaro Hara.
+
+ Use return value of mktemp() for removing -Wunused-result.
+
+ * MiniBrowser/efl/main.c:
+ (on_download_request):
+
+2012-10-18 Benjamin Poulain <bpoulain@apple.com>
+
+ [WK2] WebKit2 does not build without PLUGIN_PROCESS on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=99771
+
+ Reviewed by Anders Carlsson.
+
+ * DumpRenderTree/mac/MockWebNotificationProvider.mm: The file was not including config.h,
+ effectively breaking feature flags.
+
+2012-10-18 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+
+ [EFL][DRT] Make textareas resizable by default.
+ https://bugs.webkit.org/show_bug.cgi?id=99719
+
+ Reviewed by Gyuyoung Kim.
+
+ Enable painting the textarea resizer at the corner by default,
+ just as it already is the case for WK2. This eases the work needed
+ to get the pixel tests in shape and run by the bots, as both the
+ WK1 and WK2 ports will have more similar results.
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+
+2012-10-18 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] Add a webkit_test_support target that WebTestingSupport
+ https://bugs.webkit.org/show_bug.cgi?id=99772
+
+ Reviewed by Adam Barth.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+
+2012-10-18 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] move TestRunner files into a src/ sub directory
+ https://bugs.webkit.org/show_bug.cgi?id=99776
+
+ Reviewed by Adam Barth.
+
+ This is in preparation of adding a public API to the TestRunner library.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * DumpRenderTree/DumpRenderTree.gypi:
+ * DumpRenderTree/chromium/DRTTestRunner.h:
+ * DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/AccessibilityControllerChromium.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/AccessibilityControllerChromium.h.
+ * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h.
+ * DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.h.
+ * DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/CppVariant.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/CppVariant.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/CppVariant.h.
+ * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/EventSender.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/EventSender.h.
+ * DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/GamepadController.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/GamepadController.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/GamepadController.h.
+ * DumpRenderTree/chromium/TestRunner/src/Task.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/Task.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/Task.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/Task.h.
+ * DumpRenderTree/chromium/TestRunner/src/TestDelegate.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/TestDelegate.h.
+ * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h.
+ * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/TestRunner.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/TestRunner.h.
+ * DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp: Renamed from Tools/DumpRenderTree/chromium/TestRunner/TextInputController.cpp.
+ * DumpRenderTree/chromium/TestRunner/src/TextInputController.h: Renamed from Tools/DumpRenderTree/chromium/TestRunner/TextInputController.h.
+
+2012-10-18 Dirk Pranke <dpranke@chromium.org>
+
+ [chromium] garden-o-matic should ignore the 10.8 Tests bot
+ https://bugs.webkit.org/show_bug.cgi?id=99765
+
+ Reviewed by Adam Barth.
+
+ It's really more of an FYI bot at this point and can be safely
+ ignored like the Content Shell bots.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js:
+ (.):
+
+2012-10-18 Jochen Eisinger <jochen@chromium.org>
+
+ [chromium] Simplify TestInterfaces, as this class won't be directly exposed in the TestRunner library's interface
+ https://bugs.webkit.org/show_bug.cgi?id=99766
+
+ Reviewed by Adam Barth.
+
+ This reverts http://trac.webkit.org/changeset/123240
+
+ * DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp:
+ (TestInterfaces::TestInterfaces):
+ (TestInterfaces::~TestInterfaces):
+ (TestInterfaces::setWebView):
+ (TestInterfaces::setDelegate):
+ (TestInterfaces::bindTo):
+ (TestInterfaces::resetAll):
+ (TestInterfaces::accessibilityController):
+ (TestInterfaces::eventSender):
+ * DumpRenderTree/chromium/TestRunner/TestInterfaces.h:
+ (TestInterfaces):
+
+2012-10-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r131810.
+ http://trac.webkit.org/changeset/131810
+ https://bugs.webkit.org/show_bug.cgi?id=99762
+
+ Broke linux debug webkit_unit_tests (Requested by
+ danakj|gardening on #webkit).
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ (TestShell::resetWebSettings):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell):
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ (WebPreferences::applyTo):
+ * DumpRenderTree/chromium/WebPreferences.h:
+ (WebPreferences):
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ (ChromiumPort.virtual_test_suites):
+
+2012-10-18 Alpha Lam <hclam@chromium.org>
+
+ [chromium] Implement deferred image decoding
+ https://bugs.webkit.org/show_bug.cgi?id=94240
+
+ Reviewed by Stephen White.
+
+ Add --enable-deferred-image-decoding to DRT.
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ (TestShell::resetWebSettings):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::setDeferredImageDecodingEnabled):
+ (TestShell):
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ (WebPreferences::applyTo):
+ * DumpRenderTree/chromium/WebPreferences.h:
+ (WebPreferences):
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ (ChromiumPort.virtual_test_suites):
+
+2012-10-18 Dirk Pranke <dpranke@chromium.org>
+
+ webkitpy: fix chromium bot configs in builders.py
+ https://bugs.webkit.org/show_bug.cgi?id=99638
+
+ Reviewed by Ojan Vafai.
+
+ Updating after the great bot-renaming and deleting a test case
+ that is no longer needed.
+
+ * Scripts/webkitpy/layout_tests/port/builders.py:
+ * Scripts/webkitpy/tool/servers/gardeningserver_unittest.py:
+ (BuildCoverageExtrapolatorTest.test_extrapolate):
+
+2012-10-18 Dirk Pranke <dpranke@chromium.org>
+
+ [chromium] Add 10.8 bot into fallback path, make work with garden-o-matic
+ https://bugs.webkit.org/show_bug.cgi?id=99748
+
+ Reviewed by Ryosuke Niwa.
+
+ Subject pretty much says it all ...
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js:
+ * Scripts/webkitpy/layout_tests/port/builders.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ (ChromiumMacPort):
+ * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py:
+ (ChromiumMacPortTest.test_versions):
+ (ChromiumMacPortTest.test_baseline_path):
+ * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
+ (TestRebaseline.test_baseline_directory):
+ (test_rebaseline_and_copy_test_with_lion_result):
+ (test_rebaseline_expectations):
+
+2012-10-18 Timothy Hatcher <timothy@apple.com>
+
+ Teach prepare-ChangeLog how to handle non-function properties in JavaScript prototypes.
+
+ https://bugs.webkit.org/show_bug.cgi?id=99747
+
+ Reviewed by Joseph Pecoraro.
+
+ * Scripts/prepare-ChangeLog:
+ (get_function_line_ranges_for_javascript): Clear currentIdentifiers when comma is encountered
+ so it does not tack those identifiers onto the next changed function.
+
+2012-10-18 James Simonsen <simonjam@chromium.org>
+
+ Add a script for exporting http/tests/w3c/webperf/submission to W3C
+ https://bugs.webkit.org/show_bug.cgi?id=99675
+
+ Reviewed by Tony Gentilcore.
+
+ This does the inverse of Scripts/import-w3c-performance-wg-tests.
+
+ * Scripts/export-w3c-performance-wg-tests: Added.
+
+2012-10-18 Pablo Flouret <pablof@motorola.com>
+
+ Implement css3-conditional's @supports rule
+ https://bugs.webkit.org/show_bug.cgi?id=86146
+
+ Reviewed by Antti Koivisto.
+
+ * Scripts/webkitperl/FeatureList.pm:
+ * qmake/mkspecs/features/features.pri:
+ Add an ENABLE_CSS3_CONDITIONAL_RULES flag.
+
+2012-10-18 Xiaobo Wang <xbwang@torchmobile.com.cn>
+
+ [BlackBerry] Dump DRT output to stdout if test is passed as command line argument
+ https://bugs.webkit.org/show_bug.cgi?id=99150
+
+ Reviewed by Rob Buis.
+
+ Fixed some code style errors as well.
+
+ * DumpRenderTree/blackberry/DumpRenderTree.cpp:
+ (BlackBerry::WebKit::DumpRenderTree::runTest):
+ (BlackBerry::WebKit::DumpRenderTree::runRemainingTests):
+ (BlackBerry::WebKit::DumpRenderTree::runTests):
+ (BlackBerry::WebKit::DumpRenderTree::isHTTPTest):
+ (BlackBerry::WebKit::DumpRenderTree::dump):
+ (BlackBerry::WebKit::DumpRenderTree::addMessageToConsole):
+ * DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:
+ (DumpRenderTree):
+
+2012-10-18 Simon Hausmann <simon.hausmann@digia.com>
+
+ [Qt] Improved support for silent builds
+
+ Reviewed by Tor Arne Vestbø.
+
+ Silence our extra compilers when CONFIG+=silent is set.
+
+ * qmake/mkspecs/features/default_post.prf:
+
2012-10-18 Simon Hausmann <simon.hausmann@digia.com>
[Qt] Reduce memory pressure at link time with less compromise on speed of linking
diff --git a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp
index a24051584..a81284b0b 100644
--- a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp
+++ b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp
@@ -77,9 +77,13 @@
{
'target_name': 'TestRunner',
'type': 'static_library',
+ 'defines': [
+ 'WEBTESTRUNNER_IMPLEMENTATION=1',
+ ],
'dependencies': [
'TestRunner_resources',
'<(source_dir)/WebKit/chromium/WebKit.gyp:webkit',
+ '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit_test_support',
'<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
'<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
],
@@ -87,11 +91,12 @@
'<(chromium_src_dir)',
'<(source_dir)/WebKit/chromium/public',
'<(DEPTH)',
- '../chromium/TestRunner',
+ '../chromium/TestRunner/public',
+ '../chromium/TestRunner/src',
],
'direct_dependent_settings': {
'include_dirs': [
- '../chromium/TestRunner',
+ '../chromium/TestRunner/public',
],
},
'sources': [
@@ -358,20 +363,6 @@
'<(chromium_src_dir)/webkit/support/setup_third_party.gyp:third_party_headers',
]
}],
- ['inside_chromium_build==0 or component!="shared_library"', {
- 'dependencies': [
- '<(source_dir)/WebCore/WebCore.gyp/WebCore.gyp:webcore_test_support',
- ],
- 'include_dirs': [
- # WARNING: Do not view this particular case as a precedent for
- # including WebCore headers in DumpRenderTree project.
- '<(source_dir)/WebCore/testing/v8', # for WebCoreTestSupport.h, needed to link in window.internals code.
- ],
- 'sources': [
- '<(source_dir)/WebKit/chromium/src/WebTestingSupport.cpp',
- '<(source_dir)/WebKit/chromium/public/WebTestingSupport.h',
- ],
- }],
],
},
{
diff --git a/Tools/DumpRenderTree/DumpRenderTree.gypi b/Tools/DumpRenderTree/DumpRenderTree.gypi
index 4562aaf73..7e7d69bad 100644
--- a/Tools/DumpRenderTree/DumpRenderTree.gypi
+++ b/Tools/DumpRenderTree/DumpRenderTree.gypi
@@ -1,6 +1,8 @@
{
'variables': {
'drt_files': [
+ 'DumpRenderTree.h',
+ 'DumpRenderTreeCommon.cpp',
'chromium/DRTDevToolsAgent.cpp',
'chromium/DRTDevToolsAgent.h',
'chromium/DRTDevToolsClient.cpp',
@@ -62,28 +64,33 @@
'chromium/WebViewHostSoftwareOutputDevice.h',
],
'test_runner_files': [
- 'DumpRenderTree.h',
- 'DumpRenderTreeCommon.cpp',
- 'chromium/TestRunner/AccessibilityControllerChromium.cpp',
- 'chromium/TestRunner/AccessibilityControllerChromium.h',
- 'chromium/TestRunner/AccessibilityUIElementChromium.cpp',
- 'chromium/TestRunner/AccessibilityUIElementChromium.h',
- 'chromium/TestRunner/CppBoundClass.cpp',
- 'chromium/TestRunner/CppBoundClass.h',
- 'chromium/TestRunner/CppVariant.cpp',
- 'chromium/TestRunner/CppVariant.h',
- 'chromium/TestRunner/EventSender.cpp',
- 'chromium/TestRunner/EventSender.h',
- 'chromium/TestRunner/GamepadController.cpp',
- 'chromium/TestRunner/GamepadController.h',
- 'chromium/TestRunner/Task.cpp',
- 'chromium/TestRunner/Task.h',
- 'chromium/TestRunner/TestInterfaces.cpp',
- 'chromium/TestRunner/TestInterfaces.h',
- 'chromium/TestRunner/TextInputController.cpp',
- 'chromium/TestRunner/TextInputController.h',
- 'chromium/TestRunner/TestRunner.cpp',
- 'chromium/TestRunner/TestRunner.h',
+ 'chromium/TestRunner/public/WebAccessibilityController.h',
+ 'chromium/TestRunner/public/WebTestDelegate.h',
+ 'chromium/TestRunner/public/WebEventSender.h',
+ 'chromium/TestRunner/public/WebTestInterfaces.h',
+ 'chromium/TestRunner/src/AccessibilityControllerChromium.cpp',
+ 'chromium/TestRunner/src/AccessibilityControllerChromium.h',
+ 'chromium/TestRunner/src/AccessibilityUIElementChromium.cpp',
+ 'chromium/TestRunner/src/AccessibilityUIElementChromium.h',
+ 'chromium/TestRunner/src/CppBoundClass.cpp',
+ 'chromium/TestRunner/src/CppBoundClass.h',
+ 'chromium/TestRunner/src/CppVariant.cpp',
+ 'chromium/TestRunner/src/CppVariant.h',
+ 'chromium/TestRunner/src/EventSender.cpp',
+ 'chromium/TestRunner/src/EventSender.h',
+ 'chromium/TestRunner/src/GamepadController.cpp',
+ 'chromium/TestRunner/src/GamepadController.h',
+ 'chromium/TestRunner/src/Task.cpp',
+ 'chromium/TestRunner/src/Task.h',
+ 'chromium/TestRunner/src/TestInterfaces.cpp',
+ 'chromium/TestRunner/src/TestInterfaces.h',
+ 'chromium/TestRunner/src/TextInputController.cpp',
+ 'chromium/TestRunner/src/TextInputController.h',
+ 'chromium/TestRunner/src/TestRunner.cpp',
+ 'chromium/TestRunner/src/TestRunner.h',
+ 'chromium/TestRunner/src/WebAccessibilityController.cpp',
+ 'chromium/TestRunner/src/WebEventSender.cpp',
+ 'chromium/TestRunner/src/WebTestInterfaces.cpp',
],
'test_plugin_files': [
'TestNetscapePlugIn/PluginObject.cpp',
diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
index 00321ac9b..ebc5c396b 100644
--- a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
@@ -77,6 +77,7 @@ RefPtr<TestRunner> gTestRunner;
WebCore::Frame* mainFrame = 0;
WebCore::Frame* topLoadingFrame = 0;
bool waitForPolicy = false;
+bool runFromCommandLine = false;
// FIXME: Assuming LayoutTests has been copied to /developer/LayoutTests/
static const char* const kSDCLayoutTestsURI = "file:///developer/LayoutTests/";
@@ -176,20 +177,21 @@ DumpRenderTree::~DumpRenderTree()
void DumpRenderTree::runTest(const String& url)
{
- createFile(m_resultsDir + *m_currentTest + ".dump.crash");
-
mainFrame->loader()->stopForUserCancel();
resetToConsistentStateBeforeTesting();
if (shouldLogFrameLoadDelegates(url))
gTestRunner->setDumpFrameLoadCallbacks(true);
- String stdoutFile = m_resultsDir + *m_currentTest + ".dump";
- String stderrFile = m_resultsDir + *m_currentTest + ".stderr";
+ if (!runFromCommandLine) {
+ createFile(m_resultsDir + *m_currentTest + ".dump.crash");
- // FIXME: we should preserve the original stdout and stderr here but aren't doing
- // that yet due to issues with dup, etc.
- freopen(stdoutFile.utf8().data(), "wb", stdout);
- freopen(stderrFile.utf8().data(), "wb", stderr);
+ String stdoutFile = m_resultsDir + *m_currentTest + ".dump";
+ String stderrFile = m_resultsDir + *m_currentTest + ".stderr";
+ // FIXME: we should preserve the original stdout and stderr here but aren't doing
+ // that yet due to issues with dup, etc.
+ freopen(stdoutFile.utf8().data(), "wb", stdout);
+ freopen(stderrFile.utf8().data(), "wb", stderr);
+ }
FILE* current = fopen(m_currentTestFile.utf8().data(), "w");
fwrite(m_currentTest->utf8().data(), 1, m_currentTest->utf8().length(), current);
fclose(current);
@@ -219,6 +221,11 @@ void DumpRenderTree::runCurrentTest()
void DumpRenderTree::runRemainingTests()
{
+ if (runFromCommandLine) {
+ doneDrt();
+ return;
+ }
+
// FIXME: fflush should not be necessary but is temporarily required due to a bug in stdio output.
fflush(stdout);
fflush(stderr);
@@ -328,9 +335,14 @@ void DumpRenderTree::runTests()
mainFrame = DumpRenderTreeSupport::corePage(m_page)->mainFrame();
- // Get Test file name from PPS: /pps/services/drt/input
- // Example: test_file::fast/js/arguments.html
- waitForTest();
+ if (getenv("drtTestFile")) {
+ runFromCommandLine = true;
+ addTest(testFile);
+ } else {
+ // Get Test file name from PPS: /pps/services/drt/input
+ // Example: test_file::fast/js/arguments.html
+ waitForTest();
+ }
}
void DumpRenderTree::addTest(const char* testFile)
@@ -381,7 +393,7 @@ bool DumpRenderTree::isHTTPTest(const String& test)
String testLower = test.lower();
int lenHttpTestSyntax = strlen(httpTestSyntax);
return testLower.substring(0, lenHttpTestSyntax) == httpTestSyntax
- && testLower.substring(lenHttpTestSyntax, strlen(localTestSyntax)) != localTestSyntax;
+ && testLower.substring(lenHttpTestSyntax, strlen(localTestSyntax)) != localTestSyntax;
}
void DumpRenderTree::invalidateAnyPreviousWaitToDumpWatchdog()
@@ -500,12 +512,13 @@ void DumpRenderTree::dump()
if (m_dumpPixels && !dumpAsText && gTestRunner->generatePixelResults())
dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash());
- String crashFile = dumpFile + ".crash";
- unlink(crashFile.utf8().data());
-
- String doneFile = m_resultsDir + *m_currentTest + ".done";
- createFile(doneFile);
+ if (!runFromCommandLine) {
+ String crashFile = dumpFile + ".crash";
+ unlink(crashFile.utf8().data());
+ String doneFile = m_resultsDir + *m_currentTest + ".done";
+ createFile(doneFile);
+ }
testDone = true;
runRemainingTests();
}
@@ -641,7 +654,7 @@ void DumpRenderTree::didReceiveTitleForFrame(const String& title, WebCore::Frame
}
// ChromeClient delegates.
-void DumpRenderTree::addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID)
+void DumpRenderTree::addMessageToConsole(const String& message, unsigned lineNumber, const String& sourceID)
{
printf("CONSOLE MESSAGE: ");
if (lineNumber)
@@ -653,7 +666,7 @@ void DumpRenderTree::addMessageToConsole(const String& message, unsigned int lin
String remaining = message.substring(pos);
String fileName;
int indexFile = remaining.reverseFind('/') + 1;
- if (indexFile > 0 && indexFile < remaining.length())
+ if (indexFile > 0 && unsigned(indexFile) < remaining.length())
fileName = remaining.substring(indexFile);
else
fileName = "file:";
diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h b/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h
index 4ca9a3f2d..dfcf7c86c 100644
--- a/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h
+++ b/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h
@@ -77,7 +77,7 @@ public:
void didReceiveResponseForFrame(WebCore::Frame*, const WebCore::ResourceResponse&);
// ChromeClient delegates
- void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID);
+ void addMessageToConsole(const String& message, unsigned lineNumber, const String& sourceID);
void runJavaScriptAlert(const String& message);
bool runJavaScriptConfirm(const String& message);
String runJavaScriptPrompt(const String& message, const String& defaultValue);
diff --git a/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h b/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h
index ea6e5aea6..d066b7a71 100644
--- a/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h
+++ b/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h
@@ -31,7 +31,7 @@
#ifndef DRTDevToolsAgent_h
#define DRTDevToolsAgent_h
-#include "Task.h"
+#include "TestRunner/src/Task.h"
#include "WebDevToolsAgentClient.h"
#include "platform/WebString.h"
#include <wtf/HashMap.h>
diff --git a/Tools/DumpRenderTree/chromium/DRTDevToolsClient.h b/Tools/DumpRenderTree/chromium/DRTDevToolsClient.h
index 97a1edc0b..ead396379 100644
--- a/Tools/DumpRenderTree/chromium/DRTDevToolsClient.h
+++ b/Tools/DumpRenderTree/chromium/DRTDevToolsClient.h
@@ -31,7 +31,7 @@
#ifndef DRTDevToolsClient_h
#define DRTDevToolsClient_h
-#include "Task.h"
+#include "TestRunner/src/Task.h"
#include "WebDevToolsFrontendClient.h"
#include "platform/WebString.h"
#include <wtf/Noncopyable.h>
diff --git a/Tools/DumpRenderTree/chromium/DRTTestRunner.h b/Tools/DumpRenderTree/chromium/DRTTestRunner.h
index 3041b86a7..60a038a27 100644
--- a/Tools/DumpRenderTree/chromium/DRTTestRunner.h
+++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.h
@@ -42,7 +42,7 @@
#ifndef DRTTestRunner_h
#define DRTTestRunner_h
-#include "TestRunner/TestRunner.h"
+#include "TestRunner/src/TestRunner.h"
class TestShell;
diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
index 30ce28851..5a3210449 100644
--- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -64,6 +64,7 @@ static const char optionEnableAcceleratedPainting[] = "--enable-accelerated-pain
static const char optionEnableAcceleratedCompositingForVideo[] = "--enable-accelerated-video";
static const char optionUseGraphicsContext3DImplementation[] = "--use-graphics-context-3d-implementation=";
static const char optionEnablePerTilePainting[] = "--enable-per-tile-painting";
+static const char optionEnableDeferredImageDecoding[] = "--enable-deferred-image-decoding";
static const char optionStressOpt[] = "--stress-opt";
static const char optionStressDeopt[] = "--stress-deopt";
@@ -133,6 +134,7 @@ int main(int argc, char* argv[])
bool deferred2DCanvasEnabled = false;
bool acceleratedPaintingEnabled = false;
bool perTilePaintingEnabled = false;
+ bool deferredImageDecodingEnabled = false;
bool stressOpt = false;
bool stressDeopt = false;
bool hardwareAcceleratedGL = false;
@@ -183,6 +185,8 @@ int main(int argc, char* argv[])
fprintf(stderr, "Unknown GraphicContext3D implementation %s\n", implementation.c_str());
} else if (argument == optionEnablePerTilePainting)
perTilePaintingEnabled = true;
+ else if (argument == optionEnableDeferredImageDecoding)
+ deferredImageDecodingEnabled = true;
else if (argument == optionStressOpt)
stressOpt = true;
else if (argument == optionStressDeopt)
@@ -222,6 +226,7 @@ int main(int argc, char* argv[])
shell.setDeferred2dCanvasEnabled(deferred2DCanvasEnabled);
shell.setAcceleratedPaintingEnabled(acceleratedPaintingEnabled);
shell.setPerTilePaintingEnabled(perTilePaintingEnabled);
+ shell.setDeferredImageDecodingEnabled(deferredImageDecodingEnabled);
shell.setJavaScriptFlags(javaScriptFlags);
shell.setStressOpt(stressOpt);
shell.setStressDeopt(stressDeopt);
diff --git a/Tools/DumpRenderTree/chromium/MockSpellCheck.cpp b/Tools/DumpRenderTree/chromium/MockSpellCheck.cpp
index 56b0f1eff..7593c7190 100644
--- a/Tools/DumpRenderTree/chromium/MockSpellCheck.cpp
+++ b/Tools/DumpRenderTree/chromium/MockSpellCheck.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "MockSpellCheck.h"
-#include "platform/WebString.h"
#include <wtf/ASCIICType.h>
#include <wtf/Assertions.h>
#include <wtf/text/WTFString.h>
@@ -99,10 +98,15 @@ bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset
return false;
}
-void MockSpellCheck::fillSuggestionList(const WebString& word, Vector<WebString>* suggestions)
+void MockSpellCheck::fillSuggestionList(const WebString& word, WebVector<WebString>* suggestions)
{
- if (word == WebString::fromUTF8("wellcome"))
- suggestions->append(WebString::fromUTF8("welcome"));
+ if (word == WebString::fromUTF8("wellcome")) {
+ WebVector<WebString> result(suggestions->size() + 1);
+ for (size_t i = 0; i < suggestions->size(); ++i)
+ result[i] = (*suggestions)[i];
+ result[suggestions->size()] = WebString::fromUTF8("welcome");
+ suggestions->swap(result);
+ }
}
bool MockSpellCheck::initializeIfNeeded()
diff --git a/Tools/DumpRenderTree/chromium/MockSpellCheck.h b/Tools/DumpRenderTree/chromium/MockSpellCheck.h
index bce05c772..b7d07878e 100644
--- a/Tools/DumpRenderTree/chromium/MockSpellCheck.h
+++ b/Tools/DumpRenderTree/chromium/MockSpellCheck.h
@@ -31,14 +31,12 @@
#ifndef MockSpellCheck_h
#define MockSpellCheck_h
+#include "platform/WebString.h"
+#include "platform/WebVector.h"
#include <wtf/HashMap.h>
#include <wtf/text/StringHash.h>
#include <wtf/text/WTFString.h>
-namespace WebKit {
-class WebString;
-}
-
// A mock implementation of a spell-checker used for WebKit tests.
// This class only implements the minimal functionarities required by WebKit
// tests, i.e. this class just compares the given string with known misspelled
@@ -62,7 +60,7 @@ public:
int* misspelledOffset,
int* misspelledLength);
- void fillSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions);
+ void fillSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions);
private:
// Initialize the internal resources if we need to initialize it.
diff --git a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h
index 0e3448f21..5ddd2fc45 100644
--- a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h
+++ b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h
@@ -33,7 +33,7 @@
#if ENABLE(MEDIA_STREAM)
-#include "Task.h"
+#include "TestRunner/src/Task.h"
#include <public/WebRTCDataChannel.h>
#include <public/WebRTCPeerConnectionHandler.h>
#include <public/WebRTCSessionDescription.h>
diff --git a/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.h b/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.h
index 8d7519603..6494a7f25 100644
--- a/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.h
+++ b/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.h
@@ -28,7 +28,7 @@
#if ENABLE(INPUT_SPEECH)
-#include "Task.h"
+#include "TestRunner/src/Task.h"
#include "platform/WebRect.h"
#include "WebSpeechInputController.h"
#include "WebSpeechInputResult.h"
diff --git a/Tools/DumpRenderTree/chromium/MockWebSpeechRecognizer.h b/Tools/DumpRenderTree/chromium/MockWebSpeechRecognizer.h
index eb7c3e95b..4cc045669 100644
--- a/Tools/DumpRenderTree/chromium/MockWebSpeechRecognizer.h
+++ b/Tools/DumpRenderTree/chromium/MockWebSpeechRecognizer.h
@@ -28,7 +28,7 @@
#if ENABLE(SCRIPTED_SPEECH)
-#include "Task.h"
+#include "TestRunner/src/Task.h"
#include "WebSpeechRecognizer.h"
#include <wtf/Compiler.h>
#include <wtf/PassOwnPtr.h>
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/public/WebAccessibilityController.h b/Tools/DumpRenderTree/chromium/TestRunner/public/WebAccessibilityController.h
new file mode 100644
index 000000000..f2ec50869
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/TestRunner/public/WebAccessibilityController.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebAccessibilityController_h
+#define WebAccessibilityController_h
+
+namespace WebKit {
+class WebAccessibilityObject;
+}
+
+namespace WebTestRunner {
+
+class AccessibilityController;
+
+class WebAccessibilityController {
+public:
+#if WEBTESTRUNNER_IMPLEMENTATION
+ explicit WebAccessibilityController(AccessibilityController*);
+#endif
+
+ void setFocusedElement(const WebKit::WebAccessibilityObject&);
+ void notificationReceived(const WebKit::WebAccessibilityObject& target, const char* notificationName);
+ bool shouldLogAccessibilityEvents();
+
+private:
+ AccessibilityController* m_private;
+};
+
+}
+
+#endif // WebAccessibilityController_h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h b/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h
new file mode 100644
index 000000000..0df88a77d
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebEventSender_h
+#define WebEventSender_h
+
+#include "WebDragOperation.h"
+
+namespace WebKit {
+class WebDragData;
+}
+
+namespace WebTestRunner {
+
+class EventSender;
+
+class WebEventSender {
+public:
+#if WEBTESTRUNNER_IMPLEMENTATION
+ explicit WebEventSender(EventSender*);
+#endif
+
+ // Simulate drag&drop system call.
+ void doDragDrop(const WebKit::WebDragData&, WebKit::WebDragOperationsMask);
+
+private:
+ EventSender* m_private;
+};
+
+}
+
+#endif // WebEventSender_h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h
new file mode 100644
index 000000000..a4f62021c
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebTestDelegate_h
+#define WebTestDelegate_h
+
+#include "platform/WebString.h"
+#include "platform/WebVector.h"
+
+namespace WebKit {
+struct WebContextMenuData;
+class WebGamepads;
+}
+
+namespace WebTestRunner {
+
+class WebTestDelegate {
+public:
+ virtual void clearContextMenuData() = 0;
+ virtual void clearEditCommand() = 0;
+ virtual void fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions) = 0;
+ virtual void setEditCommand(const std::string& name, const std::string& value) = 0;
+ virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0;
+ virtual void setGamepadData(const WebKit::WebGamepads&) = 0;
+};
+
+}
+
+#endif // WebTestDelegate_h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h
index 917695461..52520a6b5 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h
@@ -28,34 +28,38 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TestInterfaces_h
-#define TestInterfaces_h
+#ifndef WebTestInterfaces_h
+#define WebTestInterfaces_h
namespace WebKit {
class WebFrame;
class WebView;
}
-class AccessibilityController;
-class EventSender;
-class TestDelegate;
+namespace WebTestRunner {
-class TestInterfaces {
+class WebAccessibilityController;
+class WebEventSender;
+class WebTestDelegate;
+
+class WebTestInterfaces {
public:
- TestInterfaces();
- ~TestInterfaces();
+ WebTestInterfaces();
+ ~WebTestInterfaces();
void setWebView(WebKit::WebView*);
- void setDelegate(TestDelegate*);
+ void setDelegate(WebTestDelegate*);
void bindTo(WebKit::WebFrame*);
void resetAll();
- AccessibilityController* accessibilityController();
- EventSender* eventSender();
+ WebAccessibilityController* accessibilityController();
+ WebEventSender* eventSender();
private:
class Internal;
Internal* m_internal;
};
-#endif // TestInterfaces_h
+}
+
+#endif // WebTestInterfaces_h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityControllerChromium.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp
index 89d5d5877..8e25db2d2 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityControllerChromium.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.cpp
@@ -40,6 +40,8 @@
using namespace WebKit;
+namespace WebTestRunner {
+
AccessibilityController::AccessibilityController()
: m_logAccessibilityEvents(false)
{
@@ -117,6 +119,9 @@ AccessibilityUIElement* AccessibilityController::getAccessibleElementById(const
if (m_rootElement.isNull())
m_rootElement = m_webView->accessibilityObject();
+ if (!m_rootElement.updateBackingStoreAndCheckValidity())
+ return 0;
+
return findAccessibleElementByIdRecursive(m_rootElement, WebString::fromUTF8(id.c_str()));
}
@@ -196,3 +201,5 @@ void AccessibilityController::fallbackCallback(const CppArgumentList&, CppVarian
"AccessibilityController\n");
result->setNull();
}
+
+}
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityControllerChromium.h b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h
index f0f5dee85..4dd7f8705 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityControllerChromium.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h
@@ -40,6 +40,8 @@ class WebFrame;
class WebView;
}
+namespace WebTestRunner {
+
class AccessibilityController : public CppBoundClass {
public:
AccessibilityController();
@@ -85,4 +87,6 @@ private:
WebKit::WebView* m_webView;
};
+}
+
#endif // AccessibilityControllerChromium_h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp
index d60822be8..2157ddb69 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp
@@ -774,7 +774,13 @@ void AccessibilityUIElement::cellForColumnAndRowCallback(const CppArgumentList&,
void AccessibilityUIElement::titleUIElementCallback(const CppArgumentList&, CppVariant* result)
{
- result->setNull();
+ WebAccessibilityObject obj = accessibilityObject().titleUIElement();
+ if (obj.isNull()) {
+ result->setNull();
+ return;
+ }
+
+ result->set(*(m_factory->getOrCreate(obj)->getAsCppVariant()));
}
void AccessibilityUIElement::setSelectedTextRangeCallback(const CppArgumentList&arguments, CppVariant* result)
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h
index d9e73e57e..d9e73e57e 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp
index 1b29d2b0f..1b29d2b0f 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.h b/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h
index 4fb5361e1..4fb5361e1 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/CppVariant.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp
index b587d75aa..b587d75aa 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/CppVariant.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/CppVariant.h b/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h
index 60cc6271e..60cc6271e 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/CppVariant.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp
index 23b65d071..310ae6c48 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp
@@ -64,10 +64,14 @@
using namespace std;
using namespace WebKit;
+namespace WebTestRunner {
+
WebPoint EventSender::lastMousePos;
WebMouseEvent::Button EventSender::pressedButton = WebMouseEvent::ButtonNone;
WebMouseEvent::Button EventSender::lastButtonType = WebMouseEvent::ButtonNone;
+namespace {
+
struct SavedEvent {
enum SavedEventType {
Unspecified,
@@ -87,27 +91,27 @@ struct SavedEvent {
, milliseconds(0) { }
};
-static WebDragData currentDragData;
-static WebDragOperation currentDragEffect;
-static WebDragOperationsMask currentDragEffectsAllowed;
-static bool replayingSavedEvents = false;
-static Deque<SavedEvent> mouseEventQueue;
-static int touchModifiers;
-static Vector<WebTouchPoint> touchPoints;
+WebDragData currentDragData;
+WebDragOperation currentDragEffect;
+WebDragOperationsMask currentDragEffectsAllowed;
+bool replayingSavedEvents = false;
+Deque<SavedEvent> mouseEventQueue;
+int touchModifiers;
+Vector<WebTouchPoint> touchPoints;
// Time and place of the last mouse up event.
-static double lastClickTimeSec = 0;
-static WebPoint lastClickPos;
-static int clickCount = 0;
+double lastClickTimeSec = 0;
+WebPoint lastClickPos;
+int clickCount = 0;
// maximum distance (in space and time) for a mouse click
// to register as a double or triple click
-static const double multipleClickTimeSec = 1;
-static const int multipleClickRadiusPixels = 5;
+const double multipleClickTimeSec = 1;
+const int multipleClickRadiusPixels = 5;
// How much we should scroll per event - the value here is chosen to
// match the WebKit impl and layout test results.
-static const float scrollbarPixelsPerTick = 40.0f;
+const float scrollbarPixelsPerTick = 40.0f;
inline bool outsideMultiClickRadius(const WebPoint& a, const WebPoint& b)
{
@@ -118,20 +122,19 @@ inline bool outsideMultiClickRadius(const WebPoint& a, const WebPoint& b)
// Used to offset the time the event hander things an event happened. This is
// done so tests can run without a delay, but bypass checks that are time
// dependent (e.g., dragging has a timeout vs selection).
-static uint32 timeOffsetMs = 0;
+uint32 timeOffsetMs = 0;
-static double getCurrentEventTimeSec()
+double getCurrentEventTimeSec()
{
return (webkit_support::GetCurrentTimeInMillisecond() + timeOffsetMs) / 1000.0;
}
-static void advanceEventTime(int32_t deltaMs)
+void advanceEventTime(int32_t deltaMs)
{
timeOffsetMs += deltaMs;
}
-static void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b,
- const WebPoint& pos, WebMouseEvent* e)
+void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b, const WebPoint& pos, WebMouseEvent* e)
{
e->type = t;
e->button = b;
@@ -145,7 +148,7 @@ static void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b,
}
// Returns true if the specified key is the system key.
-static bool applyKeyModifier(const string& modifierName, WebInputEvent* event)
+bool applyKeyModifier(const string& modifierName, WebInputEvent* event)
{
bool isSystemKey = false;
const char* characters = modifierName.c_str();
@@ -182,7 +185,7 @@ static bool applyKeyModifier(const string& modifierName, WebInputEvent* event)
return isSystemKey;
}
-static bool applyKeyModifiers(const CppVariant* argument, WebInputEvent* event)
+bool applyKeyModifiers(const CppVariant* argument, WebInputEvent* event)
{
bool isSystemKey = false;
if (argument->isObject()) {
@@ -244,6 +247,8 @@ enum KeyLocationCode {
DOMKeyLocationNumpad = 0x03
};
+}
+
EventSender::EventSender()
: m_delegate(0)
{
@@ -812,7 +817,7 @@ static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu,
if (contextMenu->isEditable) {
for (const char** item = editableMenuStrings; *item; ++item)
strings.append(WebString::fromUTF8(*item));
- Vector<WebString> suggestions;
+ WebVector<WebString> suggestions;
delegate->fillSpellingSuggestionList(contextMenu->misspelledWord, &suggestions);
for (size_t i = 0; i < suggestions.size(); ++i)
strings.append(suggestions[i]);
@@ -1269,3 +1274,5 @@ void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result)
{
result->setNull();
}
+
+}
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/EventSender.h b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.h
index e6794a077..65dfccb8c 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/EventSender.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.h
@@ -50,6 +50,8 @@ class WebView;
class TestDelegate;
+namespace WebTestRunner {
+
class EventSender : public CppBoundClass {
public:
EventSender();
@@ -183,4 +185,6 @@ private:
static WebKit::WebMouseEvent::Button lastButtonType;
};
+}
+
#endif // EventSender_h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/GamepadController.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp
index cb36bfdfb..cb36bfdfb 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/GamepadController.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/GamepadController.h b/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.h
index 4e65e922f..4e65e922f 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/GamepadController.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/Task.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/Task.cpp
index d80beef34..d80beef34 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/Task.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/Task.cpp
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/Task.h b/Tools/DumpRenderTree/chromium/TestRunner/src/Task.h
index 0b32c472b..0b32c472b 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/Task.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/Task.h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestDelegate.h b/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h
index 599e11d4c..0b0d9622e 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/TestDelegate.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h
@@ -32,7 +32,7 @@
#define TestDelegate_h
#include "platform/WebString.h"
-#include <wtf/Vector.h>
+#include "platform/WebVector.h"
namespace WebKit {
struct WebContextMenuData;
@@ -43,7 +43,7 @@ class TestDelegate {
public:
virtual void clearContextMenuData() = 0;
virtual void clearEditCommand() = 0;
- virtual void fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions) = 0;
+ virtual void fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions) = 0;
virtual void setEditCommand(const std::string& name, const std::string& value) = 0;
virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0;
virtual void setGamepadData(const WebKit::WebGamepads&) = 0;
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp
index ccec086aa..cc821214b 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp
@@ -37,33 +37,13 @@
#include "TextInputController.h"
#include "platform/WebString.h"
-#include <wtf/OwnPtr.h>
-
+using WebTestRunner::AccessibilityController;
+using WebTestRunner::EventSender;
using WebKit::WebFrame;
using WebKit::WebString;
using WebKit::WebView;
-class TestInterfaces::Internal {
-public:
- Internal();
- ~Internal();
-
- void setWebView(WebView*);
- void setDelegate(TestDelegate*);
- void bindTo(WebFrame*);
- void resetAll();
-
- AccessibilityController* accessibilityController() { return m_accessibilityController.get(); }
- EventSender* eventSender() { return m_eventSender.get(); }
-
-private:
- OwnPtr<AccessibilityController> m_accessibilityController;
- OwnPtr<EventSender> m_eventSender;
- OwnPtr<GamepadController> m_gamepadController;
- OwnPtr<TextInputController> m_textInputController;
-};
-
-TestInterfaces::Internal::Internal()
+TestInterfaces::TestInterfaces()
{
m_accessibilityController = adoptPtr(new AccessibilityController());
m_eventSender = adoptPtr(new EventSender());
@@ -71,7 +51,7 @@ TestInterfaces::Internal::Internal()
m_textInputController = adoptPtr(new TextInputController());
}
-TestInterfaces::Internal::~Internal()
+TestInterfaces::~TestInterfaces()
{
m_accessibilityController->setWebView(0);
m_eventSender->setWebView(0);
@@ -84,7 +64,7 @@ TestInterfaces::Internal::~Internal()
// m_textInputController doesn't depend on TestDelegate.
}
-void TestInterfaces::Internal::setWebView(WebView* webView)
+void TestInterfaces::setWebView(WebView* webView)
{
m_accessibilityController->setWebView(webView);
m_eventSender->setWebView(webView);
@@ -92,7 +72,7 @@ void TestInterfaces::Internal::setWebView(WebView* webView)
m_textInputController->setWebView(webView);
}
-void TestInterfaces::Internal::setDelegate(TestDelegate* delegate)
+void TestInterfaces::setDelegate(TestDelegate* delegate)
{
// m_accessibilityController doesn't depend on TestDelegate.
m_eventSender->setDelegate(delegate);
@@ -100,7 +80,7 @@ void TestInterfaces::Internal::setDelegate(TestDelegate* delegate)
// m_textInputController doesn't depend on TestDelegate.
}
-void TestInterfaces::Internal::bindTo(WebFrame* frame)
+void TestInterfaces::bindTo(WebFrame* frame)
{
m_accessibilityController->bindToJavascript(frame, WebString::fromUTF8("accessibilityController"));
m_eventSender->bindToJavascript(frame, WebString::fromUTF8("eventSender"));
@@ -108,7 +88,7 @@ void TestInterfaces::Internal::bindTo(WebFrame* frame)
m_textInputController->bindToJavascript(frame, WebString::fromUTF8("textInputController"));
}
-void TestInterfaces::Internal::resetAll()
+void TestInterfaces::resetAll()
{
m_accessibilityController->reset();
m_eventSender->reset();
@@ -116,42 +96,12 @@ void TestInterfaces::Internal::resetAll()
// m_textInputController doesn't have any state to reset.
}
-TestInterfaces::TestInterfaces()
- : m_internal(new TestInterfaces::Internal())
-{
-}
-
-TestInterfaces::~TestInterfaces()
-{
- delete m_internal;
-}
-
-void TestInterfaces::setWebView(WebView* webView)
-{
- m_internal->setWebView(webView);
-}
-
-void TestInterfaces::setDelegate(TestDelegate* delegate)
-{
- m_internal->setDelegate(delegate);
-}
-
-void TestInterfaces::bindTo(WebFrame* frame)
-{
- m_internal->bindTo(frame);
-}
-
-void TestInterfaces::resetAll()
-{
- m_internal->resetAll();
-}
-
AccessibilityController* TestInterfaces::accessibilityController()
{
- return m_internal->accessibilityController();
+ return m_accessibilityController.get();
}
EventSender* TestInterfaces::eventSender()
{
- return m_internal->eventSender();
+ return m_eventSender.get();
}
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h b/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h
new file mode 100644
index 000000000..228658c22
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TestInterfaces_h
+#define TestInterfaces_h
+
+#include <wtf/OwnPtr.h>
+
+namespace WebKit {
+class WebFrame;
+class WebView;
+}
+
+namespace WebTestRunner {
+class AccessibilityController;
+class EventSender;
+}
+
+class GamepadController;
+class TestDelegate;
+class TextInputController;
+
+class TestInterfaces {
+public:
+ TestInterfaces();
+ ~TestInterfaces();
+
+ void setWebView(WebKit::WebView*);
+ void setDelegate(TestDelegate*);
+ void bindTo(WebKit::WebFrame*);
+ void resetAll();
+
+ WebTestRunner::AccessibilityController* accessibilityController();
+ WebTestRunner::EventSender* eventSender();
+
+private:
+ OwnPtr<WebTestRunner::AccessibilityController> m_accessibilityController;
+ OwnPtr<WebTestRunner::EventSender> m_eventSender;
+ OwnPtr<GamepadController> m_gamepadController;
+ OwnPtr<TextInputController> m_textInputController;
+};
+
+#endif // TestInterfaces_h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestRunner.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
index e6ead1551..e6ead1551 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/TestRunner.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestRunner.h b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
index f7069401a..f7069401a 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/TestRunner.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TextInputController.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp
index b72a2080d..b72a2080d 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/TextInputController.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TextInputController.h b/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.h
index a959aa8b3..a959aa8b3 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/TextInputController.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/WebAccessibilityController.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/WebAccessibilityController.cpp
new file mode 100644
index 000000000..3fbe30945
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/WebAccessibilityController.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebAccessibilityController.h"
+
+#include "AccessibilityControllerChromium.h"
+
+using WebKit::WebAccessibilityObject;
+
+namespace WebTestRunner {
+
+WebAccessibilityController::WebAccessibilityController(AccessibilityController* controller)
+ : m_private(controller)
+{
+}
+
+void WebAccessibilityController::setFocusedElement(const WebAccessibilityObject& object)
+{
+ m_private->setFocusedElement(object);
+}
+
+void WebAccessibilityController::notificationReceived(const WebAccessibilityObject& target, const char* notificationName)
+{
+ m_private->notificationReceived(target, notificationName);
+}
+
+bool WebAccessibilityController::shouldLogAccessibilityEvents()
+{
+ return m_private->shouldLogAccessibilityEvents();
+}
+
+}
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/WebEventSender.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/WebEventSender.cpp
new file mode 100644
index 000000000..93c0bba49
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/WebEventSender.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebEventSender.h"
+
+#include "EventSender.h"
+
+using WebKit::WebDragData;
+using WebKit::WebDragOperationsMask;
+
+namespace WebTestRunner {
+
+WebEventSender::WebEventSender(EventSender* eventSender)
+ : m_private(eventSender)
+{
+}
+
+void WebEventSender::doDragDrop(const WebDragData& data, WebDragOperationsMask mask)
+{
+ m_private->doDragDrop(data, mask);
+}
+
+}
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp
new file mode 100644
index 000000000..3d5b0de3e
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebTestInterfaces.h"
+
+#include "TestDelegate.h"
+#include "TestInterfaces.h"
+#include "WebAccessibilityController.h"
+#include "WebEventSender.h"
+#include "WebTestDelegate.h"
+
+using WebKit::WebContextMenuData;
+using WebKit::WebFrame;
+using WebKit::WebGamepads;
+using WebKit::WebString;
+using WebKit::WebVector;
+using WebKit::WebView;
+
+namespace WebTestRunner {
+
+class WebTestInterfaces::Internal : public TestDelegate {
+public:
+ Internal();
+ virtual ~Internal();
+
+ TestInterfaces* testInterfaces() { return &m_interfaces; }
+ void setDelegate(WebTestDelegate*);
+ WebAccessibilityController* accessibilityController() { return &m_accessibilityController; }
+ WebEventSender* eventSender() { return &m_eventSender; }
+
+ // TestDelegate implementation.
+ virtual void clearContextMenuData();
+ virtual void clearEditCommand();
+ virtual void fillSpellingSuggestionList(const WebString& word, WebVector<WebString>* suggestions);
+ virtual void setEditCommand(const std::string& name, const std::string& value);
+ virtual WebContextMenuData* lastContextMenuData() const;
+ virtual void setGamepadData(const WebGamepads&);
+
+private:
+ TestInterfaces m_interfaces;
+ WebAccessibilityController m_accessibilityController;
+ WebEventSender m_eventSender;
+ WebTestDelegate* m_delegate;
+};
+
+WebTestInterfaces::Internal::Internal()
+ : m_accessibilityController(m_interfaces.accessibilityController())
+ , m_eventSender(m_interfaces.eventSender())
+ , m_delegate(0)
+{
+}
+
+WebTestInterfaces::Internal::~Internal()
+{
+}
+
+void WebTestInterfaces::Internal::setDelegate(WebTestDelegate* delegate)
+{
+ if (delegate) {
+ m_delegate = delegate;
+ m_interfaces.setDelegate(this);
+ } else {
+ m_delegate = 0;
+ m_interfaces.setDelegate(0);
+ }
+}
+
+void WebTestInterfaces::Internal::clearContextMenuData()
+{
+ m_delegate->clearContextMenuData();
+}
+
+void WebTestInterfaces::Internal::clearEditCommand()
+{
+ m_delegate->clearEditCommand();
+}
+
+void WebTestInterfaces::Internal::fillSpellingSuggestionList(const WebString& word, WebVector<WebString>* suggestions)
+{
+ m_delegate->fillSpellingSuggestionList(word, suggestions);
+}
+
+void WebTestInterfaces::Internal::setEditCommand(const std::string& name, const std::string& value)
+{
+ m_delegate->setEditCommand(name, value);
+}
+
+WebContextMenuData* WebTestInterfaces::Internal::lastContextMenuData() const
+{
+ return m_delegate->lastContextMenuData();
+}
+
+void WebTestInterfaces::Internal::setGamepadData(const WebGamepads& pads)
+{
+ m_delegate->setGamepadData(pads);
+}
+
+WebTestInterfaces::WebTestInterfaces()
+{
+ m_internal = new Internal;
+}
+
+WebTestInterfaces::~WebTestInterfaces()
+{
+ delete m_internal;
+}
+
+void WebTestInterfaces::setWebView(WebView* webView)
+{
+ m_internal->testInterfaces()->setWebView(webView);
+}
+
+void WebTestInterfaces::setDelegate(WebTestDelegate* delegate)
+{
+ m_internal->setDelegate(delegate);
+}
+
+void WebTestInterfaces::bindTo(WebFrame* frame)
+{
+ m_internal->testInterfaces()->bindTo(frame);
+}
+
+void WebTestInterfaces::resetAll()
+{
+ m_internal->testInterfaces()->resetAll();
+}
+
+WebAccessibilityController* WebTestInterfaces::accessibilityController()
+{
+ return m_internal->accessibilityController();
+}
+
+WebEventSender* WebTestInterfaces::eventSender()
+{
+ return m_internal->eventSender();
+}
+
+}
diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp
index 32585faa1..4854f5ea3 100644
--- a/Tools/DumpRenderTree/chromium/TestShell.cpp
+++ b/Tools/DumpRenderTree/chromium/TestShell.cpp
@@ -114,6 +114,7 @@ TestShell::TestShell()
, m_accelerated2dCanvasEnabled(false)
, m_deferred2dCanvasEnabled(false)
, m_acceleratedPaintingEnabled(false)
+ , m_deferredImageDecodingEnabled(false)
, m_stressOpt(false)
, m_stressDeopt(false)
, m_dumpWhenFinished(true)
@@ -135,6 +136,7 @@ TestShell::TestShell()
WebRuntimeFeatures::enableEncryptedMedia(true);
WebRuntimeFeatures::enableMediaStream(true);
WebRuntimeFeatures::enablePeerConnection(true);
+ WebRuntimeFeatures::enableDeprecatedPeerConnection(true);
WebRuntimeFeatures::enableWebAudio(true);
WebRuntimeFeatures::enableVideoTrack(true);
WebRuntimeFeatures::enableGamepad(true);
@@ -152,7 +154,7 @@ TestShell::TestShell()
void TestShell::initialize()
{
m_webPermissions = adoptPtr(new WebPermissions(this));
- m_testInterfaces = adoptPtr(new TestInterfaces());
+ m_testInterfaces = adoptPtr(new WebTestRunner::WebTestInterfaces());
m_testRunner = adoptPtr(new DRTTestRunner(this));
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
m_notificationPresenter = adoptPtr(new NotificationPresenter(this));
@@ -229,6 +231,7 @@ void TestShell::resetWebSettings(WebView& webView)
m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled;
m_prefs.deferred2dCanvasEnabled = m_deferred2dCanvasEnabled;
m_prefs.acceleratedPaintingEnabled = m_acceleratedPaintingEnabled;
+ m_prefs.deferredImageDecodingEnabled = m_deferredImageDecodingEnabled;
m_prefs.applyTo(&webView);
}
diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h
index 44b5ae388..03315690e 100644
--- a/Tools/DumpRenderTree/chromium/TestShell.h
+++ b/Tools/DumpRenderTree/chromium/TestShell.h
@@ -31,13 +31,11 @@
#ifndef TestShell_h
#define TestShell_h
-#include "AccessibilityControllerChromium.h"
#include "DRTTestRunner.h"
-#include "GamepadController.h"
#include "NotificationPresenter.h"
#include "TestEventPrinter.h"
-#include "TestInterfaces.h"
#include "WebPreferences.h"
+#include "WebTestInterfaces.h"
#include "WebViewHost.h"
#include <string>
#include <wtf/OwnPtr.h>
@@ -88,8 +86,8 @@ public:
// Returns the host for the main WebView.
WebViewHost* webViewHost() const { return m_webViewHost.get(); }
DRTTestRunner* testRunner() const { return m_testRunner.get(); }
- EventSender* eventSender() const { return m_testInterfaces->eventSender(); }
- AccessibilityController* accessibilityController() const { return m_testInterfaces->accessibilityController(); }
+ WebTestRunner::WebEventSender* eventSender() const { return m_testInterfaces->eventSender(); }
+ WebTestRunner::WebAccessibilityController* accessibilityController() const { return m_testInterfaces->accessibilityController(); }
#if ENABLE(NOTIFICATIONS)
NotificationPresenter* notificationPresenter() const { return m_notificationPresenter.get(); }
#endif
@@ -138,6 +136,7 @@ public:
void setDeferred2dCanvasEnabled(bool enabled) { m_deferred2dCanvasEnabled = enabled; }
void setAcceleratedPaintingEnabled(bool enabled) { m_acceleratedPaintingEnabled = enabled; }
void setPerTilePaintingEnabled(bool);
+ void setDeferredImageDecodingEnabled(bool enabled) { m_deferredImageDecodingEnabled = enabled; }
#if defined(OS_WIN)
// Access to the finished event. Used by the static WatchDog thread.
HANDLE finishedEvent() { return m_finishedEvent; }
@@ -212,7 +211,7 @@ private:
OwnPtr<WebPermissions> m_webPermissions;
OwnPtr<DRTDevToolsAgent> m_drtDevToolsAgent;
OwnPtr<DRTDevToolsClient> m_drtDevToolsClient;
- OwnPtr<TestInterfaces> m_testInterfaces;
+ OwnPtr<WebTestRunner::WebTestInterfaces> m_testInterfaces;
OwnPtr<DRTTestRunner> m_testRunner;
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
OwnPtr<NotificationPresenter> m_notificationPresenter;
@@ -235,6 +234,7 @@ private:
bool m_deferred2dCanvasEnabled;
bool m_acceleratedPaintingEnabled;
bool m_perTilePaintingEnabled;
+ bool m_deferredImageDecodingEnabled;
WebPreferences m_prefs;
bool m_stressOpt;
bool m_stressDeopt;
diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.cpp b/Tools/DumpRenderTree/chromium/WebPreferences.cpp
index 3bc2cdd9f..5c8c92c99 100644
--- a/Tools/DumpRenderTree/chromium/WebPreferences.cpp
+++ b/Tools/DumpRenderTree/chromium/WebPreferences.cpp
@@ -116,6 +116,7 @@ void WebPreferences::reset()
deferred2dCanvasEnabled = false;
acceleratedPaintingEnabled = false;
forceCompositingMode = false;
+ deferredImageDecodingEnabled = false;
mediaPlaybackRequiresUserGesture = false;
mockScrollbarsEnabled = false;
cssCustomFilterEnabled = false;
@@ -224,6 +225,7 @@ void WebPreferences::applyTo(WebView* webView)
settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled);
settings->setDeferred2dCanvasEnabled(deferred2dCanvasEnabled);
settings->setAcceleratedPaintingEnabled(acceleratedPaintingEnabled);
+ settings->setDeferredImageDecodingEnabled(deferredImageDecodingEnabled);
settings->setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserGesture);
settings->setMockScrollbarsEnabled(mockScrollbarsEnabled);
settings->setApplyDefaultDeviceScaleFactorInCompositor(forceCompositingMode);
diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.h b/Tools/DumpRenderTree/chromium/WebPreferences.h
index c36553b35..e0315f2d0 100644
--- a/Tools/DumpRenderTree/chromium/WebPreferences.h
+++ b/Tools/DumpRenderTree/chromium/WebPreferences.h
@@ -109,6 +109,7 @@ struct WebPreferences {
bool accelerated2dCanvasEnabled;
bool deferred2dCanvasEnabled;
bool acceleratedPaintingEnabled;
+ bool deferredImageDecodingEnabled;
bool mediaPlaybackRequiresUserGesture;
bool mockScrollbarsEnabled;
bool cssCustomFilterEnabled;
diff --git a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h
index 9e1beba4a..f43875976 100644
--- a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h
+++ b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h
@@ -33,7 +33,7 @@
#if ENABLE(MEDIA_STREAM)
-#include "Task.h"
+#include "TestRunner/src/Task.h"
#include "WebUserMediaClient.h"
#include "webkit/support/test_media_stream_client.h"
#include <public/WebCommon.h>
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
index c7ab475e7..106caa978 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -32,13 +32,14 @@
#include "WebViewHost.h"
#include "DRTTestRunner.h"
-#include "EventSender.h"
#include "MockGrammarCheck.h"
#include "MockWebSpeechInputController.h"
#include "MockWebSpeechRecognizer.h"
#include "TestNavigationController.h"
#include "TestShell.h"
#include "TestWebPlugin.h"
+#include "WebAccessibilityController.h"
+#include "WebAccessibilityObject.h"
#include "WebConsoleMessage.h"
#include "WebContextMenuData.h"
#include "WebDOMMessageEvent.h"
@@ -46,6 +47,7 @@
#include "WebDeviceOrientationClientMock.h"
#include "WebDocument.h"
#include "WebElement.h"
+#include "WebEventSender.h"
#include "WebFrame.h"
#include "WebGeolocationClientMock.h"
#include "WebHistoryItem.h"
@@ -525,7 +527,7 @@ void WebViewHost::finishLastTextCheck()
m_spellcheck.spellCheckWord(WebString(text.characters(), text.length()), &misspelledPosition, &misspelledLength);
if (!misspelledLength)
break;
- Vector<WebString> suggestions;
+ WebVector<WebString> suggestions;
m_spellcheck.fillSuggestionList(WebString(text.characters() + misspelledPosition, misspelledLength), &suggestions);
results.append(WebTextCheckingResult(WebTextCheckingTypeSpelling, offset + misspelledPosition, misspelledLength,
suggestions.isEmpty() ? WebString() : suggestions[0]));
@@ -772,7 +774,7 @@ MockSpellCheck* WebViewHost::mockSpellCheck()
return &m_spellcheck;
}
-void WebViewHost::fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions)
+void WebViewHost::fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions)
{
mockSpellCheck()->fillSuggestionList(word, suggestions);
}
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h
index c9e17b07f..ba763503a 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.h
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.h
@@ -32,15 +32,15 @@
#define WebViewHost_h
#include "MockSpellCheck.h"
-#include "Task.h"
-#include "TestDelegate.h"
#include "TestNavigationController.h"
+#include "TestRunner/src/Task.h"
#include "WebAccessibilityNotification.h"
#include "WebCursorInfo.h"
#include "WebFrameClient.h"
#include "WebIntentRequest.h"
#include "WebPrerendererClient.h"
#include "WebSpellCheckClient.h"
+#include "WebTestDelegate.h"
#include "WebViewClient.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
@@ -79,7 +79,7 @@ class TestMediaStreamClient;
class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, public NavigationHost,
public WebKit::WebPrerendererClient, public WebKit::WebSpellCheckClient,
- public TestDelegate {
+ public WebTestRunner::WebTestDelegate {
public:
WebViewHost(TestShell*);
virtual ~WebViewHost();
@@ -281,7 +281,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
// Spellcheck related helper APIs
MockSpellCheck* mockSpellCheck();
void finishLastTextCheck();
- virtual void fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions) OVERRIDE;
+ virtual void fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions) OVERRIDE;
// Geolocation client mocks for DRTTestRunner
WebKit::WebGeolocationClientMock* geolocationClientMock();
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
index 69a4211a0..a0dec4e7a 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
@@ -382,7 +382,8 @@ static void shutdownEfl()
void displayWebView()
{
- notImplemented();
+ DumpRenderTreeSupportEfl::setTracksRepaints(browser->mainFrame(), true);
+ DumpRenderTreeSupportEfl::resetTrackedRepaints(browser->mainFrame());
}
void dump()
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
index 993135ee4..d1ba5ff8f 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
@@ -287,6 +287,7 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
ewk_view_setting_web_audio_set(mainView(), EINA_FALSE);
ewk_view_setting_allow_universal_access_from_file_urls_set(mainView(), EINA_TRUE);
ewk_view_setting_allow_file_access_from_file_urls_set(mainView(), EINA_TRUE);
+ ewk_view_setting_resizable_textareas_set(mainView(), EINA_TRUE);
ewk_view_zoom_set(mainView(), 1.0, 0, 0);
ewk_view_scale_set(mainView(), 1.0, 0, 0);
@@ -319,6 +320,7 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
DumpRenderTreeSupportEfl::setMinimumLogicalFontSize(mainView(), 9);
DumpRenderTreeSupportEfl::setCSSRegionsEnabled(mainView(), true);
DumpRenderTreeSupportEfl::setShouldTrackVisitedLinks(false);
+ DumpRenderTreeSupportEfl::setTracksRepaints(mainFrame(), false);
// Reset capacities for the memory cache for dead objects.
static const unsigned cacheTotalCapacity = 8192 * 1024;
diff --git a/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp b/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp
index 4af774d32..efc506160 100644
--- a/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp
+++ b/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp
@@ -3,6 +3,7 @@
* Copyright (C) 2010 Igalia S.L.
* Copyright (C) 2011 ProFUSION Embedded Systems
* Copyright (C) 2011 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -56,6 +57,32 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool, bool, bool, bool
if (!ewk_view_paint(privateData, context.get(), &rect))
return 0;
+ if (DumpRenderTreeSupportEfl::isTrackingRepaints(mainFrame)) {
+ cairo_push_group(context.get());
+
+ // Paint the gray mask over the original image.
+ cairo_set_source_rgba(context.get(), 0, 0, 0, 0.66);
+ cairo_paint(context.get());
+
+ // Paint transparent rectangles over the mask to show the repainted regions.
+ cairo_set_source_rgba(context.get(), 0, 0, 0, 0);
+ cairo_set_operator(context.get(), CAIRO_OPERATOR_SOURCE);
+
+ Eina_List* repaintRects = DumpRenderTreeSupportEfl::trackedRepaintRects(mainFrame);
+ void* iter = 0;
+ EINA_LIST_FREE(repaintRects, iter) {
+ Eina_Rectangle* rect = static_cast<Eina_Rectangle*>(iter);
+
+ cairo_rectangle(context.get(), rect->x, rect->y, rect->w, rect->h);
+ cairo_fill(context.get());
+
+ eina_rectangle_free(rect);
+ }
+
+ cairo_pop_group_to_source(context.get());
+ cairo_paint(context.get());
+ }
+
if (drawSelectionRect) {
const WebCore::IntRect selectionRect = DumpRenderTreeSupportEfl::selectionRectangle(mainFrame);
diff --git a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm
index 4365d15d0..d80f6ba4e 100644
--- a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm
+++ b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm
@@ -26,7 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
#import "MockWebNotificationProvider.h"
+
#import <WebKit/WebSecurityOriginPrivate.h>
@implementation MockWebNotificationProvider
diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.cpp b/Tools/DumpRenderTree/qt/EventSenderQt.cpp
index fe1e96b67..dcf9f1bb2 100644
--- a/Tools/DumpRenderTree/qt/EventSenderQt.cpp
+++ b/Tools/DumpRenderTree/qt/EventSenderQt.cpp
@@ -62,6 +62,7 @@ EventSender::EventSender(QWebPage* parent)
: QObject(parent)
#ifndef QT_NO_GESTURES
, m_tapGesture(parent)
+ , m_tapAndHoldGesture(parent)
#endif
{
m_page = parent;
@@ -577,6 +578,15 @@ void EventSender::gestureTap(int x, int y)
QGestureEvent event(m_gestures);
sendEvent(m_page, &event);
}
+
+void EventSender::gestureLongPress(int x, int y)
+{
+ m_tapAndHoldGesture.setPosition(QPointF(x, y));
+ m_gestures.clear();
+ m_gestures.append(&m_tapAndHoldGesture);
+ QGestureEvent event(m_gestures);
+ sendEvent(m_page, &event);
+}
#endif
void EventSender::zoomPageIn()
diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.h b/Tools/DumpRenderTree/qt/EventSenderQt.h
index e6d9257d2..7e4c60a97 100644
--- a/Tools/DumpRenderTree/qt/EventSenderQt.h
+++ b/Tools/DumpRenderTree/qt/EventSenderQt.h
@@ -88,6 +88,7 @@ public Q_SLOTS:
void cancelTouchPoint(int index);
#ifndef QT_NO_GESTURES
void gestureTap(int x, int y);
+ void gestureLongPress(int x, int y);
#endif
void beginDragWithFiles(const QStringList& files);
@@ -123,6 +124,7 @@ private:
Qt::KeyboardModifiers m_touchModifiers;
#ifndef QT_NO_GESTURES
QTapGesture m_tapGesture;
+ QTapAndHoldGesture m_tapAndHoldGesture;
QList<QGesture*> m_gestures;
#endif
bool m_touchActive;
diff --git a/Tools/MiniBrowser/efl/main.c b/Tools/MiniBrowser/efl/main.c
index 71796de3c..c5dc495a2 100644
--- a/Tools/MiniBrowser/efl/main.c
+++ b/Tools/MiniBrowser/efl/main.c
@@ -300,8 +300,7 @@ on_download_request(void *user_data, Evas_Object *webview, void *event_info)
else {
// Generate a unique file name since no name was suggested.
char unique_path[] = "/tmp/downloaded-file.XXXXXX";
- mktemp(unique_path);
- eina_strbuf_append(destination_path, unique_path);
+ eina_strbuf_append(destination_path, mktemp(unique_path));
}
ewk_download_job_destination_set(download, eina_strbuf_string_get(destination_path));
diff --git a/Tools/Scripts/export-w3c-performance-wg-tests b/Tools/Scripts/export-w3c-performance-wg-tests
new file mode 100755
index 000000000..aaa865915
--- /dev/null
+++ b/Tools/Scripts/export-w3c-performance-wg-tests
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+# Copyright (C) 2012 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# This script exports newly added tests to the W3C Web Performance WG's test
+# suite.
+#
+# You must have checked out the 'webperf' repository from https://dvcs.w3.org/hg/
+#
+# This script will export the LayoutTests/http/tests/w3c/submission directory
+# to a local 'webperf' repository.
+#
+# The main step in exporting the tests is updating all of the URLs to account
+# for the differences in directory layout.
+
+import os
+import shutil
+import sys
+
+if len(sys.argv) != 3:
+ print 'USAGE: %s path_to_webkit_checkout_root path_to_webperf_checkout_root'
+ sys.exit(1)
+
+source_directory = os.path.join(sys.argv[1], 'LayoutTests', 'http', 'tests', 'w3c', 'webperf')
+destination_directory = os.path.join(sys.argv[2], 'tests')
+
+directories_to_copy = ['resources', 'submission']
+replacements = [
+ ('localhost:8000', 'www.w3c-test.org'), # This is the alternate host for cross-server requests.
+ ('127.0.0.1:8000', 'w3c-test.org'), # This is the primary test server.
+ ('w3c/webperf', 'webperf/tests'), # We prepend /w3c to all of our paths.
+ ('/w3c/resources/testharness', '/resources/testharness'),
+ ('\n', '\r\n'), # Convert from *NIX format.
+]
+
+for directory_to_copy in directories_to_copy:
+ destination_subdirectory = os.path.join(destination_directory, directory_to_copy)
+ if not os.path.exists(destination_subdirectory):
+ os.makedirs(destination_subdirectory)
+ for root, dirs, files in os.walk(os.path.join(source_directory, directory_to_copy)):
+ print root, dirs, files
+ root = os.path.relpath(root, source_directory)
+ for dirname in dirs:
+ destination_subdirectory = os.path.join(destination_directory, root, dirname)
+ if not os.path.exists(destination_subdirectory):
+ os.makedirs(destination_subdirectory)
+ for filename in files:
+ if filename.endswith('-expected.txt'):
+ continue
+ with open(os.path.join(source_directory, root, filename), 'r') as in_file:
+ with open(os.path.join(destination_directory, root, filename), 'w') as out_file:
+ for line in in_file:
+ for to_find, replace_with in replacements:
+ line = line.replace(to_find, replace_with)
+ out_file.write(line)
diff --git a/Tools/Scripts/prepare-ChangeLog b/Tools/Scripts/prepare-ChangeLog
index cb91c598c..a3816e2dc 100755
--- a/Tools/Scripts/prepare-ChangeLog
+++ b/Tools/Scripts/prepare-ChangeLog
@@ -1218,7 +1218,7 @@ sub get_function_line_ranges_for_javascript($$)
}
# Find function names.
- while (m-(\w+|[(){}=:;])-g) {
+ while (m-(\w+|[(){}=:;,])-g) {
# Open parenthesis.
if ($1 eq '(') {
$parenthesesDepth++;
@@ -1259,8 +1259,8 @@ sub get_function_line_ranges_for_javascript($$)
next;
}
- # Semicolon.
- if ($1 eq ';') {
+ # Semicolon or comma.
+ if ($1 eq ';' or $1 eq ',') {
@currentIdentifiers = ();
next;
}
diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests
index 9bc10a481..1276596f1 100755
--- a/Tools/Scripts/run-gtk-tests
+++ b/Tools/Scripts/run-gtk-tests
@@ -68,7 +68,6 @@ class TestRunner:
SkippedTest("WebKit2APITests/TestWebKitWebView", "/webkit2/WebKitWebView/mouse-target", "Test is flaky in GTK Linux 32-bit Release bot", 82866),
SkippedTest("WebKit2APITests/TestResources", "/webkit2/WebKitWebView/resources", "Test is flaky in GTK Linux 32-bit Release bot", 82868),
SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/hide", "Test always fails in Xvfb", 89810),
- SkippedTest("WebKit2APITests/TestCookieManager", "/webkit2/WebKitCookieManager/accept-policy", "Test fails", 98738),
SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.WKConnection", "Tests fail and time out out", 84959),
SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.RestoreSessionStateContainingFormData", "Session State is not implemented in GTK+ port", 84960),
SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.SpacebarScrolling", "Test fails", 84961),
diff --git a/Tools/Scripts/run-javascriptcore-tests b/Tools/Scripts/run-javascriptcore-tests
index ca58ab3ec..9cb4c483b 100755
--- a/Tools/Scripts/run-javascriptcore-tests
+++ b/Tools/Scripts/run-javascriptcore-tests
@@ -50,6 +50,7 @@ my @testsToSkip = (
"ecma/Date/15.9.2.2-5.js",
"ecma/Date/15.9.2.2-6.js",
# ecma_3/Date/15.9.5.7.js fails on Mac (but not Windows) https://bugs.webkit.org/show_bug.cgi?id=25161
+ "ecma_3/Date/15.9.5.6.js",
"ecma_3/Date/15.9.5.7.js",
# These three fail on Linux in certain time zones, at certain times
# of the year (!): https://bugs.webkit.org/show_bug.cgi?id=71371
diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm
index cb53b2517..5a77bf117 100644
--- a/Tools/Scripts/webkitperl/FeatureList.pm
+++ b/Tools/Scripts/webkitperl/FeatureList.pm
@@ -49,7 +49,8 @@ my (
$blobSupport,
$channelMessagingSupport,
$cspNextSupport,
- $css3TextDecorationSupport,
+ $css3ConditionalRulesSupport,
+ $css3TextSupport,
$cssBoxDecorationBreakSupport,
$cssExclusionsSupport,
$cssFiltersSupport,
@@ -168,8 +169,11 @@ my @features = (
{ option => "css-filters", desc => "Toggle CSS Filters support",
define => "ENABLE_CSS_FILTERS", default => isAppleWebKit() || isBlackBerry(), value => \$cssFiltersSupport },
- { option => "css3-text-decoration", desc => "Toggle CSS3 Text Decoration support",
- define => "ENABLE_CSS3_TEXT_DECORATION", default => isEfl(), value => \$css3TextDecorationSupport },
+ { option => "css3-conditional-rules", desc => "Toggle CSS3 Conditional Rules support (i.e. \@supports)",
+ define => "ENABLE_CSS3_CONDITIONAL_RULES", default => 0, value => \$css3ConditionalRulesSupport },
+
+ { option => "css3-text", desc => "Toggle CSS3 Text support",
+ define => "ENABLE_CSS3_TEXT", default => isEfl(), value => \$css3TextSupport },
{ option => "css-hierarchies", desc => "Toggle CSS Hierarchy support",
define => "ENABLE_CSS_HIERARCHIES", default => 0, value => \$cssHierarchiesSupport },
diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py
index 73e18b36b..06f0d04b3 100644
--- a/Tools/Scripts/webkitpy/common/config/committers.py
+++ b/Tools/Scripts/webkitpy/common/config/committers.py
@@ -390,7 +390,7 @@ committers_unable_to_review = [
Committer("Trey Matteson", "trey@usa.net", "trey"),
Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]),
Committer("Vangelis Kokkevis", "vangelis@chromium.org", "vangelis"),
- Committer("Viatcheslav Ostapenko", "ostapenko.viatcheslav@nokia.com", "ostap"),
+ Committer("Viatcheslav Ostapenko", ["ostap73@gmail.com", "v.ostapenko@samsung.com", "v.ostapenko@sisa.samsung.com"], "ostap"),
Committer("Victor Carbune", "victor@rosedu.org", "vcarbune"),
Committer("Victor Wang", "victorw@chromium.org", "victorw"),
Committer("Victoria Kirst", ["vrk@chromium.org", "vrk@google.com"], "vrk"),
diff --git a/Tools/Scripts/webkitpy/common/config/watchlist b/Tools/Scripts/webkitpy/common/config/watchlist
index 813cee5b4..941f9b2b9 100755
--- a/Tools/Scripts/webkitpy/common/config/watchlist
+++ b/Tools/Scripts/webkitpy/common/config/watchlist
@@ -269,6 +269,12 @@
"filename": r"Source/WebCore/accessibility"
r"|LayoutTests/.*accessibility",
},
+ "Cairo": {
+ "filename": r"Source/WebCore/platform/graphics/cairo",
+ },
+ "Harfbuzz": {
+ "filename": r"Source/WebCore/platform/graphics/harfbuzz",
+ }
},
"CC_RULES": {
# Note: All email addresses listed must be registered with bugzilla.
@@ -278,6 +284,7 @@
"AppleMacPublicApi": [ "timothy@apple.com" ],
"Battery": [ "gyuyoung.kim@samsung.com" ],
"BlackBerry": [ "mifenton@rim.com", "rwlbuis@gmail.com", "tonikitoo@webkit.org" ],
+ "Cairo": [ "dominik.rottsches@intel.com" ],
"CMake": [ "rakuco@webkit.org", "gyuyoung.kim@samsung.com" ],
"CSS": [ "alexis@webkit.org", "macpherson@chromium.org", "cmarcelo@webkit.org", "allan.jensen@digia.com" ],
"ChromiumGraphics": [ "jamesr@chromium.org", "cc-bugs@chromium.org" ],
@@ -292,6 +299,7 @@
"FrameLoader": [ "abarth@webkit.org", "japhet@chromium.org" ],
"GStreamerGraphics": [ "alexis@webkit.org", "pnormand@igalia.com", "gns@gnome.org", "mrobinson@webkit.org" ],
"GtkWebKit2PublicAPI": [ "cgarcia@igalia.com", "gns@gnome.org", "mrobinson@webkit.org" ],
+ "Harfbuzz": [ "dominik.rottsches@intel.com" ],
"Loader": [ "japhet@chromium.org" ],
"MathML": [ "dbarton@mathscribe.com" ],
"Media": [ "feature-media-reviews@chromium.org", "eric.carlson@apple.com" ],
@@ -303,7 +311,7 @@
"QtWebKit2PlatformSpecific": [ "alexis@webkit.org", "cmarcelo@webkit.org", "abecsi@webkit.org" ],
"QtWebKit2PublicAPI": [ "alexis@webkit.org", "cmarcelo@webkit.org", "abecsi@webkit.org" ],
"Rendering": [ "eric@webkit.org" ],
- "SVG": ["schenney@chromium.org", "pdr@google.com", "fmalita@chromium.org" ],
+ "SVG": ["schenney@chromium.org", "pdr@google.com", "fmalita@chromium.org", "dominik.rottsches@intel.com" ],
"SVNScripts": [ "dbates@webkit.org" ],
"ScrollingCoordinator": [ "andersca@apple.com", "jamesr@chromium.org", "tonikitoo@webkit.org" ],
"SecurityCritical": [ "abarth@webkit.org" ],
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/builders.py b/Tools/Scripts/webkitpy/layout_tests/port/builders.py
index 605b8cccc..74af7b4b7 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/builders.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/builders.py
@@ -35,18 +35,29 @@ from webkitpy.common.memoized import memoized
# In this dictionary, each item stores:
# * port_name -- a fully qualified port name
# * specifiers -- a set of specifiers, representing configurations covered by this builder.
+# * move_overwritten_baselines_to -- (optional) list of platform directories that we will copy an existing
+# baseline to before pulling down a new baseline during rebaselining. This is useful
+# for bringing up a new port, for example when adding a Lion was the most recent Mac version and
+# we wanted to bring up Mountain Lion, we would want to copy an existing baseline in platform/mac
+# to platform/mac-mountainlion before updating the platform/mac entry.
+# * rebaseline_override_dir -- (optional) directory to put baselines in instead of where you would normally put them.
+# This is useful when we don't have bots that cover particular configurations; so, e.g., you might
+# support mac-mountainlion but not have a mac-mountainlion bot yet, so you'd want to put the mac-lion
+# results into platform/mac temporarily.
+
_exact_matches = {
# These builders are on build.chromium.org.
"WebKit XP": {"port_name": "chromium-win-xp", "specifiers": set(["xp", "release"])},
- "WebKit Win7": {"port_name": "chromium-win-win7", "specifiers": set(["win7"])},
- "WebKit Win7 (dbg)(1)": {"port_name": "chromium-win-xp", "specifiers": set(["win", "debug"])},
- "WebKit Win7 (dbg)(2)": {"port_name": "chromium-win-xp", "specifiers": set(["win", "debug"])},
+ "WebKit Win7": {"port_name": "chromium-win-win7", "specifiers": set(["win7", "release"])},
+ "WebKit Win7 (dbg)(1)": {"port_name": "chromium-win-win7", "specifiers": set(["win7", "debug"])},
+ "WebKit Win7 (dbg)(2)": {"port_name": "chromium-win-win7", "specifiers": set(["win7", "debug"])},
"WebKit Linux": {"port_name": "chromium-linux-x86_64", "specifiers": set(["linux", "x86_64", "release"])},
"WebKit Linux 32": {"port_name": "chromium-linux-x86", "specifiers": set(["linux", "x86"])},
"WebKit Linux (dbg)": {"port_name": "chromium-linux-x86_64", "specifiers": set(["linux", "debug"])},
"WebKit Mac10.6": {"port_name": "chromium-mac-snowleopard", "specifiers": set(["snowleopard"])},
"WebKit Mac10.6 (dbg)": {"port_name": "chromium-mac-snowleopard", "specifiers": set(["snowleopard", "debug"])},
- "WebKit Mac10.7": {"port_name": "chromium-mac-lion", "specifiers": set(["lion"])},
+ "WebKit Mac10.7": {"port_name": "chromium-mac-lion", "specifiers": set(["lion", "release"])},
+ "WebKit Mac10.8": {"port_name": "chromium-mac-mountainlion", "specifiers": set(["mountainlion", "release"])},
# These builders are on build.webkit.org.
"Apple MountainLion Release WK1 (Tests)": {"port_name": "mac-mountainlion", "specifiers": set(["mountainlion"]), "rebaseline_override_dir": "mac"},
@@ -117,6 +128,10 @@ def rebaseline_override_dir(builder_name):
return _exact_matches[builder_name].get("rebaseline_override_dir", None)
+def move_overwritten_baselines_to(builder_name):
+ return _exact_matches[builder_name].get("move_overwritten_baselines_to", [])
+
+
def port_name_for_builder_name(builder_name):
if builder_name in _exact_matches:
return _exact_matches[builder_name]["port_name"]
@@ -135,7 +150,3 @@ def builder_name_for_port_name(target_port_name):
def builder_path_for_port_name(port_name):
builder_path_from_name(builder_name_for_port_name(port_name))
-
-
-def fallback_port_names_for_new_port(builder_name):
- return _exact_matches[builder_name].get("move_overwritten_baselines_to", [])
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
index c310eb15b..a69f5a822 100755
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -390,6 +390,9 @@ class ChromiumPort(Port):
VirtualTestSuite('platform/chromium/virtual/softwarecompositing',
'compositing',
['--enable-software-compositing']),
+ VirtualTestSuite('platform/chromium/virtual/deferred/fast/images',
+ 'fast/images',
+ ['--enable-deferred-image-decoding', '--enable-per-tile-painting', '--force-compositing-mode']),
]
#
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
index 47eb4ea0c..21b7e317f 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
@@ -45,14 +45,16 @@ class ChromiumMacPort(chromium.ChromiumPort):
FALLBACK_PATHS = {
'snowleopard': [
'chromium-mac-snowleopard',
+ 'chromium-mac-lion',
'chromium-mac',
'chromium',
],
'lion': [
+ 'chromium-mac-lion',
'chromium-mac',
'chromium',
],
- 'mountainlion': [ # FIXME: we don't treat ML different from Lion yet.
+ 'mountainlion': [
'chromium-mac',
'chromium',
],
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
index 14e5a2b84..b02af5ca1 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
@@ -44,7 +44,7 @@ class ChromiumMacPortTest(chromium_port_testcase.ChromiumPortTestCase):
self.assertEquals(expected, port.name())
def test_versions(self):
- self.assertTrue(self.make_port().name() in ('chromium-mac-snowleopard', 'chromium-mac-lion', 'chromium-mac-future'))
+ self.assertTrue(self.make_port().name() in ('chromium-mac-snowleopard', 'chromium-mac-lion', 'chromium-mac-mountainlion', 'chromium-mac-future'))
self.assert_name(None, 'snowleopard', 'chromium-mac-snowleopard')
self.assert_name('chromium-mac', 'snowleopard', 'chromium-mac-snowleopard')
@@ -52,12 +52,13 @@ class ChromiumMacPortTest(chromium_port_testcase.ChromiumPortTestCase):
self.assert_name('chromium-mac-snowleopard', 'snowleopard', 'chromium-mac-snowleopard')
self.assert_name(None, 'lion', 'chromium-mac-lion')
+ self.assert_name(None, 'mountainlion', 'chromium-mac-mountainlion')
self.assert_name(None, 'future', 'chromium-mac-future')
+
self.assert_name('chromium-mac', 'lion', 'chromium-mac-lion')
- self.assert_name('chromium-mac-future', 'tiger', 'chromium-mac-future')
- self.assert_name('chromium-mac-future', 'leopard', 'chromium-mac-future')
self.assert_name('chromium-mac-future', 'snowleopard', 'chromium-mac-future')
self.assert_name('chromium-mac-future', 'lion', 'chromium-mac-future')
+ self.assert_name('chromium-mac-future', 'mountainlion', 'chromium-mac-future')
self.assertRaises(AssertionError, self.assert_name, None, 'tiger', 'should-raise-assertion-so-this-value-does-not-matter')
@@ -66,6 +67,12 @@ class ChromiumMacPortTest(chromium_port_testcase.ChromiumPortTestCase):
self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-mac-snowleopard'))
port = self.make_port(port_name='chromium-mac-lion')
+ self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-mac-lion'))
+
+ port = self.make_port(port_name='chromium-mac-mountainlion')
+ self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-mac'))
+
+ port = self.make_port(port_name='chromium-mac-future')
self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-mac'))
def test_operating_system(self):
diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
index cb8fa001f..859963261 100644
--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -74,7 +74,8 @@ class RebaselineTest(AbstractRebaseliningCommand):
def __init__(self):
options = [
optparse.make_option("--builder", help="Builder to pull new baselines from"),
- optparse.make_option("--platform-to-move-to", help="Platform to move existing baselines to before rebaselining. This is for dealing with bringing up new ports that interact with non-tree portions of the fallback graph."),
+ optparse.make_option("--move-overwritten-baselines-to", action="append", default=[],
+ help="Platform to move existing baselines to before rebaselining. This is for bringing up new ports."),
optparse.make_option("--test", help="Test to rebaseline"),
]
AbstractRebaseliningCommand.__init__(self, options=options)
@@ -90,13 +91,13 @@ class RebaselineTest(AbstractRebaseliningCommand):
return self._tool.filesystem.join(port.layout_tests_dir(), 'platform', override_dir)
return port.baseline_version_dir()
- def _copy_existing_baseline(self, platforms_to_move_existing_baselines_to, test_name, suffix):
+ def _copy_existing_baseline(self, move_overwritten_baselines_to, test_name, suffix):
old_baselines = []
new_baselines = []
# Need to gather all the baseline paths before modifying the filesystem since
# the modifications can affect the results of port.expected_filename.
- for platform in platforms_to_move_existing_baselines_to:
+ for platform in move_overwritten_baselines_to:
port = self._tool.port_factory.get(platform)
old_baseline = port.expected_filename(test_name, "." + suffix)
if not self._tool.filesystem.exists(old_baseline):
@@ -152,15 +153,15 @@ class RebaselineTest(AbstractRebaseliningCommand):
def _file_name_for_expected_result(self, test_name, suffix):
return "%s-expected.%s" % (self._test_root(test_name), suffix)
- def _rebaseline_test(self, builder_name, test_name, platforms_to_move_existing_baselines_to, suffix):
+ def _rebaseline_test(self, builder_name, test_name, move_overwritten_baselines_to, suffix):
results_url = self._results_url(builder_name)
baseline_directory = self._baseline_directory(builder_name)
source_baseline = "%s/%s" % (results_url, self._file_name_for_actual_result(test_name, suffix))
target_baseline = self._tool.filesystem.join(baseline_directory, self._file_name_for_expected_result(test_name, suffix))
- if platforms_to_move_existing_baselines_to:
- self._copy_existing_baseline(platforms_to_move_existing_baselines_to, test_name, suffix)
+ if move_overwritten_baselines_to:
+ self._copy_existing_baseline(move_overwritten_baselines_to, test_name, suffix)
_log.info("Retrieving %s." % source_baseline)
self._save_baseline(self._tool.web.get_binary(source_baseline, convert_404_to_None=True), target_baseline)
@@ -172,7 +173,7 @@ class RebaselineTest(AbstractRebaseliningCommand):
def execute(self, options, args, tool):
self._baseline_suffix_list = options.suffixes.split(',')
- self._rebaseline_test_and_update_expectations(options.builder, options.test, options.platform_to_move_to)
+ self._rebaseline_test_and_update_expectations(options.builder, options.test, options.move_overwritten_baselines_to)
print json.dumps(self._scm_changes)
@@ -269,6 +270,9 @@ class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand):
for builder in self._builders_to_fetch_from(test_list[test]):
suffixes = ','.join(test_list[test][builder])
cmd_line = [path_to_webkit_patch, 'rebaseline-test-internal', '--suffixes', suffixes, '--builder', builder, '--test', test]
+ move_overwritten_baselines_to = builders.move_overwritten_baselines_to(builder)
+ for platform in move_overwritten_baselines_to:
+ cmd_line.extend(['--move-overwritten-baselines-to', platform])
commands.append(tuple([cmd_line, cwd]))
return commands
diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
index 4b63f2f67..35394245f 100644
--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
@@ -54,7 +54,7 @@ class TestRebaseline(unittest.TestCase):
self.assertEqual(command._baseline_directory("GTK Linux 32-bit Release"), "/mock-checkout/LayoutTests/platform/gtk")
self.assertEqual(command._baseline_directory("EFL Linux 64-bit Debug"), "/mock-checkout/LayoutTests/platform/efl")
self.assertEqual(command._baseline_directory("Qt Linux Release"), "/mock-checkout/LayoutTests/platform/qt")
- self.assertEqual(command._baseline_directory("WebKit Mac10.7"), "/mock-checkout/LayoutTests/platform/chromium-mac")
+ self.assertEqual(command._baseline_directory("WebKit Mac10.7"), "/mock-checkout/LayoutTests/platform/chromium-mac-lion")
self.assertEqual(command._baseline_directory("WebKit Mac10.6"), "/mock-checkout/LayoutTests/platform/chromium-mac-snowleopard")
def test_rebaseline_updates_expectations_file_noop(self):
@@ -167,9 +167,7 @@ Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-resu
lion_port = tool.port_factory.get_from_builder_name("WebKit Mac10.7")
tool.filesystem.write_text_file(os.path.join(lion_port.baseline_path(), "userscripts/another-test-expected.txt"), "Dummy expected result")
- expected_logs = """Copying baseline from /mock-checkout/LayoutTests/platform/chromium-mac/userscripts/another-test-expected.txt to /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt.
-Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt.
-"""
+ expected_logs = "Copying baseline from /mock-checkout/LayoutTests/platform/chromium-mac-lion/userscripts/another-test-expected.txt to /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt.\nRetrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt.\n"
OutputCapture().assert_outputs(self, command._rebaseline_test, ["WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt"], expected_logs=expected_logs)
def test_rebaseline_and_copy_no_overwrite_test(self):
@@ -239,9 +237,9 @@ MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'user-scri
tool.executive.run_in_parallel = run_in_parallel
- expected_logs = "Retrieving results for chromium-linux-x86 from WebKit Linux 32.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-linux-x86_64 from WebKit Linux.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-lion from WebKit Mac10.7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-snowleopard from WebKit Mac10.6.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-win7 from WebKit Win7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-xp from WebKit XP.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for efl from EFL Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for gtk from GTK Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-lion from Apple Lion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-mountainlion from Apple MountainLion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for qt-linux from Qt Linux Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for win-7sp0 from Apple Win 7 Release (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\n"
+ expected_logs = "Retrieving results for chromium-linux-x86 from WebKit Linux 32.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-linux-x86_64 from WebKit Linux.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-lion from WebKit Mac10.7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-mountainlion from WebKit Mac10.8.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-snowleopard from WebKit Mac10.6.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-win7 from WebKit Win7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-xp from WebKit XP.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for efl from EFL Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for gtk from GTK Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-lion from Apple Lion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-mountainlion from Apple MountainLion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for qt-linux from Qt Linux Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for win-7sp0 from Apple Win 7 Release (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\n"
- expected_stdout = "[(['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux 32', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Win7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Qt Linux Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit XP', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux 32', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Win7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Qt Linux Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit XP', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout')]\n"
+ expected_stdout = "[(['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux 32', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Win7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.8', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Qt Linux Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit XP', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux 32', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Win7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.8', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Qt Linux Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit XP', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout')]\n"
expected_stderr = """MOCK run_command: ['qmake', '-v'], cwd=None
MOCK run_command: ['qmake', '-v'], cwd=None
@@ -458,3 +456,60 @@ MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'wav,txt,png', 'm
finally:
builders._exact_matches = old_exact_matches
+
+ def test_rebaseline_json_with_move_overwritten_baselines_to(self):
+ old_exact_matches = builders._exact_matches
+ try:
+ builders._exact_matches = {
+ "MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])},
+ "MOCK builder2": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier2"]),
+ "move_overwritten_baselines_to": ["test-mac-leopard"]},
+ }
+
+ command = Rebaseline()
+ tool = MockTool()
+ tool.executive = MockExecutive(should_log=True)
+ command.bind_to_tool(tool)
+
+ expected_stdout = """rebaseline-json: {'mock/path/to/test.html': {'MOCK builder2': ['txt', 'png']}}\n"""
+ expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test.html', '--move-overwritten-baselines-to', 'test-mac-leopard'], cwd=/mock-checkout
+MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'mock/path/to/test.html'], cwd=/mock-checkout
+"""
+
+ options = MockOptions(optimize=True, builders=["MOCK builder2"], suffixes=["txt,png"], verbose=True)
+ OutputCapture().assert_outputs(self, command.execute, [options, ["mock/path/to/test.html"], tool],
+ expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+ finally:
+ builders._exact_matches = old_exact_matches
+
+ def test_rebaseline_test_internal_with_move_overwritten_baselines_to(self):
+ old_exact_matches = builders._exact_matches
+ try:
+ builders._exact_matches = {
+ "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])},
+ "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier"])},
+ }
+
+ command = RebaselineTest()
+ tool = MockTool()
+ tool.executive = MockExecutive(should_log=True)
+ command.bind_to_tool(tool)
+
+ port = tool.port_factory.get('test-mac-snowleopard')
+ tool.filesystem.write_text_file(tool.filesystem.join(port.baseline_version_dir(), 'failures', 'expected', 'image-expected.txt'), '')
+
+ options = MockOptions(optimize=True, builder="MOCK SnowLeopard", suffixes="txt",
+ move_overwritten_baselines_to=["test-mac-leopard"], verbose=True, test="failures/expected/image.html")
+
+ oc = OutputCapture()
+ oc.capture_output()
+ try:
+ logs = ''
+ command.execute(options, [], tool)
+ finally:
+ _, _, logs = oc.restore_output()
+
+ self.assertTrue("Copying baseline from /test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image-expected.txt to /test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.txt.\n" in logs)
+
+ finally:
+ builders._exact_matches = old_exact_matches
diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
index 6c64bdd7e..a2f3fabc8 100644
--- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
@@ -91,9 +91,6 @@ class BuildCoverageExtrapolatorTest(unittest.TestCase):
converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros())
extrapolator = BuildCoverageExtrapolator(converter)
self.assertEquals(extrapolator.extrapolate_test_configurations("WebKit XP"), set([TestConfiguration(version='xp', architecture='x86', build_type='release')]))
- self.assertEquals(extrapolator.extrapolate_test_configurations("WebKit Win7"), set([
- TestConfiguration(version='win7', architecture='x86', build_type='debug'),
- TestConfiguration(version='win7', architecture='x86', build_type='release')]))
self.assertRaises(KeyError, extrapolator.extrapolate_test_configurations, "Potato")
@@ -124,9 +121,3 @@ class GardeningServerTest(unittest.TestCase):
self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}', expected_stderr=expected_stderr % ('MOCK builder', '"txt","png"'), expected_stdout=expected_stdout, server=server)
self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt","png"]}}', expected_stderr=expected_stderr % ('MOCK builder (Debug)', '"txt","png"'), expected_stdout=expected_stdout)
-
- def test_rebaseline_new_port(self):
- builders._exact_matches = {"MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"]), "move_overwritten_baselines_to": ["mock-port-fallback", "mock-port-fallback2"]}}
- expected_stderr = 'MOCK run_command: [\'echo\', \'rebaseline-json\'], cwd=/mock-checkout, input={"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}\n'
- expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
- self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}', expected_stderr=expected_stderr, expected_stdout=expected_stdout)
diff --git a/Tools/TestResultServer/static-dashboards/aggregate_results.html b/Tools/TestResultServer/static-dashboards/aggregate_results.html
index 9a76b06b4..fa033a54d 100644
--- a/Tools/TestResultServer/static-dashboards/aggregate_results.html
+++ b/Tools/TestResultServer/static-dashboards/aggregate_results.html
@@ -51,6 +51,7 @@ img {
}
</style>
<script src="builders.js"></script>
+<script src="loader.js"></script>
<script src="dashboard_base.js"></script>
<script>
// @fileoverview Creates a dashboard for tracking number of passes/failures per run.
diff --git a/Tools/TestResultServer/static-dashboards/builders.js b/Tools/TestResultServer/static-dashboards/builders.js
index 3dd6052da..43902ffe7 100644
--- a/Tools/TestResultServer/static-dashboards/builders.js
+++ b/Tools/TestResultServer/static-dashboards/builders.js
@@ -122,26 +122,13 @@ function associateBuildersWithMaster(builders, master)
});
}
-function doXHR(url, onLoad, builderGroups, groupName)
-{
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, true);
- xhr.onload = function() {
- if (xhr.status == 200)
- onLoad(JSON.parse(xhr.response));
- else
- onErrorLoadingBuilderList(url, builderGroups, groupName);
- };
- xhr.onerror = function() { onErrorLoadingBuilderList(url, builderGroups, groupName); };
- xhr.send();
-}
-
function requestBuilderList(builderGroups, builderFilter, master, groupName, builderGroup)
{
if (!builderGroups[groupName])
builderGroups[groupName] = builderGroup;
- var onLoad = partial(onBuilderListLoad, builderGroups, builderFilter, master, groupName);
- doXHR(master.builderJsonPath(), onLoad, builderGroups, groupName);
+ loader.request(master.builderJsonPath(),
+ partial(onBuilderListLoad, builderGroups, builderFilter, master, groupName),
+ partial(onErrorLoadingBuilderList, master.builderJsonPath(), builderGroups, groupName));
builderGroups[groupName].expectedGroups += 1;
}
@@ -220,16 +207,16 @@ function generateBuildersFromBuilderList(builderList, filter)
});
}
-function onBuilderListLoad(builderGroups, builderFilter, master, groupName, json)
+function onBuilderListLoad(builderGroups, builderFilter, master, groupName, xhr)
{
- var builders = generateBuildersFromBuilderList(Object.keys(json), builderFilter);
+ var builders = generateBuildersFromBuilderList(Object.keys(JSON.parse(xhr.responseText)), builderFilter);
associateBuildersWithMaster(builders, master);
builderGroups[groupName].append(builders);
if (builderGroups[groupName].loaded())
- g_handleBuildersListLoaded();
+ g_resourceLoader.buildersListLoaded();
}
-function onErrorLoadingBuilderList(url, builderGroups, groupName)
+function onErrorLoadingBuilderList(url, builderGroups, groupName, xhr)
{
builderGroups[groupName].groups += 1;
console.log('Could not load list of builders from ' + url + '. Try reloading.');
diff --git a/Tools/TestResultServer/static-dashboards/dashboard_base.js b/Tools/TestResultServer/static-dashboards/dashboard_base.js
index a3a4ec126..59502d603 100644
--- a/Tools/TestResultServer/static-dashboards/dashboard_base.js
+++ b/Tools/TestResultServer/static-dashboards/dashboard_base.js
@@ -33,6 +33,7 @@
// The calling page is expected to implement the following "abstract"
// functions/objects:
var g_pageLoadStartTime = Date.now();
+var g_resourceLoader;
// Generates the contents of the dashboard. The page should override this with
// a function that generates the page assuming all resources have loaded.
@@ -159,8 +160,6 @@ var RLE = {
VALUE: 1
}
-var TEST_RESULTS_SERVER = 'http://test-results.appspot.com/';
-
function isFailingResult(value)
{
return 'FSTOCIZ'.indexOf(value) != -1;
@@ -262,24 +261,6 @@ function collapseWhitespace(str)
return str.replace(/\s+/g, ' ');
}
-function request(url, success, error, opt_isBinaryData)
-{
- console.log('XMLHttpRequest: ' + url);
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, true);
- if (opt_isBinaryData)
- xhr.overrideMimeType('text/plain; charset=x-user-defined');
- xhr.onreadystatechange = function(e) {
- if (xhr.readyState == 4) {
- if (xhr.status == 200)
- success(xhr);
- else
- error(xhr);
- }
- }
- xhr.send();
-}
-
function validateParameter(state, key, value, validateFn)
{
if (validateFn())
@@ -359,7 +340,8 @@ function parseParameters()
var dashboardSpecificDiffState = diffStates(oldDashboardSpecificState, g_currentState);
fillMissingValues(g_currentState, g_defaultDashboardSpecificStateValues);
- fillMissingValues(g_currentState, {'builder': g_defaultBuilderName});
+ if (!g_crossDashboardState.useTestData)
+ fillMissingValues(g_currentState, {'builder': g_defaultBuilderName});
// FIXME: dashboard_base shouldn't know anything about specific dashboard specific keys.
if (dashboardSpecificDiffState.builder)
@@ -410,34 +392,10 @@ function fillMissingValues(to, from)
}
}
-// Load a script.
-// @param {string} path Path to the script to load.
-// @param {Function=} opt_onError Optional function to call if the script
-// does not load.
-// @param {Function=} opt_onLoad Optional function to call when the script
-// is loaded. Called with the script element as its 1st argument.
-function appendScript(path, opt_onError, opt_onLoad)
-{
- var script = document.createElement('script');
- script.src = path;
- if (opt_onLoad) {
- script.onreadystatechange = function() {
- if (this.readyState == 'complete')
- opt_onLoad(script);
- };
- script.onload = function() { opt_onLoad(script); };
- }
- if (opt_onError)
- script.onerror = opt_onError;
- document.getElementsByTagName('head')[0].appendChild(script);
-}
-
// FIXME: Rename this to g_dashboardSpecificState;
var g_currentState = {};
var g_crossDashboardState = {};
-var g_waitingOnExpectations;
parseCrossDashboardParameters();
-loadBuildersList(g_crossDashboardState.group, g_crossDashboardState.testType);
function isLayoutTestResults()
{
@@ -498,32 +456,6 @@ var g_expectationsByPlatform = {};
var g_staleBuilders = [];
var g_buildersThatFailedToLoad = [];
-function ADD_RESULTS(builds)
-{
- var json_version = builds['version'];
- for (var builderName in builds) {
- if (builderName == 'version')
- continue;
-
- // If a test suite stops being run on a given builder, we don't want to show it.
- // Assume any builder without a run in two weeks for a given test suite isn't
- // running that suite anymore.
- // FIXME: Grab which bots run which tests directly from the buildbot JSON instead.
- var lastRunSeconds = builds[builderName].secondsSinceEpoch[0];
- if ((Date.now() / 1000) - lastRunSeconds > ONE_WEEK_SECONDS)
- continue;
-
- if ((Date.now() / 1000) - lastRunSeconds > ONE_DAY_SECONDS)
- g_staleBuilders.push(builderName);
-
- if (json_version >= 4)
- builds[builderName][TESTS_KEY] = flattenTrie(builds[builderName][TESTS_KEY]);
- g_resultsByBuilder[builderName] = builds[builderName];
- }
-
- handleResourceLoad();
-}
-
// TODO(aboxhall): figure out whether this is a performance bottleneck and
// change calling code to understand the trie structure instead if necessary.
function flattenTrie(trie, prefix)
@@ -544,44 +476,6 @@ function flattenTrie(trie, prefix)
return result;
}
-function pathToBuilderResultsFile(builderName)
-{
- return TEST_RESULTS_SERVER + 'testfile?builder=' + builderName +
- '&master=' + builderMaster(builderName).name +
- '&testtype=' + g_crossDashboardState.testType + '&name=';
-}
-
-function requestExpectationsFiles()
-{
- var expectationsFilesToRequest = {};
- traversePlatformsTree(function(platform, platformName) {
- if (platform.fallbackPlatforms)
- platform.fallbackPlatforms.forEach(function(fallbackPlatform) {
- var fallbackPlatformObject = platformObjectForName(fallbackPlatform);
- if (fallbackPlatformObject.expectationsDirectory && !(fallbackPlatform in expectationsFilesToRequest))
- expectationsFilesToRequest[fallbackPlatform] = EXPECTATIONS_URL_BASE_PATH + fallbackPlatformObject.expectationsDirectory + '/TestExpectations';
- });
-
- if (platform.expectationsDirectory)
- expectationsFilesToRequest[platformName] = EXPECTATIONS_URL_BASE_PATH + platform.expectationsDirectory + '/TestExpectations';
- });
-
- for (platformWithExpectations in expectationsFilesToRequest)
- request(expectationsFilesToRequest[platformWithExpectations],
- partial(function(platformName, xhr) {
- g_expectationsByPlatform[platformName] = getParsedExpectations(xhr.responseText);
-
- delete expectationsFilesToRequest[platformName];
- if (!Object.keys(expectationsFilesToRequest).length) {
- g_waitingOnExpectations = false;
- handleResourceLoad();
- }
- }, platformWithExpectations),
- partial(function(platformName, xhr) {
- console.error('Could not load expectations file for ' + platformName);
- }, platformWithExpectations));
-}
-
function isTreeMap()
{
return endsWith(window.location.pathname, 'treemap.html');
@@ -592,106 +486,10 @@ function isFlakinessDashboard()
return endsWith(window.location.pathname, 'flakiness_dashboard.html');
}
-function appendJSONScriptElementFor(builderName)
-{
- var resultsFilename;
- if (isTreeMap())
- resultsFilename = 'times_ms.json';
- else if (g_crossDashboardState.showAllRuns)
- resultsFilename = 'results.json';
- else
- resultsFilename = 'results-small.json';
-
- appendScript(pathToBuilderResultsFile(builderName) + resultsFilename + '&callback=ADD_RESULTS',
- partial(handleResourceLoadError, builderName),
- partial(handleScriptLoaded, builderName));
-}
-
-function appendJSONScriptElements()
-{
- clearErrors();
-
- if (isTreeMap())
- return;
-
- parseParameters();
-
- if (g_crossDashboardState.useTestData)
- return;
-
- for (var builderName in g_builders)
- appendJSONScriptElementFor(builderName);
-
- g_waitingOnExpectations = isLayoutTestResults() && isFlakinessDashboard();
- if (g_waitingOnExpectations)
- requestExpectationsFiles();
-}
-
var g_hasDoneInitialPageGeneration = false;
// String of error messages to display to the user.
var g_errorMessages = '';
-function handleResourceLoad()
-{
- // In case we load a results.json that's not in the list of builders,
- // make sure to only call handleLocationChange once from the resource loads.
- if (!g_hasDoneInitialPageGeneration)
- handleLocationChange();
-}
-
-function handleScriptLoaded(builderName, script)
-{
- // We need this work-around for webkit.org/b/50589.
- if (!g_resultsByBuilder[builderName]) {
- var error = new Error("Builder data was empty");
- error.target = script;
- handleResourceLoadError(builderName, error);
- }
-}
-
-// Handle resource loading errors - 404s, 500s, etc. Recover from the error to
-// still show as much data as possible, but show some UI about the failure, and
-// do not try using this resource again until user refreshes.
-//
-// @param {string} builderName Name of builder that the resource failed for.
-// @param {Event} e The error event.
-function handleResourceLoadError(builderName, e)
-{
- var error = e.target.src + ' failed to load for ' + builderName + '.';
-
- if (isLayoutTestResults()) {
- console.error(error);
- g_buildersThatFailedToLoad.push(builderName);
- } else {
- // Avoid to show error/warning messages for non-layout tests. We may be
- // checking the builders that are not running the tests.
- console.info('info:' + error);
- }
-
- // Remove this builder from builders, so we don't try to use the
- // data that isn't there.
- delete g_builders[builderName];
-
- // Change the default builder name if it has been deleted.
- if (g_defaultBuilderName == builderName) {
- g_defaultBuilderName = null;
- for (var availableBuilderName in g_builders) {
- g_defaultBuilderName = availableBuilderName;
- g_defaultDashboardSpecificStateValues.builder = availableBuilderName;
- break;
- }
- if (!g_defaultBuilderName) {
- var error = 'No tests results found for ' + g_crossDashboardState.testType + '. Reload the page to try fetching it again.';
- console.error(error);
- addError(error);
- }
- }
-
- // Proceed as if the resource had loaded.
- handleResourceLoad();
-}
-
-
// Record a new error message.
// @param {string} errorMsg The message to show to the user.
function addError(errorMsg)
@@ -726,25 +524,6 @@ function showErrors()
errors.innerHTML = g_errorMessages;
}
-// @return {boolean} Whether the json files have all completed loading.
-function haveJsonFilesLoaded()
-{
- if (!currentBuilderGroup())
- return false;
-
- if (g_waitingOnExpectations)
- return false;
-
- if (isTreeMap())
- return true;
-
- for (var builder in g_builders) {
- if (!g_resultsByBuilder[builder])
- return false;
- }
- return true;
-}
-
function addBuilderLoadErrors()
{
if (g_hasDoneInitialPageGeneration)
@@ -757,9 +536,15 @@ function addBuilderLoadErrors()
addError('ERROR: Data from ' + g_staleBuilders.toString() + ' is more than 1 day stale.');
}
+function resourceLoadingComplete()
+{
+ g_resourceLoader = null;
+ handleLocationChange();
+}
+
function handleLocationChange()
{
- if(!haveJsonFilesLoaded())
+ if (g_resourceLoader)
return;
addBuilderLoadErrors();
@@ -1117,13 +902,6 @@ function decompressResults(builderResults)
};
}
-function g_handleBuildersListLoaded() {
- if (!currentBuilderGroup())
- return;
- initBuilders();
- appendJSONScriptElements();
-}
-
document.addEventListener('mousedown', function(e) {
// Clear the open popup, unless the click was inside the popup.
var popup = $('popup');
@@ -1135,4 +913,6 @@ window.addEventListener('load', function() {
// This doesn't seem totally accurate as there is a race between
// onload firing and the last script tag being executed.
logTime('Time to load JS', g_pageLoadStartTime);
+ g_resourceLoader = new loader.Loader();
+ g_resourceLoader.load();
}, false);
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html
index 6be0dda04..625d4238d 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html
@@ -31,5 +31,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<link rel="stylesheet" href="flakiness_dashboard.css"></link>
<link rel="stylesheet" href="flakiness_dashboard_tests.css"></link>
<script src="builders.js"></script>
+<script src="loader.js"></script>
<script src="dashboard_base.js"></script>
<script src="flakiness_dashboard.js"></script>
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
index 41a2d6a51..7589e3424 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
@@ -1860,7 +1860,7 @@ function maybeAddPngChecksum(expectationDiv, pngUrl)
{
// pngUrl gets served from the browser cache since we just loaded it in an
// <img> tag.
- request(pngUrl,
+ loader.request(pngUrl,
function(xhr) {
// Convert the first 2k of the response to a byte string.
var bytes = xhr.responseText.substring(0, 2048);
@@ -1954,7 +1954,7 @@ function addExpectationItem(expectationsContainers, parentContainer, platform, p
if (!isImage)
childContainer.appendChild(dummyNode);
} else {
- request(url,
+ loader.request(url,
function(xhr) {
var item = document.createElement('pre');
item.innerText = xhr.responseText;
diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
index 75864fae7..597c62e2a 100644
--- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
+++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
@@ -387,6 +387,11 @@ test('htmlForIndividualTestOnAllBuildersWithResultsLinks', 1, function() {
'</tr></thead>' +
'<tbody></tbody>' +
'</table>' +
+ '<div>The following builders either don\'t run this test (e.g. it\'s skipped) or all runs passed:</div>' +
+ '<div class=skipped-builder-list>' +
+ '<div class=skipped-builder>WebKit Linux</div><div class=skipped-builder>WebKit Linux (dbg)</div>' +
+ '<div class=skipped-builder>WebKit Mac10.7</div><div class=skipped-builder>WebKit Win</div>' +
+ '</div>' +
'<div class=expectations test=dummytest.html>' +
'<div><span class=link onclick="setQueryParameter(\'showExpectations\', true)">Show results</span> | ' +
'<span class=link onclick="setQueryParameter(\'showLargeExpectations\', true)">Show large thumbnails</span> | ' +
@@ -412,6 +417,11 @@ test('htmlForIndividualTestOnAllBuildersWithResultsLinksWebkitMaster', 1, functi
'</tr></thead>' +
'<tbody></tbody>' +
'</table>' +
+ '<div>The following builders either don\'t run this test (e.g. it\'s skipped) or all runs passed:</div>' +
+ '<div class=skipped-builder-list>' +
+ '<div class=skipped-builder>WebKit Linux</div><div class=skipped-builder>WebKit Linux (dbg)</div>' +
+ '<div class=skipped-builder>WebKit Mac10.7</div><div class=skipped-builder>WebKit Win</div>' +
+ '</div>' +
'<div class=expectations test=dummytest.html>' +
'<div><span class=link onclick="setQueryParameter(\'showExpectations\', true)">Show results</span> | ' +
'<span class=link onclick="setQueryParameter(\'showLargeExpectations\', true)">Show large thumbnails</span>' +
@@ -642,9 +652,9 @@ test('builderGroupIsToTWebKitAttribute', 2, function() {
testBuilderGroups['@DEPS - dummy.org'].expectedGroups = 1;
var testJSONData = "{ \"Dummy Builder 1\": null, \"Dummy Builder 2\": null }";
- onBuilderListLoad(testBuilderGroups, function() { return true; }, dummyMaster, '@ToT - dummy.org', JSON.parse(testJSONData));
+ onBuilderListLoad(testBuilderGroups, function() { return true; }, dummyMaster, '@ToT - dummy.org', {responseText: testJSONData});
equal(testBuilderGroups['@ToT - dummy.org'].isToTWebKit, true);
- onBuilderListLoad(testBuilderGroups, function() { return true; }, dummyMaster, '@DEPS - dummy.org', JSON.parse(testJSONData));
+ onBuilderListLoad(testBuilderGroups, function() { return true; }, dummyMaster, '@DEPS - dummy.org', {responseText: testJSONData});
equal(testBuilderGroups['@DEPS - dummy.org'].isToTWebKit, false);
});
@@ -657,10 +667,10 @@ test('builderGroupExpectedGroups', 4, function() {
var testJSONData = "{ \"Dummy Builder 1\": null }";
equal(testBuilderGroups['@ToT - dummy.org'].expectedGroups, 3);
- onBuilderListLoad(testBuilderGroups, function() { return true; }, dummyMaster, '@ToT - dummy.org', JSON.parse(testJSONData));
+ onBuilderListLoad(testBuilderGroups, function() { return true; }, dummyMaster, '@ToT - dummy.org', {responseText: testJSONData});
equal(testBuilderGroups['@ToT - dummy.org'].groups, 1);
var testJSONData = "{ \"Dummy Builder 2\": null }";
- onBuilderListLoad(testBuilderGroups, function() { return true; }, dummyMaster, '@ToT - dummy.org', JSON.parse(testJSONData));
+ onBuilderListLoad(testBuilderGroups, function() { return true; }, dummyMaster, '@ToT - dummy.org', {responseText: testJSONData});
equal(testBuilderGroups['@ToT - dummy.org'].groups, 2);
onErrorLoadingBuilderList('http://build.dummy.org', testBuilderGroups, '@ToT - dummy.org');
equal(testBuilderGroups['@ToT - dummy.org'].groups, 3);
@@ -669,9 +679,10 @@ test('builderGroupExpectedGroups', 4, function() {
test('requestBuilderListAddsBuilderGroupEntry', 2, function() {
var testBuilderGroups = { '@ToT - dummy.org': null };
- var oldDoXHR = doXHR;
+ var requestFunction = loader.request;
+ loader.request = function() {};
+
try {
- doXHR = function() {};
var builderFilter = null;
var master = { builderJsonPath: function() {} };
var groupName = '@ToT - dummy.org';
@@ -681,7 +692,7 @@ test('requestBuilderListAddsBuilderGroupEntry', 2, function() {
equal(testBuilderGroups['@ToT - dummy.org'], builderGroup);
equal(testBuilderGroups['@ToT - dummy.org'].expectedGroups, 1);
} finally {
- doXHR = oldDoXHR;
+ loader.request = requestFunction;
}
})
diff --git a/Tools/TestResultServer/static-dashboards/loader.js b/Tools/TestResultServer/static-dashboards/loader.js
new file mode 100644
index 000000000..be9e708a1
--- /dev/null
+++ b/Tools/TestResultServer/static-dashboards/loader.js
@@ -0,0 +1,247 @@
+// Copyright (C) 2012 Google Inc. All rights reserved.
+// Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com>
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+var loader = loader || {};
+
+(function() {
+
+var TEST_RESULTS_SERVER = 'http://test-results.appspot.com/';
+var CHROMIUM_EXPECTATIONS_URL = 'http://svn.webkit.org/repository/webkit/trunk/LayoutTests/platform/chromium/TestExpectations';
+
+function pathToBuilderResultsFile(builderName) {
+ return TEST_RESULTS_SERVER + 'testfile?builder=' + builderName +
+ '&master=' + builderMaster(builderName).name +
+ '&testtype=' + g_crossDashboardState.testType + '&name=';
+}
+
+loader.request = function(url, success, error, opt_isBinaryData)
+{
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', url, true);
+ if (opt_isBinaryData)
+ xhr.overrideMimeType('text/plain; charset=x-user-defined');
+ xhr.onreadystatechange = function(e) {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 200)
+ success(xhr);
+ else
+ error(xhr);
+ }
+ }
+ xhr.send();
+}
+
+loader.Loader = function()
+{
+ this._loadingSteps = [
+ this._loadBuildersList,
+ this._loadResultsFiles,
+ this._loadExpectationsFiles,
+ ];
+}
+
+loader.Loader.prototype = {
+ load: function()
+ {
+ this._loadNext();
+ },
+ buildersListLoaded: function()
+ {
+ initBuilders();
+ this._loadNext();
+ },
+ _loadNext: function()
+ {
+ var loadingStep = this._loadingSteps.shift();
+ if (!loadingStep) {
+ resourceLoadingComplete();
+ return;
+ }
+ loadingStep.apply(this);
+ },
+ _loadBuildersList: function()
+ {
+ loadBuildersList(g_crossDashboardState.group, g_crossDashboardState.testType);
+ },
+ _loadResultsFiles: function()
+ {
+ parseParameters();
+
+ for (var builderName in g_builders)
+ this._loadResultsFileForBuilder(builderName);
+ },
+ _loadResultsFileForBuilder: function(builderName)
+ {
+ var resultsFilename;
+ if (isTreeMap())
+ resultsFilename = 'times_ms.json';
+ else if (g_crossDashboardState.showAllRuns)
+ resultsFilename = 'results.json';
+ else
+ resultsFilename = 'results-small.json';
+
+ var resultsFileLocation = pathToBuilderResultsFile(builderName) + resultsFilename;
+ loader.request(resultsFileLocation,
+ partial(function(loader, builderName, xhr) {
+ loader._handleResultsFileLoaded(builderName, xhr.responseText);
+ }, this, builderName),
+ partial(function(loader, builderName, xhr) {
+ loader._handleResultsFileLoadError(builderName);
+ }, this, builderName));
+ },
+ _handleResultsFileLoaded: function(builderName, fileData)
+ {
+ if (isTreeMap())
+ this._processTimesJSONData(builderName, fileData);
+ else
+ this._processResultsJSONData(builderName, fileData);
+
+ // We need this work-around for webkit.org/b/50589.
+ if (!g_resultsByBuilder[builderName]) {
+ this._handleResultsFileLoadError(builderName);
+ return;
+ }
+
+ this._handleResourceLoad();
+ },
+ _processTimesJSONData: function(builderName, fileData)
+ {
+ // FIXME: We should probably include the builderName in the JSON
+ // rather than relying on only loading one JSON file per page.
+ g_resultsByBuilder[builderName] = JSON.parse(fileData);
+ },
+ _processResultsJSONData: function(builderName, fileData)
+ {
+ var builds = JSON.parse(fileData);
+
+ var json_version = builds['version'];
+ for (var builderName in builds) {
+ if (builderName == 'version')
+ continue;
+
+ // If a test suite stops being run on a given builder, we don't want to show it.
+ // Assume any builder without a run in two weeks for a given test suite isn't
+ // running that suite anymore.
+ // FIXME: Grab which bots run which tests directly from the buildbot JSON instead.
+ var lastRunSeconds = builds[builderName].secondsSinceEpoch[0];
+ if ((Date.now() / 1000) - lastRunSeconds > ONE_WEEK_SECONDS)
+ continue;
+
+ if ((Date.now() / 1000) - lastRunSeconds > ONE_DAY_SECONDS)
+ g_staleBuilders.push(builderName);
+
+ if (json_version >= 4)
+ builds[builderName][TESTS_KEY] = flattenTrie(builds[builderName][TESTS_KEY]);
+ g_resultsByBuilder[builderName] = builds[builderName];
+ }
+ },
+ _handleResultsFileLoadError: function(builderName)
+ {
+ var error = 'Failed to load results file for ' + builderName + '.';
+
+ if (isLayoutTestResults()) {
+ console.error(error);
+ g_buildersThatFailedToLoad.push(builderName);
+ } else {
+ // Avoid to show error/warning messages for non-layout tests. We may be
+ // checking the builders that are not running the tests.
+ console.info('info:' + error);
+ }
+
+ // Remove this builder from builders, so we don't try to use the
+ // data that isn't there.
+ delete g_builders[builderName];
+
+ // Change the default builder name if it has been deleted.
+ if (g_defaultBuilderName == builderName) {
+ g_defaultBuilderName = null;
+ for (var availableBuilderName in g_builders) {
+ g_defaultBuilderName = availableBuilderName;
+ g_defaultDashboardSpecificStateValues.builder = availableBuilderName;
+ break;
+ }
+ if (!g_defaultBuilderName) {
+ var error = 'No tests results found for ' + g_crossDashboardState.testType + '. Reload the page to try fetching it again.';
+ console.error(error);
+ addError(error);
+ }
+ }
+
+ // Proceed as if the resource had loaded.
+ this._handleResourceLoad();
+ },
+ _handleResourceLoad: function()
+ {
+ if (this._haveResultsFilesLoaded())
+ this._loadNext();
+ },
+ _haveResultsFilesLoaded: function()
+ {
+ for (var builder in g_builders) {
+ if (!g_resultsByBuilder[builder])
+ return false;
+ }
+ return true;
+ },
+ _loadExpectationsFiles: function()
+ {
+ if (!isFlakinessDashboard() && !g_crossDashboardState.useTestData) {
+ this._loadNext();
+ return;
+ }
+
+ var expectationsFilesToRequest = {};
+ traversePlatformsTree(function(platform, platformName) {
+ if (platform.fallbackPlatforms)
+ platform.fallbackPlatforms.forEach(function(fallbackPlatform) {
+ var fallbackPlatformObject = platformObjectForName(fallbackPlatform);
+ if (fallbackPlatformObject.expectationsDirectory && !(fallbackPlatform in expectationsFilesToRequest))
+ expectationsFilesToRequest[fallbackPlatform] = EXPECTATIONS_URL_BASE_PATH + fallbackPlatformObject.expectationsDirectory + '/TestExpectations';
+ });
+
+ if (platform.expectationsDirectory)
+ expectationsFilesToRequest[platformName] = EXPECTATIONS_URL_BASE_PATH + platform.expectationsDirectory + '/TestExpectations';
+ });
+
+ for (platformWithExpectations in expectationsFilesToRequest)
+ loader.request(expectationsFilesToRequest[platformWithExpectations],
+ partial(function(loader, platformName, xhr) {
+ g_expectationsByPlatform[platformName] = getParsedExpectations(xhr.responseText);
+
+ delete expectationsFilesToRequest[platformName];
+ if (!Object.keys(expectationsFilesToRequest).length)
+ loader._loadNext();
+ }, this, platformWithExpectations),
+ partial(function(platformName, xhr) {
+ console.error('Could not load expectations file for ' + platformName);
+ }, platformWithExpectations));
+ }
+}
+
+})();
diff --git a/Tools/TestResultServer/static-dashboards/loader_unittests.js b/Tools/TestResultServer/static-dashboards/loader_unittests.js
new file mode 100644
index 000000000..e2f546c09
--- /dev/null
+++ b/Tools/TestResultServer/static-dashboards/loader_unittests.js
@@ -0,0 +1,106 @@
+// Copyright (C) Zan Dobersek <zandobersek@gmail.com>
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+module('loader');
+
+test('loading steps', 1, function() {
+ var loadedSteps = [];
+ var resourceLoader = new loader.Loader();
+ function loadingStep1() {
+ loadedSteps.push('step 1');
+ resourceLoader.load();
+ }
+ function loadingStep2() {
+ loadedSteps.push('step 2');
+ resourceLoader.load();
+ }
+
+ var loadingCompleteCallback = resourceLoadingComplete;
+ resourceLoadingComplete = function() {
+ deepEqual(loadedSteps, ['step 1', 'step 2']);
+ }
+
+ try {
+ resourceLoader._loadingSteps = [loadingStep1, loadingStep2];
+ resourceLoader.load();
+ } finally {
+ resourceLoadingComplete = loadingCompleteCallback;
+ }
+});
+
+test('results files loading', 5, function() {
+ var expectedLoadedBuilders = ["WebKit Linux", "WebKit Win"];
+ var loadedBuilders = [];
+ var resourceLoader = new loader.Loader();
+ resourceLoader._loadNext = function() {
+ deepEqual(loadedBuilders.sort(), expectedLoadedBuilders);
+ loadedBuilders.forEach(function(builderName) {
+ ok('secondsSinceEpoch' in g_resultsByBuilder[builderName]);
+ deepEqual(g_resultsByBuilder[builderName].tests, {});
+ });
+ }
+
+ var requestFunction = loader.request;
+ loader.request = function(url, successCallback, errorCallback) {
+ var builderName = /builder=([\w ]+)&/.exec(url)[1];
+ loadedBuilders.push(builderName);
+ successCallback({responseText: '{"version": 4, "' + builderName + '": {"secondsSinceEpoch": [' + Date.now() + '], "tests": {}}}'});
+ }
+
+ g_builders = {"WebKit Linux": true, "WebKit Win": true};
+
+ try {
+ resourceLoader._loadResultsFiles();
+ } finally {
+ g_builders = undefined;
+ g_resultsByBuilder = undefined;
+ loader.request = requestFunction;
+ }
+});
+
+test('expectations files loading', 1, function() {
+ var expectedLoadedPlatforms = ["chromium", "chromium-android", "efl", "efl-wk1", "efl-wk2", "gtk",
+ "gtk-wk2", "mac", "mac-lion", "mac-snowleopard", "qt", "win", "wk2"];
+ var loadedPlatforms = [];
+ var resourceLoader = new loader.Loader();
+ resourceLoader._loadNext = function() {
+ deepEqual(loadedPlatforms.sort(), expectedLoadedPlatforms);
+ }
+
+ var requestFunction = loader.request;
+ loader.request = function(url, successCallback, errorCallback) {
+ loadedPlatforms.push(/LayoutTests\/platform\/(.+)\/TestExpectations/.exec(url)[1]);
+ successCallback({responseText: ''});
+ }
+
+ try {
+ resourceLoader._loadExpectationsFiles();
+ } finally {
+ loader.request = requestFunction;
+ }
+});
diff --git a/Tools/TestResultServer/static-dashboards/run-unittests.html b/Tools/TestResultServer/static-dashboards/run-unittests.html
index e6879d931..9999c71f9 100644
--- a/Tools/TestResultServer/static-dashboards/run-unittests.html
+++ b/Tools/TestResultServer/static-dashboards/run-unittests.html
@@ -44,23 +44,24 @@ THE POSSIBILITY OF SUCH DAMAGE.
<script>
// Don't request the actual builders off the bots when running unittests.
function loadBuildersList() {};
-function g_handleBuildersListLoaded() {};
</script>
<script src="dashboard_base.js"></script>
+<script src="loader.js"></script>
<script src="flakiness_dashboard.js"></script>
<script>
window.location.href = '#useTestData=true';
var groupName = '@ToT - chromium.org';
-var builders = {'Webkit Linux': '', 'Webkit Linux (dbg)': '', 'Webkit Mac10.7': '', 'Webkit Win': ''};
+var builders = '{"WebKit Linux": true, "WebKit Linux (dbg)": true, "WebKit Mac10.7": true, "WebKit Win": true}';
LAYOUT_TESTS_BUILDER_GROUPS[groupName] = new BuilderGroup(BuilderGroup.TOT_WEBKIT);
LAYOUT_TESTS_BUILDER_GROUPS[groupName].expectedGroups = 4;
-onBuilderListLoad(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitTipOfTreeTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.TOT_WEBKIT, builders);
+onBuilderListLoad(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitTipOfTreeTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, {responseText: builders});
initBuilders();
</script>
<!-- FIXME: Split this up into multiple unittest.js, e.g. one for builders.js and one for dashboard_base.js. -->
<script src="flakiness_dashboard_unittests.js"></script>
+<script src="loader_unittests.js"></script>
</body>
</html>
diff --git a/Tools/TestResultServer/static-dashboards/timeline_explorer.html b/Tools/TestResultServer/static-dashboards/timeline_explorer.html
index dd8505332..b3fa41bc3 100644
--- a/Tools/TestResultServer/static-dashboards/timeline_explorer.html
+++ b/Tools/TestResultServer/static-dashboards/timeline_explorer.html
@@ -97,6 +97,7 @@ body {
</style>
<script src="dygraph-combined.js"></script>
<script src="builders.js"></script>
+<script src="loader.js"></script>
<script src="dashboard_base.js"></script>
<script>
var FAILING_TESTS_DATASET_NAME = 'Failing tests';
diff --git a/Tools/TestResultServer/static-dashboards/treemap.html b/Tools/TestResultServer/static-dashboards/treemap.html
index 684957bc6..aa7ae437e 100644
--- a/Tools/TestResultServer/static-dashboards/treemap.html
+++ b/Tools/TestResultServer/static-dashboards/treemap.html
@@ -108,6 +108,7 @@ td {
}
</style>
<script src="builders.js"></script>
+<script src="loader.js"></script>
<script src="dashboard_base.js"></script>
<script src='webtreemap.js'></script>
@@ -223,35 +224,12 @@ function showAverages()
map.parentNode.replaceChild(table, map);
}
-var g_resultsByBuilder = {};
-
-function ADD_RESULTS(data)
-{
- // FIXME: We should probably include the builderName in the JSON
- // rather than relying on only loading one JSON file per page.
- if (!g_resultsByBuilder[g_currentState.builder])
- g_resultsByBuilder[g_currentState.builder] = data;
-
- handleLocationChange();
-}
-
-function g_handleBuildersListLoaded() {
- g_buildersListLoaded = true;
- initBuilders(g_currentState);
- $('header-container').innerHTML = htmlForTestTypeSwitcher();
- parseParameters();
- appendJSONScriptElementFor(g_currentState.builder);
-}
-
var g_isGeneratingPage = false;
var g_webTree;
function generatePage()
{
- if (!g_resultsByBuilder[g_currentState.builder]) {
- handleResourceLoadError(g_currentState.builder);
- return;
- }
+ $('header-container').innerHTML = htmlForTestTypeSwitcher();
g_isGeneratingPage = true;
@@ -319,12 +297,6 @@ g_defaultDashboardSpecificStateValues = {
function handleQueryParameterChange(params)
{
- if (!g_buildersListLoaded)
- return false;
-
- if (!g_resultsByBuilder[g_currentState.builder])
- appendJSONScriptElementFor(g_currentState.builder);
-
for (var param in params) {
if (param != 'treemapfocus') {
$('map').innerHTML = 'Loading...';
@@ -373,7 +345,7 @@ function handleFocus(tree)
tree.extraDom.className = 'extra-dom';
tree.dom.appendChild(tree.extraDom);
- request(TEST_URL_BASE_PATH + name,
+ loader.request(TEST_URL_BASE_PATH + name,
function(xhr) {
tree.extraDom.onmousedown = function(e) {
e.stopPropagation();
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
index 77eee845d..973a6d0fa 100644
--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
@@ -42,6 +42,9 @@
37200B9213A16230007A4FAD /* VectorReverse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37200B9113A16230007A4FAD /* VectorReverse.cpp */; };
3722C8691461E03E00C45D00 /* RenderedImageFromDOMRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */; };
3776BC63150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */; };
+ 378E64731632646D00B6C676 /* InjectedBundleFrameHitTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378E64711632646D00B6C676 /* InjectedBundleFrameHitTest.cpp */; };
+ 378E64771632655E00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */; };
+ 378E64791632707400B6C676 /* link-with-title.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 378E647816326FDF00B6C676 /* link-with-title.html */; };
379028B614FABD92007E6B43 /* AcceptsFirstMouse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 379028B514FABD92007E6B43 /* AcceptsFirstMouse.mm */; };
379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */; };
3799AD3A14120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */; };
@@ -223,6 +226,7 @@
33DC8912141955FE00747EF7 /* simple-iframe.html in Copy Resources */,
1A9E52C913E65EF4006917F5 /* 18-characters.html in Copy Resources */,
C07E6CB213FD73930038B22B /* devicePixelRatio.html in Copy Resources */,
+ 378E64791632707400B6C676 /* link-with-title.html in Copy Resources */,
9361002914DC95A70061379D /* lots-of-iframes.html in Copy Resources */,
93AF4ED11506F130007FD57E /* lots-of-images.html in Copy Resources */,
930AD402150698D00067970F /* lots-of-text.html in Copy Resources */,
@@ -279,6 +283,9 @@
37200B9113A16230007A4FAD /* VectorReverse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VectorReverse.cpp; path = WTF/VectorReverse.cpp; sourceTree = "<group>"; };
3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderedImageFromDOMRange.mm; sourceTree = "<group>"; };
3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeviceScaleFactorInDashboardRegions.mm; sourceTree = "<group>"; };
+ 378E64711632646D00B6C676 /* InjectedBundleFrameHitTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleFrameHitTest.cpp; sourceTree = "<group>"; };
+ 378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleFrameHitTest_Bundle.cpp; sourceTree = "<group>"; };
+ 378E647816326FDF00B6C676 /* link-with-title.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "link-with-title.html"; sourceTree = "<group>"; };
379028B514FABD92007E6B43 /* AcceptsFirstMouse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AcceptsFirstMouse.mm; sourceTree = "<group>"; };
379028B814FABE49007E6B43 /* acceptsFirstMouse.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = acceptsFirstMouse.html; sourceTree = "<group>"; };
3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringByEvaluatingJavaScriptFromString.mm; sourceTree = "<group>"; };
@@ -592,6 +599,8 @@
4BFDFFA61314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp */,
BC575AAC126E83B9006F0F12 /* InjectedBundleBasic.cpp */,
BC575AAF126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp */,
+ 378E64711632646D00B6C676 /* InjectedBundleFrameHitTest.cpp */,
+ 378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */,
F660AA1215A619C8003A1243 /* InjectedBundleInitializationUserDataCallbackWins.cpp */,
F660AA1415A61ABF003A1243 /* InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp */,
52CB47401448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp */,
@@ -670,9 +679,11 @@
isa = PBXGroup;
children = (
C045F9461385C2F800C0F3CD /* 18-characters.html */,
+ 76E182DE15475A8300F1FADD /* auto-submitting-form.html */,
BC2D004A12A9FEB300E732A3 /* file-with-anchor.html */,
1A02C84B125D4A5E00E3F4BD /* find.html */,
BCBD372E125ABBE600D2C29F /* icon.png */,
+ 378E647816326FDF00B6C676 /* link-with-title.html */,
9361002814DC957B0061379D /* lots-of-iframes.html */,
93AF4ECF1506F123007FD57E /* lots-of-images.html */,
930AD401150698B30067970F /* lots-of-text.html */,
@@ -684,7 +695,6 @@
BCAA485514A021640088FAC4 /* simple-tall.html */,
BC909778125571AB00083756 /* simple.html */,
C02B7882126615410026BF0F /* spacebar-scrolling.html */,
- 76E182DE15475A8300F1FADD /* auto-submitting-form.html */,
);
name = Resources;
sourceTree = "<group>";
@@ -995,6 +1005,7 @@
9318778915EEC57700A9CCE3 /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */,
2943BE86161DFEB800999E3D /* UserContentTest.mm in Sources */,
4F4D2C0E1626FE2700320FE1 /* MemoryInstrumentationTest.cpp in Sources */,
+ 378E64731632646D00B6C676 /* InjectedBundleFrameHitTest.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1029,6 +1040,7 @@
F6F49C6B15545CA70007F39D /* DOMWindowExtensionNoCache_Bundle.cpp in Sources */,
F660AA1115A5F631003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp in Sources */,
F660AA1515A61ABF003A1243 /* InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp in Sources */,
+ 378E64771632655E00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp b/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
index 7847d7d26..c6368bf3f 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
@@ -95,7 +95,7 @@ public:
private:
class Client : public WTF::MemoryInstrumentationClient {
public:
- virtual void countObjectSize(MemoryObjectType objectType, size_t size)
+ virtual void countObjectSize(const void*, MemoryObjectType objectType, size_t size)
{
TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size);
if (!result.isNewEntry)
@@ -734,5 +734,28 @@ TEST(MemoryInstrumentationTest, arrayBuffer)
EXPECT_EQ(2u, helper.visitedObjects());
}
+class ClassWithTwoAncestors : public NotInstrumented, public Instrumented {
+public:
+ virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+ {
+ MemoryClassInfo info(memoryObjectInfo, this, TestType);
+ }
+};
+
+
+TEST(MemoryInstrumentationTest, instrumentedWithMultipleAncestors)
+{
+ InstrumentationTestHelper helper;
+ OwnPtr<ClassWithTwoAncestors> instance = adoptPtr(new ClassWithTwoAncestors());
+ ClassWithTwoAncestors* descendantPointer = instance.get();
+ InstrumentedOwner<ClassWithTwoAncestors*> descendantPointerOwner(descendantPointer);
+ Instrumented* ancestorPointer = descendantPointer;
+ InstrumentedOwner<Instrumented*> ancestorPointerOwner(ancestorPointer);
+ helper.addRootObject(descendantPointerOwner);
+ helper.addRootObject(ancestorPointerOwner);
+ EXPECT_EQ(sizeof(ClassWithTwoAncestors), helper.reportedSizeForAllTypes());
+ EXPECT_EQ(1u, helper.visitedObjects());
+}
+
} // namespace
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp
new file mode 100644
index 000000000..9320801d3
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool done;
+
+static void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
+{
+ if (WKStringIsEqualToUTF8CString(messageName, "InjectedBundleFrameHitTestDone")) {
+ done = true;
+ WKStringRef linkTitle = (WKStringRef)messageBody;
+ EXPECT_WK_STREQ("HitTestLinkTitle", linkTitle);
+ }
+}
+
+static void setInjectedBundleClient(WKContextRef context)
+{
+ WKContextInjectedBundleClient injectedBundleClient;
+ memset(&injectedBundleClient, 0, sizeof(injectedBundleClient));
+ injectedBundleClient.version = 0;
+ injectedBundleClient.clientInfo = 0;
+ injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle;
+ WKContextSetInjectedBundleClient(context, &injectedBundleClient);
+}
+
+TEST(WebKit2, InjectedBundleFrameHitTest)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("InjectedBundleFrameHitTestTest"));
+
+ setInjectedBundleClient(context.get());
+
+ PlatformWebView webView(context.get());
+
+ WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("link-with-title", "html")).get());
+
+ Util::run(&done);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp
new file mode 100644
index 000000000..ddaeec182
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedBundleTest.h"
+#include "PlatformUtilities.h"
+#include <WebKit2/WKBundle.h>
+#include <WebKit2/WKBundleFramePrivate.h>
+#include <WebKit2/WKBundleHitTestResult.h>
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+class InjectedBundleFrameHitTestTest : public InjectedBundleTest {
+public:
+ InjectedBundleFrameHitTestTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+ {
+ }
+
+ virtual void didCreatePage(WKBundleRef, WKBundlePageRef) OVERRIDE;
+ void frameLoadFinished(WKBundleFrameRef);
+
+ WKBundleRef m_bundle;
+};
+
+static InjectedBundleTest::Register<InjectedBundleFrameHitTestTest> registrar("InjectedBundleFrameHitTestTest");
+
+static void didFinishLoadForFrameCallback(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo)
+{
+ ((InjectedBundleFrameHitTestTest*)clientInfo)->frameLoadFinished(frame);
+}
+
+void InjectedBundleFrameHitTestTest::didCreatePage(WKBundleRef bundle, WKBundlePageRef page)
+{
+ m_bundle = bundle;
+
+ WKBundlePageLoaderClient pageLoaderClient;
+ memset(&pageLoaderClient, 0, sizeof(pageLoaderClient));
+
+ pageLoaderClient.version = 1;
+ pageLoaderClient.clientInfo = this;
+ pageLoaderClient.didFinishLoadForFrame = didFinishLoadForFrameCallback;
+
+ WKBundlePageSetPageLoaderClient(page, &pageLoaderClient);
+}
+
+void InjectedBundleFrameHitTestTest::frameLoadFinished(WKBundleFrameRef frame)
+{
+ WKBundleHitTestResultRef hitTestResult = WKBundleFrameCreateHitTestResult(frame, WKPointMake(50, 50));
+ WKRetainPtr<WKStringRef> linkTitle(AdoptWK, WKBundleHitTestResultCopyLinkTitle(hitTestResult));
+ WKBundlePostMessage(m_bundle, Util::toWK("InjectedBundleFrameHitTestDone").get(), linkTitle.get());
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/link-with-title.html b/Tools/TestWebKitAPI/Tests/WebKit2/link-with-title.html
new file mode 100644
index 000000000..971ed281b
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/link-with-title.html
@@ -0,0 +1,5 @@
+<html>
+ <body>
+ <a href="#" style="display: block; height: 100%;" title="HitTestLinkTitle"></a>
+ </body>
+</html>
diff --git a/Tools/Tools.pro b/Tools/Tools.pro
index 3efb72c6a..dcc365b6f 100644
--- a/Tools/Tools.pro
+++ b/Tools/Tools.pro
@@ -8,22 +8,22 @@ TEMPLATE = subdirs
CONFIG += ordered
build?(webkit1) {
- SUBDIRS += QtTestBrowser/QtTestBrowser.pro
+ build?(testbrowser): SUBDIRS += QtTestBrowser/QtTestBrowser.pro
build?(drt): SUBDIRS += DumpRenderTree/qt/DumpRenderTree.pro
- SUBDIRS += DumpRenderTree/qt/ImageDiff.pro
+ build?(imagediff): SUBDIRS += DumpRenderTree/qt/ImageDiff.pro
}
build?(webkit2) {
# WTR's InjectedBundle depends currently on WK1's DumpRenderTreeSupport
build?(webkit1):build?(wtr):have?(QTQUICK): SUBDIRS += WebKitTestRunner/WebKitTestRunner.pro
- have?(QTQUICK): SUBDIRS += MiniBrowser/qt/MiniBrowser.pro
- SUBDIRS += MiniBrowser/qt/raw/MiniBrowserRaw.pro
+ build?(minibrowser) {
+ have?(QTQUICK): SUBDIRS += MiniBrowser/qt/MiniBrowser.pro
+ SUBDIRS += MiniBrowser/qt/raw/MiniBrowserRaw.pro
+ }
}
-!win32:enable?(NETSCAPE_PLUGIN_API) {
- SUBDIRS += DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
-}
+build?(test_npapi): SUBDIRS += DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
OTHER_FILES = \
Scripts/* \
diff --git a/Tools/WebKitTestRunner/GNUmakefile.am b/Tools/WebKitTestRunner/GNUmakefile.am
index a03f8bcf1..a8a2fad56 100644
--- a/Tools/WebKitTestRunner/GNUmakefile.am
+++ b/Tools/WebKitTestRunner/GNUmakefile.am
@@ -42,6 +42,7 @@ Programs_WebKitTestRunner_CPPFLAGS = \
-I$(top_builddir)/DerivedSources/WebKit2/include \
$(global_cppflags) \
$(javascriptcore_cppflags) \
+ $(webcore_cppflags) \
$(GLOBALDEPS_CFLAGS) \
$(CAIRO_CFLAGS) \
$(GTK_CFLAGS) \
@@ -136,6 +137,7 @@ Libraries_libTestRunnerInjectedBundle_la_CPPFLAGS = \
-I$(top_builddir)/DerivedSources/WebKit2/include \
$(global_cppflags) \
$(javascriptcore_cppflags) \
+ $(webcore_cppflags) \
$(GLOBALDEPS_CFLAGS) \
$(CAIRO_CFLAGS) \
$(GLIB_CFLAGS) \
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
index 81432da1e..f9f619981 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
@@ -186,5 +186,7 @@ interface TestRunner {
void queueBackNavigation(in unsigned long howFarBackward);
void queueLoad(in DOMString url, in DOMString target);
void queueReload();
+ void queueLoadingScript(in DOMString script);
+ void queueNonLoadingScript(in DOMString script);
};
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index 8ff713f05..d64a734f0 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -507,4 +507,20 @@ void InjectedBundle::queueReload()
WKBundlePostMessage(m_bundle, messageName.get(), 0);
}
+void InjectedBundle::queueLoadingScript(WKStringRef script)
+{
+ m_useWorkQueue = true;
+
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueLoadingScript"));
+ WKBundlePostMessage(m_bundle, messageName.get(), script);
+}
+
+void InjectedBundle::queueNonLoadingScript(WKStringRef script)
+{
+ m_useWorkQueue = true;
+
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueNonLoadingScript"));
+ WKBundlePostMessage(m_bundle, messageName.get(), script);
+}
+
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index 0b895846f..f3d2034ef 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -104,6 +104,8 @@ public:
void queueBackNavigation(unsigned howFarBackward);
void queueLoad(WKStringRef url, WKStringRef target);
void queueReload();
+ void queueLoadingScript(WKStringRef script);
+ void queueNonLoadingScript(WKStringRef script);
private:
InjectedBundle();
diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
index 740049544..23b5f34f2 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
@@ -75,6 +75,7 @@ TestRunner::TestRunner()
, m_dumpStatusCallbacks(false)
, m_dumpTitleChanges(false)
, m_dumpPixels(true)
+ , m_dumpSelectionRect(false)
, m_dumpFullScreenCallbacks(false)
, m_dumpFrameLoadCallbacks(false)
, m_dumpProgressFinishedCallback(false)
@@ -852,4 +853,16 @@ void TestRunner::queueReload()
InjectedBundle::shared().queueReload();
}
+void TestRunner::queueLoadingScript(JSStringRef script)
+{
+ WKRetainPtr<WKStringRef> scriptWK = toWK(script);
+ InjectedBundle::shared().queueLoadingScript(scriptWK.get());
+}
+
+void TestRunner::queueNonLoadingScript(JSStringRef script)
+{
+ WKRetainPtr<WKStringRef> scriptWK = toWK(script);
+ InjectedBundle::shared().queueNonLoadingScript(scriptWK.get());
+}
+
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
index 96d8220d6..f92e34220 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
@@ -265,6 +265,8 @@ public:
void queueBackNavigation(unsigned howFarBackward);
void queueLoad(JSStringRef url, JSStringRef target);
void queueReload();
+ void queueLoadingScript(JSStringRef script);
+ void queueNonLoadingScript(JSStringRef script);
private:
static const double waitToDumpWatchdogTimerInterval;
diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp
index 040adb544..fd9423220 100644
--- a/Tools/WebKitTestRunner/TestInvocation.cpp
+++ b/Tools/WebKitTestRunner/TestInvocation.cpp
@@ -466,6 +466,20 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
return;
}
+ if (WKStringIsEqualToUTF8CString(messageName, "QueueLoadingScript")) {
+ ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
+ WKStringRef script = static_cast<WKStringRef>(messageBody);
+ TestController::shared().workQueueManager().queueLoadingScript(toWTFString(script));
+ return;
+ }
+
+ if (WKStringIsEqualToUTF8CString(messageName, "QueueNonLoadingScript")) {
+ ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
+ WKStringRef script = static_cast<WKStringRef>(messageBody);
+ TestController::shared().workQueueManager().queueNonLoadingScript(toWTFString(script));
+ return;
+ }
+
ASSERT_NOT_REACHED();
}
diff --git a/Tools/WebKitTestRunner/WorkQueueManager.cpp b/Tools/WebKitTestRunner/WorkQueueManager.cpp
index 1efa8ad12..738357908 100644
--- a/Tools/WebKitTestRunner/WorkQueueManager.cpp
+++ b/Tools/WebKitTestRunner/WorkQueueManager.cpp
@@ -29,6 +29,7 @@
#include "PlatformWebView.h"
#include "TestController.h"
#include <WebKit2/WKPage.h>
+#include <WebKit2/WKRetainPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/text/CString.h>
@@ -53,11 +54,48 @@ static inline bool goToItemAtIndex(int index)
return true;
}
+class WorkQueueItem {
+public:
+ enum Type {
+ Loading,
+ NonLoading
+ };
+
+ virtual ~WorkQueueItem() { }
+ virtual Type invoke() const = 0;
+};
+
+// Required by WKPageRunJavaScriptInMainFrame().
+static void runJavaScriptFunction(WKSerializedScriptValueRef, WKErrorRef, void*)
+{
+}
+
+template <WorkQueueItem::Type type>
+class ScriptItem : public WorkQueueItem {
+public:
+ explicit ScriptItem(const String& script)
+ : m_script(AdoptWK, WKStringCreateWithUTF8CString(script.utf8().data()))
+ {
+ }
+
+ WorkQueueItem::Type invoke() const
+ {
+ WKPageRunJavaScriptInMainFrame(mainPage(), m_script.get(), 0, runJavaScriptFunction);
+ return type;
+ }
+
+ WKRetainPtr<WKStringRef> m_script;
+};
+
WorkQueueManager::WorkQueueManager()
: m_processing(false)
{
}
+WorkQueueManager::~WorkQueueManager()
+{
+}
+
void WorkQueueManager::clearWorkQueue()
{
m_processing = false;
@@ -69,7 +107,7 @@ bool WorkQueueManager::processWorkQueue()
m_processing = false;
while (!m_processing && !m_workQueue.isEmpty()) {
OwnPtr<WorkQueueItem> item(m_workQueue.takeFirst());
- m_processing = item->invoke();
+ m_processing = (item->invoke() == WorkQueueItem::Loading);
}
return !m_processing;
@@ -85,15 +123,15 @@ void WorkQueueManager::queueLoad(const String& url, const String& target)
{
}
- bool invoke() const
+ WorkQueueItem::Type invoke() const
{
if (!m_target.isEmpty()) {
// FIXME: Use target. Some layout tests cannot pass as they rely on this functionality.
fprintf(stderr, "queueLoad for a specific target is not implemented.\n");
- return false;
+ return WorkQueueItem::NonLoading;
}
WKPageLoadURL(mainPage(), m_url.get());
- return true;
+ return WorkQueueItem::Loading;
}
WKRetainPtr<WKURLRef> m_url;
@@ -107,9 +145,9 @@ void WorkQueueManager::queueBackNavigation(unsigned howFarBackward)
{
class BackNavigationItem : public WorkQueueItem {
public:
- BackNavigationItem(unsigned howFarBackward) : m_howFarBackward(howFarBackward) { }
+ explicit BackNavigationItem(unsigned howFarBackward) : m_howFarBackward(howFarBackward) { }
- bool invoke() const { return goToItemAtIndex(-m_howFarBackward); }
+ WorkQueueItem::Type invoke() const { return goToItemAtIndex(-m_howFarBackward) ? WorkQueueItem::Loading : WorkQueueItem::NonLoading; }
unsigned m_howFarBackward;
};
@@ -121,16 +159,26 @@ void WorkQueueManager::queueReload()
{
class ReloadItem : public WorkQueueItem {
public:
- bool invoke() const
+ WorkQueueItem::Type invoke() const
{
WKPageReload(mainPage());
- return true;
+ return WorkQueueItem::Loading;
}
};
enqueue(new ReloadItem());
}
+void WorkQueueManager::queueLoadingScript(const String& script)
+{
+ enqueue(new ScriptItem<WorkQueueItem::Loading>(script));
+}
+
+void WorkQueueManager::queueNonLoadingScript(const String& script)
+{
+ enqueue(new ScriptItem<WorkQueueItem::NonLoading>(script));
+}
+
void WorkQueueManager::enqueue(WorkQueueItem* item)
{
ASSERT(item);
diff --git a/Tools/WebKitTestRunner/WorkQueueManager.h b/Tools/WebKitTestRunner/WorkQueueManager.h
index 665c7ab72..b9a22dde3 100644
--- a/Tools/WebKitTestRunner/WorkQueueManager.h
+++ b/Tools/WebKitTestRunner/WorkQueueManager.h
@@ -26,7 +26,6 @@
#ifndef WorkQueueManager_h
#define WorkQueueManager_h
-#include <WebKit2/WKRetainPtr.h>
#include <wtf/Deque.h>
#include <wtf/OwnPtr.h>
#include <wtf/text/WTFString.h>
@@ -37,6 +36,7 @@ class WorkQueueManager {
WTF_MAKE_NONCOPYABLE(WorkQueueManager);
public:
WorkQueueManager();
+ ~WorkQueueManager();
bool isWorkQueueEmpty() const { return m_workQueue.isEmpty(); }
void clearWorkQueue();
@@ -45,14 +45,11 @@ public:
void queueLoad(const String& url, const String& target);
void queueBackNavigation(unsigned howFarBackward);
void queueReload();
+ void queueLoadingScript(const String& script);
+ void queueNonLoadingScript(const String& script);
-private:
- class WorkQueueItem {
- public:
- virtual ~WorkQueueItem() { }
- virtual bool invoke() const = 0; // Returns 'true' if this started a load.
- };
- typedef Deque<OwnPtr<WorkQueueItem> > WorkQueue;
+private:
+ typedef Deque<OwnPtr<class WorkQueueItem> > WorkQueue;
void enqueue(WorkQueueItem*); // Adopts pointer.
diff --git a/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp b/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp
index d3fbfd2ef..498be14e4 100644
--- a/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp
+++ b/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp
@@ -2,6 +2,7 @@
* Copyright (C) 2009 Apple Inc. All rights reserved.
* (C) 2011 Brent Fulgham <bfulgham@webkit.org>. All rights reserved.
* (C) 2010, 2011 Igalia S.L
+ * (C) 2012 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -77,10 +78,39 @@ static void dumpBitmap(cairo_surface_t* surface, const char* checksum)
printPNG(data, dataLength, checksum);
}
-void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef wkImage, WKArrayRef /*repaintRects*/)
+static void paintRepaintRectOverlay(cairo_surface_t* surface, WKArrayRef repaintRects)
+{
+ cairo_t* context = cairo_create(surface);
+
+ cairo_push_group(context);
+
+ // Paint the gray mask over the original image.
+ cairo_set_source_rgba(context, 0, 0, 0, 0.66);
+ cairo_paint(context);
+
+ // Paint transparent rectangles over the mask to show the repainted regions.
+ cairo_set_source_rgba(context, 0, 0, 0, 0);
+ cairo_set_operator(context, CAIRO_OPERATOR_SOURCE);
+ size_t count = WKArrayGetSize(repaintRects);
+ for (size_t i = 0; i < count; ++i) {
+ WKRect rect = WKRectGetValue(static_cast<WKRectRef>(WKArrayGetItemAtIndex(repaintRects, i)));
+ cairo_rectangle(context, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
+ cairo_fill(context);
+ }
+
+ cairo_pop_group_to_source(context);
+ cairo_paint(context);
+
+ cairo_destroy(context);
+}
+
+void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef wkImage, WKArrayRef repaintRects)
{
cairo_surface_t* surface = WKImageCreateCairoSurface(wkImage);
+ if (repaintRects)
+ paintRepaintRectOverlay(surface, repaintRects);
+
char actualHash[33];
computeMD5HashStringForCairoSurface(surface, actualHash);
if (!compareActualHashToExpectedAndDumpResults(actualHash))
diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
index e11e6e74a..00177db81 100644
--- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
+++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
@@ -66,6 +66,9 @@ private Q_SLOTS:
setSurfaceType(OpenGLSurface);
create();
QQuickWindowPrivate::get(this)->setRenderWithoutShowing(true);
+ } else {
+ QQuickWebViewExperimental experimental(m_view);
+ experimental.setRenderToOffscreenBuffer(true);
}
QWindowSystemInterface::handleWindowActivated(this);
@@ -82,8 +85,6 @@ PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGro
, m_windowIsKey(true)
, m_modalEventLoop(0)
{
- QQuickWebViewExperimental experimental(m_view);
- experimental.setRenderToOffscreenBuffer(true);
m_view->setAllowAnyHTTPSCertificateForLocalHost(true);
m_view->componentComplete();
}
@@ -164,6 +165,8 @@ WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
bool PlatformWebView::windowShapshotEnabled()
{
+ // We need a way to disable UI side rendering for tests because it is
+ // too slow without appropriate hardware.
static bool result;
static bool hasChecked = false;
if (!hasChecked)
diff --git a/Tools/qmake/mkspecs/features/configure.prf b/Tools/qmake/mkspecs/features/configure.prf
index 7b607de9d..3954a9452 100644
--- a/Tools/qmake/mkspecs/features/configure.prf
+++ b/Tools/qmake/mkspecs/features/configure.prf
@@ -11,6 +11,14 @@
load(features)
load(configure)
+WEBKIT_TOOLS_CONFIG = \
+ build_drt \
+ build_wtr \
+ build_imagediff \
+ build_test_npapi \
+ build_testbrowser \
+ build_minibrowser
+
defineTest(runConfigure) {
!webkit_configured:!print_defaults {
log($${EOL}Running configure tests...$${EOL}$${EOL})
@@ -41,9 +49,8 @@ defineTest(runConfigure) {
WEBKIT_CONFIG += \
build_webkit1 \
build_webkit2 \
- build_drt \
- build_wtr \
- build_tests
+ build_tests \
+ $$WEBKIT_TOOLS_CONFIG
# Sanatize WebKit1/WebKit2, as WebKit.pro uses these two options
# to determine which pro-files to include. The remaining sanitazion
@@ -86,12 +93,14 @@ defineTest(finalizeConfigure) {
WEBKIT_CONFIG -= build_drt build_wtr build_tests
}
+ win32|!enable?(NETSCAPE_PLUGIN_API): WEBKIT_CONFIG -= build_test_npapi
+
wince* {
WEBKIT_CONFIG -= build_drt
}
production_build {
- WEBKIT_CONFIG -= build_drt build_wtr build_tests
+ WEBKIT_CONFIG -= $$WEBKIT_TOOLS_CONFIG build_tests
}
print_defaults {
diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf
index 8800e1e44..ccae00f56 100644
--- a/Tools/qmake/mkspecs/features/default_post.prf
+++ b/Tools/qmake/mkspecs/features/default_post.prf
@@ -28,11 +28,6 @@ root_project_file: finalizeConfigure()
}
}
-# Help keep the build tree clean
-MOC_DIR = moc
-RCC_DIR = rcc
-isEmpty(OBJECTS_DIR): OBJECTS_DIR = obj/$$activeBuildConfig()
-
# General default build tweaks
DEFINES += \
BUILDING_QT__=1
diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf
index a9cccb803..46b66afef 100644
--- a/Tools/qmake/mkspecs/features/default_pre.prf
+++ b/Tools/qmake/mkspecs/features/default_pre.prf
@@ -69,6 +69,11 @@ TAB = $$escape_expand(\\t)
MAKEFILE_NOOP_COMMAND = @echo -n
win32-msvc*: MAKEFILE_NOOP_COMMAND = @echo >NUL
+# Help keep the build tree clean
+MOC_DIR = moc
+RCC_DIR = rcc
+OBJECTS_DIR = obj/$$activeBuildConfig()
+
# Set up a default python version
scratchbox: PYTHON = python2.6
else: PYTHON = python
diff --git a/Tools/qmake/mkspecs/features/features.pri b/Tools/qmake/mkspecs/features/features.pri
index c2e0f1421..33cc0409f 100644
--- a/Tools/qmake/mkspecs/features/features.pri
+++ b/Tools/qmake/mkspecs/features/features.pri
@@ -33,7 +33,8 @@ FEATURE_DEFAULTS = \
ENABLE_CSS_SHADERS=0 \
ENABLE_CSS_STICKY_POSITION=1 \
ENABLE_CSS_VARIABLES=0 \
- ENABLE_CSS3_TEXT_DECORATION=0 \
+ ENABLE_CSS3_CONDITIONAL_RULES=0 \
+ ENABLE_CSS3_TEXT=0 \
ENABLE_DASHBOARD_SUPPORT=0 \
ENABLE_DATAGRID=0 \
ENABLE_DATALIST_ELEMENT=1 \
diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index 74f98a34e..090e056ef 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,27 @@
+2012-10-19 Dongwoo Joshua Im <dw.im@samsung.com>
+
+ Rename ENABLE_CSS3_TEXT_DECORATION to ENABLE_CSS3_TEXT
+ https://bugs.webkit.org/show_bug.cgi?id=99804
+
+ Reviewed by Julien Chaffraix.
+
+ CSS3 text related properties will be implemented under this flag,
+ including text decoration, text-align-last, and text-justify.
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+ * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
+2012-10-18 Pablo Flouret <pablof@motorola.com>
+
+ Implement css3-conditional's @supports rule
+ https://bugs.webkit.org/show_bug.cgi?id=86146
+
+ Reviewed by Antti Koivisto.
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+ * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+ Add an ENABLE_CSS3_CONDITIONAL_RULES flag.
+
2012-10-08 Kiran Muppala <cmuppala@apple.com>
Throttle DOM timers on hidden pages.
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
index 76da27dac..8880ab765 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_TEXT_DECORATION);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CSS_STICKY_POSITION);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CSS_STICKY_POSITION);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_RENDERING"
@@ -37,7 +37,12 @@
PerformEnvironmentSet="true"
/>
<UserMacro
- Name="ENABLE_CSS3_TEXT_DECORATION"
+ Name="ENABLE_CSS3_CONDITIONAL_RULES"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
+ Name="ENABLE_CSS3_TEXT"
Value=""
PerformEnvironmentSet="true"
/>
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
index d2c8fa2ea..ca18aed7a 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_TEXT_DECORATION);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_RENDERING"
@@ -37,7 +37,12 @@
PerformEnvironmentSet="true"
/>
<UserMacro
- Name="ENABLE_CSS3_TEXT_DECORATION"
+ Name="ENABLE_CSS3_CONDITIONAL_RULES"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
+ Name="ENABLE_CSS3_TEXT"
Value=""
PerformEnvironmentSet="true"
/>
diff --git a/configure.ac b/configure.ac
index 7dddfecdf..37663e28c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -800,6 +800,14 @@ AC_ARG_ENABLE(coverage,
[],[enable_coverage="no"])
AC_MSG_RESULT([$enable_coverage])
+# check whether to enable CSS conditional rules support
+AC_MSG_CHECKING([whether to enable CSS3 conditional rules support])
+AC_ARG_ENABLE(css3_conditional_rules,
+ AC_HELP_STRING([--enable-css3-conditional-rules],
+ [enable CSS3 conditional rules support [default=no]]),
+ [],[enable_css3_conditional_rules="no"])
+AC_MSG_RESULT([$enable_css3_conditional_rules])
+
# check whether to enable FastMalloc
AC_MSG_CHECKING([whether to enable optimized memory allocator])
AC_ARG_ENABLE(fast_malloc,
@@ -1166,6 +1174,7 @@ AM_CONDITIONAL([ENABLE_MEDIA_STREAM],[test "$enable_media_stream" = "yes"])
AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
+AM_CONDITIONAL([ENABLE_CSS3_CONDITIONAL_RULES],[test "$enable_css3_conditional_rules" = "yes"])
AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
AM_CONDITIONAL([ENABLE_WEB_AUDIO],[test "$enable_web_audio" = "yes"])
AM_CONDITIONAL([ENABLE_OPCODE_STATS],[test "$enable_opcode_stats" = "yes"])
@@ -1228,6 +1237,7 @@ Build configuration:
Features:
=======
Accelerated Compositing : $enable_accelerated_compositing
+ CSS3 Conditional Rules support : $enable_css3_conditional_rules
Filters support : $enable_filters
Gamepad support : $enable_gamepad
Geolocation support : $enable_geolocation