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

Side by Side Diff: chrome/browser/sync/notifier/base/network_status_detector_task.h

Issue 194065: Initial commit of sync engine code to browser/sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixes to gtest include path, reverted syncapi. Created 11 years, 3 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_BASE_NETWORK_STATUS_DETECTOR_TASK_H_
6 #define CHROME_BROWSER_SYNC_NOTIFIER_BASE_NETWORK_STATUS_DETECTOR_TASK_H_
7
8 #include "chrome/browser/sync/notifier/base/time.h"
9 #include "talk/base/sigslot.h"
10 #include "talk/base/task.h"
11
12 namespace notifier {
13 class AsyncNetworkAlive;
14
15 // Detects the current network state and any changes to that.
16 class NetworkStatusDetectorTask : public talk_base::Task,
17 public sigslot::has_slots<> {
18 public:
19 // Create an instance of (a subclass of) this class.
20 static NetworkStatusDetectorTask* Create(talk_base::Task* parent);
21
22 // Determines the current network state and
23 // then calls SignalNetworkStateDetected.
24 void DetectNetworkState();
25
26 // Fires whenever the network state is detected.
27 // SignalNetworkStateDetected(was_alive, is_alive);
28 sigslot::signal2<bool, bool> SignalNetworkStateDetected;
29
30 protected:
31 explicit NetworkStatusDetectorTask(talk_base::Task* parent)
32 : talk_base::Task(parent),
33 initial_detection_done_(false),
34 is_alive_(false) {
35 }
36
37 virtual ~NetworkStatusDetectorTask() { }
38
39 virtual int ProcessStart() = 0;
40
41 // Stay around until aborted.
42 virtual int ProcessResponse() {
43 return STATE_BLOCKED;
44 }
45
46 void SetNetworkAlive(bool is_alive);
47
48 private:
49 bool initial_detection_done_;
50 bool is_alive_;
51
52 DISALLOW_COPY_AND_ASSIGN(NetworkStatusDetectorTask);
53 };
idana 2009/09/10 05:44:37 Blank lines.
54 } // namespace notifier
55 #endif // CHROME_BROWSER_SYNC_NOTIFIER_BASE_NETWORK_STATUS_DETECTOR_TASK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698