Add WKProcessClass class
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jan 2014 19:26:37 +0000 (19:26 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jan 2014 19:26:37 +0000 (19:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127433
<rdar://problem/15882582>

Reviewed by Dan Bernstein.

Add a stubbed out WKProcessClass class.

* Shared/API/Cocoa/WKFoundation.h:
* UIProcess/API/Cocoa/WKProcessClass.h: Added.
* UIProcess/API/Cocoa/WKProcessClass.mm: Added.
(-[WKProcessClass initWithConfiguration:]):
(-[WKProcessClass configuration]):
* UIProcess/API/Cocoa/WKProcessClassConfiguration.mm:
* WebKit2.xcodeproj/project.pbxproj:

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/Cocoa/WKFoundation.h
Source/WebKit2/UIProcess/API/Cocoa/WKProcessClass.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/Cocoa/WKProcessClass.mm [new file with mode: 0644]
Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassConfiguration.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

index 4cd4b07..d87c88b 100644 (file)
@@ -1,3 +1,21 @@
+2014-01-22  Anders Carlsson  <andersca@apple.com>
+
+        Add WKProcessClass class
+        https://bugs.webkit.org/show_bug.cgi?id=127433
+        <rdar://problem/15882582>
+
+        Reviewed by Dan Bernstein.
+
+        Add a stubbed out WKProcessClass class.
+
+        * Shared/API/Cocoa/WKFoundation.h:
+        * UIProcess/API/Cocoa/WKProcessClass.h: Added.
+        * UIProcess/API/Cocoa/WKProcessClass.mm: Added.
+        (-[WKProcessClass initWithConfiguration:]):
+        (-[WKProcessClass configuration]):
+        * UIProcess/API/Cocoa/WKProcessClassConfiguration.mm:
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2014-01-22  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
 
         [EFL][GTK] Get EFL and GTK compiling with ACCESSIBILITY disabled
index 662c3d9..f95dc57 100644 (file)
@@ -34,3 +34,5 @@
 #define WK_API_CLASS __attribute__((visibility("default")))
 #endif
 #endif
+
+#define WK_DESIGNATED_INITIALIZER
diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKProcessClass.h b/Source/WebKit2/UIProcess/API/Cocoa/WKProcessClass.h
new file mode 100644 (file)
index 0000000..bcde89b
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+#import <WebKit2/WKFoundation.h>
+
+#if WK_API_ENABLED
+
+@class WKProcessClassConfiguration;
+
+/*! A WKProcessClass defines a distinct type—or category—of Web Content process.
+ A @link WKWebView @/link specifies the WKProcessClass of the Web
+ Content process backing it through its @link WKWebViewConfiguration @/link.
+ @helperclass @link WKProcessClassConfiguration @/link
+ Used to configure @link WKProcessClass @/link instances.
+ */
+WK_API_CLASS
+@interface WKProcessClass : NSObject
+
+/*! @abstract A copy of the configuration with which the @link WKProcessClass @/link was
+        initialized.
+*/
+@property (nonatomic, readonly) WKProcessClassConfiguration *configuration;
+
+/*!
+    @abstract Returns an instance initialized with the specified configuration.
+    @param configuration The configuration for the new instance.
+    @result An initialized instance, or nil if the object could not be initialized.
+    @discussion This is a designated initializer. You can use @link -init @/link to initialize an
+        instance with the default configuration.
+
+        The initializer copies
+        @link //apple_ref/doc/methodparam/WKProcessClass/initWithConfiguration:/configuration
+        configuration@/link, so mutating it after initialization has no effect on the
+        @link WKProcessClass @/link instance.
+*/
+- (instancetype)initWithConfiguration:(WKProcessClassConfiguration *)configuration WK_DESIGNATED_INITIALIZER;
+
+@end
+
+#endif
diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKProcessClass.mm b/Source/WebKit2/UIProcess/API/Cocoa/WKProcessClass.mm
new file mode 100644 (file)
index 0000000..7da24bd
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WKProcessClass.h"
+
+#if WK_API_ENABLED
+
+#import <wtf/RetainPtr.h>
+
+@implementation WKProcessClass {
+    RetainPtr<WKProcessClassConfiguration> _configuration;
+}
+
+- (instancetype)initWithConfiguration:(WKProcessClassConfiguration *)configuration
+{
+    if (!(self = [super init]))
+        return nil;
+
+    _configuration = adoptNS([configuration copy]);
+
+    // FIXME: Create a WebContext.
+
+    return self;
+}
+
+- (WKProcessClassConfiguration *)configuration
+{
+    return [[_configuration copy] autorelease];
+}
+
+@end
+
+#endif // WK_API_ENABLED
index 5364c42..583a216 100644 (file)
@@ -23,8 +23,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
-#include "WKProcessClassConfigurationPrivate.h"
+#import "config.h"
+#import "WKProcessClassConfigurationPrivate.h"
 
 #if WK_API_ENABLED
 
index 52abc1d..df93309 100644 (file)
@@ -90,6 +90,8 @@
                1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */; };
                1A0F29E3120B44420053D1B9 /* VisitedLinkProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0F29E1120B44420053D1B9 /* VisitedLinkProvider.cpp */; };
                1A0F29E4120B44420053D1B9 /* VisitedLinkProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0F29E2120B44420053D1B9 /* VisitedLinkProvider.h */; };
+               1A158419189044F50017616C /* WKProcessClass.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A158417189044F50017616C /* WKProcessClass.mm */; };
+               1A15841A189044F50017616C /* WKProcessClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A158418189044F50017616C /* WKProcessClass.h */; };
                1A17977F137EE82C00F97D45 /* PluginCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A17977D137EE82C00F97D45 /* PluginCreationParameters.cpp */; };
                1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A17977E137EE82C00F97D45 /* PluginCreationParameters.h */; };
                1A186EEA12EF7618008E5F37 /* LayerTreeHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A186EE812EF7618008E5F37 /* LayerTreeHost.h */; };
                1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkTable.h; sourceTree = "<group>"; };
                1A0F29E1120B44420053D1B9 /* VisitedLinkProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkProvider.cpp; sourceTree = "<group>"; };
                1A0F29E2120B44420053D1B9 /* VisitedLinkProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkProvider.h; sourceTree = "<group>"; };
+               1A158417189044F50017616C /* WKProcessClass.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKProcessClass.mm; sourceTree = "<group>"; };
+               1A158418189044F50017616C /* WKProcessClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProcessClass.h; sourceTree = "<group>"; };
                1A17635416B1D5D000D88FD6 /* StorageNamespaceImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespaceImpl.cpp; sourceTree = "<group>"; };
                1A17635516B1D5D000D88FD6 /* StorageNamespaceImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageNamespaceImpl.h; sourceTree = "<group>"; };
                1A17977D137EE82C00F97D45 /* PluginCreationParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginCreationParameters.cpp; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                1A43E826188F38E2009E4D30 /* Deprecated */,
+                               1A158418189044F50017616C /* WKProcessClass.h */,
+                               1A158417189044F50017616C /* WKProcessClass.mm */,
                                1A43E828188F3CDC009E4D30 /* WKProcessClassConfiguration.h */,
                                1A43E827188F3CDC009E4D30 /* WKProcessClassConfiguration.mm */,
                                1A43E82B188F3CF5009E4D30 /* WKProcessClassConfigurationPrivate.h */,
                                BCB9E24B1120E15C00A137E0 /* WKContext.h in Headers */,
                                51A555F6128C6C47009ABCEC /* WKContextMenuItem.h in Headers */,
                                51A55601128C6D92009ABCEC /* WKContextMenuItemTypes.h in Headers */,
+                               1A15841A189044F50017616C /* WKProcessClass.h in Headers */,
                                1AB8A1EE18400ACB00E9AE69 /* WKPagePolicyClient.h in Headers */,
                                37183D57182F4E700080C811 /* WKNSURLExtras.h in Headers */,
                                BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */,
                                BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */,
                                BC111A5F112F4FBB00337BAB /* WebFrameLoaderClient.cpp in Sources */,
                                9391F2CA121B679A00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */,
+                               1A158419189044F50017616C /* WKProcessClass.mm in Sources */,
                                BCB9F6A11123A84B00A137E0 /* WebFramePolicyListenerProxy.cpp in Sources */,
                                BC111B0E112F5E4F00337BAB /* WebFrameProxy.cpp in Sources */,
                                CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */,