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

Unified Diff: chrome/browser/sync/glue/session_model_associator.cc

Issue 10966002: Add cache_guid accessor to UserShare (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update + back to small patch Created 8 years, 1 month 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
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator.h ('k') | sync/internal_api/public/user_share.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/session_model_associator.cc
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc
index 739e1379a11209b602443c8b1c1714fa43276ca3..5c6ea1502b96a67085bce3c83879b3eabafbcd7e 100644
--- a/chrome/browser/sync/glue/session_model_associator.cc
+++ b/chrome/browser/sync/glue/session_model_associator.cc
@@ -36,12 +36,10 @@
#include "sync/internal_api/public/base/model_type_invalidation_map.h"
#include "sync/internal_api/public/read_node.h"
#include "sync/internal_api/public/read_transaction.h"
+#include "sync/internal_api/public/user_share.h"
#include "sync/internal_api/public/write_node.h"
#include "sync/internal_api/public/write_transaction.h"
#include "sync/protocol/session_specifics.pb.h"
-#include "sync/syncable/directory.h"
-#include "sync/syncable/read_transaction.h"
-#include "sync/syncable/write_transaction.h"
#include "sync/util/get_session_name.h"
#include "ui/gfx/favicon_size.h"
#if defined(OS_LINUX)
@@ -602,7 +600,7 @@ syncer::SyncError SessionModelAssociator::AssociateModels() {
// Make sure we have a machine tag.
if (current_machine_tag_.empty()) {
- InitializeCurrentMachineTag(&trans);
+ InitializeCurrentMachineTag(sync_service_->GetUserShare());
// The session name is retrieved asynchronously so it might not come back
// for the writing of the session. However, we write to the session often
// enough (on every navigation) that we'll pick it up quickly.
@@ -677,7 +675,7 @@ syncer::SyncError SessionModelAssociator::DisassociateModels() {
}
void SessionModelAssociator::InitializeCurrentMachineTag(
- syncer::WriteTransaction* trans) {
+ syncer::UserShare* share) {
DCHECK(CalledOnValidThread());
DCHECK(current_machine_tag_.empty());
std::string persisted_guid;
@@ -688,8 +686,6 @@ void SessionModelAssociator::InitializeCurrentMachineTag(
DVLOG(1) << "Restoring persisted session sync guid: "
<< persisted_guid;
} else {
- syncer::syncable::Directory* dir =
- trans->GetWrappedWriteTrans()->directory();
current_machine_tag_ = "session_sync";
#if defined(OS_ANDROID)
const std::string android_id = syncer::internal::GetAndroidId();
@@ -697,9 +693,9 @@ void SessionModelAssociator::InitializeCurrentMachineTag(
// are supposed to be fixed as of Gingerbread, but if it happens we fall
// back to use the same GUID generation as on other platforms.
current_machine_tag_.append(android_id.empty() ?
- dir->cache_guid() : android_id);
+ share->cache_guid() : android_id);
#else
- current_machine_tag_.append(dir->cache_guid());
+ current_machine_tag_.append(share->cache_guid());
#endif
DVLOG(1) << "Creating session sync guid: " << current_machine_tag_;
if (pref_service_)
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator.h ('k') | sync/internal_api/public/user_share.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698