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

Side by Side Diff: components/autofill/core/browser/webdata/autocomplete_sync_bridge.h

Issue 2582713003: [USS] Impelementation for GetData and GetAllData (Closed)
Patch Set: skym review 2 Created 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_
7 7
8 #include "base/scoped_observer.h" 8 #include "base/scoped_observer.h"
9 #include "base/supports_user_data.h" 9 #include "base/supports_user_data.h"
10 #include "base/threading/non_thread_safe.h" 10 #include "base/threading/non_thread_safe.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 std::string GetClientTag(const syncer::EntityData& entity_data) override; 58 std::string GetClientTag(const syncer::EntityData& entity_data) override;
59 // Generate a string key uniquely identifying |entity_data| in the context of 59 // Generate a string key uniquely identifying |entity_data| in the context of
60 // local storage. The format, which should stay the same, is $name|$value" 60 // local storage. The format, which should stay the same, is $name|$value"
61 // where $name and $value are escaped. 61 // where $name and $value are escaped.
62 std::string GetStorageKey(const syncer::EntityData& entity_data) override; 62 std::string GetStorageKey(const syncer::EntityData& entity_data) override;
63 63
64 // AutofillWebDataServiceObserverOnDBThread implementation. 64 // AutofillWebDataServiceObserverOnDBThread implementation.
65 void AutofillEntriesChanged(const AutofillChangeList& changes) override; 65 void AutofillEntriesChanged(const AutofillChangeList& changes) override;
66 66
67 private: 67 private:
68 friend class AutocompleteSyncBridgeTest;
vabr (Chromium) 2016/12/21 08:48:07 Please do not friend the test. Tests should only d
Gang Wu 2016/12/22 01:33:53 Done.
69
68 // Returns the table associated with the |web_data_backend_|. 70 // Returns the table associated with the |web_data_backend_|.
69 AutofillTable* GetAutofillTable() const; 71 AutofillTable* GetAutofillTable() const;
70 72
73 std::string GetStorageKeyFromAutofillEntry(
74 const autofill::AutofillEntry& entry);
75
76 static std::string FormatStorageKey(const std::string& name,
77 const std::string& value);
78
79 static AutofillEntry CreateAutofillEntry(
vabr (Chromium) 2016/12/21 08:48:07 I can only see this used in the test. Could you de
skym 2016/12/21 21:50:41 I think moving this function to the test file woul
Gang Wu 2016/12/22 01:33:53 you are right, we need this function later on, eve
Gang Wu 2016/12/22 01:33:53 Done.
80 const sync_pb::AutofillSpecifics& autofill_specifics);
81
71 base::ThreadChecker thread_checker_; 82 base::ThreadChecker thread_checker_;
72 83
73 // AutocompleteSyncBridge is owned by |web_data_backend_| through 84 // AutocompleteSyncBridge is owned by |web_data_backend_| through
74 // SupportsUserData, so it's guaranteed to outlive |this|. 85 // SupportsUserData, so it's guaranteed to outlive |this|.
75 AutofillWebDataBackend* const web_data_backend_; 86 AutofillWebDataBackend* const web_data_backend_;
76 87
77 ScopedObserver<AutofillWebDataBackend, AutocompleteSyncBridge> 88 ScopedObserver<AutofillWebDataBackend, AutocompleteSyncBridge>
78 scoped_observer_; 89 scoped_observer_;
79 }; 90 };
80 91
81 } // namespace autofill 92 } // namespace autofill
82 93
83 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_ 94 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOCOMPLETE_SYNC_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698