OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync
able_service.h" | 5 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync
able_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/base64.h" | 11 #include "base/base64.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/containers/scoped_ptr_hash_map.h" | 13 #include "base/containers/scoped_ptr_hash_map.h" |
14 #include "base/location.h" | 14 #include "base/location.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
18 #include "base/numerics/safe_conversions.h" | 18 #include "base/numerics/safe_conversions.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "components/autofill/core/browser/autofill_data_model.h" | 20 #include "components/autofill/core/browser/autofill_data_model.h" |
21 #include "components/autofill/core/browser/autofill_profile.h" | 21 #include "components/autofill/core/browser/autofill_profile.h" |
22 #include "components/autofill/core/browser/credit_card.h" | 22 #include "components/autofill/core/browser/credit_card.h" |
23 #include "components/autofill/core/browser/webdata/autofill_change.h" | 23 #include "components/autofill/core/browser/webdata/autofill_change.h" |
24 #include "components/autofill/core/browser/webdata/autofill_table.h" | 24 #include "components/autofill/core/browser/webdata/autofill_table.h" |
25 #include "components/autofill/core/browser/webdata/autofill_webdata_backend.h" | 25 #include "components/autofill/core/browser/webdata/autofill_webdata_backend.h" |
26 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 26 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
27 #include "sync/api/sync_change.h" | 27 #include "components/sync/api/sync_change.h" |
28 #include "sync/api/sync_change_processor.h" | 28 #include "components/sync/api/sync_change_processor.h" |
29 #include "sync/api/sync_data.h" | 29 #include "components/sync/api/sync_data.h" |
30 #include "sync/api/sync_error_factory.h" | 30 #include "components/sync/api/sync_error_factory.h" |
31 #include "sync/protocol/sync.pb.h" | 31 #include "components/sync/protocol/sync.pb.h" |
32 | 32 |
33 namespace autofill { | 33 namespace autofill { |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 void* UserDataKey() { | 37 void* UserDataKey() { |
38 // Use the address of a static so that COMDAT folding won't ever fold | 38 // Use the address of a static so that COMDAT folding won't ever fold |
39 // with something else. | 39 // with something else. |
40 static int user_data_key = 0; | 40 static int user_data_key = 0; |
41 return reinterpret_cast<void*>(&user_data_key); | 41 return reinterpret_cast<void*>(&user_data_key); |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 it->GetSpecifics().wallet_metadata(); | 530 it->GetSpecifics().wallet_metadata(); |
531 if (base::checked_cast<size_t>(remote.use_count()) < local.use_count() && | 531 if (base::checked_cast<size_t>(remote.use_count()) < local.use_count() && |
532 base::Time::FromInternalValue(remote.use_date()) < local.use_date()) { | 532 base::Time::FromInternalValue(remote.use_date()) < local.use_date()) { |
533 SendChangesToSyncServer(syncer::SyncChangeList( | 533 SendChangesToSyncServer(syncer::SyncChangeList( |
534 1, syncer::SyncChange(FROM_HERE, syncer::SyncChange::ACTION_UPDATE, | 534 1, syncer::SyncChange(FROM_HERE, syncer::SyncChange::ACTION_UPDATE, |
535 BuildSyncData(remote.type(), server_id, local)))); | 535 BuildSyncData(remote.type(), server_id, local)))); |
536 } | 536 } |
537 } | 537 } |
538 | 538 |
539 } // namespace autofill | 539 } // namespace autofill |
OLD | NEW |