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

Side by Side Diff: chrome/browser/sync_file_system/drive_file_sync_service.cc

Issue 13372002: Uninstall a non-syncfs extension should not cause Token loss (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/drive_file_sync_service.h" 5 #include "chrome/browser/sync_file_system/drive_file_sync_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 pending_tasks_.push_back(base::Bind( 493 pending_tasks_.push_back(base::Bind(
494 &DriveFileSyncService::UninstallOrigin, 494 &DriveFileSyncService::UninstallOrigin,
495 AsWeakPtr(), origin, callback)); 495 AsWeakPtr(), origin, callback));
496 return; 496 return;
497 } 497 }
498 498
499 std::string resource_id = metadata_store_->GetResourceIdForOrigin(origin); 499 std::string resource_id = metadata_store_->GetResourceIdForOrigin(origin);
500 500
501 // An empty resource_id indicates either one of following two cases: 501 // An empty resource_id indicates either one of following two cases:
502 // 1) origin is not in metadata_store_ because the extension was never 502 // 1) origin is not in metadata_store_ because the extension was never
503 // run and thus no origin directory on the remote drive was created. 503 // run or it's not managed by this service, and thus no
504 // origin directory on the remote drive was created.
504 // 2) origin or sync root folder is deleted on Drive. 505 // 2) origin or sync root folder is deleted on Drive.
505 if (resource_id.empty()) { 506 if (resource_id.empty()) {
507 token->ResetTask(FROM_HERE);
508 NotifyTaskDone(last_operation_status_, token.Pass());
506 callback.Run(SYNC_STATUS_OK); 509 callback.Run(SYNC_STATUS_OK);
507 return; 510 return;
508 } 511 }
509 512
510 // Convert origin's directory GURL to ResourceID and delete it. Expected MD5 513 // Convert origin's directory GURL to ResourceID and delete it. Expected MD5
511 // is empty to force delete (i.e. skip conflict resolution). 514 // is empty to force delete (i.e. skip conflict resolution).
512 sync_client_->DeleteFile( 515 sync_client_->DeleteFile(
513 resource_id, 516 resource_id,
514 std::string(), 517 std::string(),
515 base::Bind(&DriveFileSyncService::DidUninstallOrigin, 518 base::Bind(&DriveFileSyncService::DidUninstallOrigin,
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
2471 pending_batch_sync_origins_.insert(origin); 2474 pending_batch_sync_origins_.insert(origin);
2472 } 2475 }
2473 callback.Run(status, resource_id); 2476 callback.Run(status, resource_id);
2474 } 2477 }
2475 2478
2476 std::string DriveFileSyncService::sync_root_resource_id() { 2479 std::string DriveFileSyncService::sync_root_resource_id() {
2477 return metadata_store_->sync_root_directory(); 2480 return metadata_store_->sync_root_directory();
2478 } 2481 }
2479 2482
2480 } // namespace sync_file_system 2483 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698