summaryrefslogtreecommitdiffstats
path: root/net/proxy
Commit message (Collapse)AuthorAgeFilesLines
* Move over another legacy "LoadLog-style" event generator to routing its ↵eroman@chromium.org2010-03-163-51/+60
| | | | | | | | | | messages through the NetLog. BUG=37421 Review URL: http://codereview.chromium.org/1052002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41768 0039d316-1c4b-4281-b951-d872f2087c98
* Generalize the net module's LoadLog facility from a passive container, to an ↵eroman@chromium.org2010-03-1620-270/+279
| | | | | | | | | | | | | | | | event stream (NetLog). This makes it possible to associate a single NetLog with a URLRequestContext, and then attach observers to that log to watch the stream of events. This changelist attempts to do the most direct translation, so there will be subsequent iterations to clean up. The user-visible behavior should remain unchanged. BUG=37421 Review URL: http://codereview.chromium.org/848006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41689 0039d316-1c4b-4281-b951-d872f2087c98
* Remove LOG(WARNING)s for when fails to parse proxy bypass rules.eroman@chromium.org2010-03-111-5/+3
| | | | | | | | | | This can pollute the log since it gets hit often (each time poll for checks). BUG=none Review URL: http://codereview.chromium.org/781001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41243 0039d316-1c4b-4281-b951-d872f2087c98
* Use CHECK_* in netwillchan@chromium.org2010-03-021-2/+2
| | | | | | Review URL: http://codereview.chromium.org/660404 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40453 0039d316-1c4b-4281-b951-d872f2087c98
* ProxyConfig behaved like a struct, but was defined as a class.eroman@chromium.org2010-02-2415-452/+618
| | | | | | | | | Changed it to be a proper class with hidden implementation variables, setters etc. Also seized this opportunity to move the bypass list from being a member of ProxyConfig, to being a member of ProxyRules. This is a more correct hiearchy, since the bypass rules only apply to the manual settings. Lastly, this makes it possible to have the manual rules evaluation be a method on ProxyRules, and shift some more code out of proxy_service. Review URL: http://codereview.chromium.org/651070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39818 0039d316-1c4b-4281-b951-d872f2087c98
* Really connect to the same server in FTP network transaction.phajdan.jr@chromium.org2010-02-201-1/+1
| | | | | | | | | | | | Also create necessary infrastructure to know the address a client socket is connected to. TEST=Covered by net_unittests. BUG=35670 Review URL: http://codereview.chromium.org/598071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39559 0039d316-1c4b-4281-b951-d872f2087c98
* Split out the handling of proxy bypass rules into ProxyBypassRules. There ↵eroman@chromium.org2010-02-1916-569/+717
| | | | | | | | | | | | | | are some pretty complicated rules, and this helps isolate that code and better test it. This also lays a framework for addressing bug 9835 (IP/CIDR matching) Lastly, adds support for the exclusion format ".domain" on all platforms, which is interpreted as "*.domain". BUG=28112 TEST=ProxyBypassRulesTest.* Review URL: http://codereview.chromium.org/601070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39486 0039d316-1c4b-4281-b951-d872f2087c98
* Added factories for HttpAuthHandler.cbentzel@chromium.org2010-02-151-3/+5
| | | | | | | | | | | | | | | | | | | The driving rationale for this change was to prevent choosing an AuthHandler when it is not supported on the system due to a missing runtime component (such as not being able to locate a gssapi shared library when seeing a Negotiate scheme). It also has the advantage (currently unused) of determining some per-auth-scheme properties only the first time that a challenge for that scheme is seen (such as maximum token length for the SSPI implementation of NTLM). Finally, it may make unit tests easier to generate since the factory can be easily mocked. BUG=34795 TEST=New unit test for HttpAuthHandlerDispatchFactory. Review URL: http://codereview.chromium.org/582007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39065 0039d316-1c4b-4281-b951-d872f2087c98
* Minor unittest cleanup.eroman@chromium.org2010-02-051-24/+21
| | | | | | | | | BUG=None TEST=None Review URL: http://codereview.chromium.org/561082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38244 0039d316-1c4b-4281-b951-d872f2087c98
* Re-enable a unittest which failed on valgrind thread sanitizer.eroman@chromium.org2010-02-051-1/+5
| | | | | | | | | | | | | TSAN had reported a race on the bool |should_block_|, between BlockableProxyResolver::GetProxyForURL() and BlockableProxyResolver::Unblock(). I avoided the problem by calling WaitUntilBlocked() before Unblock(), which is the same pardigm used by the other tests. Really, the best fix is to remove that limitation from BlockableProxyResolver... left that as a future TODO. TBR=willchan Review URL: http://codereview.chromium.org/561083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38195 0039d316-1c4b-4281-b951-d872f2087c98
* Disable a test which is causing an error under valgrind TSAN.eroman@chromium.org2010-02-051-1/+1
| | | | | | | | | | It looks like there is a problem with the test setup (BlockableProxyResolver tests a bool outside of a lock). I will fix that next. TBR=willchan Review URL: http://codereview.chromium.org/578011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38194 0039d316-1c4b-4281-b951-d872f2087c98
* Add a timing measurement to LoadLog that shows how long a proxy resolve ↵eroman@chromium.org2010-02-052-2/+85
| | | | | | | | | request was stalled waiting to be scheduled to a thread. TEST=SingleThreadedProxyResolverTest.UpdatesLoadLogWithThreadWait Review URL: http://codereview.chromium.org/570019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38181 0039d316-1c4b-4281-b951-d872f2087c98
* Add unittest for r37566 (on PAC failure, should fallback to DIRECT).eroman@chromium.org2010-02-052-9/+23
| | | | | | | | | | | | To make it more testable, I had to move the fallback code in question from HttpNetworkTransaction to ProxyService. Although I think this is a better fit for that code anway, so it should be an overall readability improvement. BUG=32316 TEST=ProxyServiceTest.ProxyFallback_BadConfig, ProxyServiceTest.ProxyResolverFails Review URL: http://codereview.chromium.org/556087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38177 0039d316-1c4b-4281-b951-d872f2087c98
* Pass the NetworkChangeNotifier to HostResolver.willchan@chromium.org2010-02-043-7/+6
| | | | | | | | | | | | | | | This requires the following refactors: (1) NetworkChangeNotifier moves out of HttpNetworkSession into IOThread. (2) HostResolver gets initialized with NetworkChangeNotifier. (3) NetworkChangeNotifier needs to get passed into HttpCache and HttpNetworkSession (required updating a lot of files). (4) NetworkChangeNotifier is no longer reference counted. It is owned by IOThread. (5) IOThread gains a new struct: Globals. It can only be used on the io thread. (6) ChromeURLRequestContextFactory uses IOThread::Globals to initialize ChromeURLRequest objects with the host resolver and network change notifier. BUG=26159 Review URL: http://codereview.chromium.org/552117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38052 0039d316-1c4b-4281-b951-d872f2087c98
* Add fine grain tracing to HostResolverImpl.eroman@chromium.org2010-02-021-1/+0
| | | | | | | | | | | | | This will help in diagnosing the "slow resolving host" bugs. Users can now click an "Enable tracing" button on "chrome://net-internals/hostresolver". This logs detailed information on the DNS requests flowing through the browser (when they were received, when they were posted to the thread pool, when they started running on the worker thread, etc...). BUG=12754 Review URL: http://codereview.chromium.org/556094 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37776 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup the unittest helpers in load_log_unittest.h.eroman@chromium.org2010-01-293-65/+63
| | | | | | | | | | | Consolidates all the callers to using the testing::AssertionResult() flavor, and renames them to have "Event" in the name. This rename is in anticipation of adding testers for other entry types. BUG=NONE TEST=existing Review URL: http://codereview.chromium.org/551135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37501 0039d316-1c4b-4281-b951-d872f2087c98
* Add a histogram to record how long fetching the system proxy settings takes:eroman@chromium.org2010-01-281-0/+11
| | | | | | | | | | | Net.ProxyPollConfigurationTime On Windows, this corresponds to the duration of WinHttpGetIEProxyConfigForCurrentUser(), which we have seen can run very slowly on some systesm. This histogram tries to gauge the extent of the problem. BUG=12189 Review URL: http://codereview.chromium.org/553122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37352 0039d316-1c4b-4281-b951-d872f2087c98
* Add more functionality to about:net-internals:eroman@chromium.org2010-01-132-0/+23
| | | | | | | | | | | | | (1) Display the cached bad proxies, and how long until they will be retried (addresses an old TODO). (2) Add a button to clear the bad proxies cache. (3) Add a button to force refetching of the proxy configuration (this can be used to force refetch of PAC files, very convenient when testing). BUG=none TEST=none Review URL: http://codereview.chromium.org/541045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36159 0039d316-1c4b-4281-b951-d872f2087c98
* Retry proxies which were cached as bad before giving up.eroman@chromium.org2010-01-126-17/+97
| | | | | | | | | | | This morphs ProxyList::RemoveBadProxies() into ProxyList::DeprioritizeBadProxies(), such that "bad proxies" are moved to the end of the fallback list rather than removed alltogether. BUG=31983 TEST=ProxyListTest.DeprioritizeBadProxies Review URL: http://codereview.chromium.org/542029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36054 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a NetworkChangeNotifier dependency to ProxyService; when we observer a ↵eroman@chromium.org2010-01-083-50/+190
| | | | | | | | | | | | | | | network change through the notifier, the ProxyService re-configures itself. So for example, if you were to switch to VPN and are using a custom PAC URL, we will re-download that URL on the new network. Similarly if you are using auto-detect PAC settings, we will re-run the autodiscovery steps for the next resolve. Note that Chromium is still passing a NULL NetworkChangeNotifier dependency into its ProxyService -- until it passes a real implementation, this will not impact Chrome. BUG=12293 TEST=ProxyServiceTest.NetworkChangeTriggersPacRefetch Review URL: http://codereview.chromium.org/525104 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35772 0039d316-1c4b-4281-b951-d872f2087c98
* Log the results of proxy resolution to LoadLog when "full logging mode" is ↵eroman@chromium.org2010-01-075-17/+39
| | | | | | | | | | | | | | enabled. Examples of what the logged text looks like: "Resolved proxy list: PROXY foobar:6233" "Resolved proxy list: DIRECT" "Resolved proxy list: PROXY foobar:80;SOCKS5 baz:1080;DIRECT" Review URL: http://codereview.chromium.org/518042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35749 0039d316-1c4b-4281-b951-d872f2087c98
* Re-order some declarations in ProxyService, to ensure that deletion of ↵eroman@chromium.org2010-01-063-6/+78
| | | | | | | | | | | InitProxyResolver happens *after* the deletion of ProxyResolver. BUG=24864 TEST=ProxyServiceTest.DeleteWhileInitProxyResolverHasOutstandingFetch, ProxyServiceTest.DeleteWhileInitProxyResolverHasOutstandingSet Review URL: http://codereview.chromium.org/519060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35643 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the implicit fallback to DIRECT when proxies fail. This better ↵eroman@chromium.org2010-01-059-147/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | matches other browsers, and simplifies the code. To better understand what this means, here are some examples how the behaviors will differ for the user: (1) You start chrome with --proxy-server="foobar:80". The server "foobar:80" is refusing connections. Before: Would fallback to direct after failing to connect through foobar:80. Now: Will error-out with connection refused after failing to connect through foobar:80. (2) You start chrome with --proxy-pac-url="file:///foobar.pac". The server "foobar:80" is unreachable, and foobar.pac reads: function FindProxyForURL(url, host) { return "PROXY foobar:80"; } Before: Would fallback to direct after failing to connect through foobar:80. Now: Will error-out with connection refused after failing to connect through foobar:80. (3) You start chrome with --proxy-pac-url="file:///foobar.pac". The server "foobar:80" is unreachable, and foobar.pac reads: function FindProxyForURL(url, host) { return "PROXY foobar:80; DIRECT"; } *No change, since the fallback to DIRECT is explicit in the PAC script* BUG=12303 Review URL: http://codereview.chromium.org/502068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35549 0039d316-1c4b-4281-b951-d872f2087c98
* Move some logging from LOG(INFO) to the LoadLog. These particular ones are ↵eroman@chromium.org2009-12-222-29/+40
| | | | | | | | for proxy initialization, and are enabled in passive mode since the data will be little. Review URL: http://codereview.chromium.org/501162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35123 0039d316-1c4b-4281-b951-d872f2087c98
* Extend LoadLog to support logging of arbitrary strings, and of network error ↵eroman@chromium.org2009-12-214-9/+9
| | | | | | | | | | | | | | codes. - The logging of error codes is intended to be used in passive mode. - The logging of string messages is intended to be used when in full-logging mode. - The logging of string literal messages is intended to be used in passive mode. BUG=27552 Review URL: http://codereview.chromium.org/503066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35103 0039d316-1c4b-4281-b951-d872f2087c98
* Minor cleanup: add a sys_addrinfo.h header that hides the platform-specific ↵eroman@chromium.org2009-12-122-16/+2
| | | | | | | | | | includes needed for struct addrinfo / struct sockaddr, since we were duplicating that #if #else logic in a growing number of places. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/491038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34399 0039d316-1c4b-4281-b951-d872f2087c98
* Separate ProxyResolverMac and ProxyConfigServiceMac into their own files and ↵hayato@chromium.org2009-12-107-218/+261
| | | | | | | | | | extract common utility functions into other files. TEST=trybot and MacUtilTest in base_unittests BUG=27310 Review URL: http://codereview.chromium.org/463028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34243 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes to the string MatchPattern functions:tony@chromium.org2009-12-032-2/+3
| | | | | | | | | | | | | | | 1) Make it explicit that it only supports ASCII (since it iterates character by character). 2) Limit the recursion to 16 levels. We could allow more, but in the case of a ?, it has exponential complexity, so I figured 16 was a good stopping point. It seems rare that someone would have more than 16 '?' and '*'s. BUG=28645 Review URL: http://codereview.chromium.org/460047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33748 0039d316-1c4b-4281-b951-d872f2087c98
* Add a new event to LoadLog:eroman@chromium.org2009-12-013-21/+29
| | | | | | | | | | | | | | | | | PROXY_SERVICE_POLL_CONFIG_SERVICE_FOR_CHANGES which measures how much time was spent per request retrieving the system proxy settings. On Windows this corresponds with the function: WinHttpGetIEProxyConfigForCurrentUser(). Which seems to be very slow on some systems. BUG=12189 Review URL: http://codereview.chromium.org/452034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33508 0039d316-1c4b-4281-b951-d872f2087c98
* Properly detect KDE4 on newer systems (e.g. [K]Ubuntu 9.04).mdm@chromium.org2009-11-251-1/+1
| | | | | | | | BUG=25938 TEST=try to configure proxy settings on KDE4 when $DESKTOP_SESSION=kde, it should work Review URL: http://codereview.chromium.org/427013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33132 0039d316-1c4b-4281-b951-d872f2087c98
* Add compiler-specific "examine printf format" attributes to printfs.evan@chromium.org2009-11-202-8/+13
| | | | | | | | | | | | Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Review URL: http://codereview.chromium.org/339059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32600 0039d316-1c4b-4281-b951-d872f2087c98
* NULL out the ProxyScriptFetcher used by ProxyService when the ↵eroman@chromium.org2009-11-187-10/+123
| | | | | | | | | | | | URLRequestContext it was using for downloads is destroyed. This avoids the possibility of accessing freed memory when sharing ProxyService amongst request context, and the main context is destroyed first. BUG=25338 Review URL: http://codereview.chromium.org/387065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32427 0039d316-1c4b-4281-b951-d872f2087c98
* Use GURL::is_valid() in place of !GURL::is_empty() in a condition.eroman@chromium.org2009-11-102-1/+23
| | | | | | | | This is to be more consistent with another piece of code which tests is_valid() rather than is_empty(), in case there should be some difference between those. Review URL: http://codereview.chromium.org/385017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31614 0039d316-1c4b-4281-b951-d872f2087c98
* Grab SOCKS settings from system prefs.avi@chromium.org2009-11-101-1/+14
| | | | | | | | | BUG=http://crbug.com/13423 TEST=test SOCKS (ssh -D) proxying Review URL: http://codereview.chromium.org/383010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31594 0039d316-1c4b-4281-b951-d872f2087c98
* Improve the display of LoadLogs when truncation occurs.eroman@chromium.org2009-11-066-19/+29
| | | | | | | | | | | | | | Rather than drop all subsequent entries, we now preserve the final entry that was appended to the log. This way, even if entries have been dropped, we can still infer what the total time was, and what the exit condition was. Also makes LoadLog take the bound as a required parameter. BUG=none TEST=LoadLogUtilTest.DisplayOfTruncated Review URL: http://codereview.chromium.org/363025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31274 0039d316-1c4b-4281-b951-d872f2087c98
* Second patch in making destructors of refcounted objects private.jam@chromium.org2009-11-058-2/+39
| | | | | | | | 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
* Add three of the six extensions to PAC that Internet Explorer supports. eroman@chromium.org2009-10-266-19/+322
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following descriptions were taken from <http://blogs.msdn.com/wndp/articles/IPV6_PAC_Extensions_v0_9.aspx> ---------------------------- * myIpAddressEx(): Returns a semi-colon delimited string containing all IP addresses for localhost (IPv6 and/or IPv4), or an empty string if unable to resolve localhost to an IP address. * dnsResolveEx(host): Returns semi-colon delimited string containing IPv6 and IPv4 addresses or an empty string if host is not resolvable. * isResolvableEx(): Returns TRUE if the host is resolvable to a IPv4 or IPv6 address, FALSE otherwise. ---------------------------- These differ from the vanilla PAC functions in the following ways: * myIpAddressEx() returns all the addrsses for localhost (including IPv6 ones), whereas myIpAddress() only returns the first IPv4 one. * On failure, myIpAddress() returns "127.0.0.1" whereas on failure myIpAddressEx() returns empty string. * dnsResolveEx() returns a list of addresses (including IPV6 ones), whereas dnsResolve() only returns the first IPv4 address. * On failure, dnsResolve() returns |null|, whereas on failure dnsResolveEx() returns empty string. BUG=25407 TEST=ProxyResolverV8Test.DNSResolutionFailure, ProxyResolverJSBindingsTest.RestrictAddressFamily, ProxyResolverJSBindingsTest.ExFunctionsReturnList Review URL: http://codereview.chromium.org/333006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30127 0039d316-1c4b-4281-b951-d872f2087c98
* Move initialization of ChromeURLRequestContexts to the IO thread.eroman@chromium.org2009-10-233-22/+14
| | | | | | | | | | | | | | | | | | | | | | | Before, these URLRequestContexts were lazily created from the UI thread. Unfortunately that model made it easy for consumers on the UI thread to poke at stuff which was being used from the IO thread, and introduce races. So instead of providing a URLRequestContext*, the Profile now vends a URLRequestContextGetter*. The consequence of this is: * Consumers on the UI thread can no longer get access to a URLRequestContext. * Consumers on the IO thread need to call URLRequestContextGetter::GetURLRequestContext() to get at the context. This uses the same style lazy-creation of URLRequestContexts, albeit from the IO thread. OK, so now the smelly part: There were a couple of consumers of URLRequestContext on the UI thread that can't easily be moved to the IO thread -- these are the consumers of the cookie store. Before they could happily mess with the cookie store from the UI thread, and this was fine since CookieStore is threadsafe. However under the new model, they have no way to get at the URLRequestContext from the UI thread, hence can't get a pointer to the cookie store. To support that use-cases, I bastardized the API some by adding a URLRequestContextGetter::GetCookieStore() method that lets UI thread consumers get a pointer to the cookie store, since we know this particular cross-thread usage is safe. BUG=http://crbug.com/22294 Review URL: http://codereview.chromium.org/258008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29880 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor: Address some style comments from a review (which missed the ↵eroman@chromium.org2009-10-232-9/+12
| | | | | | | | original check-in). Review URL: http://codereview.chromium.org/322009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29874 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor: Don't send the quit command before killing test server for ↵eroman@chromium.org2009-10-221-2/+1
| | | | | | | | | ProxyScriptFetcherTest.NoCache. Instead we just murder the process directly. Calling HttpTestServer::SendQuit() adds unnecessary latency since we need to wait for the sever to respond. But more importantly it is adding noise to my valgrind race investigation, since SendQuit() spins up its own IO thread to issue requests on (making the test have multiple threads that handle requests). Review URL: http://codereview.chromium.org/320003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29826 0039d316-1c4b-4281-b951-d872f2087c98
* Disable IPv6 results for the PAC bindings:eroman@chromium.org2009-10-222-9/+56
| | | | | | | | | | | | | | | myIpAddress() dnsResolve() isResolvable() This makes us behave more like IE and less like Firefox for scripts where IPv6 addresses are not expected. BUG=24641 TEST=ProxyResolverJSBindingsTest.DontUseIPv6 Review URL: http://codereview.chromium.org/303022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29788 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a data race found by ThreadSanitizer in LoadLog::Release().eroman@chromium.org2009-10-201-2/+3
| | | | | | | | | | | | The scoped_refptr's destructor was being called at the very end of the function scope. This meant that worker_log->Release() was called *after* PostTask(). However since the posted task also called worker_log->Release() (but from a different thread) this was a race. BUG=22272 Review URL: http://codereview.chromium.org/308005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29551 0039d316-1c4b-4281-b951-d872f2087c98
* Remove some unnecessary manual AddRef/Release.eroman@chromium.org2009-10-201-9/+0
| | | | | | | | | | | These aren't needed since NewRunnableMethod() already holds a reference, ensuring it can't be deleted while tasks are outstanding. BUG=none. TEST=continue to pass existing unit tests, especially when run under valgrind. Review URL: http://codereview.chromium.org/269037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29485 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate all uses of strerror() in code that uses src/base. strerror() is ↵tschmelcher@chromium.org2009-10-131-4/+3
| | | | | | | | | | | inherently unsafe in multi-threaded apps because it stores the string in a global buffer. It should never be used. If you want to log an error, use PLOG and friends, or if that's too high-level then use safe_strerror(). TEST=built on Linux in 32-bit and 64-bit mode; ran base_unittests in each case; ran Chromium itself in each case; try servers BUG=none Review URL: http://codereview.chromium.org/261055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28850 0039d316-1c4b-4281-b951-d872f2087c98
* Add the ability to purge memory to the ProxyResolver.pkasting@chromium.org2009-10-139-3/+79
| | | | | | | | BUG=23400 TEST=none Review URL: http://codereview.chromium.org/272018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28769 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the dependency on i18n/icu_string_conversions from base/string_util.h.brettw@chromium.org2009-10-101-4/+6
| | | | | | | | | | | | Fix up all files requireing this header to include it directly. Split out the ICU-dependent string util unit tests into a new file base/i18n/icu_string_util_unittest.cc TEST=none BUG=none Review URL: http://codereview.chromium.org/269034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28674 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 27389.darin@chromium.org2009-09-301-6/+5
| | | | | | Review URL: http://codereview.chromium.org/246027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27594 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid potential "NULL used as int" warnings by changing ASSERT_EQ(NULL, ...) ↵pkasting@chromium.org2009-09-291-2/+2
| | | | | | | | | to ASSERT_TRUE(... == NULL). Patch by Jacob Mandelson (see http://codereview.chromium.org/202057 ), r=me. BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27511 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 27379, in hopes of fixing browser_tests.senorblanco@chromium.org2009-09-281-5/+6
| | | | | | | | TBR=darin Review URL: http://codereview.chromium.org/248021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27389 0039d316-1c4b-4281-b951-d872f2087c98
* Assert that thread-safe reference counting is used withdarin@chromium.org2009-09-281-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | cross-thread NewRunnableMethod. This assertion caught such an error in VisitedLinkMaster! My approach, modify RunnableMethodTraits<T> to assert that when ReleaseCallee happens on a different thread from RetainCallee that the type supports thread-safe reference counting. I do this by adding a static method to both RefCounted<T> and RefCountedThreadSafe<T>. This results in a little ugliness in cases where people implement AddRef and Release by hand (to make the no-ops). There may be a nicer way to deal with those few cases. R=brettw BUG=none TEST=none Review URL: http://codereview.chromium.org/251012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27379 0039d316-1c4b-4281-b951-d872f2087c98