diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 20:07:35 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 20:07:35 +0000 |
commit | 2b3102bea014c815d42aaf99a97e8da462a6ea5c (patch) | |
tree | 9bea75fee6c9dc116e0d5e4ee3e6fad600fafcd4 /chrome_frame/http_negotiate.cc | |
parent | e70313140106d364cb359179773c656c6d84423c (diff) | |
download | chromium_src-2b3102bea014c815d42aaf99a97e8da462a6ea5c.zip chromium_src-2b3102bea014c815d42aaf99a97e8da462a6ea5c.tar.gz chromium_src-2b3102bea014c815d42aaf99a97e8da462a6ea5c.tar.bz2 |
Only switch to cf for text/html. With opt-in URLs we could mark a URL to be loaded in CF regardless of the target mime type. If CF turns around and wants to download the target, we would hit an infinite loop.
TEST=Verify that issue 40046 is resolved. OptIn urls should work with the moniker patch and downloads should not cause an infinite loop.
BUG=40046
Review URL: http://codereview.chromium.org/1715004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45226 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/http_negotiate.cc')
-rw-r--r-- | chrome_frame/http_negotiate.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome_frame/http_negotiate.cc b/chrome_frame/http_negotiate.cc index a95255a..4cc1a7d 100644 --- a/chrome_frame/http_negotiate.cc +++ b/chrome_frame/http_negotiate.cc @@ -28,7 +28,7 @@ const char kUACompatibleHttpHeader[] = "x-ua-compatible"; // avoid conflict (and therefore build errors) for those building with // a newer Windows SDK. // TODO(robertshield): Remove this once we update our SDK version. -static const int LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE = 54; +const int LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE = 54; static const int kHttpNegotiateBeginningTransactionIndex = 3; static const int kHttpNegotiateOnResponseTransactionIndex = 4; @@ -96,7 +96,8 @@ class SimpleBindStatusCallback : public CComObjectRootEx<CComSingleThreadModel>, } }; -// Attempts to get to the associated browser service for an active request. +} // end namespace + HRESULT GetBrowserServiceFromProtocolSink(IInternetProtocolSink* sink, IBrowserService** browser_service) { DCHECK(browser_service); @@ -116,8 +117,6 @@ HRESULT GetBrowserServiceFromProtocolSink(IInternetProtocolSink* sink, return hr; } -} // end namespace - HttpNegotiatePatch::HttpNegotiatePatch() { } @@ -340,6 +339,7 @@ HRESULT HttpNegotiatePatch::ReportProgress( if (status_code == BINDSTATUS_MIMETYPEAVAILABLE || status_code == BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE || status_code == LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE) { + DCHECK(lstrlenW(status_text)); bool render_in_chrome_frame = false; bool is_top_level_request = !IsSubFrameRequest(me); // NOTE: After switching over to using the onhttpequiv notification from @@ -395,8 +395,12 @@ HRESULT HttpNegotiatePatch::ReportProgress( } if (render_in_chrome_frame) { - DLOG(INFO) << "- changing mime type to " << kChromeMimeType; - status_text = kChromeMimeType; + if (IsTextHtmlMimeType(status_text)) { + DLOG(INFO) << "- changing mime type to " << kChromeMimeType; + status_text = kChromeMimeType; + } else { + DLOG(INFO) << "- don't want to render " << status_text << " in cf"; + } } } |