Loading media/libmediametrics/include/media/MediaMetricsItem.h +6 −6 Original line number Diff line number Diff line Loading @@ -223,7 +223,7 @@ static inline bool startsWith(const std::string& s, const std::string& comp) { class Defer { public: template <typename U> Defer(U &&f) : mThunk(std::forward<U>(f)) {} explicit Defer(U &&f) : mThunk(std::forward<U>(f)) {} ~Defer() { mThunk(); } private: Loading Loading @@ -522,7 +522,7 @@ public: BufferedItem(const BufferedItem&) = delete; BufferedItem& operator=(const BufferedItem&) = delete; BufferedItem(const std::string key, char *begin, char *end) BufferedItem(const std::string& key, char *begin, char *end) : BufferedItem(key.c_str(), begin, end) { } BufferedItem(const char *key, char *begin, char *end) Loading Loading @@ -687,7 +687,7 @@ protected: template <size_t N = 4096> class LogItem : public BufferedItem { public: explicit LogItem(const std::string key) : LogItem(key.c_str()) { } explicit LogItem(const std::string& key) : LogItem(key.c_str()) { } // Since this class will not be defined before the base class, we initialize variables // in our own order. Loading Loading @@ -742,10 +742,10 @@ public: mElem = other.mElem; return *this; } Prop(Prop&& other) { Prop(Prop&& other) noexcept { *this = std::move(other); } Prop& operator=(Prop&& other) { Prop& operator=(Prop&& other) noexcept { mName = std::move(other.mName); mElem = std::move(other.mElem); return *this; Loading Loading @@ -856,7 +856,7 @@ public: // Iteration of props within item class iterator { public: iterator(const std::map<std::string, Prop>::const_iterator &_it) : it(_it) { } explicit iterator(const std::map<std::string, Prop>::const_iterator &_it) : it(_it) { } iterator &operator++() { ++it; return *this; Loading services/mediametrics/AnalyticsState.h +2 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ public: } if (ll > 0) { auto [s, l] = mTransactionLog.dump(ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; } if (ll > 0) { Loading @@ -107,7 +107,7 @@ public: } if (ll > 0) { auto [s, l] = mTimeMachine.dump(ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; } return { ss.str(), lines - ll }; Loading services/mediametrics/AudioAnalytics.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ std::pair<std::string, int32_t> AudioAnalytics::dump( if (ll > 0) { auto [s, l] = mAnalyticsState->dump(ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; } if (ll > 0) { Loading @@ -124,7 +124,7 @@ std::pair<std::string, int32_t> AudioAnalytics::dump( } if (ll > 0) { auto [s, l] = mPreviousAnalyticsState->dump(ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; } return { ss.str(), lines - ll }; Loading services/mediametrics/TimeMachine.h +4 −4 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ private: std::string s = dump(mKey, tsPair, time); if (s.size() > 0) { --ll; ss << std::move(s); ss << s; } } return { ss.str(), lines - ll }; Loading Loading @@ -319,7 +319,7 @@ public: if (it == mHistory.end()) continue; remoteKeyHistory = it->second; } std::lock_guard(getLockForKey(remoteKey)); std::lock_guard lock(getLockForKey(remoteKey)); remoteKeyHistory->putProp(remoteName, prop, time); } return NO_ERROR; Loading Loading @@ -426,7 +426,7 @@ public: if (prefix != nullptr && !startsWith(it->first, prefix)) break; std::lock_guard lock(getLockForKey(it->first)); auto [s, l] = it->second->dump(ll, sinceNs); ss << std::move(s); ss << s; ll -= l; } return { ss.str(), lines - ll }; Loading @@ -441,7 +441,7 @@ private: // Finds a KeyHistory from a URL. Returns nullptr if not found. std::shared_ptr<KeyHistory> getKeyHistoryFromUrl( std::string url, std::string* key, std::string *prop) const { const std::string& url, std::string* key, std::string *prop) const { std::lock_guard lock(mLock); auto it = mHistory.upper_bound(url); Loading services/mediametrics/TransactionLog.h +2 −2 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public: --ll; } auto [s, l] = dumpMapTimeItem(mLog, ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; // Grouped by item key (category) Loading @@ -158,7 +158,7 @@ public: if (prefix != nullptr && !startsWith(it->first, prefix)) break; auto [s, l] = dumpMapTimeItem(it->second, ll - 1, sinceNs, prefix); if (l == 0) continue; // don't show empty groups (due to sinceNs). ss << " " << it->first << "\n" << std::move(s); ss << " " << it->first << "\n" << s; ll -= l + 1; } return { ss.str(), lines - ll }; Loading Loading
media/libmediametrics/include/media/MediaMetricsItem.h +6 −6 Original line number Diff line number Diff line Loading @@ -223,7 +223,7 @@ static inline bool startsWith(const std::string& s, const std::string& comp) { class Defer { public: template <typename U> Defer(U &&f) : mThunk(std::forward<U>(f)) {} explicit Defer(U &&f) : mThunk(std::forward<U>(f)) {} ~Defer() { mThunk(); } private: Loading Loading @@ -522,7 +522,7 @@ public: BufferedItem(const BufferedItem&) = delete; BufferedItem& operator=(const BufferedItem&) = delete; BufferedItem(const std::string key, char *begin, char *end) BufferedItem(const std::string& key, char *begin, char *end) : BufferedItem(key.c_str(), begin, end) { } BufferedItem(const char *key, char *begin, char *end) Loading Loading @@ -687,7 +687,7 @@ protected: template <size_t N = 4096> class LogItem : public BufferedItem { public: explicit LogItem(const std::string key) : LogItem(key.c_str()) { } explicit LogItem(const std::string& key) : LogItem(key.c_str()) { } // Since this class will not be defined before the base class, we initialize variables // in our own order. Loading Loading @@ -742,10 +742,10 @@ public: mElem = other.mElem; return *this; } Prop(Prop&& other) { Prop(Prop&& other) noexcept { *this = std::move(other); } Prop& operator=(Prop&& other) { Prop& operator=(Prop&& other) noexcept { mName = std::move(other.mName); mElem = std::move(other.mElem); return *this; Loading Loading @@ -856,7 +856,7 @@ public: // Iteration of props within item class iterator { public: iterator(const std::map<std::string, Prop>::const_iterator &_it) : it(_it) { } explicit iterator(const std::map<std::string, Prop>::const_iterator &_it) : it(_it) { } iterator &operator++() { ++it; return *this; Loading
services/mediametrics/AnalyticsState.h +2 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ public: } if (ll > 0) { auto [s, l] = mTransactionLog.dump(ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; } if (ll > 0) { Loading @@ -107,7 +107,7 @@ public: } if (ll > 0) { auto [s, l] = mTimeMachine.dump(ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; } return { ss.str(), lines - ll }; Loading
services/mediametrics/AudioAnalytics.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ std::pair<std::string, int32_t> AudioAnalytics::dump( if (ll > 0) { auto [s, l] = mAnalyticsState->dump(ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; } if (ll > 0) { Loading @@ -124,7 +124,7 @@ std::pair<std::string, int32_t> AudioAnalytics::dump( } if (ll > 0) { auto [s, l] = mPreviousAnalyticsState->dump(ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; } return { ss.str(), lines - ll }; Loading
services/mediametrics/TimeMachine.h +4 −4 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ private: std::string s = dump(mKey, tsPair, time); if (s.size() > 0) { --ll; ss << std::move(s); ss << s; } } return { ss.str(), lines - ll }; Loading Loading @@ -319,7 +319,7 @@ public: if (it == mHistory.end()) continue; remoteKeyHistory = it->second; } std::lock_guard(getLockForKey(remoteKey)); std::lock_guard lock(getLockForKey(remoteKey)); remoteKeyHistory->putProp(remoteName, prop, time); } return NO_ERROR; Loading Loading @@ -426,7 +426,7 @@ public: if (prefix != nullptr && !startsWith(it->first, prefix)) break; std::lock_guard lock(getLockForKey(it->first)); auto [s, l] = it->second->dump(ll, sinceNs); ss << std::move(s); ss << s; ll -= l; } return { ss.str(), lines - ll }; Loading @@ -441,7 +441,7 @@ private: // Finds a KeyHistory from a URL. Returns nullptr if not found. std::shared_ptr<KeyHistory> getKeyHistoryFromUrl( std::string url, std::string* key, std::string *prop) const { const std::string& url, std::string* key, std::string *prop) const { std::lock_guard lock(mLock); auto it = mHistory.upper_bound(url); Loading
services/mediametrics/TransactionLog.h +2 −2 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public: --ll; } auto [s, l] = dumpMapTimeItem(mLog, ll, sinceNs, prefix); ss << std::move(s); ss << s; ll -= l; // Grouped by item key (category) Loading @@ -158,7 +158,7 @@ public: if (prefix != nullptr && !startsWith(it->first, prefix)) break; auto [s, l] = dumpMapTimeItem(it->second, ll - 1, sinceNs, prefix); if (l == 0) continue; // don't show empty groups (due to sinceNs). ss << " " << it->first << "\n" << std::move(s); ss << " " << it->first << "\n" << s; ll -= l + 1; } return { ss.str(), lines - ll }; Loading