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/chromeos/gdata/gdata_sync_client.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_sync_client.h" |
6 | 6 |
7 #include <sys/types.h> | 7 #include <sys/types.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 void GDataSyncClient::StartInitialScan(const base::Closure& closure) { | 99 void GDataSyncClient::StartInitialScan(const base::Closure& closure) { |
100 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 100 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
101 DCHECK(!closure.is_null()); | 101 DCHECK(!closure.is_null()); |
102 | 102 |
103 // Start scanning the pinned directory in the cache. | 103 // Start scanning the pinned directory in the cache. |
104 std::vector<std::string>* resource_ids = new std::vector<std::string>; | 104 std::vector<std::string>* resource_ids = new std::vector<std::string>; |
105 const bool posted = | 105 const bool posted = |
106 BrowserThread::GetBlockingPool()->PostTaskAndReply( | 106 BrowserThread::GetBlockingPool()->PostTaskAndReply( |
107 FROM_HERE, | 107 FROM_HERE, |
108 base::Bind(&ScanPinnedDirectory, | 108 base::Bind(&ScanPinnedDirectory, |
109 file_system_->GetGDataCachePinnedDirectory(), | 109 file_system_->GetCacheDirectoryPath( |
| 110 GDataRootDirectory::CACHE_TYPE_PINNED), |
110 resource_ids), | 111 resource_ids), |
111 base::Bind(&GDataSyncClient::OnInitialScanComplete, | 112 base::Bind(&GDataSyncClient::OnInitialScanComplete, |
112 weak_ptr_factory_.GetWeakPtr(), | 113 weak_ptr_factory_.GetWeakPtr(), |
113 closure, | 114 closure, |
114 base::Owned(resource_ids))); | 115 base::Owned(resource_ids))); |
115 DCHECK(posted); | 116 DCHECK(posted); |
116 } | 117 } |
117 | 118 |
118 void GDataSyncClient::StartFetchLoop() { | 119 void GDataSyncClient::StartFetchLoop() { |
119 if (!fetch_loop_is_running_) | 120 if (!fetch_loop_is_running_) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 const content::NotificationDetails& details) { | 251 const content::NotificationDetails& details) { |
251 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 252 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
252 | 253 |
253 // Resume the fetch loop if gdata preferences are changed. Note that we | 254 // Resume the fetch loop if gdata preferences are changed. Note that we |
254 // don't need to check the new values here as these will be checked in | 255 // don't need to check the new values here as these will be checked in |
255 // ShouldStopFetchLoop() as soon as the loop is resumed. | 256 // ShouldStopFetchLoop() as soon as the loop is resumed. |
256 StartFetchLoop(); | 257 StartFetchLoop(); |
257 } | 258 } |
258 | 259 |
259 } // namespace gdata | 260 } // namespace gdata |
OLD | NEW |