summaryrefslogtreecommitdiffstats
path: root/net/flip
Commit message (Collapse)AuthorAgeFilesLines
* Reland: Fix the FlipSession to support partial writes.mbelshe@google.com2009-11-295-342/+316
| | | | | | | | | | | | | | | | | Modified the FlipIOBuffer to use a DrainableIOBuffer instead of a IOBufferWithSize. When a write completes, we drain the bytes, and only fetch the next FlipFrame from the queue after we have fully drained the buffer. I will update the tests to be much more thorough in my next CL. BUG=none TEST=FlipNetworkTransactionTest.PartialWrites Review URL: http://codereview.chromium.org/451002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33250 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 33073 - Reland 33018:mbelshe@google.com2009-11-255-313/+342
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the FlipSession to support partial writes. Modified the FlipIOBuffer to use a DrainableIOBuffer instead of a IOBufferWithSize. When a write completes, we drain the bytes, and only fetch the next FlipFrame from the queue after we have fully drained the buffer. I will update the tests to be much more thorough in my next CL. BUG=none TEST=FlipNetworkTransactionTest.PartialWrites Review URL: http://codereview.chromium.org/436019 Review URL: http://codereview.chromium.org/434065 TBR=mbelshe@google.com Review URL: http://codereview.chromium.org/443003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33076 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 33018:mbelshe@google.com2009-11-255-342/+313
| | | | | | | | | | | | | | | | | | | | | | Fix the FlipSession to support partial writes. Modified the FlipIOBuffer to use a DrainableIOBuffer instead of a IOBufferWithSize. When a write completes, we drain the bytes, and only fetch the next FlipFrame from the queue after we have fully drained the buffer. I will update the tests to be much more thorough in my next CL. BUG=none TEST=FlipNetworkTransactionTest.PartialWrites Review URL: http://codereview.chromium.org/436019 Review URL: http://codereview.chromium.org/434065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33073 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 33018 - Fix the FlipSession to support partial writes.laforge@chromium.org2009-11-255-313/+342
| | | | | | | | | | | | | | | | | | | | Modified the FlipIOBuffer to use a DrainableIOBuffer instead of a IOBufferWithSize. When a write completes, we drain the bytes, and only fetch the next FlipFrame from the queue after we have fully drained the buffer. I will update the tests to be much more thorough in my next CL. BUG=none TEST=FlipNetworkTransactionTest.PartialWrites Review URL: http://codereview.chromium.org/436019 TBR=mbelshe@google.com Review URL: http://codereview.chromium.org/440011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33020 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the FlipSession to support partial writes.mbelshe@google.com2009-11-255-342/+313
| | | | | | | | | | | | | | | | | Modified the FlipIOBuffer to use a DrainableIOBuffer instead of a IOBufferWithSize. When a write completes, we drain the bytes, and only fetch the next FlipFrame from the queue after we have fully drained the buffer. I will update the tests to be much more thorough in my next CL. BUG=none TEST=FlipNetworkTransactionTest.PartialWrites Review URL: http://codereview.chromium.org/436019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33018 0039d316-1c4b-4281-b951-d872f2087c98
* Flip: Fix leak of UploadDataStream if it's empty.willchan@chromium.org2009-11-241-2/+6
| | | | | | Review URL: http://codereview.chromium.org/434043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32959 0039d316-1c4b-4281-b951-d872f2087c98
* Flip: Handle empty post.willchan@chromium.org2009-11-242-2/+76
| | | | | | Review URL: http://codereview.chromium.org/437039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32947 0039d316-1c4b-4281-b951-d872f2087c98
* Flip: Fix a bunch of leaks.willchan@chromium.org2009-11-246-33/+61
| | | | | | | | | | | | FlipIOBuffer::release() was broken. It called release() on scoped_refptrs which does not decrease refcount, hence it leaked IOBuffers and FlipStreams. Redo the memory management for FlipSession. Stop using raw pointers in FlipSessionPool to hold onto FlipSession. FlipSessionPool uses scoped_refptr now to track Fli pSessions. Instead of having FlipSession call Release() on itself, it now calls FlipSessionPool to remove itself from the pool when the tcp connection is closed. In FlipStreamTest, manually call FlipSessionPool::Remove() since there is no tcp connection event to trigger FlipSession to remove itself. BUG=http://crbug.com/28493 Review URL: http://codereview.chromium.org/438014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32945 0039d316-1c4b-4281-b951-d872f2087c98
* Flip: Fix cancellation code path.willchan@chromium.org2009-11-231-8/+8
| | | | | | | | The current fix is suboptimal, since we're doing unnecessary work in the FlipStream (still handling reads and writes for a cancelled stream), but just don't ever hand the data over to a user since they've already cancelled the stream. We should fix this, but don't bother for now. Not calling any user_callback_ is good enough for now. Review URL: http://codereview.chromium.org/439002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32881 0039d316-1c4b-4281-b951-d872f2087c98
* Disable FlipStreamTest::SendRequest as it causes leaks.tim@chromium.org2009-11-231-1/+2
| | | | | | | | | | | | I'm sorry for reverting your change earlier, looks like it wasn't the cause :( TBR=mbelshe BUG=28622 TEST=FlipStreamTest Review URL: http://codereview.chromium.org/436009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32858 0039d316-1c4b-4281-b951-d872f2087c98
* Flip: Merge FlipStreamParser and FlipStream. Eliminate FlipDelegate.willchan@chromium.org2009-11-2211-834/+825
| | | | | | | | | | | | | | FlipStream now conceptually contains everything associated with a single Flip stream. This primarily consists of 2 things: (1) FlipStream as a consumer of network events from FlipSession (2) FlipStream as a network provider to consumers (such as FlipNetworkTransaction). Conceptually, FlipStream also should be agnostic of wire level protocol framing details, only dealing with HTTP style headers and responses. Anything wire level has been moved out of FlipStream into FlipSession. FlipStream is now reference counted since it is referenced by both the FlipSession and the consumer (only FlipNetworkTransaction currently). FlipNetworkTransaction can be cancelled prior to all network events finishing up, therefore the code needs to handle this gracefully. FlipStream supports a Cancel() function for this reason. FlipStream now communicates with consumers via CompletionCallbacks rather than using FlipDelegates. Review URL: http://codereview.chromium.org/410006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32765 0039d316-1c4b-4281-b951-d872f2087c98
* Add some diagnostics for dumping the headers that the clientmbelshe@google.com2009-11-211-0/+30
| | | | | | | | | | | sends to the server so that others can more easily debug. BUG=none TEST=none Review URL: http://codereview.chromium.org/414078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32764 0039d316-1c4b-4281-b951-d872f2087c98
* Implement a test case for a basic server-push operation.mbelshe@google.com2009-11-211-0/+180
| | | | | | | | | BUG=none TEST=flip_network_transaction_unittest.cc Review URL: http://codereview.chromium.org/414032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32763 0039d316-1c4b-4281-b951-d872f2087c98
* When we had upload data, but it was a zero-length uploadmbelshe@chromium.org2009-11-211-1/+1
| | | | | | | | | | | | | | data, we would not set the FIN flag, which would stall the request upload. This fixes gmail. TEST=none BUG=none Review URL: http://codereview.chromium.org/414077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32762 0039d316-1c4b-4281-b951-d872f2087c98
* Add a sanity check into the framer; this tripsmbelshe@google.com2009-11-201-0/+1
| | | | | | | | | | | | often if you send bad data into the framer and helps debug early. BUG=none TEST=none Review URL: http://codereview.chromium.org/418008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32630 0039d316-1c4b-4281-b951-d872f2087c98
* Robustness improvements on the X-Associated-Content header.mbelshe@google.com2009-11-201-2/+7
| | | | | | | | | | | | | If we get a header which doesn't look like it contains a parseable URL, log an error and drop it (instead of inserting it into the pending_streams_ list). BUG=none TEST=none Review URL: http://codereview.chromium.org/420002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32629 0039d316-1c4b-4281-b951-d872f2087c98
* Fix memory leak.mbelshe@google.com2009-11-191-1/+1
| | | | | | | | | | BUG=none TEST=none TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/408019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32482 0039d316-1c4b-4281-b951-d872f2087c98
* Fix two flip bugs.mbelshe@google.com2009-11-195-22/+60
| | | | | | | | | | | | | | | | | | First, we kept points to FlipDelegates rather than references. Now that the classes are separated, this becomes problematic because the FlipNetworkTransaction can go away independently of the FlipSession. Second, there was a bug with posted data - we were compressing the frames, and we don't want to. BUG=none TEST=none Review URL: http://codereview.chromium.org/402073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32458 0039d316-1c4b-4281-b951-d872f2087c98
* Add a test for verifying that SYN_REPLY headers are properlymbelshe@google.com2009-11-161-0/+148
| | | | | | | | | | | | converted back into the HTTP headers used by the upper layers of the HttpNetworkTransaction stack. BUG=none TEST=flip_network_transaction_unittest.cc Review URL: http://codereview.chromium.org/384145 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32099 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bad last checkin which broke everything in flip.mbelshe@google.com2009-11-151-0/+1
| | | | | | | | | | TBR=wtc@chromium.org TEST=none BUG=none Review URL: http://codereview.chromium.org/387058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32028 0039d316-1c4b-4281-b951-d872f2087c98
* Fix multi-valued headers to and from the server.mbelshe@google.com2009-11-142-5/+31
| | | | | | | | | | | | | | | | | | | | | | | | | This is basically for Set-Cookie, but the solution is generic. If the HTTP layer had issued multiple, duplicate named headers, we send a single name-value pair where the value is a null-character separated list of the original headers. So: Set-Cookie: foo Set-Cookie: bar Becomes Set-cookie "foo\0bar" BUG=none TEST=none Review URL: http://codereview.chromium.org/391061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32007 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Coverity defects in the FLIP code.wtc@chromium.org2009-11-123-5/+5
| | | | | | | | | | | | | CID=6816 PASS_BY_VALUE CID=6817 PASS_BY_VALUE CID=7523 UNINIT_CTOR R=mbelshe BUG=none TEST=none Review URL: http://codereview.chromium.org/392012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31828 0039d316-1c4b-4281-b951-d872f2087c98
* Enable FLIP POST with unittest.mbelshe@google.com2009-11-127-84/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | | Involved some refactoring of FlipStreamParser/FlipStream/FlipSession. I now want to merge FlipStream and FlipStreamParser. In this CL: * Update the FlipDelegate to remove unused methods and add the OnWriteCompleted() method. * Add a full state machine to the FlipStreamParser. This is the same state machine which is used by the HttpStreamParser, with only small changes. The FLIP side of this only needs the write-state right now, and as we merge the FlipStream and FlipStreamParser, I think we'll get the full state machine hashed out. * POST now works (minimally). I need more testing for large posts. But the unittests are updated (using the new delayed async mock socket work). BUG=none TEST=flip_network_transaction_unittest.cc Review URL: http://codereview.chromium.org/390016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31772 0039d316-1c4b-4281-b951-d872f2087c98
* There was confusion in the mock socket classes due tombelshe@google.com2009-11-111-4/+4
| | | | | | | | | | | | | | | | | | | overlapping names. The MockSocket is not actually a socket. It is an interface for fetching data for reads and writes on a socket. The MockClientSocket and MockTCPClientSocket are the actual sockets. Rename MockSocket to SocketDataProvider. Rename SSLMockSocket to SSLSocketDataProvider. Update all tests to reflect name change. BUG=none TEST=none Review URL: http://codereview.chromium.org/384024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31640 0039d316-1c4b-4281-b951-d872f2087c98
* Pickup some server nits from the checkin on the GFE side.mbelshe@google.com2009-11-102-32/+49
| | | | | | | | | | | | No significant code changes here, just some renames, minor reworkings and comment additions. BUG=none TEST=none Review URL: http://codereview.chromium.org/372074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31564 0039d316-1c4b-4281-b951-d872f2087c98
* Switch chrome to requesting full-urls over FLIP rather thanmbelshe@google.com2009-11-102-18/+14
| | | | | | | | | | | | | | | URIs. This is so that the protocol (http/https) can be conveyed directly from the client. This makes the host header irrelevant. Will update the spec. Updated the unit tests to reflect the host header removal. TEST=flip_network_transaction_unittest.cc BUG=none Review URL: http://codereview.chromium.org/379011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31530 0039d316-1c4b-4281-b951-d872f2087c98
* Fix some over-80-char lines.mbelshe@google.com2009-11-091-4/+11
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/381008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31506 0039d316-1c4b-4281-b951-d872f2087c98
* Take3:mbelshe@google.com2009-11-068-362/+654
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the FlipProtocol to separate the Clike structs from the methods. Without this refactoring, we didn't have a clean way to allocate and deallocate FlipFrames. Now we can use the scoped_ptr cleanly. Summary of misc changes: * Merged in some small changes from the GFE side. * flip_protocol.h Changes substantially. We now have separate structs and classes. No longer can you cast from one frame type to another. All FlipFrame classes derive from FlipFrame. A FlipFrame owns a buffer which is used for the frame, and when you create the Frame, you can specify whether the FlipFrame will selfclean its buffer or not. This makes it cheap to instantiate a FlipFrame class on the stack and use it temporarily for accessing fields without having to do any copies or allocations. * You can't use sizeof(FlipFrame) anymore that is now a class. Added a static "size()" method to each FlipFrame type for declaring its real size. * Refactored a couple of routines in flip_framer. These were previously in a huge state machine (ProcessInput), just copied the code into subroutines. * Added flip_protocol_test to the mix from the gfe side. Much of this is a refactoring from flip_framer_test. * Eliminated reinterpret_casts as much as I could and got rid of all uses of scoped_array for FlipFrames. BUG=none TEST=all flip tests reworked Review URL: http://codereview.chromium.org/377014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31305 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 31277 - Take 2:willchan@chromium.org2009-11-068-654/+362
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the FlipProtocol to separate the Clike structs from the methods. Without this refactoring, we didn't have a clean way to allocate and deallocate FlipFrames. Now we can use the scoped_ptr cleanly. Summary of misc changes: * Merged in some small changes from the GFE side. * flip_protocol.h Changes substantially. We now have separate structs and classes. No longer can you cast from one frame type to another. All FlipFrame classes derive from FlipFrame. A FlipFrame owns a buffer which is used for the frame, and when you create the Frame, you can specify whether the FlipFrame will selfclean its buffer or not. This makes it cheap to instantiate a FlipFrame class on the stack and use it temporarily for accessing fields without having to do any copies or allocations. * You can't use sizeof(FlipFrame) anymore that is now a class. Added a static "size()" method to each FlipFrame type for declaring its real size. * Refactored a couple of routines in flip_framer. These were previously in a huge state machine (ProcessInput), just copied the code into subroutines. * Added flip_protocol_test to the mix from the gfe side. Much of this is a refactoring from flip_framer_test. * Eliminated reinterpret_casts as much as I could and got rid of all uses of scoped_array for FlipFrames. BUG=none TEST=all flip tests reworked Review URL: http://codereview.chromium.org/376012 TBR=mbelshe@google.com Review URL: http://codereview.chromium.org/371027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31281 0039d316-1c4b-4281-b951-d872f2087c98
* Take 2:mbelshe@google.com2009-11-068-362/+654
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the FlipProtocol to separate the C-like structs from the methods. Without this refactoring, we didn't have a clean way to allocate and deallocate FlipFrames. Now we can use the scoped_ptr cleanly. Summary of misc changes: * Merged in some small changes from the GFE side. * flip_protocol.h Changes substantially. We now have separate structs and classes. No longer can you cast from one frame type to another. All FlipFrame classes derive from FlipFrame. A FlipFrame owns a buffer which is used for the frame, and when you create the Frame, you can specify whether the FlipFrame will self-clean its buffer or not. This makes it cheap to instantiate a FlipFrame class on the stack and use it temporarily for accessing fields without having to do any copies or allocations. * You can't use sizeof(FlipFrame) anymore - that is now a class. Added a static "size()" method to each FlipFrame type for declaring its real size. * Refactored a couple of routines in flip_framer. These were previously in a huge state machine (ProcessInput), just copied the code into subroutines. * Added flip_protocol_test to the mix from the gfe side. Much of this is a refactoring from flip_framer_test. * Eliminated reinterpret_casts as much as I could and got rid of all uses of scoped_array for FlipFrames. BUG=none TEST=all flip tests reworked Review URL: http://codereview.chromium.org/376012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31277 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 31252 - Rework the FlipProtocol to separate the Clike structs from thewillchan@chromium.org2009-11-068-652/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | methods. Without this refactoring, we didn't have a clean way to allocate and deallocate FlipFrames. Now we can use the scoped_ptr cleanly. Summary of misc changes: * Merged in some small changes from the GFE side. * flip_protocol.h Changes substantially. We now have separate structs and classes. No longer can you cast from one frame type to another. All FlipFrame classes derive from FlipFrame. A FlipFrame owns a buffer which is used for the frame, and when you create the Frame, you can specify whether the FlipFrame will selfclean its buffer or not. This makes it cheap to instantiate a FlipFrame class on the stack and use it temporarily for accessing fields without having to do any copies or allocations. * You can't use sizeof(FlipFrame) anymore that is now a class. Added a static "size()" method to each FlipFrame type for declaring its real size. * Refactored a couple of routines in flip_framer. These were previously in a huge state machine (ProcessInput), just copied the code into subroutines. * Added flip_protocol_test to the mix from the gfe side. Much of this is a refactoring from flip_framer_test. * Eliminated reinterpret_casts as much as I could and got rid of all uses of scoped_array for FlipFrames. BUG=none TEST=all flip tests reworked Review URL: http://codereview.chromium.org/366014 TBR=mbelshe@google.com Review URL: http://codereview.chromium.org/372028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31264 0039d316-1c4b-4281-b951-d872f2087c98
* Rework the FlipProtocol to separate the C-like structs from thembelshe@google.com2009-11-068-360/+652
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | methods. Without this refactoring, we didn't have a clean way to allocate and deallocate FlipFrames. Now we can use the scoped_ptr cleanly. Summary of misc changes: * Merged in some small changes from the GFE side. * flip_protocol.h Changes substantially. We now have separate structs and classes. No longer can you cast from one frame type to another. All FlipFrame classes derive from FlipFrame. A FlipFrame owns a buffer which is used for the frame, and when you create the Frame, you can specify whether the FlipFrame will self-clean its buffer or not. This makes it cheap to instantiate a FlipFrame class on the stack and use it temporarily for accessing fields without having to do any copies or allocations. * You can't use sizeof(FlipFrame) anymore - that is now a class. Added a static "size()" method to each FlipFrame type for declaring its real size. * Refactored a couple of routines in flip_framer. These were previously in a huge state machine (ProcessInput), just copied the code into subroutines. * Added flip_protocol_test to the mix from the gfe side. Much of this is a refactoring from flip_framer_test. * Eliminated reinterpret_casts as much as I could and got rid of all uses of scoped_array for FlipFrames. BUG=none TEST=all flip tests reworked Review URL: http://codereview.chromium.org/366014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31252 0039d316-1c4b-4281-b951-d872f2087c98
* Change some logging for better debugging ofmbelshe@chromium.org2009-11-061-1/+2
| | | | | | | | | | abandoned streams. BUG=none TEST=none Review URL: http://codereview.chromium.org/371017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31244 0039d316-1c4b-4281-b951-d872f2087c98
* Flip: Refactor Flip stream reading and writing out of FlipNetworkTransaction ↵willchan@chromium.org2009-11-064-209/+422
| | | | | | | | | | | | | | | | | | | into FlipStreamParser. FlipNetworkTransaction still contains the TCP socket connection code, but the session setup and all the stream communication code has moved into FlipStreamParser, in anticipation of it being used by the HTTP/SSL code. It's still not quite in the shape I'll need it to be in for use by other clients, but this gets it much closer. Added a test for transaction cancellation and added a basic test for FlipStreamParser. I'll add more tests as I add more consumers. I'm not terribly happy with the name FlipStreamParser, but it mirrors the existing HttpStreamParser in functionality, so oh well. Did some random other cleanups, including deleting unused #includes. Review URL: http://codereview.chromium.org/362017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31196 0039d316-1c4b-4281-b951-d872f2087c98
* Second patch in making destructors of refcounted objects private.jam@chromium.org2009-11-052-3/+6
| | | | | | | | BUG=26749 Review URL: http://codereview.chromium.org/368001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31165 0039d316-1c4b-4281-b951-d872f2087c98
* Flip: FlipSessionPool changes.willchan@chromium.org2009-11-046-82/+98
| | | | | | | | | | | (1) Move it into the HttpNetworkSession so that HttpNetworkTransaction can access it. This is in anticipation of switching HTTP/HTTPS connections over to FLIP. (2) Add some more functionality to FlipSessionPool, allowing HttpNetworkTransactions to check for the existence of other, reusable FlipSessions. Review URL: http://codereview.chromium.org/348066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30909 0039d316-1c4b-4281-b951-d872f2087c98
* Update the FLIP session to use the FlipIOBuffer.mbelshe@google.com2009-11-044-121/+49
| | | | | | | | | | | | | | | | | | | | | | Also removed some of the testing hacks for URL rewriting that are no longer needed. This change removes the 'batching' of frames written to the socket. The reason for doing this is because I'm going to need to start notifying to the upper layer as progress is made on the writes (e.g. upload notifications). When the frames are batched (potentially from different transactions), it becomes very difficult to know when each write completes. I don't think that batching is necessary, as writes will accummulate in the socket buffer, so this should be a better approach. BUG=none TEST=flip_session_unittest.cc Review URL: http://codereview.chromium.org/342088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30898 0039d316-1c4b-4281-b951-d872f2087c98
* Add LoadLog to ClientSocket::Connect().willchan@chromium.org2009-11-021-2/+2
| | | | | | | | TODO: Use LoadLog in FLIP code. Review URL: http://codereview.chromium.org/344026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30765 0039d316-1c4b-4281-b951-d872f2087c98
* Rename PrioritizedIOBuffer to FlipIOBuffer, refactor it intombelshe@google.com2009-10-292-0/+72
| | | | | | | | | | | | | | | | | | | | | | its own file, and have it carry a FlipStream pointer. The PrioritizedIOBuffer was more generic, but after we queued IO, we couldn't track which stream should be notified about the IO completion. Having it carry the FlipStream pointer will enable IO tracking, but with a FlipStream pointer, it is really specific to Flip, so I renamed to FlipIOBuffer. I could have kept a generic (void*) pointer (or used a template), but that seemed unnecessary in this case. This CL just changes the refactoring. Will remove the PrioritizedIOBuffer next. BUG=none TEST=none Review URL: http://codereview.chromium.org/341032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30514 0039d316-1c4b-4281-b951-d872f2087c98
* FLIP: fix new[]/delete mismatch.agl@chromium.org2009-10-291-1/+1
| | | | | | http://codereview.chromium.org/340031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30467 0039d316-1c4b-4281-b951-d872f2087c98
* Rename FlipStreamImpl to FlipStream and separate it out intombelshe@chromium.org2009-10-294-182/+227
| | | | | | | | | | | | its own files. This is a straight refactoring with no other changes BUG=none TEST=none Review URL: http://codereview.chromium.org/348007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30428 0039d316-1c4b-4281-b951-d872f2087c98
* FLIP requests were missing the host header.mbelshe@google.com2009-10-292-18/+26
| | | | | | | | | | | Update the unit test as well. BUG=none TEST=flip_transaction_unittest.cc Review URL: http://codereview.chromium.org/340025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30420 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup the FlipDelegate API a bit in prep for fixing upload.mbelshe@google.com2009-10-284-15/+50
| | | | | | | | | | | | | | | | 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 Review URL: http://codereview.chromium.org/339047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30380 0039d316-1c4b-4281-b951-d872f2087c98
* Update the unit test to test the FLIP client writes as wellmbelshe@google.com2009-10-283-22/+126
| | | | | | | | | | | | | | | | | | | as the FLIP client reads. Then, enable the use of the CONTROL_FLAG_FIN on a request which has no data. Added a new test for a POST. The test passes today, but I will make it stronger with my next pass at fully implementing POST. POST uploads are still not complete BUG=none TEST=none Review URL: http://codereview.chromium.org/338055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30342 0039d316-1c4b-4281-b951-d872f2087c98
* linux: Fix signed vs unsigned issuepiman@chromium.org2009-10-261-5/+4
| | | | | | Review URL: http://codereview.chromium.org/297015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30099 0039d316-1c4b-4281-b951-d872f2087c98
* Add download metrics into FLIP. They aren't used yet,mbelshe@google.com2009-10-243-60/+127
| | | | | | | | | | | | | | but they do measure accurately. Also add some minor cleanup to the FlipSession and added a new test. There is a lot more cleanup to do in FlipSession. BUG=none TEST=none Review URL: http://codereview.chromium.org/333009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30001 0039d316-1c4b-4281-b951-d872f2087c98
* Expand the options for how FLIP runs. The GFE team needsmbelshe@google.com2009-10-212-1/+4
| | | | | | | | | | | | the ability to run a client with ssl & compression turned off. Update the command line to accomodate. BUG=none TEST=none Review URL: http://codereview.chromium.org/315006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29741 0039d316-1c4b-4281-b951-d872f2087c98
* I had some debug URL handling turned on in chromembelshe@google.com2009-10-212-4/+5
| | | | | | | | | | | | making the use-flip mode not useful unless you were using my test environment. Sorry! BUG=none TEST=none Review URL: http://codereview.chromium.org/292040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29597 0039d316-1c4b-4281-b951-d872f2087c98
* Fixup the flip_framer eof-handling semantics now that we havembelshe@google.com2009-10-207-90/+257
| | | | | | | | | | | | | | | | | | the FIN bit in place. The FlipFrameVisitor will always inject a zero-length data packet to the Visitor as a signal that the data stream is complete. Even if the FIN packet was set on a SYN_REPLY (e.g. there are no data packets), the FlipFramer will simulate a zero-length read to the caller. Likewise, zero-length reads are never sent to the visitor unless the FIN packet has been received. This means that the FlipFramer must swallow zero-length data packets. Also merged in changes from server. BUG=none TEST=flip_framer_test.cc Review URL: http://codereview.chromium.org/294015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29513 0039d316-1c4b-4281-b951-d872f2087c98
* Update the flip_protocol header to add flags to all framesmbelshe@google.com2009-10-144-35/+108
| | | | | | | | | | | and a FIN flag. TEST=flip_framer_test.cc BUG=none Review URL: http://codereview.chromium.org/275017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29005 0039d316-1c4b-4281-b951-d872f2087c98