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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.cc

Issue 2189113002: Rename CalledOnValidSequencedThread() to CalledOnValidSequence(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_backend/drive_service_wrapper.h" 5 #include "chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "components/drive/service/drive_service_interface.h" 10 #include "components/drive/service/drive_service_interface.h"
11 11
12 namespace sync_file_system { 12 namespace sync_file_system {
13 namespace drive_backend { 13 namespace drive_backend {
14 14
15 DriveServiceWrapper::DriveServiceWrapper( 15 DriveServiceWrapper::DriveServiceWrapper(
16 drive::DriveServiceInterface* drive_service) 16 drive::DriveServiceInterface* drive_service)
17 : drive_service_(drive_service) { 17 : drive_service_(drive_service) {
18 DCHECK(drive_service_); 18 DCHECK(drive_service_);
19 } 19 }
20 20
21 void DriveServiceWrapper::AddNewDirectory( 21 void DriveServiceWrapper::AddNewDirectory(
22 const std::string& parent_resource_id, 22 const std::string& parent_resource_id,
23 const std::string& directory_title, 23 const std::string& directory_title,
24 const drive::AddNewDirectoryOptions& options, 24 const drive::AddNewDirectoryOptions& options,
25 const google_apis::FileResourceCallback& callback) { 25 const google_apis::FileResourceCallback& callback) {
26 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 26 DCHECK(sequece_checker_.CalledOnValidSequence());
27 drive_service_->AddNewDirectory(parent_resource_id, 27 drive_service_->AddNewDirectory(parent_resource_id,
28 directory_title, 28 directory_title,
29 options, 29 options,
30 callback); 30 callback);
31 } 31 }
32 32
33 void DriveServiceWrapper::DeleteResource( 33 void DriveServiceWrapper::DeleteResource(
34 const std::string& resource_id, 34 const std::string& resource_id,
35 const std::string& etag, 35 const std::string& etag,
36 const google_apis::EntryActionCallback& callback) { 36 const google_apis::EntryActionCallback& callback) {
37 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 37 DCHECK(sequece_checker_.CalledOnValidSequence());
38 drive_service_->DeleteResource(resource_id, 38 drive_service_->DeleteResource(resource_id,
39 etag, 39 etag,
40 callback); 40 callback);
41 } 41 }
42 42
43 void DriveServiceWrapper::DownloadFile( 43 void DriveServiceWrapper::DownloadFile(
44 const base::FilePath& local_cache_path, 44 const base::FilePath& local_cache_path,
45 const std::string& resource_id, 45 const std::string& resource_id,
46 const google_apis::DownloadActionCallback& download_action_callback, 46 const google_apis::DownloadActionCallback& download_action_callback,
47 const google_apis::GetContentCallback& get_content_callback, 47 const google_apis::GetContentCallback& get_content_callback,
48 const google_apis::ProgressCallback& progress_callback) { 48 const google_apis::ProgressCallback& progress_callback) {
49 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 49 DCHECK(sequece_checker_.CalledOnValidSequence());
50 drive_service_->DownloadFile(local_cache_path, 50 drive_service_->DownloadFile(local_cache_path,
51 resource_id, 51 resource_id,
52 download_action_callback, 52 download_action_callback,
53 get_content_callback, 53 get_content_callback,
54 progress_callback); 54 progress_callback);
55 } 55 }
56 56
57 void DriveServiceWrapper::GetAboutResource( 57 void DriveServiceWrapper::GetAboutResource(
58 const google_apis::AboutResourceCallback& callback) { 58 const google_apis::AboutResourceCallback& callback) {
59 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 59 DCHECK(sequece_checker_.CalledOnValidSequence());
60 drive_service_->GetAboutResource(callback); 60 drive_service_->GetAboutResource(callback);
61 } 61 }
62 62
63 void DriveServiceWrapper::GetChangeList( 63 void DriveServiceWrapper::GetChangeList(
64 int64_t start_changestamp, 64 int64_t start_changestamp,
65 const google_apis::ChangeListCallback& callback) { 65 const google_apis::ChangeListCallback& callback) {
66 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 66 DCHECK(sequece_checker_.CalledOnValidSequence());
67 drive_service_->GetChangeList(start_changestamp, callback); 67 drive_service_->GetChangeList(start_changestamp, callback);
68 } 68 }
69 69
70 void DriveServiceWrapper::GetRemainingChangeList( 70 void DriveServiceWrapper::GetRemainingChangeList(
71 const GURL& next_link, 71 const GURL& next_link,
72 const google_apis::ChangeListCallback& callback) { 72 const google_apis::ChangeListCallback& callback) {
73 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 73 DCHECK(sequece_checker_.CalledOnValidSequence());
74 drive_service_->GetRemainingChangeList(next_link, callback); 74 drive_service_->GetRemainingChangeList(next_link, callback);
75 } 75 }
76 76
77 void DriveServiceWrapper::GetRemainingFileList( 77 void DriveServiceWrapper::GetRemainingFileList(
78 const GURL& next_link, 78 const GURL& next_link,
79 const google_apis::FileListCallback& callback) { 79 const google_apis::FileListCallback& callback) {
80 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 80 DCHECK(sequece_checker_.CalledOnValidSequence());
81 drive_service_->GetRemainingFileList(next_link, callback); 81 drive_service_->GetRemainingFileList(next_link, callback);
82 } 82 }
83 83
84 void DriveServiceWrapper::GetFileResource( 84 void DriveServiceWrapper::GetFileResource(
85 const std::string& resource_id, 85 const std::string& resource_id,
86 const google_apis::FileResourceCallback& callback) { 86 const google_apis::FileResourceCallback& callback) {
87 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 87 DCHECK(sequece_checker_.CalledOnValidSequence());
88 drive_service_->GetFileResource(resource_id, callback); 88 drive_service_->GetFileResource(resource_id, callback);
89 } 89 }
90 90
91 void DriveServiceWrapper::GetFileListInDirectory( 91 void DriveServiceWrapper::GetFileListInDirectory(
92 const std::string& directory_resource_id, 92 const std::string& directory_resource_id,
93 const google_apis::FileListCallback& callback) { 93 const google_apis::FileListCallback& callback) {
94 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 94 DCHECK(sequece_checker_.CalledOnValidSequence());
95 drive_service_->GetFileListInDirectory(directory_resource_id, callback); 95 drive_service_->GetFileListInDirectory(directory_resource_id, callback);
96 } 96 }
97 97
98 void DriveServiceWrapper::RemoveResourceFromDirectory( 98 void DriveServiceWrapper::RemoveResourceFromDirectory(
99 const std::string& parent_resource_id, 99 const std::string& parent_resource_id,
100 const std::string& resource_id, 100 const std::string& resource_id,
101 const google_apis::EntryActionCallback& callback) { 101 const google_apis::EntryActionCallback& callback) {
102 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 102 DCHECK(sequece_checker_.CalledOnValidSequence());
103 drive_service_->RemoveResourceFromDirectory( 103 drive_service_->RemoveResourceFromDirectory(
104 parent_resource_id, resource_id, callback); 104 parent_resource_id, resource_id, callback);
105 } 105 }
106 106
107 void DriveServiceWrapper::SearchByTitle( 107 void DriveServiceWrapper::SearchByTitle(
108 const std::string& title, 108 const std::string& title,
109 const std::string& directory_resource_id, 109 const std::string& directory_resource_id,
110 const google_apis::FileListCallback& callback) { 110 const google_apis::FileListCallback& callback) {
111 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); 111 DCHECK(sequece_checker_.CalledOnValidSequence());
112 drive_service_->SearchByTitle( 112 drive_service_->SearchByTitle(
113 title, directory_resource_id, callback); 113 title, directory_resource_id, callback);
114 } 114 }
115 115
116 } // namespace drive_backend 116 } // namespace drive_backend
117 } // namespace sync_file_system 117 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698