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

Side by Side Diff: chrome/browser/intranet_redirect_detector.h

Issue 122543002: Ensure WeakPtrFactories are at the end of their owning classes and refer (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_INTRANET_REDIRECT_DETECTOR_H_ 5 #ifndef CHROME_BROWSER_INTRANET_REDIRECT_DETECTOR_H_
6 #define CHROME_BROWSER_INTRANET_REDIRECT_DETECTOR_H_ 6 #define CHROME_BROWSER_INTRANET_REDIRECT_DETECTOR_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // switch sleep has finished. Runs any pending fetch. 65 // switch sleep has finished. Runs any pending fetch.
66 void FinishSleep(); 66 void FinishSleep();
67 67
68 // net::URLFetcherDelegate 68 // net::URLFetcherDelegate
69 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; 69 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
70 70
71 // NetworkChangeNotifier::IPAddressObserver 71 // NetworkChangeNotifier::IPAddressObserver
72 virtual void OnIPAddressChanged() OVERRIDE; 72 virtual void OnIPAddressChanged() OVERRIDE;
73 73
74 GURL redirect_origin_; 74 GURL redirect_origin_;
75 base::WeakPtrFactory<IntranetRedirectDetector> weak_factory_;
76 Fetchers fetchers_; 75 Fetchers fetchers_;
77 std::vector<GURL> resulting_origins_; 76 std::vector<GURL> resulting_origins_;
78 bool in_sleep_; // True if we're in the seven-second "no fetching" period 77 bool in_sleep_; // True if we're in the seven-second "no fetching" period
79 // that begins at browser start, or the one-second "no 78 // that begins at browser start, or the one-second "no
80 // fetching" period that begins after network switches. 79 // fetching" period that begins after network switches.
80 base::WeakPtrFactory<IntranetRedirectDetector> weak_ptr_factory_;
81 81
82 DISALLOW_COPY_AND_ASSIGN(IntranetRedirectDetector); 82 DISALLOW_COPY_AND_ASSIGN(IntranetRedirectDetector);
83 }; 83 };
84 84
85 // This is for use in testing, where we don't want our fetches to actually go 85 // This is for use in testing, where we don't want our fetches to actually go
86 // over the network. It captures the requests and causes them to fail. 86 // over the network. It captures the requests and causes them to fail.
87 class IntranetRedirectHostResolverProc : public net::HostResolverProc { 87 class IntranetRedirectHostResolverProc : public net::HostResolverProc {
88 public: 88 public:
89 explicit IntranetRedirectHostResolverProc(net::HostResolverProc* previous); 89 explicit IntranetRedirectHostResolverProc(net::HostResolverProc* previous);
90 90
91 virtual int Resolve(const std::string& host, 91 virtual int Resolve(const std::string& host,
92 net::AddressFamily address_family, 92 net::AddressFamily address_family,
93 net::HostResolverFlags host_resolver_flags, 93 net::HostResolverFlags host_resolver_flags,
94 net::AddressList* addrlist, 94 net::AddressList* addrlist,
95 int* os_error) OVERRIDE; 95 int* os_error) OVERRIDE;
96 96
97 private: 97 private:
98 virtual ~IntranetRedirectHostResolverProc() {} 98 virtual ~IntranetRedirectHostResolverProc() {}
99 }; 99 };
100 100
101 #endif // CHROME_BROWSER_INTRANET_REDIRECT_DETECTOR_H_ 101 #endif // CHROME_BROWSER_INTRANET_REDIRECT_DETECTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/google/google_url_tracker.cc ('k') | chrome/browser/intranet_redirect_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698