summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 19:16:32 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 19:16:32 +0000
commit955f0ffae85be445f114f5ab6f729ad65e25dc28 (patch)
tree3a8a5f8d7bd026e05332b88f3435b0d90d462c80 /chrome_frame
parent5e83826af14858fca1ebac8281afa75107281e7b (diff)
downloadchromium_src-955f0ffae85be445f114f5ab6f729ad65e25dc28.zip
chromium_src-955f0ffae85be445f114f5ab6f729ad65e25dc28.tar.gz
chromium_src-955f0ffae85be445f114f5ab6f729ad65e25dc28.tar.bz2
Make new (CTransaction) hooking and sniffing mechanism the default one.
Review URL: http://codereview.chromium.org/2822028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/protocol_sink_wrap.cc24
-rw-r--r--chrome_frame/utils.cc2
2 files changed, 19 insertions, 7 deletions
diff --git a/chrome_frame/protocol_sink_wrap.cc b/chrome_frame/protocol_sink_wrap.cc
index b429e14..efba86e 100644
--- a/chrome_frame/protocol_sink_wrap.cc
+++ b/chrome_frame/protocol_sink_wrap.cc
@@ -123,12 +123,7 @@ STDMETHODIMP ProtocolSinkWrap::ReportResult(HRESULT result, DWORD error,
LPCWSTR result_text) {
DLOG(INFO) << "ProtocolSinkWrap::ReportResult: result: " << result <<
" error: " << error << " Text: " << (result_text ? result_text : L"");
- DCHECK_NE(UNDETERMINED, prot_data_->renderer_type());
-
- HRESULT hr = E_FAIL;
- if (delegate_)
- hr = delegate_->ReportResult(result, error, result_text);
-
+ HRESULT hr = prot_data_->ReportResult(delegate_, result, error, result_text);
return hr;
}
@@ -357,6 +352,23 @@ HRESULT ProtData::ReportData(IInternetProtocolSink* delegate,
return delegate->ReportData(flags, progress, max_progress);
}
+HRESULT ProtData::ReportResult(IInternetProtocolSink* delegate, HRESULT result,
+ DWORD error, LPCWSTR result_text) {
+ // We may receive ReportResult without ReportData, if the connection fails
+ // for example.
+ if (renderer_type_ == UNDETERMINED) {
+ DLOG(INFO) << "ReportResult received but renderer type is yet unknown.";
+ renderer_type_ = OTHER;
+ FireSugestedMimeType(delegate);
+ }
+
+ HRESULT hr = S_OK;
+ if (delegate)
+ hr = delegate->ReportResult(result, error, result_text);
+ return hr;
+}
+
+
void ProtData::UpdateUrl(const wchar_t* url) {
url_ = url;
}
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index cf27048..a864200 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -1075,7 +1075,7 @@ bool IsTextHtmlClipFormat(CLIPFORMAT cf) {
ProtocolPatchMethod GetPatchMethod() {
ProtocolPatchMethod patch_method =
static_cast<ProtocolPatchMethod>(
- GetConfigInt(PATCH_METHOD_MONIKER, kPatchProtocols));
+ GetConfigInt(PATCH_METHOD_INET_PROTOCOL, kPatchProtocols));
return patch_method;
}