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

Unified Diff: ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.mm

Issue 2458613004: Record the initial state of the Physical Web at startup (Closed)
Patch Set: fix retain loop Created 3 years, 11 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: ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.mm
diff --git a/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.mm b/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.mm
index 80c074479920ed699f1e66ac5d5ba901b6548518..f2dcdeea51e9cca922f4e3948db359491f40c947 100644
--- a/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.mm
+++ b/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.mm
@@ -6,11 +6,18 @@
#include "base/memory/ptr_util.h"
#include "base/values.h"
+#import "ios/chrome/browser/physical_web/physical_web_initial_state_recorder.h"
#import "ios/chrome/common/physical_web/physical_web_scanner.h"
-IOSChromePhysicalWebDataSource::IOSChromePhysicalWebDataSource() {}
+IOSChromePhysicalWebDataSource::IOSChromePhysicalWebDataSource(
+ PrefService* pref_service) {
+ initialStateRecorder_.reset([[PhysicalWebInitialStateRecorder alloc]
+ initWithPrefService:pref_service]);
+ [initialStateRecorder_ collectAndRecordState];
+}
IOSChromePhysicalWebDataSource::~IOSChromePhysicalWebDataSource() {
+ [initialStateRecorder_ invalidate];
StopDiscovery();
}

Powered by Google App Engine
This is Rietveld 408576698