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

Unified Diff: content/browser/loader/mime_type_resource_handler.cc

Issue 1323793002: PlzNavigate: add PDF viewer bypass hack to avoid crash. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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 | content/browser/loader/navigation_resource_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/mime_type_resource_handler.cc
diff --git a/content/browser/loader/mime_type_resource_handler.cc b/content/browser/loader/mime_type_resource_handler.cc
index 59c2b5310660487b1a0ccdc7f9591da7ebcc14bc..be40d9f96de5d35a3c563bba4ca6dc76cee8037e 100644
--- a/content/browser/loader/mime_type_resource_handler.cc
+++ b/content/browser/loader/mime_type_resource_handler.cc
@@ -7,6 +7,7 @@
#include <vector>
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
@@ -27,6 +28,7 @@
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/resource_dispatcher_host_delegate.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/resource_response.h"
#include "content/public/common/webplugininfo.h"
#include "net/base/io_buffer.h"
@@ -417,7 +419,11 @@ bool MimeTypeResourceHandler::UseAlternateNextHandler(
// which does so is CrossSiteResourceHandler. Cross-site transitions should
// not trigger when switching handlers.
DCHECK(!defer_ignored);
- if (payload_for_old_handler.empty()) {
+ ResourceRequestInfoImpl* info = GetRequestInfo();
+ if (payload_for_old_handler.empty() ||
+ (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation) &&
+ (info->IsDownload() || info->is_stream()))) {
davidben 2015/09/01 18:22:56 I was actually thinking we should do: if (!plz_na
net::URLRequestStatus status(net::URLRequestStatus::CANCELED,
net::ERR_ABORTED);
next_handler_->OnResponseCompleted(status, std::string(), &defer_ignored);
« no previous file with comments | « no previous file | content/browser/loader/navigation_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698