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

Side by Side Diff: Source/core/page/NetworkStateNotifier.h

Issue 1333613004: Refactor WebConnectionType names (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@netinfo
Patch Set: Fix enum and tests Created 5 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
« no previous file with comments | « no previous file | Source/core/page/NetworkStateNotifierTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 WTF_MAKE_NONCOPYABLE(NetworkStateNotifier); WTF_MAKE_FAST_ALLOCATED(NetworkS tateNotifier); 42 WTF_MAKE_NONCOPYABLE(NetworkStateNotifier); WTF_MAKE_FAST_ALLOCATED(NetworkS tateNotifier);
43 public: 43 public:
44 class NetworkStateObserver { 44 class NetworkStateObserver {
45 public: 45 public:
46 // Will be called on the thread of the context passed in addObserver. 46 // Will be called on the thread of the context passed in addObserver.
47 virtual void connectionChange(WebConnectionType, double maxBandwidthMbps ) = 0; 47 virtual void connectionChange(WebConnectionType, double maxBandwidthMbps ) = 0;
48 }; 48 };
49 49
50 NetworkStateNotifier() 50 NetworkStateNotifier()
51 : m_isOnLine(true) 51 : m_isOnLine(true)
52 , m_type(ConnectionTypeOther) 52 , m_type(WebConnectionTypeOther)
53 , m_maxBandwidthMbps(std::numeric_limits<double>::infinity()) 53 , m_maxBandwidthMbps(std::numeric_limits<double>::infinity())
54 , m_testUpdatesOnly(false) 54 , m_testUpdatesOnly(false)
55 { 55 {
56 } 56 }
57 57
58 // Can be called on any thread. 58 // Can be called on any thread.
59 bool onLine() const 59 bool onLine() const
60 { 60 {
61 MutexLocker locker(m_mutex); 61 MutexLocker locker(m_mutex);
62 return m_isOnLine; 62 return m_isOnLine;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 double m_maxBandwidthMbps; 126 double m_maxBandwidthMbps;
127 ObserverListMap m_observers; 127 ObserverListMap m_observers;
128 bool m_testUpdatesOnly; 128 bool m_testUpdatesOnly;
129 }; 129 };
130 130
131 CORE_EXPORT NetworkStateNotifier& networkStateNotifier(); 131 CORE_EXPORT NetworkStateNotifier& networkStateNotifier();
132 132
133 } // namespace blink 133 } // namespace blink
134 134
135 #endif // NetworkStateNotifier_h 135 #endif // NetworkStateNotifier_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/page/NetworkStateNotifierTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698