Changeset 63756 in webkit
- Timestamp:
- Jul 20, 2010 10:50:02 AM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r63708 r63756 1 2010-07-20 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Implement NPN_GetURL and NPN_PostURL 6 https://bugs.webkit.org/show_bug.cgi?id=42650 7 8 * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: 9 (WebKit::parsePostBuffer): 10 Add a FIXME about deleting the file. 11 12 (WebKit::makeURLString): 13 Move this static method before NPN_GetURL. 14 15 (WebKit::NPN_GetURL): 16 Call NetscapePLugin::LoadURL. 17 18 (WebKit::NPN_PostURL): 19 Ditto. 20 21 (WebKit::NPN_PostURLNotify): 22 * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: 23 Remove unreached code. 24 25 (WebKit::NetscapePluginStream::deliverDataToPlugin): 26 Stop the stream if the plug-in returns -1 from NPP_Write. 27 1 28 2010-07-19 Anders Carlsson <andersca@apple.com> 2 29 -
trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
r63701 r63756 210 210 postBuffer = fileContents->data(); 211 211 postBufferSize = fileContents->size(); 212 213 // FIXME: The NPAPI spec states that the file should be deleted here. 212 214 } else { 213 215 postBuffer = buffer; … … 248 250 } 249 251 250 static NPError NPN_GetURL(NPP instance, const char* url, const char* target) 251 { 252 notImplemented(); 252 static String makeURLString(const char* url) 253 { 254 String urlString(url); 255 256 // Strip return characters. 257 urlString.replace('\r', ""); 258 urlString.replace('\n', ""); 259 260 return urlString; 261 } 262 263 static NPError NPN_GetURL(NPP npp, const char* url, const char* target) 264 { 265 if (!url) 266 return NPERR_GENERIC_ERROR; 267 268 RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); 269 plugin->loadURL("GET", makeURLString(url), target, HTTPHeaderMap(), Vector<char>(), false, 0); 270 253 271 return NPERR_GENERIC_ERROR; 254 272 } 255 273 256 static NPError NPN_PostURL(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file) 257 { 258 notImplemented(); 259 return NPERR_GENERIC_ERROR; 274 static NPError NPN_PostURL(NPP npp, const char* url, const char* target, uint32_t len, const char* buf, NPBool file) 275 { 276 HTTPHeaderMap headerFields; 277 Vector<char> postData; 278 279 // NPN_PostURL only allows headers if the post buffer points to a file. 280 bool parseHeaders = file; 281 282 NPError error = parsePostBuffer(file, buf, len, parseHeaders, headerFields, postData); 283 if (error != NPERR_NO_ERROR) 284 return error; 285 286 RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); 287 plugin->loadURL("POST", makeURLString(url), target, headerFields, postData, false, 0); 288 return NPERR_NO_ERROR; 260 289 } 261 290 … … 333 362 notImplemented(); 334 363 return 0; 335 }336 337 static String makeURLString(const char* url)338 {339 String urlString(url);340 341 // Strip return characters.342 urlString.replace('\r', "");343 urlString.replace('\n', "");344 345 return urlString;346 364 } 347 365 … … 368 386 plugin->loadURL("POST", makeURLString(url), target, headerFields, postData, true, notifyData); 369 387 return NPERR_NO_ERROR; 370 371 notImplemented();372 return NPERR_GENERIC_ERROR;373 388 } 374 389 -
trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
r63704 r63756 221 221 int32_t numBytesWritten = m_plugin->NPP_Write(&m_npStream, m_offset, dataLength, data); 222 222 if (numBytesWritten < 0) { 223 // FIXME: Destroy the stream!224 ASSERT_NOT_REACHED();223 stop(NPRES_NETWORK_ERR); 224 return; 225 225 } 226 226
Note: See TracChangeset
for help on using the changeset viewer.