| OLD | NEW | 
|---|
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/engine/syncapi.h" | 5 #include "chrome/browser/sync/engine/syncapi.h" | 
| 6 | 6 | 
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" | 
| 8 | 8 | 
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) | 
| 10 #include <windows.h> | 10 #include <windows.h> | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
| 22 #include <linux/netlink.h> | 22 #include <linux/netlink.h> | 
| 23 #include <linux/rtnetlink.h> | 23 #include <linux/rtnetlink.h> | 
| 24 #endif | 24 #endif | 
| 25 | 25 | 
| 26 #include <iomanip> | 26 #include <iomanip> | 
| 27 #include <list> | 27 #include <list> | 
| 28 #include <string> | 28 #include <string> | 
| 29 #include <vector> | 29 #include <vector> | 
| 30 | 30 | 
| 31 #include "base/basictypes.h" | 31 #include "base/basictypes.h" | 
|  | 32 #include "base/base64.h" | 
| 32 #include "base/lock.h" | 33 #include "base/lock.h" | 
| 33 #include "base/platform_thread.h" | 34 #include "base/platform_thread.h" | 
| 34 #include "base/scoped_ptr.h" | 35 #include "base/scoped_ptr.h" | 
| 35 #include "base/sha1.h" | 36 #include "base/sha1.h" | 
| 36 #include "base/string_util.h" | 37 #include "base/string_util.h" | 
| 37 #include "base/task.h" | 38 #include "base/task.h" | 
| 38 #include "base/utf_string_conversions.h" | 39 #include "base/utf_string_conversions.h" | 
| 39 #include "chrome/browser/sync/engine/all_status.h" | 40 #include "chrome/browser/sync/engine/all_status.h" | 
| 40 #include "chrome/browser/sync/engine/auth_watcher.h" | 41 #include "chrome/browser/sync/engine/auth_watcher.h" | 
| 41 #include "chrome/browser/sync/engine/change_reorder_buffer.h" | 42 #include "chrome/browser/sync/engine/change_reorder_buffer.h" | 
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 392 | 393 | 
| 393 std::string BaseNode::GenerateSyncableHash( | 394 std::string BaseNode::GenerateSyncableHash( | 
| 394     syncable::ModelType model_type, const std::string& client_tag) { | 395     syncable::ModelType model_type, const std::string& client_tag) { | 
| 395   // blank PB with just the extension in it has termination symbol, | 396   // blank PB with just the extension in it has termination symbol, | 
| 396   // handy for delimiter | 397   // handy for delimiter | 
| 397   sync_pb::EntitySpecifics serialized_type; | 398   sync_pb::EntitySpecifics serialized_type; | 
| 398   syncable::AddDefaultExtensionValue(model_type, &serialized_type); | 399   syncable::AddDefaultExtensionValue(model_type, &serialized_type); | 
| 399   std::string hash_input; | 400   std::string hash_input; | 
| 400   serialized_type.AppendToString(&hash_input); | 401   serialized_type.AppendToString(&hash_input); | 
| 401   hash_input.append(client_tag); | 402   hash_input.append(client_tag); | 
| 402   return HexEncode(hash_input.data(), hash_input.length()); | 403 | 
|  | 404   std::string encode_output; | 
|  | 405   CHECK(base::Base64Encode(base::SHA1HashString(hash_input), &encode_output)); | 
|  | 406   return encode_output; | 
| 403 } | 407 } | 
| 404 | 408 | 
| 405 int64 BaseNode::GetParentId() const { | 409 int64 BaseNode::GetParentId() const { | 
| 406   return IdToMetahandle(GetTransaction()->GetWrappedTrans(), | 410   return IdToMetahandle(GetTransaction()->GetWrappedTrans(), | 
| 407                         GetEntry()->Get(syncable::PARENT_ID)); | 411                         GetEntry()->Get(syncable::PARENT_ID)); | 
| 408 } | 412 } | 
| 409 | 413 | 
| 410 int64 BaseNode::GetId() const { | 414 int64 BaseNode::GetId() const { | 
| 411   return GetEntry()->Get(syncable::META_HANDLE); | 415   return GetEntry()->Get(syncable::META_HANDLE); | 
| 412 } | 416 } | 
| (...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1865 BaseTransaction::~BaseTransaction() { | 1869 BaseTransaction::~BaseTransaction() { | 
| 1866   delete lookup_; | 1870   delete lookup_; | 
| 1867 } | 1871 } | 
| 1868 | 1872 | 
| 1869 UserShare* SyncManager::GetUserShare() const { | 1873 UserShare* SyncManager::GetUserShare() const { | 
| 1870   DCHECK(data_->initialized()) << "GetUserShare requires initialization!"; | 1874   DCHECK(data_->initialized()) << "GetUserShare requires initialization!"; | 
| 1871   return data_->GetUserShare(); | 1875   return data_->GetUserShare(); | 
| 1872 } | 1876 } | 
| 1873 | 1877 | 
| 1874 }  // namespace sync_api | 1878 }  // namespace sync_api | 
| OLD | NEW | 
|---|