Make CefURLRequest::GetResponse() data available before download completion (issue #956).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1418 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-08-27 19:16:24 +00:00
parent ac22cfaad2
commit 8ac34699f6
2 changed files with 29 additions and 9 deletions

View File

@@ -436,6 +436,9 @@ class RequestClient : public CefURLRequestClient {
virtual void OnDownloadProgress(CefRefPtr<CefURLRequest> request,
uint64 current,
uint64 total) OVERRIDE {
response_ = request->GetResponse();
EXPECT_TRUE(response_);
EXPECT_TRUE(response_->IsReadOnly());
download_progress_ct_++;
download_total_ = total;
}
@@ -443,6 +446,9 @@ class RequestClient : public CefURLRequestClient {
virtual void OnDownloadData(CefRefPtr<CefURLRequest> request,
const void* data,
size_t data_length) OVERRIDE {
response_ = request->GetResponse();
EXPECT_TRUE(response_);
EXPECT_TRUE(response_->IsReadOnly());
download_data_ct_++;
download_data_ += std::string(static_cast<const char*>(data), data_length);
}