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

Side by Side Diff: chrome_frame/urlmon_upload_data_stream.cc

Issue 6134003: Prototype of chunked transfer encoded POST. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome_frame/urlmon_upload_data_stream.h" 5 #include "chrome_frame/urlmon_upload_data_stream.h"
6 6
7 #include "net/base/io_buffer.h" 7 #include "net/base/io_buffer.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 9
10 void UrlmonUploadDataStream::Initialize(net::UploadData* upload_data) { 10 void UrlmonUploadDataStream::Initialize(net::UploadData* upload_data) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 memcpy(write_pointer, buf->data(), bytes_to_copy_now); 45 memcpy(write_pointer, buf->data(), bytes_to_copy_now);
46 46
47 // Advance our copy tally 47 // Advance our copy tally
48 bytes_copied += bytes_to_copy_now; 48 bytes_copied += bytes_to_copy_now;
49 49
50 // Advance our write pointer 50 // Advance our write pointer
51 write_pointer += bytes_to_copy_now; 51 write_pointer += bytes_to_copy_now;
52 52
53 // Advance the UploadDataStream read pointer: 53 // Advance the UploadDataStream read pointer:
54 request_body_stream_->DidConsume(bytes_to_copy_now); 54 request_body_stream_->ConsumeAndFillBuffer(bytes_to_copy_now);
vandebo (ex-Chrome) 2011/01/24 20:16:08 You missed updating one name.
55 } 55 }
56 56
57 DCHECK(bytes_copied == total_bytes_to_copy); 57 DCHECK(bytes_copied == total_bytes_to_copy);
58 DCHECK(request_body_stream_->position() == 58 DCHECK(request_body_stream_->position() ==
59 initial_position + total_bytes_to_copy); 59 initial_position + total_bytes_to_copy);
60 60
61 if (read) { 61 if (read) {
62 *read = static_cast<ULONG>(total_bytes_to_copy); 62 *read = static_cast<ULONG>(total_bytes_to_copy);
63 } 63 }
64 64
(...skipping 29 matching lines...) Expand all
94 if (0 == (grf_stat_flag & STATFLAG_NONAME)) { 94 if (0 == (grf_stat_flag & STATFLAG_NONAME)) {
95 const wchar_t kStreamBuffer[] = L"PostStream"; 95 const wchar_t kStreamBuffer[] = L"PostStream";
96 stat_stg->pwcsName = 96 stat_stg->pwcsName =
97 static_cast<wchar_t*>(::CoTaskMemAlloc(sizeof(kStreamBuffer))); 97 static_cast<wchar_t*>(::CoTaskMemAlloc(sizeof(kStreamBuffer)));
98 lstrcpy(stat_stg->pwcsName, kStreamBuffer); 98 lstrcpy(stat_stg->pwcsName, kStreamBuffer);
99 } 99 }
100 stat_stg->type = STGTY_STREAM; 100 stat_stg->type = STGTY_STREAM;
101 stat_stg->cbSize.QuadPart = upload_data_->GetContentLength(); 101 stat_stg->cbSize.QuadPart = upload_data_->GetContentLength();
102 return S_OK; 102 return S_OK;
103 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698