Changeset 106749 in webkit
- Timestamp:
- Feb 4, 2012, 4:18:17 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r106723 r106749 1 2012-02-04 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/10772406> WKPreferences instances cannot be copied 4 https://bugs.webkit.org/show_bug.cgi?id=77816 5 6 Reviewed by Sam Weinig. 7 8 Test added in TestWebKitAPI/Tests/WebKit2/WKPreferences.cpp. 9 10 * UIProcess/API/C/WKPreferences.cpp: 11 (WKPreferencesCreateCopy): Added. 12 * UIProcess/API/C/WKPreferencesPrivate.h: 13 * UIProcess/WebPreferences.cpp: 14 (WebKit::WebPreferences::WebPreferences): Added this constructor that copies the 15 WebPreferencesStore of the given WebPreferences. 16 * UIProcess/WebPreferences.h: 17 (WebKit::WebPreferences::create): Added this create function that takes a WebPreferences 18 instance and creates a new instance with a copy of the given instance’s store. 19 1 20 2012-02-03 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
r106005 r106749 53 53 } 54 54 55 WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef preferencesRef) 56 { 57 RefPtr<WebPreferences> preferences = WebPreferences::create(*toImpl(preferencesRef)); 58 return toAPI(preferences.release().leakRef()); 59 } 60 55 61 void WKPreferencesSetJavaScriptEnabled(WKPreferencesRef preferencesRef, bool javaScriptEnabled) 56 62 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
r106005 r106749 52 52 }; 53 53 typedef enum WKEditableLinkBehavior WKEditableLinkBehavior; 54 55 // Creates a copy with no identifier. 56 WK_EXPORT WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef); 54 57 55 58 // Defaults to kWKFontSmoothingLevelWindows on Windows, kWKFontSmoothingLevelMedium on other platforms. -
trunk/Source/WebKit2/UIProcess/WebPreferences.cpp
r95901 r106749 38 38 WebPreferences::WebPreferences(const String& identifier) 39 39 : m_identifier(identifier) 40 { 41 platformInitializeStore(); 42 } 43 44 WebPreferences::WebPreferences(const WebPreferences& other) 45 : m_store(other.m_store) 40 46 { 41 47 platformInitializeStore(); -
trunk/Source/WebKit2/UIProcess/WebPreferences.h
r106005 r106749 55 55 } 56 56 57 static PassRefPtr<WebPreferences> create(const WebPreferences& other) 58 { 59 return adoptRef(new WebPreferences(other)); 60 } 61 57 62 virtual ~WebPreferences(); 58 63 … … 76 81 WebPreferences(); 77 82 WebPreferences(const String& identifier); 83 WebPreferences(const WebPreferences&); 78 84 79 85 void platformInitializeStore(); -
trunk/Tools/ChangeLog
r106739 r106749 1 2012-02-04 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/10772406> WKPreferences instances cannot be copied 4 https://bugs.webkit.org/show_bug.cgi?id=77816 5 6 Reviewed by Sam Weinig. 7 8 * TestWebKitAPI/Tests/WebKit2/WKPreferences.cpp: 9 (TestWebKitAPI::TEST): 10 1 11 2012-02-04 Adam Barth <abarth@webkit.org> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/WKPreferences.cpp
r95188 r106749 98 98 } 99 99 100 TEST(WebKit2, WKPreferencesCopying) 101 { 102 WKRetainPtr<WKStringRef> identifier(AdoptWK, WKStringCreateWithUTF8CString("identifier")); 103 104 WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreateWithIdentifier(identifier.get())); 105 WKPreferencesSetDefaultFontSize(preferences.get(), 36); 106 107 WKRetainPtr<WKPreferencesRef> copy(AdoptWK, WKPreferencesCreateCopy(preferences.get())); 108 109 WKPreferencesSetDefaultFontSize(preferences.get(), 24); 110 EXPECT_EQ(24u, WKPreferencesGetDefaultFontSize(preferences.get())); 111 EXPECT_EQ(36u, WKPreferencesGetDefaultFontSize(copy.get())); 112 } 113 100 114 } // namespace TestWebKitAPI
Note:
See TracChangeset
for help on using the changeset viewer.