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

Side by Side Diff: chrome/browser/extensions/api/audio_modem/audio_modem_api.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller 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
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 CHROME_BROWSER_EXTENSIONS_API_AUDIO_MODEM_AUDIO_MODEM_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_AUDIO_MODEM_AUDIO_MODEM_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_AUDIO_MODEM_AUDIO_MODEM_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_AUDIO_MODEM_AUDIO_MODEM_API_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 content::BrowserContext* const browser_context_; 67 content::BrowserContext* const browser_context_;
68 scoped_ptr<audio_modem::WhispernetClient> whispernet_client_; 68 scoped_ptr<audio_modem::WhispernetClient> whispernet_client_;
69 scoped_ptr<audio_modem::Modem> modem_; 69 scoped_ptr<audio_modem::Modem> modem_;
70 bool init_failed_; 70 bool init_failed_;
71 71
72 // IDs for the currently transmitting app (if any), indexed by AudioType. 72 // IDs for the currently transmitting app (if any), indexed by AudioType.
73 std::string transmitters_[2]; 73 std::string transmitters_[2];
74 74
75 // Timeouts for the currently active transmits, indexed by AudioType. 75 // Timeouts for the currently active transmits, indexed by AudioType.
76 base::OneShotTimer<AudioModemAPI> transmit_timers_[2]; 76 base::OneShotTimer transmit_timers_[2];
77 77
78 // Maps of currently receiving app ID => timeouts. Indexed by AudioType. 78 // Maps of currently receiving app ID => timeouts. Indexed by AudioType.
79 // We own all of these pointers. Do not remove them without calling delete. 79 // We own all of these pointers. Do not remove them without calling delete.
80 std::map<std::string, base::OneShotTimer<AudioModemAPI>*> receive_timers_[2]; 80 std::map<std::string, base::OneShotTimer*> receive_timers_[2];
81 81
82 // BrowserContextKeyedAPI implementation. 82 // BrowserContextKeyedAPI implementation.
83 static const bool kServiceIsCreatedWithBrowserContext = false; 83 static const bool kServiceIsCreatedWithBrowserContext = false;
84 static const char* service_name() { return "AudioModemAPI"; } 84 static const char* service_name() { return "AudioModemAPI"; }
85 85
86 DISALLOW_COPY_AND_ASSIGN(AudioModemAPI); 86 DISALLOW_COPY_AND_ASSIGN(AudioModemAPI);
87 }; 87 };
88 88
89 template<> 89 template<>
90 void BrowserContextKeyedAPIFactory<AudioModemAPI>::DeclareFactoryDependencies(); 90 void BrowserContextKeyedAPIFactory<AudioModemAPI>::DeclareFactoryDependencies();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 DECLARE_EXTENSION_FUNCTION("audioModem.stopReceive", AUDIOMODEM_STOPRECEIVE); 122 DECLARE_EXTENSION_FUNCTION("audioModem.stopReceive", AUDIOMODEM_STOPRECEIVE);
123 123
124 protected: 124 protected:
125 ~AudioModemStopReceiveFunction() override {} 125 ~AudioModemStopReceiveFunction() override {}
126 ExtensionFunction::ResponseAction Run() override; 126 ExtensionFunction::ResponseAction Run() override;
127 }; 127 };
128 128
129 } // namespace extensions 129 } // namespace extensions
130 130
131 #endif // CHROME_BROWSER_EXTENSIONS_API_AUDIO_MODEM_AUDIO_MODEM_API_H_ 131 #endif // CHROME_BROWSER_EXTENSIONS_API_AUDIO_MODEM_AUDIO_MODEM_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698