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

Side by Side Diff: device/nfc/nfc_adapter.h

Issue 1499793003: Fix classes that have too many virtuals for inline constructors. Base URL: https://chromium.googlesource.com/chromium/src.git@enable-virtuals-as-complexity
Patch Set: Finish fixing the codebase that's accessible from Linux. Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 DEVICE_NFC_NFC_ADAPTER_H_ 5 #ifndef DEVICE_NFC_NFC_ADAPTER_H_
6 #define DEVICE_NFC_NFC_ADAPTER_H_ 6 #define DEVICE_NFC_NFC_ADAPTER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // this call, its life-time cannot be guaranteed once this call returns, as 78 // this call, its life-time cannot be guaranteed once this call returns, as
79 // the object may get destroyed if the connection with the peer is lost. 79 // the object may get destroyed if the connection with the peer is lost.
80 // Instead of caching the pointer directly, observers should store the 80 // Instead of caching the pointer directly, observers should store the
81 // peer's assigned unique identifier instead, which can be used to obtain a 81 // peer's assigned unique identifier instead, which can be used to obtain a
82 // pointer to the peer, as long as it exists. 82 // pointer to the peer, as long as it exists.
83 virtual void PeerFound(NfcAdapter* adaper, NfcPeer* peer) {} 83 virtual void PeerFound(NfcAdapter* adaper, NfcPeer* peer) {}
84 84
85 // Called when the remote NFC adapter |peer| is no longer known by the 85 // Called when the remote NFC adapter |peer| is no longer known by the
86 // adapter |adapter|. |peer| should not be cached. 86 // adapter |adapter|. |peer| should not be cached.
87 virtual void PeerLost(NfcAdapter* adapter, NfcPeer* peer) {} 87 virtual void PeerLost(NfcAdapter* adapter, NfcPeer* peer) {}
88
89 protected:
90 Observer() = default;
88 }; 91 };
89 92
90 // The ErrorCallback is used by methods to asynchronously report errors. 93 // The ErrorCallback is used by methods to asynchronously report errors.
91 typedef base::Closure ErrorCallback; 94 typedef base::Closure ErrorCallback;
92 95
93 // Typedefs for lists of NFC peer and NFC tag objects. 96 // Typedefs for lists of NFC peer and NFC tag objects.
94 typedef std::vector<NfcPeer*> PeerList; 97 typedef std::vector<NfcPeer*> PeerList;
95 typedef std::vector<NfcTag*> TagList; 98 typedef std::vector<NfcTag*> TagList;
96 99
97 // Adds and removes observers for events on this NFC adapter. If monitoring 100 // Adds and removes observers for events on this NFC adapter. If monitoring
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // Peers and tags that are managed by this adapter. 204 // Peers and tags that are managed by this adapter.
202 PeersMap peers_; 205 PeersMap peers_;
203 TagsMap tags_; 206 TagsMap tags_;
204 207
205 DISALLOW_COPY_AND_ASSIGN(NfcAdapter); 208 DISALLOW_COPY_AND_ASSIGN(NfcAdapter);
206 }; 209 };
207 210
208 } // namespace device 211 } // namespace device
209 212
210 #endif // DEVICE_NFC_NFC_ADAPTER_H_ 213 #endif // DEVICE_NFC_NFC_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698