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

Unified Diff: chrome/browser/chromeos/net/wake_on_wifi_manager.h

Issue 1891633002: Remove unnecessary calls to AddWakeOnPaketConnection and RemoveWakeOnPacketConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/net/wake_on_wifi_manager.h
diff --git a/chrome/browser/chromeos/net/wake_on_wifi_manager.h b/chrome/browser/chromeos/net/wake_on_wifi_manager.h
index 9a2516c21eb274794adea6a7d4604cf2e67741f5..2377aebd0fafbdb65c3e12b3fcbe6d2e24ea2550 100644
--- a/chrome/browser/chromeos/net/wake_on_wifi_manager.h
+++ b/chrome/browser/chromeos/net/wake_on_wifi_manager.h
@@ -5,9 +5,9 @@
#ifndef CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_
#define CHROME_BROWSER_CHROMEOS_NET_WAKE_ON_WIFI_MANAGER_H_
-#include <memory>
+#include <map>
-#include "base/containers/scoped_ptr_hash_map.h"
+#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/power/extension_event_observer.h"
@@ -23,6 +23,8 @@ class DictionaryValue;
namespace chromeos {
+class WakeOnWifiConnectionObserver;
+
// This class is responsible for managing the various wake-on-wifi related bits
// of functionality in chrome. It is responsible for communicating the user's
// preferences to shill as well as listening for connections to the Google GCM
@@ -42,6 +44,7 @@ class WakeOnWifiManager : public content::NotificationObserver,
};
static WakeOnWifiManager* Get();
+ static bool IsWakeOnPacketEnabled(WakeOnWifiFeature feature);
WakeOnWifiManager();
~WakeOnWifiManager() override;
@@ -64,6 +67,11 @@ class WakeOnWifiManager : public content::NotificationObserver,
void DevicePropertiesUpdated(const DeviceState* device) override;
private:
+ FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiPacketAdd);
+ FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiPacketRemove);
+ FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiNoneAdd);
+ FRIEND_TEST_ALL_PREFIXES(WakeOnWifiObserverTest, TestWakeOnWifiNoneRemove);
+
// Sends the user's preference to shill, updates the timer used by the GCM
// client to send heartbeats, and tells |extension_event_observer_| to block
// (or not block) suspends based on the value of |current_feature_|.
@@ -86,10 +94,8 @@ class WakeOnWifiManager : public content::NotificationObserver,
// shill.
bool wifi_properties_received_;
- class WakeOnPacketConnectionObserver;
- base::ScopedPtrHashMap<Profile*,
- std::unique_ptr<WakeOnPacketConnectionObserver>>
- connection_observers_;
+ std::map<Profile*,
+ std::unique_ptr<WakeOnWifiConnectionObserver>> connection_observers_;
std::unique_ptr<ExtensionEventObserver> extension_event_observer_;
« no previous file with comments | « chrome/browser/chromeos/net/wake_on_wifi_connection_observer.cc ('k') | chrome/browser/chromeos/net/wake_on_wifi_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698