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

Unified Diff: chrome_frame/urlmon_bind_status_callback.cc

Issue 1613020: Merge 44735 - With the ChromeFrame moniker patch on, the data cache maintaine... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/375/src/
Patch Set: Created 10 years, 8 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 | « chrome_frame/urlmon_bind_status_callback.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/urlmon_bind_status_callback.cc
===================================================================
--- chrome_frame/urlmon_bind_status_callback.cc (revision 44737)
+++ chrome_frame/urlmon_bind_status_callback.cc (working copy)
@@ -20,7 +20,7 @@
// CacheStream instance.
HRESULT CacheStream::BSCBFeedData(IBindStatusCallback* bscb, const char* data,
size_t size, CLIPFORMAT clip_format,
- size_t flags) {
+ size_t flags, bool eof) {
if (!bscb) {
NOTREACHED() << "invalid IBindStatusCallback";
return E_INVALIDARG;
@@ -36,7 +36,7 @@
}
cache_stream->AddRef();
- cache_stream->Initialize(data, size);
+ cache_stream->Initialize(data, size, eof);
FORMATETC format_etc = { clip_format, NULL, DVASPECT_CONTENT, -1,
TYMED_ISTREAM };
@@ -50,10 +50,11 @@
return hr;
}
-void CacheStream::Initialize(const char* cache, size_t size) {
+void CacheStream::Initialize(const char* cache, size_t size, bool eof) {
cache_ = cache;
size_ = size;
position_ = 0;
+ eof_ = eof;
}
// Read is the only call that we expect. Return E_PENDING if there
@@ -64,7 +65,7 @@
return E_INVALIDARG;
// Default to E_PENDING to signal that this is a partial data.
- HRESULT hr = E_PENDING;
+ HRESULT hr = eof_ ? S_FALSE : E_PENDING;
if (position_ < size_) {
*read = std::min(size_ - position_, size_t(cb));
memcpy(pv, cache_ + position_, *read);
@@ -114,6 +115,7 @@
}
bool last_chance = force_determination || (size() >= kMaxSniffSize);
+ eof_ = force_determination;
DetermineRendererType(last_chance);
return hr;
}
@@ -131,7 +133,8 @@
HRESULT hr = GetHGlobalFromStream(cache_, &memory);
if (SUCCEEDED(hr) && memory) {
char* buffer = reinterpret_cast<char*>(GlobalLock(memory));
- hr = CacheStream::BSCBFeedData(bscb, buffer, size_, clip_format, bscf);
+ hr = CacheStream::BSCBFeedData(bscb, buffer, size_, clip_format, bscf,
+ eof_);
GlobalUnlock(memory);
}
« no previous file with comments | « chrome_frame/urlmon_bind_status_callback.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698