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

Side by Side Diff: sync/internal_api/public/attachments/attachment_downloader_impl.h

Issue 642023004: Standardize usage of virtual/override/final in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_
6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_
7 7
8 #include "base/containers/scoped_ptr_hash_map.h" 8 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "base/threading/non_thread_safe.h" 9 #include "base/threading/non_thread_safe.h"
10 #include "google_apis/gaia/oauth2_token_service_request.h" 10 #include "google_apis/gaia/oauth2_token_service_request.h"
(...skipping 24 matching lines...) Expand all
35 // 35 //
36 // |token_service_provider| provides an OAuth2 token service. 36 // |token_service_provider| provides an OAuth2 token service.
37 AttachmentDownloaderImpl( 37 AttachmentDownloaderImpl(
38 const GURL& sync_service_url, 38 const GURL& sync_service_url,
39 const scoped_refptr<net::URLRequestContextGetter>& 39 const scoped_refptr<net::URLRequestContextGetter>&
40 url_request_context_getter, 40 url_request_context_getter,
41 const std::string& account_id, 41 const std::string& account_id,
42 const OAuth2TokenService::ScopeSet& scopes, 42 const OAuth2TokenService::ScopeSet& scopes,
43 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& 43 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>&
44 token_service_provider); 44 token_service_provider);
45 virtual ~AttachmentDownloaderImpl(); 45 ~AttachmentDownloaderImpl() override;
46 46
47 // AttachmentDownloader implementation. 47 // AttachmentDownloader implementation.
48 virtual void DownloadAttachment(const AttachmentId& attachment_id, 48 void DownloadAttachment(const AttachmentId& attachment_id,
49 const DownloadCallback& callback) override; 49 const DownloadCallback& callback) override;
50 50
51 // OAuth2TokenService::Consumer implementation. 51 // OAuth2TokenService::Consumer implementation.
52 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, 52 void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
53 const std::string& access_token, 53 const std::string& access_token,
54 const base::Time& expiration_time) override; 54 const base::Time& expiration_time) override;
55 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, 55 void OnGetTokenFailure(const OAuth2TokenService::Request* request,
56 const GoogleServiceAuthError& error) override; 56 const GoogleServiceAuthError& error) override;
57 57
58 // net::URLFetcherDelegate implementation. 58 // net::URLFetcherDelegate implementation.
59 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; 59 void OnURLFetchComplete(const net::URLFetcher* source) override;
60 60
61 private: 61 private:
62 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_First); 62 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_First);
63 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_None); 63 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_None);
64 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_Empty); 64 FRIEND_TEST_ALL_PREFIXES(AttachmentDownloaderImplTest, ExtractCrc32c_Empty);
65 65
66 struct DownloadState; 66 struct DownloadState;
67 typedef std::string AttachmentUrl; 67 typedef std::string AttachmentUrl;
68 typedef base::ScopedPtrHashMap<AttachmentUrl, DownloadState> StateMap; 68 typedef base::ScopedPtrHashMap<AttachmentUrl, DownloadState> StateMap;
69 typedef std::vector<DownloadState*> StateList; 69 typedef std::vector<DownloadState*> StateList;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // objects while access token request is pending. It doesn't control objects' 106 // objects while access token request is pending. It doesn't control objects'
107 // lifetime. 107 // lifetime.
108 StateList requests_waiting_for_access_token_; 108 StateList requests_waiting_for_access_token_;
109 109
110 DISALLOW_COPY_AND_ASSIGN(AttachmentDownloaderImpl); 110 DISALLOW_COPY_AND_ASSIGN(AttachmentDownloaderImpl);
111 }; 111 };
112 112
113 } // namespace syncer 113 } // namespace syncer
114 114
115 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_ 115 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_IMPL_H_
OLDNEW
« no previous file with comments | « sync/internal_api/js_sync_manager_observer.h ('k') | sync/internal_api/public/attachments/attachment_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698