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

Side by Side Diff: chromecast/net/connectivity_checker_impl.h

Issue 1169163002: Add timeout check for connectivity_checker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add timeout check for connectivity_checker. Created 5 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_ 5 #ifndef CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_
6 #define CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_ 6 #define CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_
7 7
8 #include "chromecast/net/connectivity_checker.h" 8 #include "chromecast/net/connectivity_checker.h"
9 #include "net/base/network_change_notifier.h" 9 #include "net/base/network_change_notifier.h"
10 #include "net/url_request/url_request.h" 10 #include "net/url_request/url_request.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 // Cancels current connectivity checking in progress. 58 // Cancels current connectivity checking in progress.
59 void Cancel(); 59 void Cancel();
60 60
61 // Sets connectivity and alerts observers if it has changed 61 // Sets connectivity and alerts observers if it has changed
62 void SetConnected(bool connected); 62 void SetConnected(bool connected);
63 63
64 // Called when URL request failed. 64 // Called when URL request failed.
65 void OnUrlRequestError(); 65 void OnUrlRequestError();
66 66
67 // Called when URL request timed out.
68 void OnUrlRequestTimeOut(unsigned int request_index);
69
67 scoped_ptr<GURL> connectivity_check_url_; 70 scoped_ptr<GURL> connectivity_check_url_;
68 scoped_ptr<net::URLRequestContext> url_request_context_; 71 scoped_ptr<net::URLRequestContext> url_request_context_;
69 scoped_ptr<net::URLRequest> url_request_; 72 scoped_ptr<net::URLRequest> url_request_;
70 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 73 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
71 bool connected_; 74 bool connected_;
72 // Number of connectivity check errors. 75 // Number of connectivity check errors.
73 unsigned int check_errors_; 76 unsigned int check_errors_;
77 unsigned int request_index_;
74 78
75 DISALLOW_COPY_AND_ASSIGN(ConnectivityCheckerImpl); 79 DISALLOW_COPY_AND_ASSIGN(ConnectivityCheckerImpl);
76 }; 80 };
77 81
78 } // namespace chromecast 82 } // namespace chromecast
79 83
80 #endif // CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_ 84 #endif // CHROMECAST_NET_CONNECTIVITY_CHECKER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | chromecast/net/connectivity_checker_impl.cc » ('j') | chromecast/net/connectivity_checker_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698