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

Unified Diff: chrome_frame/protocol_sink_wrap.cc

Issue 3038049: Protect against receiving different BINDSTATUS_MIMETYPEAVAILABLE multiple tim... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/protocol_sink_wrap.cc
===================================================================
--- chrome_frame/protocol_sink_wrap.cc (revision 54553)
+++ chrome_frame/protocol_sink_wrap.cc (working copy)
@@ -359,6 +359,20 @@
return read_fun_(protocol_, buffer, size, size_read);
}
+// Attempt to detect ChromeFrame from HTTP headers when
+// BINDSTATUS_MIMETYPEAVAILABLE is received.
+// There are three possible outcomes: CHROME/OTHER/UNDETERMINED.
+// If UNDETERMINED we are going to sniff the content later in ReportData().
+//
+// With not-so-well-written software (mime filters/protocols/protocol patchers)
+// BINDSTATUS_MIMETYPEAVAILABLE might be fired multiple times with different
+// values for the same client.
+// If the renderer_type_ member is:
+// CHROME - 2nd (and any subsequent) BINDSTATUS_MIMETYPEAVAILABLE is ignored.
+// OTHER - 2nd (and any subsequent) BINDSTATUS_MIMETYPEAVAILABLE is
+// passed through.
+// UNDETERMINED - Try to detect ChromeFrame from HTTP headers (acts as if this
+// is the first time BINDSTATUS_MIMETYPEAVAILABLE is received).
HRESULT ProtData::ReportProgress(IInternetProtocolSink* delegate,
ULONG status_code, LPCWSTR status_text) {
switch (status_code) {
@@ -380,12 +394,12 @@
// TODO(stoyan): BINDSTATUS_RAWMIMETYPE
case BINDSTATUS_MIMETYPEAVAILABLE:
case BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE:
+ SaveSuggestedMimeType(status_text);
// When Transaction is attached i.e. when existing BTS it terminated
// and "converted" to BTO, events will be re-fired for the new sink,
// but we may skip the renderer_type_ determination since it's already
// done.
if (renderer_type_ == UNDETERMINED) {
- SaveSuggestedMimeType(status_text);
// This may seem awkward. CBinding's implementation of IWinInetHttpInfo
// will forward to CTransaction that will forward to the real protocol.
// We may ask CTransaction (our protocol_ member) for IWinInetHttpInfo.
« 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