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/contacts/gdata_contacts_service.h" | 5 #include "chrome/browser/chromeos/contacts/gdata_contacts_service.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 std::vector<std::string> scopes; | 864 std::vector<std::string> scopes; |
865 scopes.push_back(kContactsScope); | 865 scopes.push_back(kContactsScope); |
866 sender_.reset(new google_apis::RequestSender(profile, | 866 sender_.reset(new google_apis::RequestSender(profile, |
867 url_request_context_getter_, | 867 url_request_context_getter_, |
868 scopes, | 868 scopes, |
869 "" /* custom_user_agent */)); | 869 "" /* custom_user_agent */)); |
870 } | 870 } |
871 | 871 |
872 GDataContactsService::~GDataContactsService() { | 872 GDataContactsService::~GDataContactsService() { |
873 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 873 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
874 sender_->CancelAll(); | |
875 STLDeleteContainerPointers(requests_.begin(), requests_.end()); | 874 STLDeleteContainerPointers(requests_.begin(), requests_.end()); |
876 requests_.clear(); | 875 requests_.clear(); |
877 } | 876 } |
878 | 877 |
879 google_apis::AuthService* GDataContactsService::auth_service_for_testing() { | 878 google_apis::AuthService* GDataContactsService::auth_service_for_testing() { |
880 return sender_->auth_service(); | 879 return sender_->auth_service(); |
881 } | 880 } |
882 | 881 |
883 void GDataContactsService::Initialize() { | 882 void GDataContactsService::Initialize() { |
884 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 883 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 20 matching lines...) Expand all Loading... |
905 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 904 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
906 DCHECK(request); | 905 DCHECK(request); |
907 VLOG(1) << "Download request " << request << " complete"; | 906 VLOG(1) << "Download request " << request << " complete"; |
908 if (!request->my_contacts_group_id().empty()) | 907 if (!request->my_contacts_group_id().empty()) |
909 cached_my_contacts_group_id_ = request->my_contacts_group_id(); | 908 cached_my_contacts_group_id_ = request->my_contacts_group_id(); |
910 requests_.erase(request); | 909 requests_.erase(request); |
911 delete request; | 910 delete request; |
912 } | 911 } |
913 | 912 |
914 } // namespace contacts | 913 } // namespace contacts |
OLD | NEW |