summaryrefslogtreecommitdiffstats
path: root/net/url_request
Commit message (Collapse)AuthorAgeFilesLines
* Add a visualizer for the HostCache (DNS cache) on the network internals page.eroman@chromium.org2009-09-021-1/+62
| | | | | | | | BUG=http://crbug.com/14478 Review URL: http://codereview.chromium.org/172100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25227 0039d316-1c4b-4281-b951-d872f2087c98
* Keep track of the live URLRequest instances, and the last 25 that were ↵eroman@chromium.org2009-09-023-100/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | destroyed. This functionality will be used by the "about:net-internal" page to display profiling information for the in-progress requests, as well as the recently completed requests. This does not have any performance impact. Note that all of the tracking operations are constant time. In particular: * Global tracking of all URLRequest instances is done by chaining them as linked list nodes. So we get constant-time insertion/deletion without needing to do any extra heap allocs. * The recent requests list is a circular queue, backed by an array. So insertions are constant time (and we never erase entries, just overwrite). Moreover, the entry types themselves are comprised of {GURL, LoadLog*}, so very little copying actually happens -- LoadLog is refcounted so copy is cheap, and GURL is backed by a std::string which is also refcounted so the copy is cheap. R=darin BUG=http://crbug.com/14478 TEST=unittests. Review URL: http://codereview.chromium.org/173175 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25158 0039d316-1c4b-4281-b951-d872f2087c98
* Add skeleton for an about:net-internal page.eroman@chromium.org2009-09-013-0/+300
| | | | | | | | | | | | | | | | | | This page contains low-level debug information that is of interest to power users, and bug investigators. The output can be filtered by using special sub-URLs. The sub-URLs themselves are listed when visiting about:net-internal, but to give an idea: about:net-internal -- everything about:net-internal/proxyservice -- all things proxy about:net-internal/proxyservice.config -- current settings about:net-internal/hostresolver.hostcache -- dns cache BUG=http://crbug.com/14478 R=darin Review URL: http://codereview.chromium.org/173024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25109 0039d316-1c4b-4281-b951-d872f2087c98
* Move Mozilla FTP LIST response parsing code to net/third_party directory.phajdan.jr@chromium.org2009-09-011-1/+1
| | | | | | | | | | | This should make licensing terms and third-party origin of the code more clear. TEST=none BUG=none Review URL: http://codereview.chromium.org/179041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25047 0039d316-1c4b-4281-b951-d872f2087c98
* Speed up net_unittests by re-using one FTP test server instance.phajdan.jr@chromium.org2009-08-312-73/+68
| | | | | | | | | | | | | | I managed to save 30s with this change! I had to change the interface of the test server a bit. Now the credentials to be used are passed (optionally) for TestPage request, not in the ctor. BUG=none TEST=none Review URL: http://codereview.chromium.org/182031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24942 0039d316-1c4b-4281-b951-d872f2087c98
* Replace the RenderProcessHost.PID function that returns the OS-generatedbrettw@chromium.org2009-08-312-12/+0
| | | | | | | | | | | | | | | | | | | | process ID with an internally-generated id() function. This allows us the guarantee that the IDs are unique over the entire run of the application. This also cleans up some code associated with managing the PID. The main potentially interesting change is now the PID is set uniquely for every creation of RenderProcessHost. It used to be set cleared if the process went away, and re-set if the process was re-created. The ID generation is in ChildProcesInfo so it is also unique between workers and plugins. I had to change some significant things in resource_dispatcher_host_unittest to take into account this new generation of IDs. BUG=17828 TEST=none Review URL: http://codereview.chromium.org/160203 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24899 0039d316-1c4b-4281-b951-d872f2087c98
* Sanitizing the referrer header before starting the automation ↵tommi@chromium.org2009-08-313-9/+17
| | | | | | | | request.TEST=Run automation unit tests.BUG=none Review URL: http://codereview.chromium.org/183004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24888 0039d316-1c4b-4281-b951-d872f2087c98
* Adding command-line option to override bans on certain port numbers through ↵mirandac@chromium.org2009-08-313-1/+79
| | | | | | | | | | a comma-separated list of ports. BUG= http://crbug.com/18307 TEST= url_request_unittest, use commandline flag allowed_ports=1,600. Navigate to http://www.google.com:1 or http://www.google.com:600. You should not get an ERR_UNSAFE_PORT, it will attempt to load the page. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24883 0039d316-1c4b-4281-b951-d872f2087c98
* Add histograms for FTP server types encountered by users.phajdan.jr@chromium.org2009-08-282-1/+42
| | | | | | | | | | | This should help with decision which FTP server types we can safely stop supporting. TEST=none BUG=none Review URL: http://codereview.chromium.org/176020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24824 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix a ton of compiler warnings."tony@chromium.org2009-08-281-5/+3
| | | | | | | | | | | This reverts commit r24792. TBR=estade Review URL: http://codereview.chromium.org/179028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24796 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a ton of compiler warnings.estade@chromium.org2009-08-281-3/+5
| | | | | | | | | | | | | | | Most of these are classes with virtual methods lacking virtual destructors or NULL used in non-pointer context. BUG=none TEST=app_unittests && base_unittests --gtest_filter=-ConditionVariableTest.LargeFastTaskTest patch by Jacob Mandelson <jlmjlm [at] gmail> http://codereview.chromium.org/171028/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid crashing the test process when InterceptRedirector ↵tommi@chromium.org2009-08-271-2/+6
| | | | | | | | | | | | | InterceptRestartRequired fail. The unit tests still fail, but don't crash which allows the other tests to run. TEST=Run UrlRequest unit tests. BUG=none Review URL: http://codereview.chromium.org/173572 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24610 0039d316-1c4b-4281-b951-d872f2087c98
* Implement RestartWithAuth for NewFtpTransaction.phajdan.jr@chromium.org2009-08-263-3/+136
| | | | | | | | | TEST=Covered by net_unittests. http://crbug.com/20112 Review URL: http://codereview.chromium.org/173270 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24449 0039d316-1c4b-4281-b951-d872f2087c98
* Add the ability to not send cookies or send user name/password.levin@chromium.org2009-08-262-0/+88
| | | | | | | | | | | Added unit tests for the above functionality plus the do not save cookies functionality. BUG=http://crbug.com/10961 TEST=Added unit tests for this. Also, this isn't yet called from the rest of the code. Review URL: http://codereview.chromium.org/173206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24412 0039d316-1c4b-4281-b951-d872f2087c98
* Remove uses of deprecated version of FileUtil::ResolveShortcut.evan@chromium.org2009-08-251-2/+2
| | | | | | | | | | BUG=None TEST=run base_unittests.exe Review URL: http://codereview.chromium.org/173181 Patch from Thiago Farina <thiago.farina@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24208 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent a crash that can occur when redirecting a file URL.darin@chromium.org2009-08-217-6/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We redirect a file URL that corresponds to a directory when the file URL does not end in a slash. We redirect to the same URL with a slash appended to simplify other code, which can then rely on the presence of a trailing slash for all file URLs that correspond to a directory. It turns out that following the redirect could result in the job being used after free. The code in URLRequestJob::FollowDeferredRedirect clears some fields after calling FollowRedirect. For all other jobs this is not a problem since the process of following a redirect causes the job to be killed, and URLRequestJob::Kill takes a reference to the job. It turns out that URLRequestFileDirJob was not calling URLRequestJob::Kill, and so this extra reference was not being taken. The fix is two-fold: 1- Make URLRequestFileDirJob call URLRequestJob::Kill just like the rest of the jobs. This seems like a good idea for other reasons as well. 2- Make URLRequestJob::FollowDeferredRedirect not depend on itself being alive after the FollowRedirect call. This just seems good for future cases where a special URLRequestJob subclass might not call URLRequestJob::Kill for some reason or another. Finally, some minor changes were rqeuired to URLRequestFileDirJob to support the call to Kill. See changes to OnListDone. Writing a unit test for this was a bit tricky. It turns out that while the URLRequestFileDirJob is waiting for the client to call FollowDeferredRedirect, it is still traversing the directory. It does not pause the directory listing. The crash could only happen if the directory listing completed before the consumer called FollowDeferredRedirect because a reference to the job was taken on behalf of the DirectoryLister. To test this condition, I made it possible for a test to poll the URLRequestFileDirJob::list_completed_ flag. Once that is set, I then have the test call FollowDeferredRedirect. NOTE: When running within net_unittests, NetModule::SetResourceProvider has not been called. So, I downgraded a NOTREACHED to a DLOG(WARNING). NOTREACHED was a bit excessive since it is a condition that can be reached, and I don't see any problem with allowing unit tests to function without a resource provider. R=wtc BUG=18686 TEST=URLRequestTest.FileDirRedirectNoCrash Review URL: http://codereview.chromium.org/174076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23944 0039d316-1c4b-4281-b951-d872f2087c98
* Pref-backed SSLConfigService for Linux.mattm@chromium.org2009-08-193-3/+15
| | | | | | | | | | Makes SSLConfigService into a ref-counted interface, and makes Profile own an SSLConfigServiceFactory which is used to create the SSLConfigService and pass it through the URLRequestContext on down to where it is actually used. R=eroman,wtc BUG=11507,19290 Review URL: http://codereview.chromium.org/165003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23757 0039d316-1c4b-4281-b951-d872f2087c98
* Renames the function CreateTemporaryFilename to CreateTemporaryFile and ↵erikkay@chromium.org2009-08-181-3/+3
| | | | | | | | | | | | | | track down all callers, also removes the deprecated function that uses std::wstring. BUG=3078 (http://crbug.com/3078) TEST=run base_unittests, installer_util_unittests, net_unittests, setup_unittests, and unit_tests. Review URL: http://codereview.chromium.org/164537 Patch from Thiago Farina. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23631 0039d316-1c4b-4281-b951-d872f2087c98
* Reference count ProxyService.eroman@chromium.org2009-08-183-7/+3
| | | | | | | | | | | | | This is necessary since ProxyService is getting shared between chrome's url request contexts (off the record, media), and the current way it is being shared could result in free memory read/writes during shutdown. This is a step towards fixing http://crbug.com/15289. BUG=http://crbug.com/15289 TEST=The existing tests should continue to pass following this refactor. Review URL: http://codereview.chromium.org/165430 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23612 0039d316-1c4b-4281-b951-d872f2087c98
* Make even more tests in net_unittests faster by reusing the test server.phajdan.jr@chromium.org2009-08-171-106/+67
| | | | | | | | | | | | I gained at least 30s by doing that, and there is still room for improvement! I'm doing changes step-by-step to make sure it won't break mysteriously. TEST=none BUG=none Review URL: http://codereview.chromium.org/172057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23574 0039d316-1c4b-4281-b951-d872f2087c98
* Speed up net_unittests a bit by re-using launched test server.phajdan.jr@chromium.org2009-08-142-22/+53
| | | | | | | | | | | | | | On POSIX it makes the server fork a separate process for each request for better test isolation. Starting with just few tests to limit impact of an eventual breakage. The results are promising. TEST=none BUG=none Review URL: http://codereview.chromium.org/164522 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23481 0039d316-1c4b-4281-b951-d872f2087c98
* LoadLog is used as an output parameter, reorder it to the last parameter.willchan@chromium.org2009-08-142-2/+2
| | | | | | Review URL: http://codereview.chromium.org/164531 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23419 0039d316-1c4b-4281-b951-d872f2087c98
* Make FtpNetworkTransaction report its load state.phajdan.jr@chromium.org2009-08-122-0/+6
| | | | | | | | | TEST=Covered by net_unittests. http://crbug.com/19095 Review URL: http://codereview.chromium.org/164354 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23201 0039d316-1c4b-4281-b951-d872f2087c98
* Add a "LoadLog" parameter to transactions, hostresolver, clientsocketpool ↵ericroman@google.com2009-08-124-4/+16
| | | | | | | | and proyxservice.This dependency comes from the parent URLRequest, and is used as a container for per-request profiling data.This change is strictly a no-op refactor -- the parameter is unused, and LoadLog does nothing.BUG=http://crbug.com/14478TEST=none -- just needs to compile and pass existing tests.DESIGN=<http://docs.google.com/Doc?id=dfhcnb2v_21gbtrcpr3&hl=en> Review URL: http://codereview.chromium.org/126303 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23127 0039d316-1c4b-4281-b951-d872f2087c98
* Add checks to DEBUG mode that no instance of URLRequest or URLFetcher ↵ericroman@google.com2009-08-111-0/+3
| | | | | | | | | | | | | | | | | | | | survives the destruction of the IO thread. This checking is done by introducing a new helper class to base called LeakTracker. Classes that you want to check for leaks just need to extend LeakTracker. The reason I am picking on URLFetcher / URLRequest, is I believe we have a bug that is making an instance of URLFetcher to outlive the IO thread. This causes various sorts of badness. For example: If URLFetcher survives the IO thread, then URLRequestContext remains referenced and therefore also survives IO thread. In turn HostResolverImpl survives the IO thread, so any outstanding resolve requests are NOT cancelled before the IO thread is decomissioned. So now, when the worker thread doing the DNS resolve finally finishes (assuming it finishes before the rogue URLRequest is destroyed), it post the result to a defunct message loop. KAB00m! (http://crbug.com/15513) Moreover, I believe we hit this same problem sporadically in AutomationProxyTest.AutocompleteGetSetText -- the test is flaky on the buildbots, and I've seen DCHECKs which suggest it is related to this issue. BUG=http://crbug.com/18372 Review URL: http://codereview.chromium.org/160447 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23084 0039d316-1c4b-4281-b951-d872f2087c98
* Re-enable remaining FTP unit tests.phajdan.jr@chromium.org2009-08-072-5/+3
| | | | | | | | | | | Also, use NotifyDone in URLRequestNewFtpJob instead of NotifyStartError. This way is_pending in URLRequest is correctly reset to false. TEST=Covered by net_unittests. http://crbug.com/18036 Review URL: http://codereview.chromium.org/165142 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22752 0039d316-1c4b-4281-b951-d872f2087c98
* Relanding Coverity fixes from http://codereview.chromium.org/159862 ↵phajdan.jr@chromium.org2009-08-061-3/+1
| | | | | | | | | | | | | excluding the broken ones. The change of GURL -> const GURL& caused some nasty crash and the change got reverted. TEST=none BUG=none Review URL: http://codereview.chromium.org/164095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22682 0039d316-1c4b-4281-b951-d872f2087c98
* Submitting http://codereview.chromium.org/164076 for syf1984@gmail.com (aka ↵robertshield@chromium.org2009-08-061-1/+28
| | | | | | | | | | | | miletus): Make the timeout in WaitToStart() of TestServerLauncher parametrized and expose this parameter to HTTPTestServer::CreateServer() TBR=syf1984@gmail.com, tommi@chromium.org Review URL: http://codereview.chromium.org/164090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22667 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of r22559.aa@chromium.org2009-08-061-2/+1
| | | | | | | | | | | | | | | | | | This caused an easily reproducible crash: 1. Start with a fresh profile 2. Navigate to google.com 3. Restart 4. Navigate to google.com 5. crash The change from pass-by-value to pass-by-ref in fav_icon_helper.* seems to be to blame, but I can't see it right off. TBR=phajdan.jr@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22595 0039d316-1c4b-4281-b951-d872f2087c98
* Bunch of Coverity fixes, rather minor severity.phajdan.jr@chromium.org2009-08-061-1/+2
| | | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/159862 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22559 0039d316-1c4b-4281-b951-d872f2087c98
* Correctly handle multiple control responses for RETR command.phajdan.jr@chromium.org2009-08-051-4/+2
| | | | | | | | | | | | Re-enable tests which were intermittently failing before this fix and remove debugging code used to track down the issue. TEST=Covered by net_unittests. http://crbug.com/18036 Review URL: http://codereview.chromium.org/160537 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22500 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a hang if directory listing size is > 8K, for example,wtc@chromium.org2009-07-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | ftp://ftp.mozilla.org/pub/addons/ The problem is that data was spooling on network stack and after 8K data TCP Window size becomes small and no more data is received after 8K. The fix is to change the ERROR_CLASS_INITIATED case in the ProcessResponseLIST function to not go back to the STATE_CTRL_READ state. In URLRequestNewFtpJob::ProcessFtpDir. construct the std::string from buf->data() and its length so that buf->data() doesn't need to be null-terminated. Author: Ibrar Ahmed <ibrar.ahmad@gmail.com> Original review: http://codereview.chromium.org/146137 R=wtc,phajdan.jr BUG=http://crbug.com/4965 TEST=ftp://ftp.mozilla.org/pub/addons/ Review URL: http://codereview.chromium.org/159663 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22217 0039d316-1c4b-4281-b951-d872f2087c98
* Disable FTP tests failing intermittently on Mac.phajdan.jr@chromium.org2009-07-311-2/+4
| | | | | | | | | | | The root cause is a bug in the code. I'm working on a fix. TEST=none http://crbug.com/18036 Review URL: http://codereview.chromium.org/160484 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22208 0039d316-1c4b-4281-b951-d872f2087c98
* Fix 307 redirects of a POST request to actually send the body again, and add adarin@chromium.org2009-07-302-3/+2
| | | | | | | | | | | | | | | test. Note: the fix is trivial, but adding support for a test required teaching the FileHandler of testserver to consume a post body. BUG=16832 TEST=covered by unit test R=abarth Review URL: http://codereview.chromium.org/149710 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22100 0039d316-1c4b-4281-b951-d872f2087c98
* Re-enable half of new ftp unit tests in url_request_unittest.cc.phajdan.jr@chromium.org2009-07-301-32/+23
| | | | | | | | | | | | This change might introduce flakiness and test hangs, but we have infrastructure in place to quickly detect it. TEST=none http://crbug.com/18036 Review URL: http://codereview.chromium.org/159614 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22069 0039d316-1c4b-4281-b951-d872f2087c98
* Add plumbing for allowing the renderer to intercept and cancel redirects beforedarin@chromium.org2009-07-308-32/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | they are sent. A good portion of this CL is to support the new UI test. The IPC to notify the renderer of a redirect now includes a ResponseInfo struct allowing WebURLLoaderImpl to provide detailed response info (including response headers) to WebKit. This isn't strictly necessary, but I thought I'd include this to make the code more future proof. A cross origin restriction is added to SyncResourceHandler::OnRequestRedirected that mimics the code in WebCore/platform/network/cf/ResourceHandleCFNet.cpp. This is most unfortunate, and I filed a bug at bugs.webkit.org about the similar duplication of logic in WebCore. There seemed to be enough code paths leading to request cancellation at the ResourceDispatcher level that I couldn't easily ensure that a request only gets cancelled once. So, I added an is_cancelled flag to record if it is not necessary to send a ViewHostMsg_CancelRequest IPC. This avoids some warnings in the ResourceDispatcherHost. To support my UI test, I needed to change URLRequestMockHttpJob to know how to serve redirects. I moved URLRequestHttpJob::IsRedirectResponse to its base class, URLRequestJob so that the implementation could be shared. This revealed a minor bug in URLRequest. We were never resetting response_info_ upon following a redirect. I added this code consolidated similar code from URLRequest::Redirect and URLRequest::RestartWithJob into a new PrepareToRestart method. To support my UI test, I added a "hit count" field to URLRequestFilter, and I added an associated automation IPC to query the value. The test was a bit challenging to write because there is no way to tell the difference from JS. Before and after, it appears to JS as though the cross-origin redirect failed. However, the server can see the extra redirect request. So, I simply record the number of hits against URLs of the form http://mock.http/foo, and use that to observe if any extra requests were made. I implemented the new IPC message by extending the AutomationResourceMessageFilter. This allowed me to trap the IPC message on the IO thread where it is safe to probe the URLRequestFilter. I then changed the implementation of AutomationMsg_SetFilteredInet to work similarly. I revised URLRequestMockHTTPJob::GetOnDiskPath to support ports. This actually allowed me to reuse URLRequestMockHTTPJob to service URLs in different security origins. My test redirects from http://mock.http/ to http://mock.http:4000/. Please see the comments in cross-origin-redirect-blocked.html for details about how the test functions. R=brettw,wtc BUG=16413 TEST=covered by resource_dispatcher_host_uitest.cc Review URL: http://codereview.chromium.org/159370 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22067 0039d316-1c4b-4281-b951-d872f2087c98
* Moved the logical dependency on Blacklist from URLRequestContextidanan@chromium.org2009-07-281-7/+1
| | | | | | | | | | | to ChromeURLRequestContext. BUG=16932 TEST=none Review URL: http://codereview.chromium.org/159519 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21874 0039d316-1c4b-4281-b951-d872f2087c98
* Navigation and cookies for Automationamit@chromium.org2009-07-282-10/+9
| | | | | | | | | | | | | Give Automation better visibility and control over navigations. Also, make it possible for automation to implement a dummy cookie store to go with dummy request serving over automation. BUG=none TEST=none Review URL: http://codereview.chromium.org/159189 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21836 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup in url_request_new_ftp_job.phajdan.jr@chromium.org2009-07-272-3/+1
| | | | | | | | | | | The header tried overriding a non-virtual method, changing its visibility. By the way, there was no implementation provided for this "overriden" method. I just hit that while fixing other things. Review URL: http://codereview.chromium.org/160173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21730 0039d316-1c4b-4281-b951-d872f2087c98
* Return Error Status Upon Blocking Requestsidanan@chromium.org2009-07-242-5/+5
| | | | | | | | | | | | | | | Blocked requests now return an error status so that the Chrome throbber does not spin indefinitely when blocking URL requests. This code shall be replaced with resource substitution next but gives a better experience until then. Same goes for the added type-based interception. TEST=none BUG=16932 Review URL: http://codereview.chromium.org/159214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21536 0039d316-1c4b-4281-b951-d872f2087c98
* Add support to URLRequest for deferring redirects.darin@chromium.org2009-07-236-37/+154
| | | | | | | | | | | | | | | | | | | | I chose to add an out parameter to OnReceivedRedirect because it allows for the default behavior to remain the same. I considered adding a ContinueAfterRedirect method that all OnReceivedRedirect implementations would need to call, but this caused one annoying problem: In the case of a ChromePlugin, it is possible for the URLRequest to get deleted inside the handler for the redirect. This would make it hard to subsequently call a method on the URLRequest since I would need to have a way to determine if the URLRequest had been deleted. TEST=covered by unit tests BUG=16413,6442 R=eroman,wtc Review URL: http://codereview.chromium.org/155897 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21417 0039d316-1c4b-4281-b951-d872f2087c98
* Change URLRequest to return net::ERR_INVALID_URL on redirects to invalid urls.willchan@chromium.org2009-07-212-0/+18
| | | | | | | | | BUG=http://crbug.com/17126 TEST=net_unittests Review URL: http://codereview.chromium.org/159034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21234 0039d316-1c4b-4281-b951-d872f2087c98
* Use base::Time::Exploded instead of struct tm inwtc@chromium.org2009-07-171-30/+4
| | | | | | | | | | | | | | | ftp_directory_parser.{h,cc}. The patch is contributed by Ibrar Ahmed <ibrar.ahmad@gmail.com>. Original review URL: http://codereview.chromium.org/126096 R=wtc BUG=http://crbug.com/4965 TEST=none Review URL: http://codereview.chromium.org/149772 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21003 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a typo pointed out by wtc after I checked in.jshin@chromium.org2009-07-161-1/+1
| | | | | | | | | | | BUG=NONE TEST=NONE TBR=wtc Review URL: http://codereview.chromium.org/149726 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20818 0039d316-1c4b-4281-b951-d872f2087c98
* Refactorings surrounding HostResolver:ericroman@google.com2009-07-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | (1) Extract HostResolver to an interface. The existing concrete implementation is now named HostResolverImpl. This makes it possible to create mocks with more complex behavior (i.e. choose via rules if response will be sync vs async). (2) Transform HostMapper into HostResolverProc. Conceptually HostResolverProc maps a hostname to a socket address, whereas HostMapper mapped a hostname to another hostname (so you were still at the mercy of the system's host resolver). With HostResolverProc you can specify the exact AddressList, making it possible to run tests requiring IPv6 socketaddrs on systems (like WinXP) that don't actually support it. (3) Add a MockHostResolver implementation of HostResolver. This replaces the [ScopedHostMapper + RuleBasedHostMapper + HostResolver] combo. It is less clunky and a bit more expressive. BUG=http://crbug.com/16452 R=willchan TEST=existing Review URL: http://codereview.chromium.org/149511 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20795 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the local directory listing, FTP directory listing and the local file ↵jshin@chromium.org2009-07-094-18/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | handling (drag'n'drop and opening from the file list). For the local file listing, use the OS file system encoding. For the FTP directory listing, use ICU's encoding detector.GetDirectoryListingEntry and GetDirectoryLisingHeader were changed to accept string16 for file/directory names. To the former, a new parameter (|raw_bytes|) was added. It can be used to make a FTP request to a file with a non-ASCII name encoded in a legacy encoding. For the local file handling on Windows, get rid of the code for 'doubly converted' UTF-8 in FileURLToFilePath, which led to issue 4619 and add a few cases to NetUtil*.FileURLConversion* test. In addition, add CodepageToUTF16 and UTF16ToCodepage along with a new unittest (ConvertBetweenCodepageAndUTF16) that shares the same set of case as ConvertBetweenCodepageAndWide. The test cases were expanded and revised a bit. BUG=2939,13229,4619 http://crbug.com/2939 http://crbug.com/13229 http://crbug.com/4619 TEST=1. Pass URLRequest*.FTP* (net_unittests) 2. Pass StringUtiltTest.ConvertBetweenCode* 3. Pass NetUtil*.GetDirectoryLis* (net_unittests) 4. Open a local directory containing files with non-ASCII names and they're displayed correctly in the directory list. On Windows and Mac OS X, it should always work. On Linux, your locale encoding (as returned by nl_langinfo(CODESET)) should match the actual encoding used in your filename. 5a. Pass NetUtil*.FileURL* (net_unittests) with the default codepage set to 1252 and 932. 5b. Make a file named 'caf챕.txt' on Windows and see if it can be opened both by clicking in the directory listing page of Chrome and by drag'n'drop. Test this with the default OS code pages set to Windows-1252, Windows-1251 (Russian) and Windows-932 (Japanese). Review URL: http://codereview.chromium.org/151065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20331 0039d316-1c4b-4281-b951-d872f2087c98
* Fix 15 coverity complaints.rvargas@google.com2009-07-012-3/+3
| | | | | | | | | | | | Most of the changes are cosmetic, but there is also a memory leak in CreateExpiredServer. BUG=none TEST=none Review URL: http://codereview.chromium.org/153001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19788 0039d316-1c4b-4281-b951-d872f2087c98
* Create a more fine grained histogram of SDCH payload sizesjar@chromium.org2009-06-291-2/+2
| | | | | | | r=mbelshe Review URL: http://codereview.chromium.org/149119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19491 0039d316-1c4b-4281-b951-d872f2087c98
* Make net::HostResolver refcounted.ericroman@google.com2009-06-273-8/+3
| | | | | | | | | | | This way it can be properly shared between the url request contexts, and the dns prefetcher, and dns observer. BUG=http://crbug.com/14664 TEST=existing unit tests. Review URL: http://codereview.chromium.org/149053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19451 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 19425.ericroman@google.com2009-06-263-3/+8
| | | | | | Review URL: http://codereview.chromium.org/147242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19432 0039d316-1c4b-4281-b951-d872f2087c98