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

Side by Side Diff: chrome/browser/drive/fake_drive_service.cc

Issue 22297004: drive: Stop making multiple GetAppList() requests from DriveAppRegistry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simplify Created 7 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 | Annotate | Revision Log
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/drive/fake_drive_service.h" 5 #include "chrome/browser/drive/fake_drive_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 FakeDriveService::FakeDriveService() 158 FakeDriveService::FakeDriveService()
159 : largest_changestamp_(0), 159 : largest_changestamp_(0),
160 published_date_seq_(0), 160 published_date_seq_(0),
161 next_upload_sequence_number_(0), 161 next_upload_sequence_number_(0),
162 default_max_results_(0), 162 default_max_results_(0),
163 resource_id_count_(0), 163 resource_id_count_(0),
164 resource_list_load_count_(0), 164 resource_list_load_count_(0),
165 change_list_load_count_(0), 165 change_list_load_count_(0),
166 directory_load_count_(0), 166 directory_load_count_(0),
167 about_resource_load_count_(0), 167 about_resource_load_count_(0),
168 app_list_load_count_(0),
168 offline_(false) { 169 offline_(false) {
169 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 170 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
170 } 171 }
171 172
172 FakeDriveService::~FakeDriveService() { 173 FakeDriveService::~FakeDriveService() {
173 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
174 } 175 }
175 176
176 bool FakeDriveService::LoadResourceListForWapi( 177 bool FakeDriveService::LoadResourceListForWapi(
177 const std::string& relative_path) { 178 const std::string& relative_path) {
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 if (offline_) { 545 if (offline_) {
545 scoped_ptr<AppList> null; 546 scoped_ptr<AppList> null;
546 base::MessageLoop::current()->PostTask( 547 base::MessageLoop::current()->PostTask(
547 FROM_HERE, 548 FROM_HERE,
548 base::Bind(callback, 549 base::Bind(callback,
549 GDATA_NO_CONNECTION, 550 GDATA_NO_CONNECTION,
550 base::Passed(&null))); 551 base::Passed(&null)));
551 return CancelCallback(); 552 return CancelCallback();
552 } 553 }
553 554
555 ++app_list_load_count_;
554 scoped_ptr<AppList> app_list(AppList::CreateFrom(*app_info_value_)); 556 scoped_ptr<AppList> app_list(AppList::CreateFrom(*app_info_value_));
555 base::MessageLoop::current()->PostTask( 557 base::MessageLoop::current()->PostTask(
556 FROM_HERE, 558 FROM_HERE,
557 base::Bind(callback, HTTP_SUCCESS, base::Passed(&app_list))); 559 base::Bind(callback, HTTP_SUCCESS, base::Passed(&app_list)));
558 return CancelCallback(); 560 return CancelCallback();
559 } 561 }
560 562
561 CancelCallback FakeDriveService::DeleteResource( 563 CancelCallback FakeDriveService::DeleteResource(
562 const std::string& resource_id, 564 const std::string& resource_id,
563 const std::string& etag, 565 const std::string& etag,
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 FROM_HERE, 1535 FROM_HERE,
1534 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list))); 1536 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list)));
1535 } 1537 }
1536 1538
1537 GURL FakeDriveService::GetNewUploadSessionUrl() { 1539 GURL FakeDriveService::GetNewUploadSessionUrl() {
1538 return GURL("https://upload_session_url/" + 1540 return GURL("https://upload_session_url/" +
1539 base::Int64ToString(next_upload_sequence_number_++)); 1541 base::Int64ToString(next_upload_sequence_number_++));
1540 } 1542 }
1541 1543
1542 } // namespace drive 1544 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/drive/fake_drive_service.h ('k') | chrome/browser/drive/fake_drive_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698