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

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

Issue 10066045: RefCounted types should not have public destructors, net/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deprecated cookiestore fix Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_resolver_js_bindings.cc ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 const GURL& GetPacURL() const OVERRIDE { 551 const GURL& GetPacURL() const OVERRIDE {
552 return dummy_gurl_; 552 return dummy_gurl_;
553 } 553 }
554 554
555 void CallbackWithFailure() { 555 void CallbackWithFailure() {
556 if (!callback_.is_null()) 556 if (!callback_.is_null())
557 callback_.Run(ERR_PAC_NOT_IN_DHCP); 557 callback_.Run(ERR_PAC_NOT_IN_DHCP);
558 } 558 }
559 559
560 private: 560 private:
561 friend class base::RefCountedThreadSafe<AsyncFailDhcpFetcher>;
562 ~AsyncFailDhcpFetcher() {}
563
561 GURL dummy_gurl_; 564 GURL dummy_gurl_;
562 CompletionCallback callback_; 565 CompletionCallback callback_;
563 }; 566 };
564 567
565 TEST(ProxyScriptDeciderTest, DhcpCancelledByDestructor) { 568 TEST(ProxyScriptDeciderTest, DhcpCancelledByDestructor) {
566 // This regression test would crash before 569 // This regression test would crash before
567 // http://codereview.chromium.org/7044058/ 570 // http://codereview.chromium.org/7044058/
568 // Thus, we don't care much about actual results (hence no EXPECT or ASSERT 571 // Thus, we don't care much about actual results (hence no EXPECT or ASSERT
569 // macros below), just that it doesn't crash. 572 // macros below), just that it doesn't crash.
570 Rules rules; 573 Rules rules;
(...skipping 15 matching lines...) Expand all
586 589
587 // Run the message loop to let the DHCP fetch complete and post the results 590 // Run the message loop to let the DHCP fetch complete and post the results
588 // back. Before the fix linked to above, this would try to invoke on 591 // back. Before the fix linked to above, this would try to invoke on
589 // the callback object provided by ProxyScriptDecider after it was 592 // the callback object provided by ProxyScriptDecider after it was
590 // no longer valid. 593 // no longer valid.
591 MessageLoop::current()->RunAllPending(); 594 MessageLoop::current()->RunAllPending();
592 } 595 }
593 596
594 } // namespace 597 } // namespace
595 } // namespace net 598 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_js_bindings.cc ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698