summaryrefslogtreecommitdiffstats
path: root/chrome_frame/protocol_sink_wrap.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-23 22:17:13 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-23 22:17:13 +0000
commit2e6720abaa059f0964d26d7a0dc5536510bf833f (patch)
tree7e0be43cda99edfc029b58761792d718a7ae8c44 /chrome_frame/protocol_sink_wrap.cc
parentf645f6e2a0cdc85f04fdfb4cd7a6d462027deb71 (diff)
downloadchromium_src-2e6720abaa059f0964d26d7a0dc5536510bf833f.zip
chromium_src-2e6720abaa059f0964d26d7a0dc5536510bf833f.tar.gz
chromium_src-2e6720abaa059f0964d26d7a0dc5536510bf833f.tar.bz2
Fix ChromeFrame net tests broken by the change to determine the renderer type in our
IInternetProtocolSink::ReportProgress implementation. To determine the renderer type we try to read the data from the IInternetProtocol interface which in turn tries to determine the renderer type. Fix is to check if we are in the context of determining the renderer and bail. TBR=stoyan Bug=31031 Review URL: http://codereview.chromium.org/518012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/protocol_sink_wrap.cc')
-rw-r--r--chrome_frame/protocol_sink_wrap.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome_frame/protocol_sink_wrap.cc b/chrome_frame/protocol_sink_wrap.cc
index cbafc8f..42ed4ff 100644
--- a/chrome_frame/protocol_sink_wrap.cc
+++ b/chrome_frame/protocol_sink_wrap.cc
@@ -65,7 +65,8 @@ CComAutoCriticalSection ProtocolSinkWrap::sink_map_lock_;
ProtocolSinkWrap::ProtocolSinkWrap()
: protocol_(NULL), renderer_type_(UNDETERMINED),
buffer_size_(0), buffer_pos_(0), is_saved_result_(false),
- result_code_(0), result_error_(0), report_data_recursiveness_(0) {
+ result_code_(0), result_error_(0), report_data_recursiveness_(0),
+ determining_renderer_type_(false) {
memset(buffer_, 0, arraysize(buffer_));
}
@@ -566,6 +567,13 @@ HRESULT ProtocolSinkWrap::CheckAndReportChromeMimeTypeForRequest() {
if (!is_undetermined())
return S_OK;
+ // This function could get invoked recursively in the context of
+ // IInternetProtocol::Read. Check for the same and bail.
+ if (determining_renderer_type_)
+ return S_OK;
+
+ determining_renderer_type_ = true;
+
HRESULT hr_read = S_OK;
while (hr_read == S_OK) {
ULONG size_read = 0;
@@ -599,6 +607,8 @@ HRESULT ProtocolSinkWrap::CheckAndReportChromeMimeTypeForRequest() {
break;
}
}
+
+ determining_renderer_type_ = false;
return hr_read;
}