summaryrefslogtreecommitdiffstats
path: root/net/base
Commit message (Collapse)AuthorAgeFilesLines
* Change made by external contributor Ibrar Ahmed (ibrar.ahmad@gmail.com), ↵erikkay@google.com2008-11-118-276/+597
| | | | | | | | | | | | | | | reviewed by erikkay: http://codereview.chromium.org/6577/show ports listen_socket and telnet_server to POSIX I had to make some changes to get this to work on Mac and to fix a few regressions it caused in Windows, so please take a fresh look at this diff Dan. Ibrar, please take a look at the changes from your patch to mine (you may need to diff listen_socket_unittest.h with listen_socket_unittest.cc manually since I moved a bunch of code here). Some were bugs that I should have caught in review, some were bugs that only got tickled on the Mac, others were just cleanup. Comments welcome. Review URL: http://codereview.chromium.org/9260 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5153 0039d316-1c4b-4281-b951-d872f2087c98
* Rename tcp_client_socket.cc to _win.cc (should have been done long ago).dkegel@google.com2008-11-102-6/+6
| | | | | | | | | | Move some truly win32-specific from the 'portable' to the 'platform-specific' category. Enable some tests that already work. Fix a couple signedness mismatch errors that showed up while testing the above. Review URL: http://codereview.chromium.org/9465 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5134 0039d316-1c4b-4281-b951-d872f2087c98
* Switch MessagePumpForIO to use completion ports on Windows.rvargas@google.com2008-11-071-34/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup the separation between MessagePumpForUI and MessagePumpForIO, and convert the latter to use Completion Ports instead of MsgWaitForMultipleobjects to sleep when idle. Remove all traces of Windows messages from MessagePumpForIO, remove the transitional API of completion port notifications and remove WatchObject API. Modify all callers of RegisterIOHandler so that they are no longer using RegisterIOContext, and also handle properly the new semantics of completion ports (notifications even when the IO completes immediately). Add a new interface to allow proper cleanup of disk cache (to replace code that was waiting for pending APCs from the destructor). Add a way for the message pump to perform cleanup of abandoned IO. BUG=B/1344358, 3497, 3630 TESt=unit tests R=darin Review URL: http://codereview.chromium.org/8156 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5021 0039d316-1c4b-4281-b951-d872f2087c98
* Adds import/export of bookmarks to bookmarks.html file.sky@google.com2008-11-071-0/+1
| | | | | | | | | | | | BUG=1649 TEST=bring up bookmark manager and try out import/export from the tools menu. Note that import ALWAYS creates a new folder under the 'Other bookmarks folder' with the name of Imported (x). This is by design. Review URL: http://codereview.chromium.org/9471 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4968 0039d316-1c4b-4281-b951-d872f2087c98
* Insert histograms to support latency experiments with SDCHjar@google.com2008-11-074-1/+38
| | | | | | | | | | | | Gather data to show the duration of time between the first byte sent, to last byte read. Use a second histogram to look at latency when the content-encoding is not really sdch (due to server side experiment, or proxy interference). r=huanr,wtc Review URL: http://codereview.chromium.org/9448 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4941 0039d316-1c4b-4281-b951-d872f2087c98
* Adaptively identify URL subresources and pre-resolve hosts via DNSjar@google.com2008-11-062-5/+15
| | | | | | | | | | | | | | | | | | | | Use the HTTP "referer" header to identify subresources used during a page load. Store that info, and use it when next visiting the referenced hosts to pre-resolve the (probably) needed subresources. This set of changes will surely evolve as we see how it plays out on broader distribution (via histogram measurments), but this should be the foundation of the change. In design specs, this was previously referred to as "adaptive correlated DNS prefetching." r=mbelshe Review URL: http://codereview.chromium.org/9168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4929 0039d316-1c4b-4281-b951-d872f2087c98
* Preserve the output vector for cookie loading. This prevents a few unneeded ↵deanm@chromium.org2008-11-061-10/+13
| | | | | | | | vector growth / copies for the typical cookie database. Review URL: http://codereview.chromium.org/9437 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4889 0039d316-1c4b-4281-b951-d872f2087c98
* Allow DoLoop to be called even while no userdkegel@google.com2008-11-051-21/+97
| | | | | | | | | | | | | | | request is pending. Unlike the Windows implementation, our DoLoop eagerly initiates I/O between its internal buffers and the network, and we have to be ready to pump data when that completes. Also add debugging macros, but leave them disabled until the next time somebody has to understand the state machine. Fixes http://code.google.com/p/chromium/issues/detail?id=4061 Review URL: http://codereview.chromium.org/9152 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4823 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the UploadDataStream::Reset method. Instead,wtc@google.com2008-11-052-16/+8
| | | | | | | | | | | | | | | | rewind an UploadDataStream by recreating the object. Fix a bug in MockTCPClientSocket::Write. It needs to increment write_index_. Add two DCHECKs to simulate the DCHECKS in SSLClientSocketWin::DoPayloadEncrypt. Add a unit test. R=darin,eroman BUG=4062 Review URL: http://codereview.chromium.org/9384 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4819 0039d316-1c4b-4281-b951-d872f2087c98
* Add a unit-test for r4624 (tcpclientsocket recycling on CONNECT).ericroman@google.com2008-11-051-0/+5
| | | | | | | | Also corrects a style problem in r4624 (comment order does not match expression order). Review URL: http://codereview.chromium.org/9369 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4714 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the debugging instrumentation.ericroman@google.com2008-11-042-10/+0
| | | | | | Review URL: http://codereview.chromium.org/9304 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4623 0039d316-1c4b-4281-b951-d872f2087c98
* Enable SSL session resumption by using shared Schannelwtc@google.com2008-11-042-68/+155
| | | | | | | | | | CredHandles instead of per-socket CredHandles. R=darin,maruel BUG=3560 Review URL: http://codereview.chromium.org/8950 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4521 0039d316-1c4b-4281-b951-d872f2087c98
* More instrumentation.ericroman@google.com2008-11-032-0/+10
| | | | | | Review URL: http://codereview.chromium.org/9064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4520 0039d316-1c4b-4281-b951-d872f2087c98
* fix a typo that caused test failures in debug modeerikkay@google.com2008-11-031-1/+1
| | | | | | | | TBR=darin Review URL: http://codereview.chromium.org/9252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4458 0039d316-1c4b-4281-b951-d872f2087c98
* * Add write and read/write support to FileStream (renamed from FileInputStream).erikkay@google.com2008-11-037-296/+537
| | | | | | | | * Moved net/disk_cache/os_file to base/platform_file. Review URL: http://codereview.chromium.org/8843 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4454 0039d316-1c4b-4281-b951-d872f2087c98
* Try to fix Mac and Linux compiles.pkasting@chromium.org2008-11-012-4/+6
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4357 0039d316-1c4b-4281-b951-d872f2087c98
* Expire cookies by last access date, rather than creation date.pkasting@chromium.org2008-11-013-21/+106
| | | | | | | BUG=2906 Review URL: http://codereview.chromium.org/8753 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4354 0039d316-1c4b-4281-b951-d872f2087c98
* There's no Objective in this C++.avi@google.com2008-10-311-0/+0
| | | | | | Review URL: http://codereview.chromium.org/8773 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4307 0039d316-1c4b-4281-b951-d872f2087c98
* Implement a TODO (purge expired cookies in GetAllCookies()) and some small ↵pkasting@chromium.org2008-10-302-85/+111
| | | | | | | | | style fixes (function arguments on one line, remove braces on some single-line loop bodies). Remove some code to count how many cookies we garbage collected, since we never do anything with those numbers. Remove some TODOs that we shouldn't do (per deanm). This is a by-product of my in-progress cookie fixes. Review URL: http://codereview.chromium.org/8683 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4247 0039d316-1c4b-4281-b951-d872f2087c98
* Timeout persistent idle connections after 5 minutes, and increase the socket ↵ericroman@google.com2008-10-292-30/+53
| | | | | | | | | cleanup timer from 5 seconds to 10 seconds. http://code.google.com/p/chromium/issues/detail?id=3574 Review URL: http://codereview.chromium.org/8124 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4112 0039d316-1c4b-4281-b951-d872f2087c98
* Fix "expected, actual" order in cookie monster unittest (which was mostly ↵pkasting@chromium.org2008-10-281-110/+110
| | | | | | | | | "actual, expected"). This is a by-product of my in-progress cookie fixes. Review URL: http://codereview.chromium.org/8852 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4106 0039d316-1c4b-4281-b951-d872f2087c98
* Port a few test_shell_tests. Now it runs 45 of them.evanm@google.com2008-10-271-0/+10
| | | | | | | | | | | | | | | | I removed some files from test_files because scons complains (warns) when a file is both in test_files and input_files. So the files removed from test_files also exist in input_files and at some pointed will be ported anyway. I also made some linking stubs. BUG=3674 Review URL: http://codereview.chromium.org/7974 Patch from Paweł Hajdan jr <phajdan.jr@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4031 0039d316-1c4b-4281-b951-d872f2087c98
* Move Time, TimeDelta and TimeTicks into namespace base.dsh@google.com2008-10-2714-29/+53
| | | | | | Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup of DNS prefetch related filesjar@google.com2008-10-271-4/+5
| | | | | | | | | | | I have a separate change list coming to support predictive DNS resolutions, so I pulled out a pile of mechanical changes (with no semantic changes intendend). r=mbelshe Review URL: http://codereview.chromium.org/8624 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4015 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up filter and content encoding handling jar@google.com2008-10-279-251/+345
| | | | | | | | | | | | | | | | Centralize translation functions (text of "Content-Encoding" to enum) in filter.cc Centralize error recovery (for damaged content encoding headers) in filter.cc Error recovery includes a loss of SDCH encoding headers, plus handling of Apache server bug with gzip files are tagged as also being gzip encoded. Centralize and add a pile of unit tests to this filter code. r=openvcdiff,huanr Review URL: http://codereview.chromium.org/8018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4004 0039d316-1c4b-4281-b951-d872f2087c98
* Pull in latest file from Mozilla.pamg@google.com2008-10-241-8/+34
| | | | | | | | BUG=b/1305245 TEST=none Review URL: http://codereview.chromium.org/8132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3887 0039d316-1c4b-4281-b951-d872f2087c98
* The constructor should initialize callback_ to NULL.wtc@google.com2008-10-241-4/+5
| | | | | | | R=dank Review URL: http://codereview.chromium.org/6372 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3879 0039d316-1c4b-4281-b951-d872f2087c98
* Port:mark@chromium.org2008-10-231-3/+2
| | | | | | | | | | | | | | | | | | | | | | - net/base/dns_resolution_observer.cc - net/http/http_network_transaction.cc - net/url_request/url_request_filter.cc Add to net library the above and: - net/base/dns_resolution_observer.cc - net/base/upload_data_stream.cc - net/http/http_network_layer.cc - net/proxy/proxy_resolver_fixed.cc - net/proxy/proxy_service.cc - net/url_request/url_request_job_manager.cc Add to net_unittests: - net/http/http_network_transaction_unittest.cc - net/http/http_transaction_unittest.cc - net/http/http_util_unittest.cc Patch by Paweł Hajdan jr <phajdan.jr@gmail.com> git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3867 0039d316-1c4b-4281-b951-d872f2087c98
* Bound the maximum buffer size for response headers.ericroman@google.com2008-10-231-0/+3
| | | | | | | | http://code.google.com/p/chromium/issues/detail?id=3654 Review URL: http://codereview.chromium.org/7882 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3827 0039d316-1c4b-4281-b951-d872f2087c98
* Add a net error code for not implemented.ericroman@google.com2008-10-221-0/+3
| | | | | | Review URL: http://codereview.chromium.org/7855 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3758 0039d316-1c4b-4281-b951-d872f2087c98
* Port SSLClientSocket to Linuxdkegel@google.com2008-10-2210-50/+1269
| | | | | | | | | | | | | | | | Passes tests (once you enable them by removing DISABLED_). Probably want to add a mock https server so we can leave those tests enabled when we check in. Had to add full duplex support to TCPClientSocket on Linux to avoid kludgy plumbing issues. Also had to add dummy implementation of X509Certificate::~X509Certificate to prevent link error. Rediffed to current trunk, addressed all review issues. Review URL: http://codereview.chromium.org/4049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3751 0039d316-1c4b-4281-b951-d872f2087c98
* Remove HttpTransaction::Destroy(), and do automatic memory management with ↵ericroman@google.com2008-10-211-0/+30
| | | | | | | | scoped_ptr<>. Review URL: http://codereview.chromium.org/7532 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3701 0039d316-1c4b-4281-b951-d872f2087c98
* Suppress CERT_STATUS_NO_REVOCATION_MECHANISM to be compatiblewtc@google.com2008-10-211-0/+4
| | | | | | | | | | | | with WinHTTP, which doesn't report this error. We need this temporary workaround because our SSL UI tests aren't expecting this error. R=rvargas BUG=3004 Review URL: http://codereview.chromium.org/8022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3680 0039d316-1c4b-4281-b951-d872f2087c98
* We don't support SSL renegotiation yet. Add thewtc@google.com2008-10-215-40/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ERR_SSL_RENEGOTIATION_REQUESTED error code for when we received a renegotiation request from a server. Support the completion of an SSL handshake after we write something. (This happens in a session resumption handshake.) Use the SSL configuration settings to turn on or turn off various versions of the SSL protocol and server certificate revocation checking. Report all the errors of a certificate and whether revocation checking was done in in the server_cert_status_ bitmask. Create a new scoped_cert_chain_context.h header for the ScopedCertChainContext class that used to be in x509_certificate_win.cc, and use it to fix a leak of chain_context on error paths in SSLClientSocketWin::VerifyServerCert. R=rvargas BUG=3002,3003,3004 Review URL: http://codereview.chromium.org/7505 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3664 0039d316-1c4b-4281-b951-d872f2087c98
* Implement the getinfo call for Macavi@google.com2008-10-202-3/+151
| | | | | | Review URL: http://codereview.chromium.org/7665 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3622 0039d316-1c4b-4281-b951-d872f2087c98
* Remove typo in file name *unitest* vs *unittest*jar@google.com2008-10-201-0/+0
| | | | | | | r=openvcdiff, pinkerton Review URL: http://codereview.chromium.org/7510 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3606 0039d316-1c4b-4281-b951-d872f2087c98
* Fix problem where "text/xml" responses get buffered past 512 bytes, causing ↵ericroman@google.com2008-10-172-1/+16
| | | | | | | | | | the response to be truncated. BUG=3521 Review URL: http://codereview.chromium.org/7610 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3567 0039d316-1c4b-4281-b951-d872f2087c98
* Increase socket buffer size from default (8KB) to 64KB.mbelshe@google.com2008-10-171-0/+45
| | | | | | | | | Using a XMLHttpRequest benchmark to download 3MB files, this change contributed ~30% performance boost. Review URL: http://codereview.chromium.org/7426 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3566 0039d316-1c4b-4281-b951-d872f2087c98
* Initial Mac implementation of SSL. Requires the full-duplex socket ↵avi@google.com2008-10-174-20/+765
| | | | | | | | introduced with the Linux/NSS implementation of SSL. Review URL: http://codereview.chromium.org/7090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3525 0039d316-1c4b-4281-b951-d872f2087c98
* Don't call the callback in an unexpected case that will never happen anyway.mark@chromium.org2008-10-161-1/+2
| | | | | | Review URL: http://codereview.chromium.org/7449 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3483 0039d316-1c4b-4281-b951-d872f2087c98
* Don't user uninitialized variables. We should at least fail predictably inmark@chromium.org2008-10-161-1/+1
| | | | | | | not-reached cases. Review URL: http://codereview.chromium.org/7362 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3469 0039d316-1c4b-4281-b951-d872f2087c98
* Make zero-byte responses an error, rather than an empty HTTP/0.9 case.ericroman@google.com2008-10-161-0/+3
| | | | | | Review URL: http://codereview.chromium.org/7381 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3446 0039d316-1c4b-4281-b951-d872f2087c98
* Add a lot of robustness to SDCH filter decodingjar@google.com2008-10-1510-262/+718
| | | | | | | | | | | | | | | | | | | | | | a) Do meta-refresh (and partially disable sdch) when we have an sdch decode error early on (due to lack of dictionary). b) Gracefully handle proxy removal of "gzip" in "content-encoding: sdch,gzip". c) Recover from completely stripped content encoding (in response to a request for which we advertised an SDCH dictionary) by using a filter that can optionally decode sdch with an optional gzip as well. Some field tests have shown problems with this protocol's transit across the ether. The general approach we've adopted is to stop using SDCH on the problematic site when we have problems. This will prevent a malicious site from shutting down all use of SDCH. r=kmixter,openvcdiff,huanr Review URL: http://codereview.chromium.org/6433 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3420 0039d316-1c4b-4281-b951-d872f2087c98
* Reset server_cert_ to NULL after freeing it to preventwtc@google.com2008-10-151-1/+3
| | | | | | | | | a double free bug. R=rvargas Review URL: http://codereview.chromium.org/6806 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3397 0039d316-1c4b-4281-b951-d872f2087c98
* Turn SSLClientSocket into an interface.wtc@google.com2008-10-156-217/+244
| | | | | | | | | | | | | | | | | | | | The original ssl_client_socket.{h,cc} are renamed ssl_client_socket_win.{h,cc}. The new ssl_client_socket.h defines the SSLClientSocket interface, which simply extends the ClientSocket interface with a new GetSSLInfo method. ClientSocketFactory::CreateSSLClientSocket returns SSLClientSocket* instead of ClientSocket*. Replace the SSL protocol version mask parameter to the constructor and factory method by a SSLConfig parameter. R=darin Review URL: http://codereview.chromium.org/7304 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3387 0039d316-1c4b-4281-b951-d872f2087c98
* Support servers that request but don't require SSLwtc@google.com2008-10-142-1/+24
| | | | | | | | | | client authentication. R=rvargas BUG=166 Review URL: http://codereview.chromium.org/7291 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3337 0039d316-1c4b-4281-b951-d872f2087c98
* The Schannel considers some cipher suites (e.g., thewtc@google.com2008-10-132-0/+6
| | | | | | | | | | | | | | AES cipher suites) to be TLS only, and won't allow them to be used in SSL 3.0. If an SSL 3.0 server picks such a cipher suite, we need to handle it as if it were TLS intolerant by turning off TLS and retrying. R=darin BUG=3203,3001 Review URL: http://codereview.chromium.org/7242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3295 0039d316-1c4b-4281-b951-d872f2087c98
* Remove WatchObject calls from FileInputStream.rvargas@google.com2008-10-101-22/+20
| | | | | | Review URL: http://codereview.chromium.org/6030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3258 0039d316-1c4b-4281-b951-d872f2087c98
* Enable AddTrust External CA Root for EV. The patch iswtc@google.com2008-10-101-0/+6
| | | | | | | | | | | contributed by Rob Stradling <rob@comodo.com> of Comodo CA Limited. R=ian BUG=2170 Review URL: http://codereview.chromium.org/3173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3242 0039d316-1c4b-4281-b951-d872f2087c98
* Optimize the mime sniffer based on UMA data and move closer to the HTML 5 spec.abarth@chromium.org2008-10-092-75/+30
| | | | | | | | | | | | | | Removed over 50% of the heuristics while returning the same result 99.996% of the time. Each heuristic we remove reduces the attack surface that honest sites have to worry about when the serve third-party content. (with typo fix this time) R=darin git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3082 0039d316-1c4b-4281-b951-d872f2087c98