Changeset 142574 in webkit
- Timestamp:
- Feb 11, 2013 8:34:21 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142573 r142574 1 2013-02-11 peavo@outlook.com <peavo@outlook.com> 2 3 [Curl] setCookiesFromDOM function does not save cookies to disk. 4 https://bugs.webkit.org/show_bug.cgi?id=109285 5 6 Reviewed by Brent Fulgham. 7 8 Write cookies to disk by using the Curl easy api. 9 10 * platform/network/curl/CookieJarCurl.cpp: 11 (WebCore::setCookiesFromDOM):Write cookie to disk. 12 * platform/network/curl/ResourceHandleManager.cpp: 13 (WebCore::ResourceHandleManager::getCurlShareHandle): Added method to get Curl share handle. 14 (WebCore::ResourceHandleManager::getCookieJarFileName): Added method to get cookie file name. 15 * platform/network/curl/ResourceHandleManager.h: Added methods to get cookie file name, and Curl share handle. 16 1 17 2013-02-11 Hayato Ito <hayato@chromium.org> 2 18 -
trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp
r138413 r142574 20 20 #include "Cookie.h" 21 21 #include "KURL.h" 22 #include "ResourceHandleManager.h" 23 22 24 #include <wtf/HashMap.h> 23 25 #include <wtf/text/StringHash.h> … … 31 33 { 32 34 cookieJar.set(url.string(), value); 35 36 CURL* curl = curl_easy_init(); 37 38 if (!curl) 39 return; 40 41 const char* cookieJarFileName = ResourceHandleManager::sharedInstance()->getCookieJarFileName(); 42 CURLSH* curlsh = ResourceHandleManager::sharedInstance()->getCurlShareHandle(); 43 44 curl_easy_setopt(curl, CURLOPT_COOKIEJAR, cookieJarFileName); 45 curl_easy_setopt(curl, CURLOPT_COOKIEFILE, cookieJarFileName); 46 curl_easy_setopt(curl, CURLOPT_SHARE, curlsh); 47 48 String cookie("Set-Cookie: "); 49 if (value.is8Bit()) 50 cookie.append(value); 51 else 52 cookie.append(String::make8BitFrom16BitSource(value.characters16(), value.length())); 53 54 CString strCookie(reinterpret_cast<const char*>(cookie.characters8()), cookie.length()); 55 56 curl_easy_setopt(curl, CURLOPT_COOKIELIST, strCookie.data()); 57 58 curl_easy_cleanup(curl); 33 59 } 34 60 -
trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
r141464 r142574 152 152 } 153 153 154 CURLSH* ResourceHandleManager::getCurlShareHandle() const 155 { 156 return m_curlShareHandle; 157 } 158 154 159 void ResourceHandleManager::setCookieJarFileName(const char* cookieJarFileName) 155 160 { 156 161 m_cookieJarFileName = fastStrDup(cookieJarFileName); 162 } 163 164 const char* ResourceHandleManager::getCookieJarFileName() const 165 { 166 return m_cookieJarFileName; 157 167 } 158 168 -
trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.h
r127757 r142574 57 57 void add(ResourceHandle*); 58 58 void cancel(ResourceHandle*); 59 60 CURLSH* getCurlShareHandle() const; 61 59 62 void setCookieJarFileName(const char* cookieJarFileName); 63 const char* getCookieJarFileName() const; 60 64 61 65 void dispatchSynchronousJob(ResourceHandle*);
Note: See TracChangeset
for help on using the changeset viewer.