WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-116461-20130520131157.patch (text/plain), 9.59 KB, created by
Anders Carlsson
on 2013-05-20 13:13:08 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Anders Carlsson
Created:
2013-05-20 13:13:08 PDT
Size:
9.59 KB
patch
obsolete
>Subversion Revision: 150377 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 5e0bd5bc27ae1876529ef45d8108e76710f0aed5..186472ddc92dc5d40e0d509a06b5548082c804f5 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,5 +1,17 @@ > 2013-05-20 Anders Carlsson <andersca@apple.com> > >+ Add helper function for converting a KeyedCodingValue to a CFTypeRef >+ https://bugs.webkit.org/show_bug.cgi?id=116461 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/cf/KeyedCodingValueCF.cpp: Added. >+ * Shared/cf/KeyedCodingValueCF.h: Added. >+ >+ * WebKit2.xcodeproj/project.pbxproj: >+ >+2013-05-20 Anders Carlsson <andersca@apple.com> >+ > Begin stubbing out a new KeyedEncoder class > https://bugs.webkit.org/show_bug.cgi?id=116456 > >diff --git a/Source/WebKit2/Shared/cf/KeyedCodingValueCF.cpp b/Source/WebKit2/Shared/cf/KeyedCodingValueCF.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..e3abd36a0d2e2d8556a8592f29003fcbac03642b >--- /dev/null >+++ b/Source/WebKit2/Shared/cf/KeyedCodingValueCF.cpp >@@ -0,0 +1,55 @@ >+/* >+ * Copyright (C) 2013 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 "KeyedCodingValueCF.h" >+ >+namespace WebKit { >+ >+static RetainPtr<CFMutableDictionaryRef> toCFDictionary(const HashMap<String, KeyedCodingValue>& object) >+{ >+ RetainPtr<CFMutableDictionaryRef> dictionary = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, object.size(), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); >+ >+ for (auto it = object.begin(), end = object.end(); it != end; ++it) >+ CFDictionarySetValue(dictionary.get(), it->key.createCFString().get(), toCFType(it->value).get()); >+ >+ return dictionary; >+} >+ >+RetainPtr<CFTypeRef> toCFType(const KeyedCodingValue& value) >+{ >+ switch (value.type) { >+ case KeyedCodingValue::StringValue: >+ return value.string.createCFString(); >+ >+ case KeyedCodingValue::ObjectValue: >+ return toCFDictionary(value.object); >+ } >+ >+ ASSERT_NOT_REACHED(); >+ return nullptr; >+} >+ >+} // namespace WebKit >diff --git a/Source/WebKit2/Shared/cf/KeyedCodingValueCF.h b/Source/WebKit2/Shared/cf/KeyedCodingValueCF.h >new file mode 100644 >index 0000000000000000000000000000000000000000..11f9c99d164b71c78d28e13f6ae5036d4df7ad0d >--- /dev/null >+++ b/Source/WebKit2/Shared/cf/KeyedCodingValueCF.h >@@ -0,0 +1,38 @@ >+/* >+ * Copyright (C) 2013 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 KeyedCodingValueCF_h >+#define KeyedCodingValueCF_h >+ >+#include "KeyedCodingValue.h" >+#include <wtf/RetainPtr.h> >+ >+namespace WebKit { >+ >+RetainPtr<CFTypeRef> toCFType(const KeyedCodingValue&); >+ >+} // namespace WebKit >+ >+#endif // KeyedCodingValueCF_h >diff --git a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj >index b90a70d11e186870f33bf2d951f85d8082c898a9..ff8e41d37d04bc88c6e968c27db11277845434d6 100644 >--- a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj >+++ b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj >@@ -152,6 +152,8 @@ > 1A588B30174AAC7100ACF472 /* KeyedEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A588B2E174AAC7100ACF472 /* KeyedEncoder.cpp */; }; > 1A588B31174AAC7100ACF472 /* KeyedEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A588B2F174AAC7100ACF472 /* KeyedEncoder.h */; }; > 1A588B33174AAE0B00ACF472 /* KeyedCodingValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A588B32174AAE0B00ACF472 /* KeyedCodingValue.h */; }; >+ 1A588B36174AB77000ACF472 /* KeyedCodingValueCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A588B34174AB77000ACF472 /* KeyedCodingValueCF.cpp */; }; >+ 1A588B37174AB77000ACF472 /* KeyedCodingValueCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A588B35174AB77000ACF472 /* KeyedCodingValueCF.h */; }; > 1A594ABA112A1FB6009DE7C7 /* WebUIClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A594AB8112A1FB6009DE7C7 /* WebUIClient.cpp */; }; > 1A594ABB112A1FB6009DE7C7 /* WebUIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A594AB9112A1FB6009DE7C7 /* WebUIClient.h */; }; > 1A5E4DA412D3BD3D0099A2BB /* TextCheckerState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */; }; >@@ -1575,6 +1577,8 @@ > 1A588B2E174AAC7100ACF472 /* KeyedEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyedEncoder.cpp; sourceTree = "<group>"; }; > 1A588B2F174AAC7100ACF472 /* KeyedEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedEncoder.h; sourceTree = "<group>"; }; > 1A588B32174AAE0B00ACF472 /* KeyedCodingValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedCodingValue.h; sourceTree = "<group>"; }; >+ 1A588B34174AB77000ACF472 /* KeyedCodingValueCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyedCodingValueCF.cpp; sourceTree = "<group>"; }; >+ 1A588B35174AB77000ACF472 /* KeyedCodingValueCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedCodingValueCF.h; sourceTree = "<group>"; }; > 1A594AB8112A1FB6009DE7C7 /* WebUIClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebUIClient.cpp; sourceTree = "<group>"; }; > 1A594AB9112A1FB6009DE7C7 /* WebUIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUIClient.h; sourceTree = "<group>"; }; > 1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCheckerState.h; sourceTree = "<group>"; }; >@@ -3415,6 +3419,8 @@ > children = ( > 1AAF0C4912B16334008E49E2 /* ArgumentCodersCF.cpp */, > 1AAF0C4812B16334008E49E2 /* ArgumentCodersCF.h */, >+ 1A588B34174AB77000ACF472 /* KeyedCodingValueCF.cpp */, >+ 1A588B35174AB77000ACF472 /* KeyedCodingValueCF.h */, > ); > path = cf; > sourceTree = "<group>"; >@@ -5386,6 +5392,7 @@ > BCB0AEE9122F53E300B1341E /* MutableDictionary.h in Headers */, > 1A6FBA2A11E6862700DB1371 /* NetscapeBrowserFuncs.h in Headers */, > 1A6FBD2811E69BC200DB1371 /* NetscapePlugin.h in Headers */, >+ 1A588B37174AB77000ACF472 /* KeyedCodingValueCF.h in Headers */, > 1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */, > 1AA5889211EE70400061B882 /* NetscapePluginStream.h in Headers */, > 513A164D1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h in Headers */, >@@ -6955,6 +6962,7 @@ > BC4075F3124FF0270068F20A /* WKArray.cpp in Sources */, > 512F58F512A88A5400629530 /* WKAuthenticationChallenge.cpp in Sources */, > 512F58F712A88A5400629530 /* WKAuthenticationDecisionListener.cpp in Sources */, >+ 1A588B36174AB77000ACF472 /* KeyedCodingValueCF.cpp in Sources */, > BC646C1A11DD399F006455B0 /* WKBackForwardList.cpp in Sources */, > BC646C1C11DD399F006455B0 /* WKBackForwardListItem.cpp in Sources */, > BCBAAC72144E61990053F82F /* WKBrowsingContextController.mm in Sources */,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
thorton
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 116461
: 202311