1. 05 Apr, 2013 1 commit
    • kangil.han@samsung.com's avatar
      Prefer prefix ++/-- operators for non-primitive types · d97b4ea1
      kangil.han@samsung.com authored
      https://bugs.webkit.org/show_bug.cgi?id=114033
      
      Reviewed by Alexey Proskuryakov.
      
      Post ++/-- creates a copy of current value and it is not necessary, so use prefix instead.
      
      * bindings/js/Dictionary.cpp:
      (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
      (WebCore::Dictionary::getOwnPropertyNames):
      * bindings/js/ScriptCallStackFactory.cpp:
      (WebCore::createScriptCallStack):
      * dom/ContainerNode.cpp:
      (WebCore::willRemoveChildren):
      * dom/Range.cpp:
      (WebCore::Range::processAncestorsAndTheirSiblings):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::detachChildren):
      * platform/graphics/gpu/LoopBlinnPathProcessor.cpp:
      (WebCore):
      (WebCore::LoopBlinnPathProcessor::subdivideCurvesSlow):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintDocumentMarkers):
      * xml/XPathFunctions.cpp:
      (WebCore::XPath::Function::setArguments):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d97b4ea1
  2. 07 Sep, 2012 1 commit
    • benjamin@webkit.org's avatar
      Rename the ustring() accessor to string() · c9b7a208
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=95919
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-07
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore: 
      
      Rename ustring() to string() to make the accessor name more logical after
      r127191.
      
      * API/JSBase.cpp:
      (JSEvaluateScript):
      (JSCheckScriptSyntax):
      * API/JSObjectRef.cpp:
      (JSObjectMakeFunctionWithCallback):
      (JSObjectMakeFunction):
      (JSObjectCopyPropertyNames):
      * API/JSProfilerPrivate.cpp:
      (JSStartProfiling):
      (JSEndProfiling):
      * API/JSValueRef.cpp:
      (JSValueMakeString):
      (JSValueMakeFromJSONString):
      * API/OpaqueJSString.cpp:
      (OpaqueJSString::string):
      * API/OpaqueJSString.h:
      (OpaqueJSString):
      * bytecode/CodeBlock.cpp:
      (JSC::idName):
      (JSC::CodeBlock::dump):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::emitLoad):
      (JSC::BytecodeGenerator::addStringConstant):
      * bytecompiler/NodesCodegen.cpp:
      (JSC::RegExpNode::emitBytecode):
      (JSC::processClauseList):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dump):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * jsc.cpp:
      (GlobalObject::addFunction):
      (GlobalObject::addConstructableFunction):
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::LLINT_SLOW_PATH_DECL):
      * parser/ASTBuilder.h:
      (JSC::ASTBuilder::createRegExp):
      * parser/Parser.cpp:
      (JSC::::parsePrimaryExpression):
      * parser/Parser.h:
      (JSC::Scope::declareVariable):
      (JSC::Scope::declareParameter):
      (JSC::Scope::useVariable):
      * parser/SyntaxChecker.h:
      (JSC::SyntaxChecker::createRegExp):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createUndefinedVariableError):
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::paramString):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::finishCreation):
      * runtime/FunctionPrototype.cpp:
      (JSC::FunctionPrototype::addFunctionProperties):
      * runtime/Identifier.h:
      (JSC::Identifier::string):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::calculatedDisplayName):
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      * runtime/JSONObject.cpp:
      (JSC::PropertyNameForFunctionCall::value):
      (JSC::Stringifier::Holder::appendNextProperty):
      (JSC::Walker::walk):
      * runtime/JSPropertyNameIterator.h:
      (JSC::JSPropertyNameIterator::finishCreation):
      * runtime/JSScope.cpp:
      (JSC::JSScope::resolveBase):
      * runtime/JSString.h:
      (JSC::inlineJSValueNotStringtoString):
      * runtime/LiteralParser.cpp:
      (JSC::::parse):
      * runtime/ObjectConstructor.cpp:
      (JSC::ObjectConstructor::finishCreation):
      (JSC::objectConstructorGetOwnPropertyNames):
      (JSC::objectConstructorKeys):
      * runtime/RegExpConstructor.cpp:
      (JSC::RegExpConstructor::finishCreation):
      
      Source/WebCore: 
      
      * bindings/js/Dictionary.cpp:
      (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
      (WebCore::Dictionary::getOwnPropertyNames):
      * bindings/js/SerializedScriptValue.cpp:
      Simplify a few String constructions which were still using type conversion
      through StringImpl.
      
      (WebCore::CloneSerializer::write):
      (WebCore::CloneDeserializer::CachedString::string):
      (WebCore::CloneDeserializer::readFile):
      (WebCore::CloneDeserializer::readTerminal):
      (WebCore::CloneDeserializer::deserialize):
      * bridge/NP_jsobject.cpp:
      (_NPN_Enumerate):
      
      Source/WebKit/efl: 
      
      * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
      (DumpRenderTreeSupportEfl::sendWebIntentResponse):
      (DumpRenderTreeSupportEfl::deliverWebIntent):
      Aslo update the code from the UString->String conversion through StringImpl.
      
      Source/WebKit/mac: 
      
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      (WebKit::NetscapePluginInstanceProxy::enumerate):
      
      Source/WebKit2: 
      
      * WebProcess/Plugins/Netscape/NPJSObject.cpp:
      (WebKit::NPJSObject::enumerate):
      
      Tools: 
      
      Update EFL's DRT.
      
      Fix some string conversion that have been made useless
      with recent changes.
      
      * DumpRenderTree/efl/EventSender.cpp:
      (keyPadNameFromJSValue):
      (keyNameFromJSValue):
      * DumpRenderTree/efl/TestRunnerEfl.cpp:
      (TestRunner::queueLoad):
      (TestRunner::addOriginAccessWhitelistEntry):
      (TestRunner::removeOriginAccessWhitelistEntry):
      (TestRunner::setUserStyleSheetLocation):
      (TestRunner::setValueForUser):
      (TestRunner::elementDoesAutoCompleteForElementWithId):
      (TestRunner::execCommand):
      (TestRunner::findString):
      (TestRunner::isCommandEnabled):
      (TestRunner::clearApplicationCacheForOrigin):
      (TestRunner::setDomainRelaxationForbiddenForURLScheme):
      (TestRunner::pauseAnimationAtTimeOnElementWithId):
      (TestRunner::pauseTransitionAtTimeOnElementWithId):
      (toInt):
      (TestRunner::overridePreference):
      (TestRunner::addUserScript):
      (TestRunner::addUserStyleSheet):
      (TestRunner::evaluateInWebInspector):
      (TestRunner::evaluateScriptInIsolatedWorld):
      (TestRunner::setTextDirection):
      * DumpRenderTree/efl/WorkQueueItemEfl.cpp:
      (LoadItem::invoke):
      (LoadHTMLStringItem::invoke):
      (ScriptItem::invoke):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c9b7a208
  3. 01 Sep, 2012 1 commit
    • tommyw@google.com's avatar
      MediaStream API: Add MediaStream management to RTCPeerConnection · 0cc32da8
      tommyw@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=95543
      
      Reviewed by Adam Barth.
      
      Source/Platform:
      
      * chromium/public/WebMediaStreamCenter.h:
      (WebMediaStreamCenter):
      * chromium/public/WebRTCPeerConnectionHandler.h:
      (WebKit):
      (WebRTCPeerConnectionHandler):
      * chromium/public/WebRTCPeerConnectionHandlerClient.h:
      (WebKit):
      (WebRTCPeerConnectionHandlerClient):
      
      Source/WebCore:
      
      This includes addStream/removeStream to RTCPeerConnection,
      as well as didAddRemoteStream/didRemoveRemoteStream to RTCPeerConnectionHandlerClient.
      
      Test: fast/mediastream/RTCPeerConnection-AddRemoveStream.html
      
      * Modules/mediastream/RTCPeerConnection.cpp:
      (WebCore::RTCPeerConnection::parseConfiguration):
      (WebCore::RTCPeerConnection::RTCPeerConnection):
      (WebCore::RTCPeerConnection::addStream):
      (WebCore):
      (WebCore::RTCPeerConnection::removeStream):
      (WebCore::RTCPeerConnection::localStreams):
      (WebCore::RTCPeerConnection::remoteStreams):
      (WebCore::RTCPeerConnection::didAddRemoteStream):
      (WebCore::RTCPeerConnection::didRemoveRemoteStream):
      * Modules/mediastream/RTCPeerConnection.h:
      (RTCPeerConnection):
      * Modules/mediastream/RTCPeerConnection.idl:
      * bindings/js/Dictionary.cpp:
      (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
      (WebCore::Dictionary::getOwnPropertyNames):
      * bindings/v8/Dictionary.cpp:
      (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
      (WebCore::Dictionary::getOwnPropertyNames):
      * bindings/v8/Dictionary.h:
      (Dictionary):
      * platform/mediastream/RTCPeerConnectionHandler.cpp:
      (RTCPeerConnectionHandlerDummy):
      (WebCore::RTCPeerConnectionHandlerDummy::addStream):
      (WebCore):
      (WebCore::RTCPeerConnectionHandlerDummy::removeStream):
      * platform/mediastream/RTCPeerConnectionHandler.h:
      (RTCPeerConnectionHandler):
      * platform/mediastream/RTCPeerConnectionHandlerClient.h:
      (WebCore):
      (RTCPeerConnectionHandlerClient):
      * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
      (WebCore::RTCPeerConnectionHandlerChromium::addStream):
      (WebCore):
      (WebCore::RTCPeerConnectionHandlerChromium::removeStream):
      (WebCore::RTCPeerConnectionHandlerChromium::didAddRemoteStream):
      (WebCore::RTCPeerConnectionHandlerChromium::didRemoveRemoteStream):
      * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h:
      (WebKit):
      (RTCPeerConnectionHandlerChromium):
      
      Source/WebKit/chromium:
      
      * src/AssertMatchingEnums.cpp:
      
      Tools:
      
      Extending MockWebRTCPeerConnectionHandler to handle addStream/removeStream.
      
      * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp:
      (MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler):
      (MockWebRTCPeerConnectionHandler::addStream):
      (MockWebRTCPeerConnectionHandler::removeStream):
      * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h:
      (MockWebRTCPeerConnectionHandler):
      
      LayoutTests:
      
      * fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt: Added.
      * fast/mediastream/RTCPeerConnection-AddRemoveStream.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0cc32da8
  4. 30 Aug, 2012 2 commits
    • benjamin@webkit.org's avatar
      Replace JSC::UString by WTF::String · cff06e46
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=95271
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-08-30
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore: 
      
      Having JSC::UString and WTF::String increase the complexity of working on WebKit, and
      add useless conversions in the bindings. It also cause some code bloat.
      
      The performance advantages of UString have been ported over in previous patches. This patch
      is the last step: getting rid of UString.
      
      In addition to the simplified code, this also reduce the binary size by 15kb on x86_64.
      
      * API/OpaqueJSString.cpp:
      (OpaqueJSString::ustring):
      * runtime/Identifier.h:
      (JSC::Identifier::ustring):
      To avoid changing everything at once, the function named ustring() were kept as is. They
      will be renamed in a follow up patch.
      
      * runtime/JSString.h:
      (JSC::JSString::string):
      (JSC::JSValue::toWTFString):
      (JSC::inlineJSValueNotStringtoString):
      (JSC::JSValue::toWTFStringInline):
      Since JSValue::toString() already exist (and return the JSString), the direct accessor is renamed
      to ::toWTFString(). We may change ::string() to ::jsString() and ::toWTFString() to ::toString()
      in the future.
      
      * runtime/StringPrototype.cpp:
      (JSC::substituteBackreferencesSlow): Replace the use of UString::getCharacters<>() by String::getCharactersWithUpconvert<>().
      
      Source/WebCore: 
      
      Update the code to use String instead of UString.
      
      On x86_64, this reduces the binary size by 22kb.
      
      Since it is no longer possible to differenciate JSC::jsString() and WebCore::jsString() by the input
      types, WebCore::jsString() is renated to WebCore::jsStringWithCache().
      
      Since the cache is using a PtrHash, JSC::jsString() is used in place of the old WebCore::jsString() when
      the string is generated locally. This is because the cache can never match in those cases.
      
      Source/WebKit/blackberry: 
      
      Replace UString by String.
      
      * WebCoreSupport/ClientExtension.cpp:
      * WebCoreSupport/PagePopupBlackBerry.cpp:
      (WebCore::PagePopupBlackBerry::installDomFunction):
      
      Source/WebKit/efl: 
      
      Replace UString by String.
      
      * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
      (DumpRenderTreeSupportEfl::sendWebIntentResponse):
      * ewk/ewk_frame.cpp:
      (ewk_frame_script_execute):
      
      Source/WebKit/gtk: 
      
      Replace UString by String.
      
      * gdom/ConvertToGCharPrivate.h:
      (copyAsGchar):
      
      Source/WebKit/mac: 
      
      Get rid of UString, replace it by String, and simplify the code when possible.
      
      On x86_64, this reduces the binary size by 7kb.
      
      * Plugins/Hosted/NetscapePluginHostProxy.mm:
      (identifierFromIdentifierRep):
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      (WebKit::NetscapePluginInstanceProxy::addValueToArray):
      (WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState):
      * Plugins/Hosted/ProxyInstance.mm:
      (WebKit::ProxyRuntimeMethod::create):
      (WebKit::ProxyRuntimeMethod::finishCreation):
      (WebKit::ProxyInstance::getPropertyNames):
      (WebKit::ProxyInstance::methodsNamed):
      (WebKit::ProxyInstance::fieldNamed):
      * WebView/WebFrame.mm:
      (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
      (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
      * WebView/WebScriptDebugDelegate.mm:
      (-[WebScriptCallFrame functionName]):
      (-[WebScriptCallFrame evaluateWebScript:]):
      * WebView/WebScriptDebugger.h:
      (WTF):
      (JSC):
      (WebScriptDebugger):
      * WebView/WebScriptDebugger.mm:
      (toNSURL):
      (WebScriptDebugger::sourceParsed):
      * WebView/WebView.mm:
      (aeDescFromJSValue):
      
      Source/WebKit/qt: 
      
      Replace UString by String.
      
      * Api/qwebelement.cpp:
      (QWebElement::evaluateJavaScript):
      
      Source/WebKit/win: 
      
      Replace UString by String.
      
      * WebFrame.cpp:
      (WebFrame::stringByEvaluatingJavaScriptInScriptWorld):
      * WebView.cpp:
      (WebView::stringByEvaluatingJavaScriptFromString):
      
      Source/WebKit/wx: 
      
      Update the #includes to use the correct types.
      
      * WebFrame.cpp:
      * WebView.cpp:
      
      Source/WebKit2: 
      
      Update to code to switch from UString to String.
      
      * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
      (WebKit::JSNPMethod::finishCreation):
      * WebProcess/Plugins/Netscape/JSNPMethod.h:
      (WebKit::JSNPMethod::create):
      (JSNPMethod):
      * WebProcess/Plugins/Netscape/JSNPObject.cpp:
      (WebKit::npIdentifierFromIdentifier):
      * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
      (WebKit::NPRuntimeObjectMap::evaluate):
      (WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState):
      
      Source/WTF: 
      
      * wtf/Platform.h: Useless edit to force a full build. This is needed for some bots for some reason.
      * wtf/text/WTFString.h: Export a symbol that was exported on UString and needed in WebCore.
      
      Add String::getCharactersWithUpconvert<>(), which is similar to String::getCharacters<>() but with the same
      behaviors as UString::getCharacters<>().
      
      String::getCharactersWithUpconvert<>() is useful when manipulating multiple strings, it allow writting code
      using 16bits characters if any of the input String is not 8bit.
      
      Tools: 
      
      Get rid of UString.
      
      * DumpRenderTree/efl/WorkQueueItemEfl.cpp:
      * gdb/webkit.py:
      (WTFStringPrinter.to_string):
      (JSCIdentifierPrinter.to_string):
      (JSCJSStringPrinter.to_string):
      (add_pretty_printers):
      
      Websites/webkit.org: 
      
      Update the coding style to avoid mentioning a class that no longer exist.
      
      * coding/coding-style.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cff06e46
    • tommyw@google.com's avatar
      MediaStream API: Introduce MediaConstraints · d6365cf7
      tommyw@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=95198
      
      Reviewed by Adam Barth.
      
      Source/Platform:
      
      Adds WebMediaConstraints.
      
      * Platform.gypi:
      * chromium/public/WebMediaConstraints.h: Copied from Source/Platform/chromium/public/WebRTCPeerConnectionHandler.h.
      (WebCore):
      (WebKit):
      (WebMediaConstraints):
      (WebKit::WebMediaConstraints::WebMediaConstraints):
      (WebKit::WebMediaConstraints::~WebMediaConstraints):
      (WebKit::WebMediaConstraints::operator=):
      * chromium/public/WebRTCPeerConnectionHandler.h:
      (WebKit):
      (WebRTCPeerConnectionHandler):
      
      Source/WebCore:
      
      This introduces MediaConstraints together with relevant infrastructure, a chromium mock and LayoutTests.
      
      Patch covered by expanded existing tests.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Modules/mediastream/MediaConstraintsImpl.cpp: Added.
      (WebCore):
      (WebCore::MediaConstraintsImpl::create):
      (WebCore::MediaConstraintsImpl::initialize):
      (WebCore::MediaConstraintsImpl::~MediaConstraintsImpl):
      (WebCore::MediaConstraintsImpl::getMandatoryConstraintNames):
      (WebCore::MediaConstraintsImpl::getOptionalConstraintNames):
      (WebCore::MediaConstraintsImpl::getMandatoryConstraintValue):
      (WebCore::MediaConstraintsImpl::getOptionalConstraintValue):
      * Modules/mediastream/MediaConstraintsImpl.h: Copied from Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h.
      (WebCore):
      (MediaConstraintsImpl):
      (WebCore::MediaConstraintsImpl::MediaConstraintsImpl):
      * Modules/mediastream/RTCPeerConnection.cpp:
      (WebCore::RTCPeerConnection::create):
      (WebCore::RTCPeerConnection::RTCPeerConnection):
      * Modules/mediastream/RTCPeerConnection.h:
      (WebCore):
      (RTCPeerConnection):
      * WebCore.gypi:
      * bindings/js/Dictionary.cpp:
      (WebCore::Dictionary::getOwnPropertyNames):
      (WebCore):
      * bindings/js/Dictionary.h:
      (Dictionary):
      * bindings/v8/Dictionary.cpp:
      (WebCore::Dictionary::getOwnPropertyNames):
      (WebCore):
      * bindings/v8/Dictionary.h:
      (Dictionary):
      * platform/chromium/support/WebMediaConstraints.cpp: Copied from Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.cpp.
      (WebKit):
      (WebKit::WebMediaConstraints::WebMediaConstraints):
      (WebKit::WebMediaConstraints::assign):
      (WebKit::WebMediaConstraints::reset):
      (WebKit::WebMediaConstraints::isNull):
      (WebKit::WebMediaConstraints::getMandatoryConstraintNames):
      (WebKit::WebMediaConstraints::getOptionalConstraintNames):
      (WebKit::WebMediaConstraints::getMandatoryConstraintValue):
      (WebKit::WebMediaConstraints::getOptionalConstraintValue):
      * platform/mediastream/MediaConstraints.h: Copied from Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h.
      (WebCore):
      (MediaConstraints):
      (WebCore::MediaConstraints::~MediaConstraints):
      (WebCore::MediaConstraints::MediaConstraints):
      * platform/mediastream/RTCPeerConnectionHandler.cpp:
      (RTCPeerConnectionHandlerDummy):
      (WebCore::RTCPeerConnectionHandlerDummy::initialize):
      * platform/mediastream/RTCPeerConnectionHandler.h:
      (WebCore):
      (RTCPeerConnectionHandler):
      * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
      (WebCore::RTCPeerConnectionHandlerChromium::initialize):
      * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h:
      (RTCPeerConnectionHandlerChromium):
      
      Tools:
      
      Extending the MockWebRTCPeerConnectionHandler with MediaConstraints functionality.
      
      * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp:
      (MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler):
      (isSupportedConstraint):
      (isValidConstraint):
      (MockWebRTCPeerConnectionHandler::initialize):
      * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h:
      (MockWebRTCPeerConnectionHandler):
      
      LayoutTests:
      
      * fast/mediastream/RTCPeerConnection-expected.txt:
      * fast/mediastream/RTCPeerConnection.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d6365cf7
  5. 05 Jun, 2012 1 commit
  6. 11 May, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Web Intents code only supports V8 · 73aff5d6
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=85954
      
      Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-05-11
      Reviewed by Adam Barth.
      
      .:
      
      Add ENABLE_WEB_INTENTS flag to CMake.
      
      * Source/cmake/WebKitFeatures.cmake:
      * Source/cmakeconfig.h.cmake:
      
      Source/WebCore:
      
      Add necessary abstraction for js Dictionary and ScriptValue so that
      the Web Intents code in WebCore compiles with JSC, not just V8.
      
      This required changes in the JSC bindings generator to pass
      callback arguments of type SerializedScriptValue as raw pointers
      instead of RefPtr. This matches the change made to the V8 bindings
      generator in r104531.
      
      * CMakeLists.txt:
      * Modules/intents/Intent.cpp:
      * Modules/intents/Intent.h:
      * bindings/js/Dictionary.cpp:
      (WebCore::Dictionary::Dictionary):
      (WebCore):
      (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
      * bindings/js/Dictionary.h:
      (Dictionary):
      * bindings/js/JSBindingsAllInOne.cpp:
      * bindings/js/JSDictionary.cpp:
      (WebCore::JSDictionary::convertValue):
      (WebCore):
      * bindings/js/JSDictionary.h:
      (WebCore):
      (WebCore::JSDictionary::initializerObject):
      * bindings/js/ScriptValue.cpp:
      (WebCore::ScriptValue::serialize):
      (WebCore):
      * bindings/js/ScriptValue.h:
      (ScriptValue):
      * bindings/scripts/CodeGeneratorJS.pm:
      (AddIncludesForType):
      (GenerateCallbackHeader):
      (GenerateCallbackImplementation):
      (GetNativeTypeForCallbacks):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116763 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      73aff5d6
  7. 21 Apr, 2012 1 commit
    • jonlee@apple.com's avatar
      Add Notification constructor · 90f6ed33
      jonlee@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=80477
      <rdar://problem/10912431>
      
      Reviewed by Jian Li.
      
      Source/WebCore:
      
      Tests will be added once there is support for web notifications on the Mac ports.
      
      * WebCore.exp.in: Export finalize() function.
      
      Modify Dictionary to support creation of event listeners.
      * bindings/js/Dictionary.h:
      (WebCore::Dictionary::isObject): Return true if the JSDictionary is valid.
      (WebCore::Dictionary::isUndefinedOrNull): Return true if the JSDictionary is not valid.
      (WebCore::Dictionary::get): Add convenience function to take const char* for
      property name, to prevent having to do implicit conversion to WTF::String.
      (WebCore::Dictionary::getEventListener): Add function to create event listener
      from the dictionary.
      (WebCore::Dictionary::asJSObject): Helper to convert WebCore objects to JS wrapper.
      * bindings/js/Dictionary.cpp:
      (WebCore::Notification): Implement asJSObject() for Notification.
      * bindings/js/JSDictionary.h:
      (WebCore::JSDictionary::execState): Expose the exec state so that the Dictionary
      can obtain its world for creating the event listener.
      
      * bindings/v8/Dictionary.h:
      (WebCore::Dictionary::getEventListener): Stub implementation.
      
      Add new constructor to idl definitions.
      * notifications/DOMWindowNotifications.idl: Add Notification constructor, if
      ENABLE(NOTIFICATIONS) is on.
      * notifications/Notification.idl: If ENABLE(NOTIFICATIONS) is turned on, define
      the constructor. Otherwise, use OmitConstructor.
      * notifications/NotificationCenter.idl: Wrap creation functions in
      ENABLE(LEGACY_NOTIFICATIONS).
      * notifications/NotificationCenter.h: Ditto.
      (NotificationCenter):
      
      * notifications/Notification.h:
      (Notification): Wrap legacy constructors in ENABLE(LEGACY_NOTIFICATIONS).
      (WebCore::Notification::create): New creation function based on discussions in WG.
      * notifications/Notification.cpp:
      (WebCore::getAndAddEventListener): Helper function to get the listener from the
      dictionary, and attach to the notification.
      (WebCore::Notification::create): Create the notification, then apply whatever
      properties can be found in the dictionary to the notification. In order to
      attach the event listeners, the notification has to have been created, which is
      why this all happens in the factory method and not in the constructor.
      (WebCore::Notification::setBody): Added so that it can be set if we find it in the
      dictionary.
      
      The new constructor queues a task to show when it is created. To support this, we
      use a one-shot timer that calls show() in the next iteration of the run loop.
      (WebCore::Notification::Notification): Start the timer.
      (WebCore::Notification::showTaskTimerFired): Call show().
      
      Notifications, not being attached to the DOM, could be GC'ed by the JS engine
      before its life cycle has completed. We add calls to setPendingActivity() when the
      notification has been shown, and when it is closed, we unsetPendingActivity().
      To guarantee that we only call this once, we add a new state to the Notification
      state machine, called NotificationState::Closed.
      (WebCore::Notification::show): Call setPendingActivity() for all ports. Remove conditional on Mac.
      (WebCore::Notification::close): Include Closed state to machine; do nothing.
      (WebCore::Notification::dispatchCloseEvent): Call finalize().
      (WebCore::Notification::finalize): If the state is not Closed, we unsetPendingActivity()
      to make it available for GC.
      (WebCore::Notification::finishLoading): Remove the unsetPendingActivity(). That call
      was to balance the setPendingActivity() called for loading the icon. Instead of wrapping
      around the icon load, we wrap around the show() -> finalize() loop.
      
      In Notification, rename some of the stages and functions to more clearly communicate
      that they mostly deal with the icon of the notification, instead of general loading.
      (WebCore::Notification::show): Refactored to use LoadingIcon and CancelledIcon.
      (WebCore::Notification::close): Refactored to use LoadingIcon and CancelledIcon.
      (WebCore::Notification::~Notification): Refactor to use LoadingIcon.
      (WebCore::Notification::startLoadingIcon): Renamed from startLoading().
      (WebCore::Notification::stopLoadingIcon): Renamed from stopLoading().
      (WebCore::Notification::finishLoadingIcon): Renamed from finishLoading().
      (WebCore::Notification::didFinishLoading):
      (WebCore::Notification::didFail):
      (WebCore::Notification::didFailRedirectCheck):
      (WebCore::Notification::didReceiveResponse):
      (WebCore::Notification::finishLoading):
      
      Add Dictionary.cpp.
      * GNUmakefile.list.am:
      * Target.pri:
      * UseJSC.cmake:
      * WebCore.gypi:
      
      Fix bug in V8 bindings generation code. If the constructor doesn't raise an exception,
      don't use an exception code.
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateParametersCheck):
      * bindings/scripts/test/V8/V8TestObj.cpp: Reset results.
      (WebCore::TestObjV8Internal::optionsObjectCallback):
      
      Source/WebKit/mac:
      
      * WebCoreSupport/WebNotificationClient.mm:
      (WebNotificationClient::clearNotifications): When clearing notifications, finalize
      them so that they can be cleaned up by the GC.
      
      Source/WebKit2:
      
      * WebProcess/Notifications/WebNotificationManager.cpp:
      (WebKit::WebNotificationManager::show): If the notification doesn't get shown,
      we should return false, since it will not go through a setPendingActivity cycle.
      (WebKit::WebNotificationManager::clearNotifications): When clearing notifications,
      finalize them so that they can be cleaned up by the GC.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      90f6ed33
  8. 12 Apr, 2012 1 commit
    • jonlee@apple.com's avatar
      Implement Dictionary.h on mac (83472) · 18c38150
      jonlee@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83472
      <rdar://problem/11209766>
      
      Reviewed by Kentaro Hara.
      
      A difference between Dictionary and JSDictionary makes it difficult to merge the two together and avoid
      creating a confusing API. The boolean returned by Dictionary::get() represents whether the
      property was found. The boolean returned by JSDictionary::tryGetProperty() represents whether an
      exception was thrown.
      
      * WebCore.xcodeproj/project.pbxproj: Add Dictionary.h and Dictionary.cpp.
      
      * bindings/js/Dictionary.cpp: Added.
      (WebCore::Dictionary::Dictionary):
      (WebCore::Dictionary::get):
      * bindings/js/Dictionary.h: Leverage JSDictionary's functionality to obtain the data.
      (WebCore::Dictionary::isObject): Mark an unimplemented.
      (WebCore::Dictionary::isUndefinedOrNull): Mark an unimplemented.
      (WebCore::Dictionary::getWithUndefinedOrNullCheck): Mark an unimplemented.
      
      * bindings/js/JSDictionary.cpp:
      (WebCore::JSDictionary::tryGetProperty): Convert to a const function.
      * bindings/js/JSDictionary.h:
      (WebCore::JSDictionary::isValid):
      (WebCore::JSDictionary::tryGetProperty): Convert to a const function.
      (WebCore::JSDictionary::get): Similar to tryGetProperty(), but returns true if the
      property was found, converting the value succeeded and the out parameter "result" was set.
      (WebCore::JSDictionary::tryGetPropertyAndResult): Refactor tryGetProperty() to return the enum directly.
      
      Change bindings scripts to use Dictionary constructor.
      * bindings/js/IDBBindingUtilities.cpp: Remove createDictionaryFromValue().
      * bindings/js/IDBBindingUtilities.h: Remove createDictionaryFromValue().
      * bindings/scripts/CodeGeneratorJS.pm:
      (JSValueToNative): Update to remove IDBBindingUtilities.h dependency, and use Dictionary constructor.
      * bindings/scripts/test/JS/JSTestObj.cpp:
      (WebCore::jsTestObjPrototypeFunctionOptionsObject): Update expected generated output.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      18c38150