Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: net/proxy/multi_threaded_proxy_resolver_unittest.cc

Issue 11885009: Improve performance of proxy resolver by tracing DNS dependencies. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase off trunk Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 virtual void CancelRequest(RequestHandle request) OVERRIDE { 60 virtual void CancelRequest(RequestHandle request) OVERRIDE {
61 NOTREACHED(); 61 NOTREACHED();
62 } 62 }
63 63
64 virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE { 64 virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE {
65 NOTREACHED(); 65 NOTREACHED();
66 return LOAD_STATE_IDLE; 66 return LOAD_STATE_IDLE;
67 } 67 }
68 68
69 virtual LoadState GetLoadStateThreadSafe(
70 RequestHandle request) const OVERRIDE {
71 NOTREACHED();
72 return LOAD_STATE_IDLE;
73 }
74
75 virtual void CancelSetPacScript() OVERRIDE { 69 virtual void CancelSetPacScript() OVERRIDE {
76 NOTREACHED(); 70 NOTREACHED();
77 } 71 }
78 72
79 virtual int SetPacScript( 73 virtual int SetPacScript(
80 const scoped_refptr<ProxyResolverScriptData>& script_data, 74 const scoped_refptr<ProxyResolverScriptData>& script_data,
81 const CompletionCallback& callback) OVERRIDE { 75 const CompletionCallback& callback) OVERRIDE {
82 CheckIsOnWorkerThread(); 76 CheckIsOnWorkerThread();
83 last_script_data_ = script_data; 77 last_script_data_ = script_data;
84 return OK; 78 return OK;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 177
184 virtual void CancelRequest(RequestHandle request) OVERRIDE { 178 virtual void CancelRequest(RequestHandle request) OVERRIDE {
185 impl_->CancelRequest(request); 179 impl_->CancelRequest(request);
186 } 180 }
187 181
188 virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE { 182 virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE {
189 NOTREACHED(); 183 NOTREACHED();
190 return LOAD_STATE_IDLE; 184 return LOAD_STATE_IDLE;
191 } 185 }
192 186
193 virtual LoadState GetLoadStateThreadSafe(
194 RequestHandle request) const OVERRIDE {
195 NOTREACHED();
196 return LOAD_STATE_IDLE;
197 }
198
199 virtual void CancelSetPacScript() OVERRIDE { 187 virtual void CancelSetPacScript() OVERRIDE {
200 impl_->CancelSetPacScript(); 188 impl_->CancelSetPacScript();
201 } 189 }
202 190
203 virtual int SetPacScript( 191 virtual int SetPacScript(
204 const scoped_refptr<ProxyResolverScriptData>& script_data, 192 const scoped_refptr<ProxyResolverScriptData>& script_data,
205 const CompletionCallback& callback) OVERRIDE { 193 const CompletionCallback& callback) OVERRIDE {
206 return impl_->SetPacScript(script_data, callback); 194 return impl_->SetPacScript(script_data, callback);
207 } 195 }
208 196
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 // All in all, the first thread should have seen just 1 request. And the 777 // All in all, the first thread should have seen just 1 request. And the
790 // second thread 3 requests. 778 // second thread 3 requests.
791 ASSERT_EQ(2u, factory->resolvers().size()); 779 ASSERT_EQ(2u, factory->resolvers().size());
792 EXPECT_EQ(1, factory->resolvers()[0]->request_count()); 780 EXPECT_EQ(1, factory->resolvers()[0]->request_count());
793 EXPECT_EQ(3, factory->resolvers()[1]->request_count()); 781 EXPECT_EQ(3, factory->resolvers()[1]->request_count());
794 } 782 }
795 783
796 } // namespace 784 } // namespace
797 785
798 } // namespace net 786 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698