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_file_system/local_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/local_file_sync_service.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 return; | 214 return; |
215 } | 215 } |
216 GURL site_url = extension_service->GetSiteForExtensionId(extension->id()); | 216 GURL site_url = extension_service->GetSiteForExtensionId(extension->id()); |
217 DCHECK(!site_url.is_empty()); | 217 DCHECK(!site_url.is_empty()); |
218 scoped_refptr<fileapi::FileSystemContext> file_system_context = | 218 scoped_refptr<fileapi::FileSystemContext> file_system_context = |
219 content::BrowserContext::GetStoragePartitionForSite( | 219 content::BrowserContext::GetStoragePartitionForSite( |
220 profile_, site_url)->GetFileSystemContext(); | 220 profile_, site_url)->GetFileSystemContext(); |
221 MaybeInitializeFileSystemContext( | 221 MaybeInitializeFileSystemContext( |
222 url.origin(), | 222 url.origin(), |
223 service_name, | 223 service_name, |
224 file_system_context, | 224 file_system_context.get(), |
225 base::Bind(&LocalFileSyncService::DidInitializeForRemoteSync, | 225 base::Bind(&LocalFileSyncService::DidInitializeForRemoteSync, |
226 AsWeakPtr(), url, service_name, | 226 AsWeakPtr(), |
227 file_system_context, callback)); | 227 url, |
| 228 service_name, |
| 229 file_system_context, |
| 230 callback)); |
228 return; | 231 return; |
229 } | 232 } |
230 | 233 |
231 DCHECK(ContainsKey(origin_to_contexts_, url.origin())); | 234 DCHECK(ContainsKey(origin_to_contexts_, url.origin())); |
232 sync_context_->PrepareForSync( | 235 sync_context_->PrepareForSync( |
233 origin_to_contexts_[url.origin()], url, | 236 origin_to_contexts_[url.origin()], url, |
234 base::Bind(&PrepareForProcessRemoteChangeCallbackAdapter, callback)); | 237 base::Bind(&PrepareForProcessRemoteChangeCallbackAdapter, callback)); |
235 } | 238 } |
236 | 239 |
237 void LocalFileSyncService::ApplyRemoteChange( | 240 void LocalFileSyncService::ApplyRemoteChange( |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 changes.front(), | 422 changes.front(), |
420 sync_file_info.local_file_path, | 423 sync_file_info.local_file_path, |
421 sync_file_info.metadata, | 424 sync_file_info.metadata, |
422 url, | 425 url, |
423 base::Bind(&LocalFileSyncService::ProcessNextChangeForURL, | 426 base::Bind(&LocalFileSyncService::ProcessNextChangeForURL, |
424 AsWeakPtr(), sync_file_info, | 427 AsWeakPtr(), sync_file_info, |
425 changes.front(), changes.PopAndGetNewList())); | 428 changes.front(), changes.PopAndGetNewList())); |
426 } | 429 } |
427 | 430 |
428 } // namespace sync_file_system | 431 } // namespace sync_file_system |
OLD | NEW |