1. 29 Nov, 2013 6 commits
    • weinig@apple.com's avatar
      Fix some style boo-boos. · c6df4a5d
      weinig@apple.com authored
      * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController loadDelegate]):
      (-[WKBrowsingContextController setLoadDelegate:]):
      (-[WKBrowsingContextController policyDelegate]):
      (-[WKBrowsingContextController setPolicyDelegate:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c6df4a5d
    • weinig@apple.com's avatar
      Fix the iOS build. · a329fd72
      weinig@apple.com authored
      * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController loadDelegate]):
      (-[WKBrowsingContextController policyDelegate]):
      (-[WKBrowsingContextController setPolicyDelegate:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a329fd72
    • weinig@apple.com's avatar
      [Cocoa] Make WKBrowsingContextController work with WKObject wrapping · 0e131da2
      weinig@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=125022
      
      Reviewed by Dan Bernstein.
      
      * Shared/Cocoa/APIObject.mm:
      (API::Object::newObject):
              
      * Shared/mac/ObjCObjectGraphCoders.mm:
      Add support for WKProcessGroup.
      
      (WebKit::WebContextObjCObjectGraphDecoderImpl::decode):
      Replace call to _browsingContextControllerForPageRef: with wrapper.
      
      * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
      Convert from wrapping the C-SPI type to storing the bits of the wrapped object inline.
      
      (-[WKBrowsingContextController dealloc]):
      Add explicit destructor call.
      
      (-[WKBrowsingContextController setLoadDelegate:]):
      (-[WKBrowsingContextController setPolicyDelegate:]):
      Lazily set up the load and policy clients only once a delegate has been set to allow
      continued use of the C-SPI clients for WebKitTestRunner.
      
      (-[WKBrowsingContextController _finishInitialization]):
      Move remaining work that was done in the initialize (setting up the observer) here,
      and have the WebPageProxy call it.
      
      * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
      (WebKit::wrapper):
      Add wrapper() helper and declare conformance to the WKObject protocol. Remove no longer used
      _initWithPageRef: and _browsingContextControllerForPageRef: helpers.
      
      * UIProcess/API/Cocoa/WKProcessGroup.mm:
      (didNavigateWithNavigationData):
      (didPerformClientRedirect):
      (didPerformServerRedirect):
      (didUpdateHistoryTitle):
      Switch to using wrapper().
      
      * UIProcess/API/ios/WKContentView.mm:
      * UIProcess/API/mac/WKView.mm:
      Stop caching the WKBrowsingContextController, as it no long makes sense since it is the same object
      as the WebPageProxy.
      
      * UIProcess/mac/WebPageProxyMac.mm:
      (WebKit::WebPageProxy::platformInitialize):
      Inform the wrapper that it is safe to finish initialization.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0e131da2
    • mitz@apple.com's avatar
      [Cocoa] Add a way to recover from load errors · ec6a0371
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=125020
      
      Reviewed by Sam Weinig.
      
      * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
      (createErrorWithRecoveryAttempter): Added this helper function. It creates an NSError from
      the given error, adding two keys to the user info dictionary: the context controller under
      the recovery attempter key, and the frame under a private key.
      (didFailProvisionalLoadWithErrorForFrame): Changed to use createErrorWithRecoveryAttempter.
      (didFailLoadWithErrorForFrame): Ditto.
      (-[WKBrowsingContextController attemptRecoveryFromError:]): Implemented this
      WKErrorRecoveryAttempting protocol method by loading the failing URL from the error into the
      frame from the error.
      
      * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h: Added. Defines a protocol for attempting
      recovery from errors and declares the error user info dictionary key under which an object
      conforming to this protocol may be stored.
      * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.m: Added. Defines
      WKRecoveryAttempterErrorKey.
      
      * UIProcess/WebFrameProxy.cpp:
      (WebKit::WebFrameProxy::loadURL): Added. Sends the LoadURLInFrame message to the page.
      * UIProcess/WebFrameProxy.h:
      
      * WebKit2.xcodeproj/project.pbxproj: Added references to new files.
      
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::loadURLInFrame): Added. Loads the URL in the given frame.
      * WebProcess/WebPage/WebPage.h:
      * WebProcess/WebPage/WebPage.messages.in: Added LoadURLInFrame.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ec6a0371
    • mitz@apple.com's avatar
      [Cocoa] Expose loadAlternateHTMLString via the API · 4386e33c
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=125019
      
      Reviewed by Sam Weinig.
      
      * UIProcess/API/Cocoa/WKBrowsingContextController.h: Declared new method.
      * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]): Added.
      Calls WebPageProxy::loadAlternateHTMLString.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4386e33c
    • weinig@apple.com's avatar
      Move API files shared between Mac and iOS to the Cocoa directory · 06c4e291
      weinig@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=125017
      
      Reviewed by Dan Bernstein.
      
      * UIProcess/API/Cocoa/WKBrowsingContextController.h: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h.
      * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm.
      * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerInternal.h.
      * UIProcess/API/Cocoa/WKBrowsingContextControllerPrivate.h: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerPrivate.h.
      * UIProcess/API/Cocoa/WKBrowsingContextGroup.h: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h.
      * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm.
      * UIProcess/API/Cocoa/WKBrowsingContextGroupInternal.h: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupInternal.h.
      * UIProcess/API/Cocoa/WKBrowsingContextGroupPrivate.h: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupPrivate.h.
      * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextLoadDelegate.h.
      * UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h: Copied from Source/WebKit2/UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h.
      * UIProcess/API/Cocoa/WKConnection.h: Copied from Source/WebKit2/UIProcess/API/mac/WKConnection.h.
      * UIProcess/API/Cocoa/WKConnection.mm: Copied from Source/WebKit2/UIProcess/API/mac/WKConnection.mm.
      * UIProcess/API/Cocoa/WKConnectionInternal.h: Copied from Source/WebKit2/UIProcess/API/mac/WKConnectionInternal.h.
      * UIProcess/API/Cocoa/WKProcessGroup.h: Copied from Source/WebKit2/UIProcess/API/mac/WKProcessGroup.h.
      * UIProcess/API/Cocoa/WKProcessGroup.mm: Copied from Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm.
      * UIProcess/API/Cocoa/WKProcessGroupInternal.h: Copied from Source/WebKit2/UIProcess/API/mac/WKProcessGroupInternal.h.
      * UIProcess/API/Cocoa/WKProcessGroupPrivate.h: Copied from Source/WebKit2/UIProcess/API/mac/WKProcessGroupPrivate.h.
      * UIProcess/API/Cocoa/WKTypeRefWrapper.h: Copied from Source/WebKit2/UIProcess/API/mac/WKTypeRefWrapper.h.
      * UIProcess/API/Cocoa/WKTypeRefWrapper.mm: Copied from Source/WebKit2/UIProcess/API/mac/WKTypeRefWrapper.mm.
      * UIProcess/API/Cocoa/WKView.h: Copied from Source/WebKit2/UIProcess/API/mac/WKView.h.
      * UIProcess/API/Cocoa/WKViewPrivate.h: Copied from Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h.
      * UIProcess/API/Cocoa/WebKit2.h: Copied from Source/WebKit2/UIProcess/API/mac/WebKit2.h.
      * UIProcess/API/mac/WKBrowsingContextController.h: Removed.
      * UIProcess/API/mac/WKBrowsingContextController.mm: Removed.
      * UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Removed.
      * UIProcess/API/mac/WKBrowsingContextControllerPrivate.h: Removed.
      * UIProcess/API/mac/WKBrowsingContextGroup.h: Removed.
      * UIProcess/API/mac/WKBrowsingContextGroup.mm: Removed.
      * UIProcess/API/mac/WKBrowsingContextGroupInternal.h: Removed.
      * UIProcess/API/mac/WKBrowsingContextGroupPrivate.h: Removed.
      * UIProcess/API/mac/WKBrowsingContextLoadDelegate.h: Removed.
      * UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h: Removed.
      * UIProcess/API/mac/WKConnection.h: Removed.
      * UIProcess/API/mac/WKConnection.mm: Removed.
      * UIProcess/API/mac/WKConnectionInternal.h: Removed.
      * UIProcess/API/mac/WKProcessGroup.h: Removed.
      * UIProcess/API/mac/WKProcessGroup.mm: Removed.
      * UIProcess/API/mac/WKProcessGroupInternal.h: Removed.
      * UIProcess/API/mac/WKProcessGroupPrivate.h: Removed.
      * UIProcess/API/mac/WKTypeRefWrapper.h: Removed.
      * UIProcess/API/mac/WKTypeRefWrapper.mm: Removed.
      * UIProcess/API/mac/WKView.h: Removed.
      * UIProcess/API/mac/WKViewPrivate.h: Removed.
      * UIProcess/API/mac/WebKit2.h: Removed.
      * WebKit2.xcodeproj/project.pbxproj:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      06c4e291
  2. 28 Nov, 2013 1 commit
    • weinig@apple.com's avatar
      Perform some spring cleaning to WKContentView and WKView · 57850ccd
      weinig@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124961
      
      Reviewed by Dan Bernstein.
      
      - Store the PageClientImpl in a std::unique_ptr.
      - Remove the WKBrowsingContextController internal load delegate. Replace its use with
        a new PageClient function, didCommitLoadForMainFrame.
      - Fix typo in the WKContentViewDelegate. contentViewdidCommitLoadForMainFrame -> contentViewDidCommitLoadForMainFrame.
      - Add initializers for WKContentView and WKView that take WKContextRefs and WKPageGroupRefs to match the Mac WKView.
        These are needed for WebKitTestRunner.
      - Require a WKProcessGroup (or WKContextRef) and a WKBrowsingContextGroup (or WKPageGroupRef).
      - Stop caching the WKProcessGroup and WKBrowsingContextGroup on the WKContentView.
      - Remove incorrect implementations of initWithCoder.
      - Make WKContentView lazily create its WKBrowsingContextController wrapper.
      
      * UIProcess/API/ios/PageClientImplIOS.h:
      * UIProcess/API/ios/PageClientImplIOS.mm:
      (WebKit::PageClientImpl::PageClientImpl):
      (WebKit::PageClientImpl::didCommitLoadForMainFrame):
      (WebKit::PageClientImpl::mainDocumentDidReceiveMobileDocType):
      * UIProcess/API/ios/WKContentView.h:
      * UIProcess/API/ios/WKContentView.mm:
      (-[WKContentView initWithCoder:]):
      (-[WKContentView initWithFrame:processGroup:browsingContextGroup:]):
      (-[WKContentView browsingContextController]):
      (-[WKContentView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
      (-[WKContentView _didCommitLoadForMainFrame]):
      (-[WKContentView _didReceiveMobileDocTypeForMainFrame]):
      (-[WKContentView _didChangeViewportArguments:WebCore::]):
      (-[WKContentView _decidePolicyForGeolocationRequestFromOrigin:frame:request:]):
      (-[WKContentView _pageRef]):
      (-[WKContentView initWithFrame:contextRef:pageGroupRef:]):
      (-[WKContentView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
      * UIProcess/API/ios/WKContentViewInternal.h:
      * UIProcess/API/ios/WKContentViewPrivate.h: Added.
      * UIProcess/API/ios/WKView.mm:
      (-[WKView initWithFrame:processGroup:browsingContextGroup:]):
      (-[WKView initWithFrame:processGroup:browsingContextGroup:relatedToView:]):
      (-[WKView contentViewDidCommitLoadForMainFrame:]):
      (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
      (-[WKView pageRef]):
      (-[WKView initWithFrame:contextRef:pageGroupRef:]):
      (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
      * UIProcess/API/mac/PageClientImpl.h:
      * UIProcess/API/mac/PageClientImpl.mm:
      (WebKit::PageClientImpl::didCommitLoadForMainFrame):
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (didCommitLoadForFrame):
      * UIProcess/API/mac/WKBrowsingContextControllerInternal.h:
      * UIProcess/API/mac/WKViewPrivate.h:
      * UIProcess/PageClient.h:
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::didCommitLoadForFrame):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159859 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      57850ccd
  3. 27 Nov, 2013 1 commit
  4. 25 Nov, 2013 4 commits
    • mitz@apple.com's avatar
      [Cocoa] Use class extensions for IPI · b98fcf03
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124870
      
      Reviewed by Sam Weinig.
      
      * UIProcess/API/mac/WKBrowsingContextController.mm: Reordered methods so that the Private
      cateogry isn’t stuck between the API methods and the internal methods.
      (-[WKBrowsingContextController setPaginationMode:]):
      (-[WKBrowsingContextController paginationMode]):
      (-[WKBrowsingContextController setPaginationBehavesLikeColumns:]):
      (-[WKBrowsingContextController paginationBehavesLikeColumns]):
      (-[WKBrowsingContextController setPageLength:]):
      (-[WKBrowsingContextController pageLength]):
      (-[WKBrowsingContextController setGapBetweenPages:]):
      (-[WKBrowsingContextController gapBetweenPages]):
      (-[WKBrowsingContextController pageCount]):
      (-[WKBrowsingContextController handle]):
      * UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Changed Internal category into
      a class extension.
      
      * UIProcess/API/mac/WKConnection.mm:
      * UIProcess/API/mac/WKConnectionInternal.h: Changed Internal category into a class
      extension.
      
      * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
      * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h: Ditto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b98fcf03
    • mitz@apple.com's avatar
      Fixed the iOS build. · e0ec0ba6
      mitz@apple.com authored
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController loadDelegateInternal]):
      (-[WKBrowsingContextController setLoadDelegateInternal:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e0ec0ba6
    • mitz@apple.com's avatar
      [Cocoa] Remove some indirection that was only necessary for supporting the... · 02f9f10a
      mitz@apple.com authored
      [Cocoa] Remove some indirection that was only necessary for supporting the legacy Objective-C runtime
      https://bugs.webkit.org/show_bug.cgi?id=123065
      
      Reviewed by Sam Weinig.
      
      * UIProcess/API/mac/WKBrowsingContextController.h: Removed _data ivar and
      WKBrowsingContextControllerData class declaration.
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController dealloc]): Removed
      WKBrowsingContextControllerData class and moved ivars directly into
      WKBrowsingContextController, declaring them in the @implementation. Removed ivar and
      accessors for the delegate properties, letting the compiler synthesize them.
      (-[WKBrowsingContextController _pageRef]): Removed indirection via _data.
      (-[WKBrowsingContextController loadRequest:userData:]): Removed indirection via -_pageRef.
      (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]): Ditto.
      (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]): Ditto.
      (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]): Ditto.
      (-[WKBrowsingContextController stopLoading]): Ditto.
      (-[WKBrowsingContextController reload]): Ditto.
      (-[WKBrowsingContextController reloadFromOrigin]): Ditto.
      (-[WKBrowsingContextController goForward]): Ditto.
      (-[WKBrowsingContextController canGoForward]): Ditto.
      (-[WKBrowsingContextController goBack]): Ditto.
      (-[WKBrowsingContextController canGoBack]): Ditto.
      (-[WKBrowsingContextController goToBackForwardListItem:]): Ditto.
      (-[WKBrowsingContextController backForwardList]): Ditto.
      (-[WKBrowsingContextController activeURL]): Ditto.
      (-[WKBrowsingContextController provisionalURL]): Ditto.
      (-[WKBrowsingContextController committedURL]): Ditto.
      (-[WKBrowsingContextController unreachableURL]): Removed idirection via _data.
      (-[WKBrowsingContextController estimatedProgress]): Removed indirection via -_pageRef.
      (-[WKBrowsingContextController title]): Ditto.
      (-[WKBrowsingContextController textZoom]): Ditto.
      (-[WKBrowsingContextController setTextZoom:]): Ditto.
      (-[WKBrowsingContextController pageZoom]): Ditto.
      (-[WKBrowsingContextController setPageZoom:]): Ditto.
      (-[WKBrowsingContextController setPaginationMode:]): Ditto.
      (-[WKBrowsingContextController paginationMode]): Ditto.
      (-[WKBrowsingContextController setPaginationBehavesLikeColumns:]): Ditto.
      (-[WKBrowsingContextController paginationBehavesLikeColumns]): Ditto.
      (-[WKBrowsingContextController setPageLength:]): Ditto.
      (-[WKBrowsingContextController pageLength]): Ditto.
      (-[WKBrowsingContextController setGapBetweenPages:]): Ditto.
      (-[WKBrowsingContextController gapBetweenPages]): Ditto.
      (-[WKBrowsingContextController pageCount]): Ditto.
      (-[WKBrowsingContextController handle]): Ditto.
      (-[WKBrowsingContextController _initWithPageRef:]): Removed indirection via _data.
      
      * UIProcess/API/mac/WKBrowsingContextGroup.h: Removed _data ivar and
      WKBrowsingContextGroupData class declaration.
      * UIProcess/API/mac/WKBrowsingContextGroup.mm: Removed WKBrowsingContextGroupData class and
      moved _pageGroupRef ivar directly into WKBrowsingContextGroup, declaring it in the
      @implementation.
      (-[WKBrowsingContextGroup initWithIdentifier:]): Removed indirection via _data.
      (-[WKBrowsingContextGroup allowsJavaScript]): Removed indirection via -_pageGroupRef.
      (-[WKBrowsingContextGroup setAllowsJavaScript:]): Ditto.
      (-[WKBrowsingContextGroup allowsJavaScriptMarkup]): Ditto.
      (-[WKBrowsingContextGroup setAllowsJavaScriptMarkup:]): Ditto.
      (-[WKBrowsingContextGroup allowsPlugIns]): Ditto.
      (-[WKBrowsingContextGroup setAllowsPlugIns:]): Ditto.
      (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
      (-[WKBrowsingContextGroup removeAllUserStyleSheets]): Ditto.
      (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
      (-[WKBrowsingContextGroup removeAllUserScripts]): Ditto.
      (-[WKBrowsingContextGroup _pageGroupRef]): Removed indirection via _data.
      
      * UIProcess/API/mac/WKConnection.h: Removed _data ivar and WKConnectionData class declaration.
      * UIProcess/API/mac/WKConnection.mm: Removed WKConnectionData class and moved _connectionRef
      ivar directly into WKConnection, declaring it in the @implementation. Removed ivar and
      accessors for the delegate property, letting the compiler synthesize them.
      (-[WKConnection dealloc]): Removed indirection via _data.
      (-[WKConnection sendMessageWithName:body:]): Ditto.
      (-[WKConnection remoteObjectRegistry]): Ditto.
      (didReceiveMessage): Ditto.
      (-[WKConnection _initWithConnectionRef:]): Ditto.
      
      * UIProcess/API/mac/WKProcessGroup.h: Replaced forward declaration of WKConnection with an
      import. Removed _data ivar and WKProcessGroupData class declaration.
      * UIProcess/API/mac/WKProcessGroup.mm: Removed WKProcessGroupData class and moved
      _contextRef ivar directly into WKProcessGroup, declaring it in the @implementation. Removed
      ivar and accessors for the delegate property, letting the compiler synthesize them.
      (-[WKProcessGroup initWithInjectedBundleURL:]): Removed indirection via _data.
      (-[WKProcessGroup dealloc]): Ditto.
      (-[WKProcessGroup _contextRef]): Ditto.
      (-[WKProcessGroup _geolocationProvider]): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      02f9f10a
    • mitz@apple.com's avatar
      [Cocoa] Put most of the Cocoa API behind WK_API_ENABLED guards · 376be0b9
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124850
      
      Reviewed by Brady Eidson.
      
      Source/WebKit2:
      
      Guarded all Cocoa API headers and implementatiosn with WK_API_ENABLED. Left the WKView class
      unguarded, but limited its API.
      
      * Shared/API/Cocoa/WKFoundation.h: Replaced OBJ_VISIBLE with an explicit attribute.
      * Shared/API/Cocoa/WKRemoteObjectCoder.mm: Moved #if WK_API_ENABLED before the rest of the
      imports.
      * Shared/API/Cocoa/WKRemoteObjectInterface.mm: Ditto.
      * Shared/API/Cocoa/WKRemoteObjectRegistry.mm: Ditto.
      * Shared/API/Cocoa/WKRemoteObjectRegistryPrivate.h: Ditto.
      * UIProcess/API/mac/WKBrowsingContextController.h: Guarded all declarations with
      WK_API_ENABLED, changed to use WK_API_CLASS instead of WK_EXPORT.
      * UIProcess/API/mac/WKBrowsingContextController.mm: Guarded everything with WK_API_ENABLED.
      (-[WKBrowsingContextController dealloc]):
      (-[WKBrowsingContextController setPolicyDelegate:]):
      (-[WKBrowsingContextController backForwardList]):
      (didChangeBackForwardList):
      (setUpPageLoaderClient):
      (setUpPagePolicyClient):
      (-[WKBrowsingContextController _initWithPageRef:]):
      * UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Ditto.
      * UIProcess/API/mac/WKBrowsingContextControllerPrivate.h: Ditto.
      * UIProcess/API/mac/WKBrowsingContextGroup.h: Guarded all declarations with WK_API_ENABLED,
      chanegd to use WK_API_CLASS instead of WK_EXPORT.
      * UIProcess/API/mac/WKBrowsingContextGroup.mm: Removed redundant import, guarded everything
      with WK_API_ENABLED.
      * UIProcess/API/mac/WKBrowsingContextGroupPrivate.h: Guarded with WK_API_ENABLED.
      * UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h: Added necessary import.
      * UIProcess/API/mac/WKConnection.h: Guarded all declarations with WK_API_ENABLED, chanegd to
      use WK_API_CLASS instead of WK_EXPORT.
      * UIProcess/API/mac/WKConnection.mm: Guarded everything with WK_API_ENABLED.
      (-[WKConnection remoteObjectRegistry]):
      (didReceiveMessage):
      * UIProcess/API/mac/WKConnectionInternal.h: Guarded the delcarations with WK_API_ENABLED.
      * UIProcess/API/mac/WKProcessGroup.h: Ditto. Also changed to use WK_API_CLASS instead of
      WK_EXPORT.
      * UIProcess/API/mac/WKProcessGroup.mm: Guarded everything with WK_API_ENABLED.
      (-[WKProcessGroup initWithInjectedBundleURL:]):
      * UIProcess/API/mac/WKProcessGroupPrivate.h: Guarded the declarations with WK_API_ENABLED.
      * UIProcess/API/mac/WKTypeRefWrapper.h: Moved #if WK_API_ENABLED before the rest of the
      imports, changed to use WK_API_CLASS instead of WK_EXPORT.
      * UIProcess/API/mac/WKTypeRefWrapper.mm: Removed empty line after #import "config.h".
      * UIProcess/API/mac/WKView.h: Added #if WK_API_ENABLED around API that uses other Cocoa API
      types.
      * UIProcess/API/mac/WKView.mm: Added #if WK_API_ENABLED around implementations of methods
      that are only declared when the API is enabled.
      * UIProcess/API/mac/WKViewInternal.h: Reordered imports.
      * UIProcess/mac/WKFullScreenWindowController.mm: Added comment to #endif.
      * UIProcess/mac/WebContextMac.mm:
      (WebKit::WebContext::platformInitializeWebProcess): Guarded use of
      WKBrowsingContextController with WK_API_ENABLED.
      (WebKit::WebContext::platformInitializeNetworkProcess): Ditto.
      * UIProcess/mac/WebContextMenuProxyMac.mm: Removed newline between imports.
      * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: Moved #if WK_API_ENABLED before the
      rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
      * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: Removed newline after #import
      "config.h".
      * WebProcess/InjectedBundle/API/mac/WKDOMElement.h: Moved #if WK_API_ENABLED before the
      rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
      * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm: Removed newline after #import
      "config.h".
      * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm: Ditto.
      * WebProcess/InjectedBundle/API/mac/WKDOMNode.h: Moved #if WK_API_ENABLED before the
      rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
      * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm: Removed redundant import.
      * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:  Moved #if WK_API_ENABLED before the
      rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
      * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm: Removed newline and redundant import.
      * WebProcess/InjectedBundle/API/mac/WKDOMText.h: Moved #if WK_API_ENABLED before the
      rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
      * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h: Ditto.
      * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm: Removed newline after
      #import "config.h".
      * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h: Moved #if WK_API_ENABLED before
      the rest of the imports, and changed to use WK_API_CLASS instead of WK_EXPORT.
      * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm: Removed newline and redundant
      imports.
      * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:  Moved #if
      WK_API_ENABLED before the rest of the imports, and changed to use WK_API_CLASS instead of
      WK_EXPORT.
      * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: Removed
      newline after #import "config.h".
      
      Tools:
      
      Added #if WK_API_ENABLED guards around tests that use the Objective-C API.
      
      * TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
      * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm:
      * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
      * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm:
      * TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm:
      * TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm:
      * TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextLoadDelegateTest.mm:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      376be0b9
  5. 22 Nov, 2013 3 commits
  6. 21 Nov, 2013 2 commits
  7. 17 Nov, 2013 1 commit
    • mitz@apple.com's avatar
      No way for policy client to determine if a the response’s MIME type can be shown · 8f11b919
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124445
      
      Reviewed by Sam Weinig.
      
      Source/WebKit2: 
      
      * Platform/CoreIPC/HandleMessage.h:
      (CoreIPC::callMemberFunction): Added a fifth message parameter to this template.
      
      * UIProcess/API/C/WKPage.h: Added a canShowMIMEType parameter to
      WKPageDecidePolicyForResponseCallback and deprecated the old version.
      
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (setUpPagePolicyClient): Include whether the response MIME type can be shown under a new key
      in the action information dictionary.
      * UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h: Declared
      WKActionCanShowMIMETypeKey.
      
      * UIProcess/WebInspectorProxy.cpp:
      (WebKit::WebInspectorProxy::createInspectorPage): Updated for changes in the policy client.
      
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::decidePolicyForResponse): Added canShowMIMEType parameter, which is
      passed to the policy client.
      (WebKit::WebPageProxy::decidePolicyForResponseSync): Added canShowMIMEType parameter, which
      is passed to the above function.
      * UIProcess/WebPageProxy.h:
      * UIProcess/WebPageProxy.messages.in: Added canShowMIMEType paramter to
      DecidePolicyForResponseSync.
      
      * UIProcess/WebPolicyClient.cpp:
      (WebKit::WebPolicyClient::decidePolicyForResponse): Added canShowMIMEType parameter, which
      is passed to the client callback.
      * UIProcess/WebPolicyClient.h:
      
      * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
      (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Determine if the response
      MIME type can be shown and pass this information along in the message to the UI process.
      
      Tools: 
      
      * MiniBrowser/mac/WK2BrowserWindowController.m:
      (decidePolicyForResponse): Added canShowMIMEType parameter.
      (-[WK2BrowserWindowController awakeFromNib]): Updated for changes in the policy client.
      
      * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
      (TestWebKitAPI::decidePolicyForResponse): Added canShowMIMEType parameter.
      
      * WebKitTestRunner/TestController.cpp:
      (WTR::TestController::createWebViewWithOptions): Updated for changes in the policy client.
      (WTR::TestController::decidePolicyForResponse): Added canShowMIMEType parameter.
      * WebKitTestRunner/TestController.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8f11b919
  8. 15 Nov, 2013 1 commit
    • mitz@apple.com's avatar
      Give the policy client the originating frame of a navigation action · f9b0abcc
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124431
      
      Reviewed by Anders Carlsson.
      
      Source/WebKit2: 
      
      * Platform/CoreIPC/HandleMessage.h:
      (CoreIPC::callMemberFunction): Added a seventh message parameter to this template.
      
      * Shared/APIClientTraits.cpp: Defined API traits for WKPagePolicyClient, which now has two
      versions.
      * Shared/APIClientTraits.h: Declared APIClientTraits<WKPagePolicyClient>.
      
      * UIProcess/API/C/WKPage.h: Added an originatingFrame parameter to
      WKPageDecidePolicyForNavigationActionCallback and deprecated the old version. Bumped the
      policy client version to 1.
      
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (setUpPagePolicyClient): Include the originating frame’s URL under the a new key in the
      action information dictionary.
      * UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h: Declared
      WKActionOriginatingFrameURLKey.
      
      * UIProcess/WebInspectorProxy.cpp:
      (WebKit::decidePolicyForNavigationAction): Added originatingFrame parameter.
      (WebKit::WebInspectorProxy::createInspectorPage): Updated to the new version of the policy
      client interface.
      
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::decidePolicyForNavigationAction): Added originatingFrameID parameter
      and passing the originating frame to the policy client.
      * UIProcess/WebPageProxy.h:
      * UIProcess/WebPageProxy.messages.in: Added originatingFrameID paremeter to
      DecidePolicyForNavigationAction.
      
      * UIProcess/WebPolicyClient.cpp:
      (WebKit::WebPolicyClient::decidePolicyForNavigationAction): Added originatingFrame
      parameter, which is passed to the client callback.
      * UIProcess/WebPolicyClient.h:
      
      * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
      (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Determine the
      originating frame for link activation and form submission actions and send its ID in the
      DecidePolicyForNavigationAction message.
      
      Tools: 
      
      * MiniBrowser/mac/WK2BrowserWindowController.m:
      (decidePolicyForNavigationAction): Added originatingFrame parameter.
      (-[WK2BrowserWindowController awakeFromNib]): Updated for the new version of the policy
      client.
      
      * TestWebKitAPI/Tests/WebKit2/DownloadDecideDestinationCrash.cpp:
      (TestWebKitAPI::decidePolicyForNavigationAction): Added originatingFrame parameter.
      (TestWebKitAPI::setPagePolicyClient): Updated for the new version of the policy client.
      
      * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
      (TestWebKitAPI::decidePolicyForNavigationAction): Added originatingFrame parameter.
      (TestWebKitAPI::TEST): Updated for the new version of the policy client.
      
      * WebKitTestRunner/TestController.cpp:
      (WTR::TestController::createWebViewWithOptions): Updated for the new version of the policy
      client.
      (WTR::TestController::decidePolicyForNavigationAction): Added originatingFrame parameter.
      * WebKitTestRunner/TestController.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f9b0abcc
  9. 14 Nov, 2013 2 commits
  10. 09 Nov, 2013 1 commit
    • mitz@apple.com's avatar
      Use createCFURLFromBuffer when converting a String to a CFURL · 5a8524b6
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124113
      
      Reviewed by Anders Carlsson.
      
      * Shared/API/c/cf/WKURLCF.mm:
      (WKURLCopyCFURL): Replaced some code with a call to createCFURLFromBuffer(), which does the
      same thing.
      
      * Shared/Cocoa/WKNSURLExtras.h: Added.
      * Shared/Cocoa/WKNSURLExtras.mm: Added.
      (+[NSURL _web_URLWithWTFString:relativeToURL:]): Added. Returns nil for the null String,
      otherwise returns the result of createCFURLFromBuffer().
      
      * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
      (-[WKBackForwardListItem URL]): Changed to use +_web_URLWithWTFString:relativeToURL:.
      (-[WKBackForwardListItem originalURL]): Ditto.
      
      * UIProcess/API/Cocoa/WKNavigationData.mm:
      (-[WKNavigationData destinationURL]): Ditto.
      
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController unreachableURL]): Ditto.
      
      * WebKit2.xcodeproj/project.pbxproj: Added references to new files.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5a8524b6
  11. 08 Nov, 2013 2 commits
    • andersca@apple.com's avatar
      More build fixes. · 3f46679b
      andersca@apple.com authored
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      * UIProcess/API/mac/WKConnection.mm:
      (didReceiveMessage):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3f46679b
    • andersca@apple.com's avatar
      Add A WKBrowsingContextHandle class · 563f8c86
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=124058
      
      Reviewed by Sam Weinig.
      
      The WKBrowsingContextHandle class represents a browsing context and can be sent across process boundaries.
      
      * Shared/API/Cocoa/WKBrowsingContextHandle.h: Added.
      * Shared/API/Cocoa/WKBrowsingContextHandle.mm: Added.
      (-[WKBrowsingContextHandle _initWithPageID:]):
      (-[WKBrowsingContextHandle encodeWithCoder:]):
      (-[WKBrowsingContextHandle initWithCoder:]):
      (+[WKBrowsingContextHandle supportsSecureCoding]):
      * Shared/API/Cocoa/WKBrowsingContextHandleInternal.h: Added.
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController handle]):
      * UIProcess/API/mac/WKBrowsingContextControllerInternal.h:
      * UIProcess/API/mac/WKBrowsingContextControllerPrivate.h:
      (NS_ENUM):
      * WebKit2.xcodeproj/project.pbxproj:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      563f8c86
  12. 06 Nov, 2013 4 commits
  13. 30 Oct, 2013 1 commit
    • mitz@apple.com's avatar
      [Cocoa] Make all API objects have Cocoa wrappers, and delegate refcounting to those wrappers · 2f8b296d
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=123394
      
      Reviewed by Darin Adler.
      
      All wrappers conform to a new WKObject protocol and contain the wrapped object inline.
      APIObject-derived classes override operator new to call newObject, which allocates the
      wrapper and returns a pointer to the inline API object.
      
      There are three kinds of wrapper classes: (a) classes that inherit directly from NSObject
      and implement their API by calling the wrapped object (example: WKBackForwardList),
      (b) internal classes that inherit from a class cluster, and implement the primitive methods
      of the class cluster by calling the wrapped object (example: WKNSArray), and (c) internal
      classes that inerit from the new WKObject class, and proxy to an object of some public type,
      which is created from the wrapped object (example: WKNSURL).
      
      * Shared/APIObject.h:
      (WebKit::APIObject::wrapper): Added this getter.
      (WebKit::TypedAPIObject::operator new): Added override that calls newObject.
      * Shared/Cocoa/APIObject.mm: Added.
      (WebKit::APIObject::ref): Retains the wrapper.
      (WebKit::APIObject::deref): Releases the wrapper. When the wrapper is deallocated, it calls
      the API object destructor.
      (WebKit::APIObject::newObject): Allocates the wrapper and returns a pointer to the API
      object inside the wrapper.
      
      * Shared/Cocoa/WKNSArray.h:
      (WebKit::wrapper): Added. Returns an ImmutableArray’s wrapper as an NSArray.
      Replaced the RefPtr<ImmutableArray> ivar with space for an ImmutableArray to live inside
      the wrapper.
      (-[WKNSArray dealloc]): Calls the ImmutableArray destructor.
      (-[WKNSArray count]): Updated for ivar change.
      (-[WKNSArray objectAtIndex:]): Ditto.
      (-[WKNSArray _apiObject]): Returns the wrapped ImmutableArray.
      
      * Shared/Cocoa/WKNSObjectExtras.h: Removed.
      * Shared/Cocoa/WKNSObjectExtras.mm: Removed.
      
      * Shared/Cocoa/WKNSString.h: Added.
      * Shared/Cocoa/WKNSString.mm: Added.
      (-[WKNSString _web_createTarget]): Override this WKObject method to create an NSString from
      the WebString.
      (-[WKNSString copyWithZone:]): Retains self.
      
      * Shared/Cocoa/WKNSURL.h: Added.
      * Shared/Cocoa/WKNSURL.mm: Added.
      (-[WKNSURL _web_createTarget]): Override this WKObject method to create an NSURL from
      the WebURL.
      (-[WKNSURL copyWithZone:]): Retains self.
      
      * Shared/Cocoa/WKObject.h: Added.
      * Shared/Cocoa/WKObject.mm: Added.
      (-[WKObject dealloc]): Calls the destructor of the wrapped object and releases the target
      object.
      (initializeTargetIfNeeded): Helper function. Tries to create the target exactly once.
      (-[WKObject isEqual:]): NSObject override that creates and compares to the target
      object if necessary.
      (-[WKObject hash]): NSObject override that creates and hashes the target object if
      there is one.
      (-[WKObject isKindOfClass:]): NSObject override that delegates to the target object.
      (-[WKObject isMemberOfClass:]): Ditto.
      (-[WKObject respondsToSelector:]): NSObject override that creates the target object if
      necessary and returns whether it or self responds to the selector.
      (-[WKObject conformsToProtocol:]): Similarly for protocols.
      (-[WKObject forwardingTargetForSelector:]): NSObject override that creates the target object
      if necessary and returns it as the target.
      (-[WKObject description]): NSObject override that creates the target object if necessary and
      forwards to it.
      (-[WKObject _web_createTarget]): Added. The base implementation returns nil.
      (-[WKObject _apiObject]): Returns the wrapped object.
      
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController backForwardList]): Changed to return the existing wrapper.
      (didChangeBackForwardList): Changed to use existing wrappers.
      
      Replaced the RefPtr<WebBackForwardList> ivar with space for a WebBackForwardList to live
      inside the wrapper.
      (-[WKBackForwardList dealloc]): Call the WebBackForwardList destructor.
      (toWKBackForwardListItem): Changed to us the existing wrapper.
      (-[WKBackForwardList currentItem]): Updated for ivar change.
      (-[WKBackForwardList backItem]): Ditto.
      (-[WKBackForwardList forwardItem]): Ditto.
      (-[WKBackForwardList itemAtIndex:]): Ditto.
      (-[WKBackForwardList backListCount]): Ditto.
      (-[WKBackForwardList forwardListCount]): Ditto,
      (-[WKBackForwardList backListWithLimit:]): Ditto, and also changed to use the
      ImmutableArray’s existing wrapper.
      (-[WKBackForwardList forwardListWithLimit:]): Ditto.
      (-[WKBackForwardList _apiObject]): Returns the WebBackForwardListItem.
      * UIProcess/Cocoa/WKBackForwardListInternal.h:
      (WebKit::wrapper): Added. Returns a WebBackForwardList’s wrapper as a WKBackForwardList.
      
      * UIProcess/Cocoa/WKBackForwardListItem.mm:
      Replaced the RefPtr<WebBackForwardListItem> ivar with space for a WebBackForwardListItem to
      live inside the wrapper.
      (-[WKBackForwardListItem dealloc]): Call the WebBackForwardListItem destructor.
      (-[WKBackForwardListItem URL]): Updated for ivar change, and changed to make an NSURL
      directly instead of going through a wrapper.
      (-[WKBackForwardListItem title]): Updated for ivar change, and changed to use
      String’s operator NSString*.
      (-[WKBackForwardListItem originalURL]): Updated for ivar change, and changed to make an
      NSURL directly instead of going through a wrapper.
      (-[WKBackForwardListItem _apiObject]): Returns the WebBackForwardListItem.
      (-[WKBackForwardListItem _item]): Ditto.
      * UIProcess/Cocoa/WKBackForwardListItemInternal.h:
      (WebKit::wrapper): Added. Returns a WebBackForwardListItem’s wrapper as a
      WKBackForwardListItem.
      
      * UIProcess/WebColorPickerResultListenerProxy.h: Changed into a TypedAPIObject.
      
      * UIProcess/WebFormSubmissionListenerProxy.h:
      (WebKit::WebFormSubmissionListenerProxy::operator new): Override to call newObject.
      
      * UIProcess/WebFramePolicyListenerProxy.h:
      (WebKit::WebFramePolicyListenerProxy::operator new): Ditto.
      
      * WebKit2.xcodeproj/project.pbxproj: Updated for file additions and removals.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2f8b296d
  14. 24 Oct, 2013 1 commit
    • mitz@apple.com's avatar
      [Cocoa] Add -[WKBrowsingContextController goToBackForwardItem:] · 62e60ee4
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=123289
      
      Reviewed by Sam Weinig.
      
      * Shared/API/Cocoa/WKFoundation.h: Defined WK_API_CLASS.
      * UIProcess/API/mac/WKBrowsingContextController.h: Declared -goToBackForwardListItem:.
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController goToBackForwardListItem:]): Added.
      * UIProcess/Cocoa/WKBackForwardList.h: Deployed WK_API_CLASS to make the class exported.
      * UIProcess/Cocoa/WKBackForwardListItem.h: Ditto.
      * UIProcess/Cocoa/WKBackForwardListItem.mm:
      (-[WKBackForwardListItem _item]): Added. Returns the underlying WebBackForwardListItem.
      * UIProcess/Cocoa/WKBackForwardListItemInternal.h: Declared _item.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157951 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62e60ee4
  15. 23 Oct, 2013 1 commit
  16. 21 Oct, 2013 4 commits
    • mitz@apple.com's avatar
      Try to make the 32-bit Mac build happy. · cfd197de
      mitz@apple.com authored
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (setUpPageLoaderClient):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cfd197de
    • mitz@apple.com's avatar
      [Cocoa] Add load delegate method for didChangeBackForwardList · c62c831f
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=123136
      
      Reviewed by Anders Carlsson.
      
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (didChangeBackForwardList): Added. Calls new delegate method.
      (setUpPageLoaderClient):  Hook up new client function.
      * UIProcess/API/mac/WKBrowsingContextLoadDelegate.h: Declare new delegate method.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c62c831f
    • mitz@apple.com's avatar
      Try to fix the Mac 32-bit build. · 183d21ac
      mitz@apple.com authored
      * UIProcess/API/mac/WKBrowsingContextController.h:
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      183d21ac
    • mitz@apple.com's avatar
      [Cocoa] Back/forward list UI process API · b98c3190
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=123109
      
      Reviewed by Darin Adler.
      
      * CMakeLists.txt: Updated for renames.
      * GNUmakefile.list.am: Ditto.
      
      * Shared/Cocoa: Added.
      * Shared/Cocoa/WKNSArray.h: Added. WKNSArray is an internal NSArray subclass backed by
      a WebKit::ImmutableArray.
      * Shared/Cocoa/WKNSArray.mm: Added.
      (+[WKNSArray web_arrayWithImmutableArray:]): Added.
      (-[WKNSArray web_initWithImmutableArray:]): Added.
      (-[WKNSArray count]): Added.
      (-[WKNSArray objectAtIndex:]): Added.
      (-[WKNSArray copyWithZone:]): Added.
      
      * Shared/Cocoa/WKNSObjectExtras.h: Added. Declares a category on NSObject that allows us to
      vend WebKit API objects as Objective-C objects.
      * Shared/Cocoa/WKNSObjectExtras.mm: Added.
      (-[WKObject initWithAPIObject:]): WKObject is the generic Cocoa wrapper for API objects.
      (-[WKObject isEqual:]): Check for equality of the underlying object.
      (-[WKObject hash]): Return a pointer to the underlying object.
      (-[WKObject description]): Added.
      (+[NSObject _web_objectWithAPIObject:]): Added. Returns an appropriate Objective-C object
      for the given API object. Currently returns a WKBackForwardListItem for a back/forward list
      item and a generic WKObject for all other types.
      
      * UIProcess/API/C/WKBackForwardList.cpp: Renamed.
      * UIProcess/API/C/WKBackForwardList.h: Renamed.
      * UIProcess/API/C/WKBackForwardListItem.cpp: Renamed.
      * UIProcess/API/C/WKBackForwardListItem.h: Renamed.
      * UIProcess/API/C/WKBackForwardListItemRef.cpp: Copied from Source/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp.
      * UIProcess/API/C/WKBackForwardListItemRef.h: Copied from Source/WebKit2/UIProcess/API/C/WKBackForwardListItem.h.
      * UIProcess/API/C/WKBackForwardListRef.cpp: Copied from Source/WebKit2/UIProcess/API/C/WKBackForwardList.cpp.
      * UIProcess/API/C/WKBackForwardListRef.h: Copied from Source/WebKit2/UIProcess/API/C/WKBackForwardList.h.
      
      * UIProcess/API/C/WebKit2_C.h: Updated for header renames.
      
      * UIProcess/API/efl/ewk_back_forward_list.cpp: Updated for rename.
      * UIProcess/API/efl/ewk_back_forward_list_item.cpp: Ditto.
      
      * UIProcess/API/mac/WKBrowsingContextController.h: Declared backForwardList property.
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController backForwardList]): Added this accessor.
      
      * UIProcess/Cocoa: Added.
      * UIProcess/Cocoa/WKBackForwardList.h: Added.
      * UIProcess/Cocoa/WKBackForwardList.mm: Added.
      (toWKBackForwardListItem): Added this helper.
      (-[WKBackForwardList currentItem]): Added.
      (-[WKBackForwardList backItem]): Added.
      (-[WKBackForwardList forwardItem]): Added.
      (-[WKBackForwardList itemAtIndex:]): Added.
      (-[WKBackForwardList backListCount]): Added.
      (-[WKBackForwardList forwardListCount]): Added.
      (-[WKBackForwardList backListWithLimit:]): Added.
      (-[WKBackForwardList forwardListWithLimit:]): Added.
      (-[WKBackForwardList _initWithList:]): Added.
      * UIProcess/Cocoa/WKBackForwardListInternal.h: Added.
      
      * UIProcess/Cocoa/WKBackForwardListItem.h: Added.
      * UIProcess/Cocoa/WKBackForwardListItem.mm: Added.
      (-[WKBackForwardListItem URL]): Added.
      (-[WKBackForwardListItem title]): Added.
      (-[WKBackForwardListItem originalURL]): Added.
      (-[WKBackForwardListItem isEqual:]): Check for equality of the underlying object.
      (-[WKBackForwardListItem hash]): Return a pointer to the underlying object
      (-[WKBackForwardListItem _initWithItem:]): Added.
      * UIProcess/Cocoa/WKBackForwardListItemInternal.h: Added.
      
      * WebKit2.xcodeproj/project.pbxproj: Updated for renames and additions.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b98c3190
  17. 20 Oct, 2013 1 commit
    • mitz@apple.com's avatar
      [Cocoa] Loading progress API · 1670bcc2
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=123069
      
      Reviewed by Sam Weinig.
      
      * UIProcess/API/mac/WKBrowsingContextController.h: Declared estimatedProgress property.
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (-[WKBrowsingContextController estimatedProgress]): Added.
      (didStartProgress): Added. Calls new delegate method
      -browsingContextControllerDidStartProgress:.
      (didChangeProgress): Added. Calls new delegate method
      -browsingContextController:estimatedProgressChangedTo:.
      (didFinishProgress): Added. Calls new delegate method
      -browsingContextControllerDidFinishProgress:.
      (setUpPageLoaderClient): Hook up new client functions.
      * UIProcess/API/mac/WKBrowsingContextLoadDelegate.h: Declared new delegate methods.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1670bcc2
  18. 19 Oct, 2013 2 commits
    • mitz@apple.com's avatar
      ccebb056
    • mitz@apple.com's avatar
      [Cocoa] Remove some indirection that was only necessary for supporting the... · 91e027bf
      mitz@apple.com authored
      [Cocoa] Remove some indirection that was only necessary for supporting the legacy Objective-C runtime
      https://bugs.webkit.org/show_bug.cgi?id=123065
      
      Reviewed by Sam Weinig.
      
      * UIProcess/API/mac/WKBrowsingContextController.h: Added WK_API_ENABLED guard. Removed _data
      ivar and WKBrowsingContextControllerData class declaration.
      * UIProcess/API/mac/WKBrowsingContextController.mm: Added WK_API_ENABLED guard. Removed
      WKBrowsingContextControllerData class and moved _pageRef ivar directly into
      WKBrowsingContextController, declaring it in the @implementation. Removed ivar and accessors
      for the loadDelegate property, letting the compiler synthesize them.
      (-[WKBrowsingContextController dealloc]): Removed indirection via _data.
      (-[WKBrowsingContextController _pageRef]): Ditto.
      (-[WKBrowsingContextController loadRequest:userData:]): Removed indirection via -_pageRef.
      (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]): Ditto.
      (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]): Ditto.
      (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
      Ditto.
      (-[WKBrowsingContextController stopLoading]): Ditto.
      (-[WKBrowsingContextController reload]): Ditto.
      (-[WKBrowsingContextController reloadFromOrigin]): Ditto.
      (-[WKBrowsingContextController goForward]): Ditto.
      (-[WKBrowsingContextController canGoForward]): Ditto.
      (-[WKBrowsingContextController goBack]): Ditto.
      (-[WKBrowsingContextController canGoBack]): Ditto.
      (-[WKBrowsingContextController activeURL]): Ditto.
      (-[WKBrowsingContextController provisionalURL]): Ditto.
      (-[WKBrowsingContextController committedURL]): Ditto.
      (-[WKBrowsingContextController title]): Ditto.
      (-[WKBrowsingContextController textZoom]): Ditto.
      (-[WKBrowsingContextController setTextZoom:]): Ditto.
      (-[WKBrowsingContextController pageZoom]): Ditto.
      (-[WKBrowsingContextController setPageZoom:]): Ditto.
      (-[WKBrowsingContextController setPaginationMode:]): Ditto.
      (-[WKBrowsingContextController paginationMode]): Ditto.
      (-[WKBrowsingContextController setPaginationBehavesLikeColumns:]): Ditto.
      (-[WKBrowsingContextController paginationBehavesLikeColumns]): Ditto.
      (-[WKBrowsingContextController setPageLength:]): Ditto.
      (-[WKBrowsingContextController pageLength]): Ditto.
      (-[WKBrowsingContextController setGapBetweenPages:]): Ditto.
      (-[WKBrowsingContextController gapBetweenPages]): Ditto.
      (-[WKBrowsingContextController pageCount]): Ditto.
      (-[WKBrowsingContextController _initWithPageRef:]): Removed indirection via _data.
      * UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Added WK_API_ENABLED guard.
      * UIProcess/API/mac/WKBrowsingContextControllerPrivate.h: Ditto.
      
      * UIProcess/API/mac/WKBrowsingContextGroup.h: Added WK_API_ENABLED guard. Removed _data ivar
      and WKBrowsingContextGroupData class declaration.
      * UIProcess/API/mac/WKBrowsingContextGroup.mm: Added WK_API_ENABLED guard. Removed
      WKBrowsingContextGroupData class and moved _pageGroupRef ivar directly info
      WKBrowsingContextGroup, declaring it in the @implementation.
      (-[WKBrowsingContextGroup initWithIdentifier:]): Removed indirection via _data.
      (-[WKBrowsingContextGroup _pageGroupRef]): Ditto.
      * UIProcess/API/mac/WKBrowsingContextGroupPrivate.h: Added WK_API_ENABLED guard.
      
      * UIProcess/API/mac/WKConnection.h: Added WK_API_ENABLED guard. Removed _data ivar and
      WKConnectionData class declaration.
      * UIProcess/API/mac/WKConnection.mm: Added WK_API_ENABLED guard. Removed WKConnectionData
      class and moved _connectionRef ivar directly into WKConnection, declaring it in the
      @implementation. Removed ivar and accessors for the delegate property, letting the compiler
      synthesize them.
      (-[WKConnection dealloc]): Removed indirection via _data.
      (-[WKConnection sendMessageWithName:body:]): Ditto.
      (-[WKConnection _initWithConnectionRef:]): Ditto.
      * UIProcess/API/mac/WKConnectionInternal.h: Added WK_API_ENABLED guard.
      
      * UIProcess/API/mac/WKProcessGroup.h: Added WK_API_ENABLED guard. Replaced forward
      declaration of WKConnection with an import. Removed _data ivar and WKProcessGroupData class
      declaration.
      * UIProcess/API/mac/WKProcessGroup.mm: Added WK_API_ENABLED guard. Removed
      WKProcessGroupData class and moved _contextRef ivar directly into WKProcessGroup, declaring
      it in the @implementation. Removed ivar and accessors for the delegate property, letting the
      compiler synthesize them.
      (-[WKProcessGroup initWithInjectedBundleURL:]): Removed indirection via _data.
      (-[WKProcessGroup dealloc]): Ditto.
      (-[WKProcessGroup _contextRef]): Ditto.
      * UIProcess/API/mac/WKProcessGroupPrivate.h: Added WK_API_ENABLED guard.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      91e027bf
  19. 18 Oct, 2013 1 commit
  20. 02 Sep, 2013 1 commit
    • darin@apple.com's avatar
      [Mac] No need for HardAutorelease, which is same as CFBridgingRelease · 7ee2f27f
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120569
      
      Reviewed by Andy Estes.
      
      Source/JavaScriptCore:
      
      * API/JSValue.mm:
      (valueToString): Use CFBridgingRelease.
      
      Source/WebCore:
      
      * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
      (AXTextMarkerRange):
      (AXTextMarkerRangeStart):
      (AXTextMarkerRangeEnd):
      (textMarkerForVisiblePosition):
      Use CFBridgingRelease.
      
      * platform/mac/KURLMac.mm:
      (WebCore::KURL::operator NSURL *): Use CFBridgingRelease.
      (WebCore::KURL::createCFURL): Get rid of needless local variable.
      
      * platform/mac/WebCoreNSURLExtras.mm:
      (WebCore::mapHostNameWithRange):
      (WebCore::URLWithData):
      (WebCore::userVisibleString):
      * platform/text/mac/StringImplMac.mm:
      (WTF::StringImpl::operator NSString *):
      Use CFBridgingRelease.
      
      Source/WebKit/mac:
      
      * Misc/WebNSFileManagerExtras.mm:
      (-[NSFileManager _webkit_startupVolumeName]): Removed some unneeded locals.
      Got rid of the pointless ref/leakRef/HardAutorelease dance, and replaced it
      with a [[x copy] autorelease].
      
      * Misc/WebNSURLExtras.mm:
      (-[NSURL _web_URLWithLowercasedScheme]): Use CFBridgingRelease, and got rid
      of unneeded type casts.
      
      * Plugins/WebBasePluginPackage.mm:
      (+[WebBasePluginPackage preferredLocalizationName]): Use CFBridgingRelease.
      * WebView/WebPDFRepresentation.mm:
      (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Ditto.
      
      * WebView/WebView.mm:
      (+[WebView _setCacheModel:]): Use CFBridgingRelease and got rid of unneeded
      type cast.
      
      Source/WebKit2:
      
      * Platform/mac/StringUtilities.mm:
      (WebKit::nsStringFromWebCoreString): Use CFBridgingRelease. Also
      changed condition to be a little cleaner and use a constant string for empty
      strings as well as null strings.
      
      * UIProcess/API/mac/WKBrowsingContextController.mm:
      (autoreleased): Switched from autorelease to CFBridgingRelease for strings,
      which eliminates a type cast and makes this work under GC, although I don't
      think we should compile WebKit2 for GC.
      
      * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm:
      (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
      Use CFBridgingRelease.
      
      Source/WTF:
      
      * wtf/ObjcRuntimeExtras.h: Added a FIXME about miscapitalization of ObjC.
      Deleted HardAutorelease.
      (wtfObjcMsgSend): Dropped the use of abbreviations in local class and argument names.
      (wtfCallIMP): Ditto.
      
      Tools:
      
      * DumpRenderTree/mac/DumpRenderTree.mm:
      (dump): Use CFBridgingRelease.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7ee2f27f