Commit cc912cec authored by aroben@apple.com's avatar aroben@apple.com

Expose UserContentURLPattern as WebKit SPI

Fixes <http://webkit.org/b/37354>.

Reviewed by Tim Hatcher.

WebCore:

* WebCore.base.exp: Export UserContentURLPattern::parse, and sorted
the file.

* WebCore.xcodeproj/project.pbxproj: Marked UserContentURLPattern.h as
"Private".

* page/UserContentURLPattern.h:
(WebCore::UserContentURLPattern::UserContentURLPattern): Added a
default constructor.
(WebCore::UserContentURLPattern::isValid): Added this getter.

WebKit:

* WebKit.xcodeproj/project.pbxproj: Add WebUserContentURLPattern.

WebKit/mac:

* Misc/WebUserContentURLPattern.h: Added.

* Misc/WebUserContentURLPattern.mm: Added.
(-[WebUserContentURLPattern initWithPatternString:]): Initialize
_private and then parse the passed-in string into a
UserContentURLPattern.
(-[WebUserContentURLPattern dealloc]): Release _private.

(-[WebUserContentURLPattern isValid]):
(-[WebUserContentURLPattern scheme]):
(-[WebUserContentURLPattern host]):
(-[WebUserContentURLPattern matchesSubdomains]):
Call through to UserContentURLPattern.

WebKit/win:

* Interfaces/IWebUserContentURLPattern.idl: Added.

* Interfaces/WebKit.idl: Added WebUserContentURLPattern.

* WebKit.vcproj/Interfaces.vcproj: Added IWebUserContentURLPattern.

* WebKit.vcproj/WebKit.vcproj: Added WebUserContentURLPattern.

* WebUserContentURLPattern.cpp: Added.
(WebUserContentURLPattern::WebUserContentURLPattern):
(WebUserContentURLPattern::~WebUserContentURLPattern):
(WebUserContentURLPattern::createInstance):
(WebUserContentURLPattern::AddRef):
(WebUserContentURLPattern::Release):
(WebUserContentURLPattern::QueryInterface):
Standard COM implementations.

(WebUserContentURLPattern::parse): Parse the string into a
UserContentURLPattern and store it.

(WebUserContentURLPattern::isValid):
(WebUserContentURLPattern::scheme):
(WebUserContentURLPattern::host):
(WebUserContentURLPattern::matchesSubdomains):
Call through to UserContentURLPattern.

* WebUserContentURLPattern.h: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ad36374a
2010-04-15 Adam Roben <aroben@apple.com>
Expose UserContentURLPattern as WebKit SPI
Fixes <http://webkit.org/b/37354>.
Reviewed by Tim Hatcher.
* WebCore.base.exp: Export UserContentURLPattern::parse, and sorted
the file.
* WebCore.xcodeproj/project.pbxproj: Marked UserContentURLPattern.h as
"Private".
* page/UserContentURLPattern.h:
(WebCore::UserContentURLPattern::UserContentURLPattern): Added a
default constructor.
(WebCore::UserContentURLPattern::isValid): Added this getter.
2010-04-15 Chris Fleizach <cfleizach@apple.com> 2010-04-15 Chris Fleizach <cfleizach@apple.com>
Reviewed by Beth Dakin. Reviewed by Beth Dakin.
...@@ -312,9 +312,9 @@ __ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE ...@@ -312,9 +312,9 @@ __ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE
__ZN7WebCore14SecurityOrigin18shouldHideReferrerERKNS_4KURLERKNS_6StringE __ZN7WebCore14SecurityOrigin18shouldHideReferrerERKNS_4KURLERKNS_6StringE
__ZN7WebCore14SecurityOrigin24registerURLSchemeAsLocalERKNS_6StringE __ZN7WebCore14SecurityOrigin24registerURLSchemeAsLocalERKNS_6StringE
__ZN7WebCore14SecurityOrigin25registerURLSchemeAsSecureERKNS_6StringE __ZN7WebCore14SecurityOrigin25registerURLSchemeAsSecureERKNS_6StringE
__ZN7WebCore14SecurityOrigin27resetOriginAccessWhitelistsEv
__ZN7WebCore14SecurityOrigin29addOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b __ZN7WebCore14SecurityOrigin29addOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b
__ZN7WebCore14SecurityOrigin32removeOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b __ZN7WebCore14SecurityOrigin32removeOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b
__ZN7WebCore14SecurityOrigin27resetOriginAccessWhitelistsEv
__ZN7WebCore14SecurityOrigin40setDomainRelaxationForbiddenForURLSchemeEbRKNS_6StringE __ZN7WebCore14SecurityOrigin40setDomainRelaxationForbiddenForURLSchemeEbRKNS_6StringE
__ZN7WebCore14SecurityOrigin6createERKNS_4KURLEi __ZN7WebCore14SecurityOrigin6createERKNS_4KURLEi
__ZN7WebCore14SecurityOrigin7canLoadERKNS_4KURLERKNS_6StringEPNS_8DocumentE __ZN7WebCore14SecurityOrigin7canLoadERKNS_4KURLERKNS_6StringEPNS_8DocumentE
...@@ -444,6 +444,7 @@ __ZN7WebCore21SVGDocumentExtensions21sampleAnimationAtTimeERKNS_6StringEPNS_14SV ...@@ -444,6 +444,7 @@ __ZN7WebCore21SVGDocumentExtensions21sampleAnimationAtTimeERKNS_6StringEPNS_14SV
__ZN7WebCore21SerializedScriptValue11deserializeEPK15OpaqueJSContextPPK13OpaqueJSValue __ZN7WebCore21SerializedScriptValue11deserializeEPK15OpaqueJSContextPPK13OpaqueJSValue
__ZN7WebCore21SerializedScriptValue6createEPK15OpaqueJSContextPK13OpaqueJSValuePS6_ __ZN7WebCore21SerializedScriptValue6createEPK15OpaqueJSContextPK13OpaqueJSValuePS6_
__ZN7WebCore21SerializedScriptValueD1Ev __ZN7WebCore21SerializedScriptValueD1Ev
__ZN7WebCore21UserContentURLPattern5parseERKNS_6StringE
__ZN7WebCore21WindowsLatin1EncodingEv __ZN7WebCore21WindowsLatin1EncodingEv
__ZN7WebCore21findEventWithKeyStateEPNS_5EventE __ZN7WebCore21findEventWithKeyStateEPNS_5EventE
__ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE __ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
......
...@@ -4502,7 +4502,7 @@ ...@@ -4502,7 +4502,7 @@
BCA85A100C3AEAF4006F8308 /* DOMSVGNumberInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */; }; BCA85A100C3AEAF4006F8308 /* DOMSVGNumberInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */; };
BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */; }; BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */; };
BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */; }; BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */; };
BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */; }; BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */; }; BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */; };
BCB16C170979C3BD00467741 /* Cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16BFE0979C3BD00467741 /* Cache.cpp */; }; BCB16C170979C3BD00467741 /* Cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16BFE0979C3BD00467741 /* Cache.cpp */; };
BCB16C180979C3BD00467741 /* Cache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16BFF0979C3BD00467741 /* Cache.h */; settings = {ATTRIBUTES = (Private, ); }; }; BCB16C180979C3BD00467741 /* Cache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16BFF0979C3BD00467741 /* Cache.h */; settings = {ATTRIBUTES = (Private, ); }; };
...@@ -35,12 +35,16 @@ class KURL; ...@@ -35,12 +35,16 @@ class KURL;
class UserContentURLPattern { class UserContentURLPattern {
public: public:
UserContentURLPattern() : m_invalid(true), m_matchSubdomains(false) { }
UserContentURLPattern(const String& pattern) UserContentURLPattern(const String& pattern)
: m_matchSubdomains(false) : m_matchSubdomains(false)
{ {
m_invalid = !parse(pattern); m_invalid = !parse(pattern);
} }
bool isValid() const { return !m_invalid; }
bool matches(const KURL&) const; bool matches(const KURL&) const;
const String& scheme() const { return m_scheme; } const String& scheme() const { return m_scheme; }
......
2010-04-15 Adam Roben <aroben@apple.com>
Expose UserContentURLPattern as WebKit SPI
Fixes <http://webkit.org/b/37354>.
Reviewed by Tim Hatcher.
* WebKit.xcodeproj/project.pbxproj: Add WebUserContentURLPattern.
2010-04-15 Leandro Pereira <leandro@profusion.mobi> 2010-04-15 Leandro Pereira <leandro@profusion.mobi>
Reviewed by Kenneth Rohde Christiansen. Reviewed by Kenneth Rohde Christiansen.
......
...@@ -340,6 +340,8 @@ ...@@ -340,6 +340,8 @@
C0B1F7E910AC8E3100C925D9 /* WebScriptWorld.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0B1F7E610AC8E3100C925D9 /* WebScriptWorld.mm */; }; C0B1F7E910AC8E3100C925D9 /* WebScriptWorld.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0B1F7E610AC8E3100C925D9 /* WebScriptWorld.mm */; };
C0B1F7EA10AC8E3100C925D9 /* WebScriptWorldInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B1F7E710AC8E3100C925D9 /* WebScriptWorldInternal.h */; }; C0B1F7EA10AC8E3100C925D9 /* WebScriptWorldInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B1F7E710AC8E3100C925D9 /* WebScriptWorldInternal.h */; };
C0B88E8B10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; C0B88E8B10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */; };
DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; }; DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; };
DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; }; DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; };
DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */; }; DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */; };
...@@ -638,6 +640,8 @@ ...@@ -638,6 +640,8 @@
C0B1F7E610AC8E3100C925D9 /* WebScriptWorld.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScriptWorld.mm; sourceTree = "<group>"; }; C0B1F7E610AC8E3100C925D9 /* WebScriptWorld.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScriptWorld.mm; sourceTree = "<group>"; };
C0B1F7E710AC8E3100C925D9 /* WebScriptWorldInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptWorldInternal.h; sourceTree = "<group>"; }; C0B1F7E710AC8E3100C925D9 /* WebScriptWorldInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptWorldInternal.h; sourceTree = "<group>"; };
C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoadDelegatePrivate.h; sourceTree = "<group>"; }; C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoadDelegatePrivate.h; sourceTree = "<group>"; };
C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUserContentURLPattern.h; sourceTree = "<group>"; };
C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebUserContentURLPattern.mm; sourceTree = "<group>"; };
DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = "<group>"; }; DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = "<group>"; };
DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebElementDictionary.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebElementDictionary.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
...@@ -952,6 +956,8 @@ ...@@ -952,6 +956,8 @@
F59668C802AD2923018635CA /* WebStringTruncator.h */, F59668C802AD2923018635CA /* WebStringTruncator.h */,
F59668C902AD2923018635CA /* WebStringTruncator.mm */, F59668C902AD2923018635CA /* WebStringTruncator.mm */,
DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */, DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */,
C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */,
C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */,
); );
name = Misc; name = Misc;
path = mac/Misc; path = mac/Misc;
...@@ -1539,6 +1545,7 @@ ...@@ -1539,6 +1545,7 @@
939810710824BF01008DF038 /* WebViewPrivate.h in Headers */, 939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
0FD3B0F81076C3F700039B96 /* WebWindowAnimation.h in Headers */, 0FD3B0F81076C3F700039B96 /* WebWindowAnimation.h in Headers */,
41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */, 41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */,
C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -1896,6 +1903,7 @@ ...@@ -1896,6 +1903,7 @@
939810E80824BF01008DF038 /* WebViewFactory.mm in Sources */, 939810E80824BF01008DF038 /* WebViewFactory.mm in Sources */,
0FD3B0F91076C3F700039B96 /* WebWindowAnimation.m in Sources */, 0FD3B0F91076C3F700039B96 /* WebWindowAnimation.m in Sources */,
41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */, 41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */,
C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
2010-04-15 Adam Roben <aroben@apple.com>
Expose UserContentURLPattern as WebKit SPI
Fixes <http://webkit.org/b/37354>.
Reviewed by Tim Hatcher.
* Misc/WebUserContentURLPattern.h: Added.
* Misc/WebUserContentURLPattern.mm: Added.
(-[WebUserContentURLPattern initWithPatternString:]): Initialize
_private and then parse the passed-in string into a
UserContentURLPattern.
(-[WebUserContentURLPattern dealloc]): Release _private.
(-[WebUserContentURLPattern isValid]):
(-[WebUserContentURLPattern scheme]):
(-[WebUserContentURLPattern host]):
(-[WebUserContentURLPattern matchesSubdomains]):
Call through to UserContentURLPattern.
2010-04-13 Geoffrey Garen <ggaren@apple.com> 2010-04-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt. Reviewed by Oliver Hunt.
......
/*
* Copyright (C) 2010 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.
*/
@class WebUserContentURLPatternPrivate;
@interface WebUserContentURLPattern : NSObject {
WebUserContentURLPatternPrivate *_private;
}
- (id)initWithPatternString:(NSString *)patternString;
- (BOOL)isValid;
- (NSString *)scheme;
- (NSString *)host;
- (BOOL)matchesSubdomains;
@end
/*
* Copyright (C) 2010 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 "WebUserContentURLPattern.h"
#import <WebCore/UserContentURLPattern.h>
using namespace WebCore;
@interface WebUserContentURLPatternPrivate : NSObject
{
@public
UserContentURLPattern pattern;
}
@end
@implementation WebUserContentURLPatternPrivate
@end
@implementation WebUserContentURLPattern
- (id)initWithPatternString:(NSString *)patternString
{
self = [super init];
if (!self)
return nil;
_private = [[WebUserContentURLPatternPrivate alloc] init];
_private->pattern = UserContentURLPattern(patternString);
return self;
}
- (void)dealloc
{
[_private release];
_private = nil;
[super dealloc];
}
- (BOOL)isValid
{
return _private->pattern.isValid();
}
- (NSString *)scheme
{
return _private->pattern.scheme();
}
- (NSString *)host
{
return _private->pattern.host();
}
- (BOOL)matchesSubdomains
{
return _private->pattern.matchSubdomains();
}
@end
2010-04-15 Adam Roben <aroben@apple.com>
Expose UserContentURLPattern as WebKit SPI
Fixes <http://webkit.org/b/37354>.
Reviewed by Tim Hatcher.
* Interfaces/IWebUserContentURLPattern.idl: Added.
* Interfaces/WebKit.idl: Added WebUserContentURLPattern.
* WebKit.vcproj/Interfaces.vcproj: Added IWebUserContentURLPattern.
* WebKit.vcproj/WebKit.vcproj: Added WebUserContentURLPattern.
* WebUserContentURLPattern.cpp: Added.
(WebUserContentURLPattern::WebUserContentURLPattern):
(WebUserContentURLPattern::~WebUserContentURLPattern):
(WebUserContentURLPattern::createInstance):
(WebUserContentURLPattern::AddRef):
(WebUserContentURLPattern::Release):
(WebUserContentURLPattern::QueryInterface):
Standard COM implementations.
(WebUserContentURLPattern::parse): Parse the string into a
UserContentURLPattern and store it.
(WebUserContentURLPattern::isValid):
(WebUserContentURLPattern::scheme):
(WebUserContentURLPattern::host):
(WebUserContentURLPattern::matchesSubdomains):
Call through to UserContentURLPattern.
* WebUserContentURLPattern.h: Added.
2010-04-14 Adam Roben <aroben@apple.com> 2010-04-14 Adam Roben <aroben@apple.com>
Expose DOMWrapperWorld::unregisterWorld as WebKit SPI on Windows Expose DOMWrapperWorld::unregisterWorld as WebKit SPI on Windows
......
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DO_NO_IMPORTS
import "oaidl.idl";
import "ocidl.idl";
#endif
[
object,
oleautomation,
uuid(DBF18E5A-701B-49ab-B490-BED40053B788),
pointer_default(unique)
]
interface IWebUserContentURLPattern : IUnknown
{
HRESULT parse([in] BSTR patternString);
HRESULT isValid([out, retval] BOOL* isValid);
HRESULT scheme([out, retval] BSTR*);
HRESULT host([out, retval] BSTR*);
HRESULT matchesSubdomains([out, retval] BOOL* matches);
}
...@@ -134,6 +134,7 @@ import "ocidl.idl"; ...@@ -134,6 +134,7 @@ import "ocidl.idl";
#include "IWebURLResponsePrivate.idl" #include "IWebURLResponsePrivate.idl"
#include "IWebUndoManager.idl" #include "IWebUndoManager.idl"
#include "IWebUndoTarget.idl" #include "IWebUndoTarget.idl"
#include "IWebUserContentURLPattern.idl"
#include "IWebView.idl" #include "IWebView.idl"
#include "IWebViewPrivate.idl" #include "IWebViewPrivate.idl"
#include "IWebWorkersPrivate.idl" #include "IWebWorkersPrivate.idl"
...@@ -293,4 +294,9 @@ library WebKit ...@@ -293,4 +294,9 @@ library WebKit
coclass WebGeolocationPosition { coclass WebGeolocationPosition {
[default] interface IWebGeolocationPosition; [default] interface IWebGeolocationPosition;
} }
[uuid(2D62AE25-DEAA-4945-A76E-CCE05E899664)]
coclass WebUserContentURLPattern {
[default] interface IWebUserContentURLPattern;
}
} }
...@@ -1663,6 +1663,26 @@ ...@@ -1663,6 +1663,26 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\Interfaces\IWebUserContentURLPattern.idl"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCMIDLTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCMIDLTool"
/>
</FileConfiguration>
</File>
<File <File
RelativePath="..\Interfaces\IWebView.idl" RelativePath="..\Interfaces\IWebView.idl"
> >
......
...@@ -845,6 +845,10 @@ ...@@ -845,6 +845,10 @@
RelativePath="..\WebURLResponse.h" RelativePath="..\WebURLResponse.h"
> >
</File> </File>
<File
RelativePath="..\WebUserContentURLPattern.h"
>
</File>
<File <File
RelativePath="..\WebView.h" RelativePath="..\WebView.h"
> >
...@@ -1257,6 +1261,10 @@ ...@@ -1257,6 +1261,10 @@
RelativePath="..\WebURLResponse.cpp" RelativePath="..\WebURLResponse.cpp"
> >
</File> </File>
<File
RelativePath="..\WebUserContentURLPattern.cpp"
>
</File>
<File <File
RelativePath="..\WebView.cpp" RelativePath="..\WebView.cpp"
> >
......
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "WebKitDLL.h"
#include "WebUserContentURLPattern.h"
#include <WebCore/BString.h>
#include <WebCore/KURL.h>
using namespace WebCore;
inline WebUserContentURLPattern::WebUserContentURLPattern()
: m_refCount(0)
{
++gClassCount;
gClassNameCount.add("WebUserContentURLPattern");
}
WebUserContentURLPattern::~WebUserContentURLPattern()
{
--gClassCount;
gClassNameCount.remove("WebUserContentURLPattern");
}
COMPtr<WebUserContentURLPattern> WebUserContentURLPattern::createInstance()
{
return new WebUserContentURLPattern;
}
ULONG WebUserContentURLPattern::AddRef()
{
return ++m_refCount;
}
ULONG WebUserContentURLPattern::Release()
{
ULONG newRefCount = --m_refCount;
if (!newRefCount)
delete this;
return newRefCount;
}
HRESULT WebUserContentURLPattern::QueryInterface(REFIID riid, void** ppvObject)
{
if (!ppvObject)
return E_POINTER;
*ppvObject = 0;
if (IsEqualIID(riid, __uuidof(WebUserContentURLPattern)))
*ppvObject = this;
else if (IsEqualIID(riid, __uuidof(IWebUserContentURLPattern)))
*ppvObject = static_cast<IWebUserContentURLPattern*>(this);
else if (IsEqualIID(riid, IID_IUnknown))
*ppvObject = static_cast<IUnknown*>(this);
else
return E_NOINTERFACE;
AddRef();
return S_OK;
}
HRESULT WebUserContentURLPattern::parse(BSTR patternString)
{
m_pattern = UserContentURLPattern(String(patternString, SysStringLen(patternString)));
return S_OK;
}
HRESULT WebUserContentURLPattern::isValid(BOOL* isValid)
{
if (!isValid)
return E_POINTER;
*isValid = m_pattern.isValid();
return S_OK;
}
HRESULT WebUserContentURLPattern::scheme(BSTR* scheme)
{
if (!scheme)
return E_POINTER;
*scheme = BString(m_pattern.scheme()).release();
return S_OK;
}
HRESULT WebUserContentURLPattern::host(BSTR* host)
{
if (!host)
return E_POINTER;
*host = BString(m_pattern.host()).release();
return S_OK;
}
HRESULT WebUserContentURLPattern::matchesSubdomains(BOOL* matches)
{
if (!matches)
return E_POINTER;
*matches = m_pattern.matchSubdomains();
return S_OK;
}
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebUserContentURLPattern_h
#define WebUserContentURLPattern_h
#include <WebCore/COMPtr.h>
#include <WebCore/UserContentURLPattern.h>
namespace WebCore {
class UserContentURLPattern;
}