Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: webkit/glue/webplugin_impl.cc

Issue 373024: Fix regression in which NPRES_NETWORK_ERR instead of NPRES_USER_BREAK was pas... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webplugin_impl.cc
===================================================================
--- webkit/glue/webplugin_impl.cc (revision 31160)
+++ webkit/glue/webplugin_impl.cc (working copy)
@@ -8,6 +8,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "net/base/escape.h"
+#include "net/base/net_errors.h"
#include "skia/ext/platform_canvas.h"
#include "webkit/api/public/WebConsoleMessage.h"
#include "webkit/api/public/WebCString.h"
@@ -23,6 +24,7 @@
#include "webkit/api/public/WebPluginParams.h"
#include "webkit/api/public/WebRect.h"
#include "webkit/api/public/WebURL.h"
+#include "webkit/api/public/WebURLError.h"
#include "webkit/api/public/WebURLLoader.h"
#include "webkit/api/public/WebURLLoaderClient.h"
#include "webkit/api/public/WebURLResponse.h"
@@ -354,11 +356,13 @@
void WebPluginImpl::didFailLoadingFrameRequest(
const WebURL& url, void* notify_data, const WebURLError& error) {
- // TODO(darin): Map net::ERR_ABORTED to NPRES_USER_BREAK?
- if (delegate_) {
- delegate_->DidFinishLoadWithReason(
- url, NPRES_NETWORK_ERR, reinterpret_cast<intptr_t>(notify_data));
- }
+ if (!delegate_)
+ return;
+
+ NPReason reason =
+ error.reason == net::ERR_ABORTED ? NPRES_USER_BREAK : NPRES_NETWORK_ERR;
+ delegate_->DidFinishLoadWithReason(
+ url, reason, reinterpret_cast<intptr_t>(notify_data));
}
// -----------------------------------------------------------------------------
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698