OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/sync/glue/generic_change_processor.h" | 5 #include "chrome/browser/sync/glue/generic_change_processor.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 write_node->SetPasswordSpecifics( | 33 write_node->SetPasswordSpecifics( |
34 entity_specifics.password().client_only_encrypted_data()); | 34 entity_specifics.password().client_only_encrypted_data()); |
35 } else { | 35 } else { |
36 write_node->SetEntitySpecifics(entity_specifics); | 36 write_node->SetEntitySpecifics(entity_specifics); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 syncer::SyncData BuildRemoteSyncData( | 40 syncer::SyncData BuildRemoteSyncData( |
41 int64 sync_id, | 41 int64 sync_id, |
42 const syncer::BaseNode& read_node, | 42 const syncer::BaseNode& read_node, |
43 const syncer::AttachmentServiceProxy& attachment_service_proxy) { | 43 const scoped_refptr<syncer::AttachmentServiceProxy>& |
| 44 attachment_service_proxy) { |
44 const syncer::AttachmentIdList& attachment_ids = read_node.GetAttachmentIds(); | 45 const syncer::AttachmentIdList& attachment_ids = read_node.GetAttachmentIds(); |
45 // Use the specifics of non-password datatypes directly (encryption has | 46 // Use the specifics of non-password datatypes directly (encryption has |
46 // already been handled). | 47 // already been handled). |
47 if (read_node.GetModelType() != syncer::PASSWORDS) { | 48 if (read_node.GetModelType() != syncer::PASSWORDS) { |
48 return syncer::SyncData::CreateRemoteData(sync_id, | 49 return syncer::SyncData::CreateRemoteData(sync_id, |
49 read_node.GetEntitySpecifics(), | 50 read_node.GetEntitySpecifics(), |
50 read_node.GetModificationTime(), | 51 read_node.GetModificationTime(), |
51 attachment_ids, | 52 attachment_ids, |
52 attachment_service_proxy); | 53 attachment_service_proxy); |
53 } | 54 } |
(...skipping 17 matching lines...) Expand all Loading... |
71 const base::WeakPtr<syncer::SyncableService>& local_service, | 72 const base::WeakPtr<syncer::SyncableService>& local_service, |
72 const base::WeakPtr<syncer::SyncMergeResult>& merge_result, | 73 const base::WeakPtr<syncer::SyncMergeResult>& merge_result, |
73 syncer::UserShare* user_share, | 74 syncer::UserShare* user_share, |
74 scoped_ptr<syncer::AttachmentService> attachment_service) | 75 scoped_ptr<syncer::AttachmentService> attachment_service) |
75 : ChangeProcessor(error_handler), | 76 : ChangeProcessor(error_handler), |
76 local_service_(local_service), | 77 local_service_(local_service), |
77 merge_result_(merge_result), | 78 merge_result_(merge_result), |
78 share_handle_(user_share), | 79 share_handle_(user_share), |
79 attachment_service_(attachment_service.Pass()), | 80 attachment_service_(attachment_service.Pass()), |
80 attachment_service_weak_ptr_factory_(attachment_service_.get()), | 81 attachment_service_weak_ptr_factory_(attachment_service_.get()), |
81 attachment_service_proxy_(syncer::AttachmentServiceProxy( | 82 attachment_service_proxy_(new syncer::AttachmentServiceProxy( |
82 base::MessageLoopProxy::current(), | 83 base::MessageLoopProxy::current(), |
83 attachment_service_weak_ptr_factory_.GetWeakPtr())) { | 84 attachment_service_weak_ptr_factory_.GetWeakPtr())) { |
84 DCHECK(CalledOnValidThread()); | 85 DCHECK(CalledOnValidThread()); |
85 DCHECK(attachment_service_); | 86 DCHECK(attachment_service_); |
86 } | 87 } |
87 | 88 |
88 GenericChangeProcessor::~GenericChangeProcessor() { | 89 GenericChangeProcessor::~GenericChangeProcessor() { |
89 DCHECK(CalledOnValidThread()); | 90 DCHECK(CalledOnValidThread()); |
90 } | 91 } |
91 | 92 |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 void GenericChangeProcessor::StartImpl(Profile* profile) { | 627 void GenericChangeProcessor::StartImpl(Profile* profile) { |
627 DCHECK(CalledOnValidThread()); | 628 DCHECK(CalledOnValidThread()); |
628 } | 629 } |
629 | 630 |
630 syncer::UserShare* GenericChangeProcessor::share_handle() const { | 631 syncer::UserShare* GenericChangeProcessor::share_handle() const { |
631 DCHECK(CalledOnValidThread()); | 632 DCHECK(CalledOnValidThread()); |
632 return share_handle_; | 633 return share_handle_; |
633 } | 634 } |
634 | 635 |
635 } // namespace browser_sync | 636 } // namespace browser_sync |
OLD | NEW |