| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/proxy/multi_threaded_proxy_resolver.h" | 5 #include "net/proxy/multi_threaded_proxy_resolver.h" |
| 6 | 6 |
| 7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/waitable_event.h" | 9 #include "base/waitable_event.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 const BoundNetLog& net_log) { | 39 const BoundNetLog& net_log) { |
| 40 if (resolve_latency_ms_) | 40 if (resolve_latency_ms_) |
| 41 PlatformThread::Sleep(resolve_latency_ms_); | 41 PlatformThread::Sleep(resolve_latency_ms_); |
| 42 | 42 |
| 43 CheckIsOnWorkerThread(); | 43 CheckIsOnWorkerThread(); |
| 44 | 44 |
| 45 EXPECT_TRUE(callback == NULL); | 45 EXPECT_TRUE(callback == NULL); |
| 46 EXPECT_TRUE(request == NULL); | 46 EXPECT_TRUE(request == NULL); |
| 47 | 47 |
| 48 // Write something into |net_log| (doesn't really have any meaning.) | 48 // Write something into |net_log| (doesn't really have any meaning.) |
| 49 net_log.BeginEvent(NetLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, NULL); | 49 net_log.BeginEvent(NetLog::TYPE_PAC_JAVASCRIPT_DNS_RESOLVE, NULL); |
| 50 | 50 |
| 51 results->UseNamedProxy(query_url.host()); | 51 results->UseNamedProxy(query_url.host()); |
| 52 | 52 |
| 53 // Return a success code which represents the request's order. | 53 // Return a success code which represents the request's order. |
| 54 return request_count_++; | 54 return request_count_++; |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual void CancelRequest(RequestHandle request) { | 57 virtual void CancelRequest(RequestHandle request) { |
| 58 NOTREACHED(); | 58 NOTREACHED(); |
| 59 } | 59 } |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 // All in all, the first thread should have seen just 1 request. And the | 733 // All in all, the first thread should have seen just 1 request. And the |
| 734 // second thread 3 requests. | 734 // second thread 3 requests. |
| 735 ASSERT_EQ(2u, factory->resolvers().size()); | 735 ASSERT_EQ(2u, factory->resolvers().size()); |
| 736 EXPECT_EQ(1, factory->resolvers()[0]->request_count()); | 736 EXPECT_EQ(1, factory->resolvers()[0]->request_count()); |
| 737 EXPECT_EQ(3, factory->resolvers()[1]->request_count()); | 737 EXPECT_EQ(3, factory->resolvers()[1]->request_count()); |
| 738 } | 738 } |
| 739 | 739 |
| 740 } // namespace | 740 } // namespace |
| 741 | 741 |
| 742 } // namespace net | 742 } // namespace net |
| OLD | NEW |