Title: [98184] trunk/Source/WebKit2
Revision
98184
Author
wei...@apple.com
Date
2011-10-21 19:51:33 -0700 (Fri, 21 Oct 2011)

Log Message

Add WKBrowsingContextGroup which wraps WKPageGroupRef
https://bugs.webkit.org/show_bug.cgi?id=70665

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKBrowsingContextGroup.h: Added.
* UIProcess/API/mac/WKBrowsingContextGroup.mm: Added.
(-[WKBrowsingContextGroup initWithIdentifier:]):
(-[WKBrowsingContextGroup dealloc]):
(-[WKBrowsingContextGroup pageGroupRef]):
* UIProcess/API/mac/WKBrowsingContextGroupInternal.h: Added.
* UIProcess/API/mac/WKView.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:processGroup:browsingContextGroup:]):
* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (98183 => 98184)


--- trunk/Source/WebKit2/ChangeLog	2011-10-22 02:24:23 UTC (rev 98183)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-22 02:51:33 UTC (rev 98184)
@@ -1,5 +1,23 @@
 2011-10-21  Sam Weinig  <s...@webkit.org>
 
+        Add WKBrowsingContextGroup which wraps WKPageGroupRef
+        https://bugs.webkit.org/show_bug.cgi?id=70665
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/mac/WKBrowsingContextGroup.h: Added.
+        * UIProcess/API/mac/WKBrowsingContextGroup.mm: Added.
+        (-[WKBrowsingContextGroup initWithIdentifier:]):
+        (-[WKBrowsingContextGroup dealloc]):
+        (-[WKBrowsingContextGroup pageGroupRef]):
+        * UIProcess/API/mac/WKBrowsingContextGroupInternal.h: Added.
+        * UIProcess/API/mac/WKView.h:
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView initWithFrame:processGroup:browsingContextGroup:]):
+        * WebKit2.xcodeproj/project.pbxproj:
+
+2011-10-21  Sam Weinig  <s...@webkit.org>
+
         Mark member variables of WebKit2 API @private
         https://bugs.webkit.org/show_bug.cgi?id=70655
 

Added: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h (0 => 98184)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h	2011-10-22 02:51:33 UTC (rev 98184)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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/WKBase.h>
+
+@class WKBrowsingContextGroupData;
+
+WK_EXPORT
+@interface WKBrowsingContextGroup : NSObject {
+@private
+    WKBrowsingContextGroupData *_data;
+}
+
+- (id)initWithIdentifier:(NSString *)identifier;
+
+@end

Added: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm (0 => 98184)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm	2011-10-22 02:51:33 UTC (rev 98184)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 "WKBrowsingContextGroup.h"
+#import "WKBrowsingContextGroupInternal.h"
+
+#import "WKPageGroup.h"
+#import "WKRetainPtr.h"
+#import "WKStringCF.h"
+
+@interface WKBrowsingContextGroupData : NSObject {
+@public
+    WKRetainPtr<WKPageGroupRef> _pageGroupRef;
+}
+@end
+
+@implementation WKBrowsingContextGroupData
+@end
+
+@implementation WKBrowsingContextGroup
+
+- (id)initWithIdentifier:(NSString *)identifier
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    _data = [[WKBrowsingContextGroupData alloc] init];
+    _data->_pageGroupRef = adoptWK(WKPageGroupCreateWithIdentifier(adoptWK(WKStringCreateWithCFString((CFStringRef)identifier)).get()));
+
+    return self;
+}
+
+- (void)dealloc
+{
+    [_data release];
+    [super dealloc];
+}
+
+@end
+
+@implementation WKBrowsingContextGroup (Internal)
+
+- (WKPageGroupRef)pageGroupRef
+{
+    return _data->_pageGroupRef.get();
+}
+
+@end

Added: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupInternal.h (0 => 98184)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupInternal.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroupInternal.h	2011-10-22 02:51:33 UTC (rev 98184)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 <WebKit2/WKBrowsingContextGroup.h>
+
+@interface WKBrowsingContextGroup (Internal)
+
+@property(readonly) WKPageGroupRef pageGroupRef;
+
+@end

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm (98183 => 98184)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm	2011-10-22 02:24:23 UTC (rev 98183)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm	2011-10-22 02:51:33 UTC (rev 98184)
@@ -55,10 +55,9 @@
 
     _data = [[WKProcessGroupData alloc] init];
     
-    if (bundleURL) {
-        WKRetainPtr<WKStringRef> bundleURLString = adoptWK(WKStringCreateWithCFString((CFStringRef)[bundleURL absoluteString]));
-        _data->_contextRef = adoptWK(WKContextCreateWithInjectedBundlePath(bundleURLString.get()));
-    } else
+    if (bundleURL)
+        _data->_contextRef = adoptWK(WKContextCreateWithInjectedBundlePath(adoptWK(WKStringCreateWithCFString((CFStringRef)[bundleURL absoluteString])).get()));
+    else
         _data->_contextRef = adoptWK(WKContextCreate());
 
     return self;

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.h (98183 => 98184)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.h	2011-10-22 02:24:23 UTC (rev 98183)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.h	2011-10-22 02:51:33 UTC (rev 98184)
@@ -27,6 +27,7 @@
 #import <WebKit2/WKBase.h>
 
 @class WKBrowsingContextController;
+@class WKBrowsingContextGroup;
 @class WKProcessGroup;
 @class WKViewData;
 
@@ -37,7 +38,7 @@
     unsigned _unused;
 }
 
-- (id)initWithFrame:(NSRect)frame processCluster:(WKProcessGroup *)processCluster;
+- (id)initWithFrame:(NSRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup;
 
 @property(readonly) WKBrowsingContextController *browsingContextController;
 

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (98183 => 98184)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-10-22 02:24:23 UTC (rev 98183)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-10-22 02:51:33 UTC (rev 98184)
@@ -73,8 +73,9 @@
 #import <wtf/RetainPtr.h>
 
 /* API internals. */
+#import "WKBrowsingContextControllerInternal.h"
+#import "WKBrowsingContextGroupInternal.h"
 #import "WKProcessGroupInternal.h"
-#import "WKBrowsingContextControllerInternal.h"
 
 
 @interface NSApplication (WKNSApplicationDetails)
@@ -198,9 +199,9 @@
 
 @implementation WKView
 
-- (id)initWithFrame:(NSRect)frame processCluster:(WKProcessGroup *)processCluster
+- (id)initWithFrame:(NSRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup
 {
-    return [self initWithFrame:frame contextRef:processCluster.contextRef pageGroupRef:0];
+    return [self initWithFrame:frame contextRef:processGroup.contextRef pageGroupRef:browsingContextGroup.pageGroupRef];
 }
 
 - (void)dealloc

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (98183 => 98184)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2011-10-22 02:24:23 UTC (rev 98183)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2011-10-22 02:51:33 UTC (rev 98184)
@@ -692,6 +692,9 @@
 		BCBAACEB145225E30053F82F /* WKProcessGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBAACE5145225C90053F82F /* WKProcessGroup.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		BCBAACEC145225E30053F82F /* WKProcessGroup.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCBAACE6145225CA0053F82F /* WKProcessGroup.mm */; };
 		BCBAACED145225E30053F82F /* WKProcessGroupInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBAACE7145225CB0053F82F /* WKProcessGroupInternal.h */; };
+		BCBAACF41452324F0053F82F /* WKBrowsingContextGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBAACEE145232430053F82F /* WKBrowsingContextGroup.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		BCBAACF51452324F0053F82F /* WKBrowsingContextGroup.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCBAACEF145232440053F82F /* WKBrowsingContextGroup.mm */; };
+		BCBAACF61452324F0053F82F /* WKBrowsingContextGroupInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBAACF0145232480053F82F /* WKBrowsingContextGroupInternal.h */; };
 		BCBCB0CB1215E32100DE59CA /* ImmutableDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBCB0CA1215E32100DE59CA /* ImmutableDictionary.h */; };
 		BCBCB0CD1215E33A00DE59CA /* ImmutableDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBCB0CC1215E33A00DE59CA /* ImmutableDictionary.cpp */; };
 		BCBD3914125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD3912125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp */; };
@@ -1654,6 +1657,9 @@
 		BCBAACE5145225C90053F82F /* WKProcessGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProcessGroup.h; sourceTree = "<group>"; };
 		BCBAACE6145225CA0053F82F /* WKProcessGroup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKProcessGroup.mm; sourceTree = "<group>"; };
 		BCBAACE7145225CB0053F82F /* WKProcessGroupInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProcessGroupInternal.h; sourceTree = "<group>"; };
+		BCBAACEE145232430053F82F /* WKBrowsingContextGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextGroup.h; sourceTree = "<group>"; };
+		BCBAACEF145232440053F82F /* WKBrowsingContextGroup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKBrowsingContextGroup.mm; sourceTree = "<group>"; };
+		BCBAACF0145232480053F82F /* WKBrowsingContextGroupInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextGroupInternal.h; sourceTree = "<group>"; };
 		BCBCB0CA1215E32100DE59CA /* ImmutableDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImmutableDictionary.h; sourceTree = "<group>"; };
 		BCBCB0CC1215E33A00DE59CA /* ImmutableDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImmutableDictionary.cpp; sourceTree = "<group>"; };
 		BCBD38FA125BAB9A00D2C29F /* WebPageProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebPageProxy.messages.in; sourceTree = "<group>"; };
@@ -2925,6 +2931,9 @@
 				BCBAAC6C144E61910053F82F /* WKBrowsingContextController.h */,
 				BCBAAC6D144E61920053F82F /* WKBrowsingContextController.mm */,
 				BCBAAC6E144E61920053F82F /* WKBrowsingContextControllerInternal.h */,
+				BCBAACEE145232430053F82F /* WKBrowsingContextGroup.h */,
+				BCBAACEF145232440053F82F /* WKBrowsingContextGroup.mm */,
+				BCBAACF0145232480053F82F /* WKBrowsingContextGroupInternal.h */,
 				BCBAACE5145225C90053F82F /* WKProcessGroup.h */,
 				BCBAACE6145225CA0053F82F /* WKProcessGroup.mm */,
 				BCBAACE7145225CB0053F82F /* WKProcessGroupInternal.h */,
@@ -3912,6 +3921,8 @@
 				BCBAAC74144E61A50053F82F /* WKBrowsingContextControllerInternal.h in Headers */,
 				BCBAACEB145225E30053F82F /* WKProcessGroup.h in Headers */,
 				BCBAACED145225E30053F82F /* WKProcessGroupInternal.h in Headers */,
+				BCBAACF41452324F0053F82F /* WKBrowsingContextGroup.h in Headers */,
+				BCBAACF61452324F0053F82F /* WKBrowsingContextGroupInternal.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4603,6 +4614,7 @@
 				B62E7310143047A60069EC35 /* WKHitTestResult.cpp in Sources */,
 				BCBAAC72144E61990053F82F /* WKBrowsingContextController.mm in Sources */,
 				BCBAACEC145225E30053F82F /* WKProcessGroup.mm in Sources */,
+				BCBAACF51452324F0053F82F /* WKBrowsingContextGroup.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to