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

Issue 339047: Cleanup the FlipDelegate API a bit in prep for fixing upload.... (Closed)

Created:
11 years, 1 month ago by Mike Belshe
Modified:
9 years, 5 months ago
Reviewers:
wtc
CC:
chromium-reviews_googlegroups.com, darin (slow to review)
Visibility:
Public.

Description

Cleanup the FlipDelegate API a bit in prep for fixing upload. Document the API for FlipDelegate in flip_session.h. Remove the method OnCancel, since it was not needed. Add the method OnBodySent, which is not yet used but will be. FlipNetworkTransaction is a FlipDelegate, so the changes there are just to reflect the new API. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=30380

Patch Set 1 #

Total comments: 16

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -15 lines) Patch
M net/flip/flip_network_transaction.h View 1 1 chunk +1 line, -1 line 0 comments Download
M net/flip/flip_network_transaction.cc View 1 2 chunks +4 lines, -10 lines 0 comments Download
M net/flip/flip_session.h View 1 1 chunk +44 lines, -3 lines 0 comments Download
M net/flip/flip_session.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Mike Belshe
Start with flip_session.h, I've documented the API for FlipDelegate. I removed the method OnCancel, since ...
11 years, 1 month ago (2009-10-28 16:37:14 UTC) #1
wtc
LGTM. Your comment is a nice description of the CL, so I took the liberty ...
11 years, 1 month ago (2009-10-28 19:04:34 UTC) #2
Mike Belshe
11 years, 1 month ago (2009-10-28 19:30:53 UTC) #3
http://codereview.chromium.org/339047/diff/1/3
File net/flip/flip_session.h (right):

http://codereview.chromium.org/339047/diff/1/3#newcode34
Line 34: // A callback interface for HTTP content retrieved from the Flip
stream.
On 2009/10/28 19:04:34, wtc wrote:
> It would be nice to document who calls the FlipDelegate
> interface.  I think it's FlipSession, right?

Done.

http://codereview.chromium.org/339047/diff/1/3#newcode41
Line 41: // The delegate provides access to the HttpRequest for use by the flip
On 2009/10/28 19:04:34, wtc wrote:
> Typo: HttpRequest => HttpRequestInfo

Done.

http://codereview.chromium.org/339047/diff/1/3#newcode46
Line 46: // flip session.  If the delegate is not uploading content, this call
It is a bit TBD; basically the delegate (we need the delegate to participate at
least for status so you can see what percentage has been uploaded)

But more work may be needed here.
On 2009/10/28 19:04:34, wtc wrote:
> Question: who is uploading content?  The delegate or the
> FlipSession?
> 
> Should we rename this method upload_data()?

http://codereview.chromium.org/339047/diff/1/3#newcode58
Line 58: virtual void OnBodySent(int status) = 0;
On 2009/10/28 19:04:34, wtc wrote:
> Do you want to rename this method OnUploadDataSent, since
> you're talking about "upload data" rather than "body"
> everywhere?
> 
> Since the int argument can be a byte count, it'd be nice
> to name it 'result', which is more general.  'status'
> suggests a succeed/fail status or an error status code.

Done.

http://codereview.chromium.org/339047/diff/1/3#newcode62
Line 62: // |status| contains an error code if a failure has occurred or OK
On 2009/10/28 19:04:34, wtc wrote:
> I'd also rename the argument 'result' even though it is truly
> a status for this method.

Done.

http://codereview.chromium.org/339047/diff/1/3#newcode66
Line 66: // Called by the FlipSession when a response (e.g. a SYN_REPLY) has
been
On 2009/10/28 19:04:34, wtc wrote:
> It's important to point out that when this callback is called,
> exactly what parts of a response have been received.  For
> example, the response data hasn't been received; that's the
> job of OnDataReceived.

Done.

http://codereview.chromium.org/339047/diff/1/3#newcode74
Line 74: // |buffer| contains the data received.
On 2009/10/28 19:04:34, wtc wrote:
> Document the lifetime of |buffer|.  Does the delegate need
> to copy the data in |buffer| before onDataReceived?

Done.

http://codereview.chromium.org/339047/diff/1/3#newcode75
Line 75: // |bytes| is the number of bytes received or an error.
On 2009/10/28 19:04:34, wtc wrote:
> If |bytes| is 0, does it mean end of stream/response body?

Done.

Powered by Google App Engine
This is Rietveld 408576698