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

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

Issue 556083002: Eliminate use of 'delete self' pattern in AttachmentUploaderImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@persistentuploads-retry
Patch Set: Merge with master. Created 6 years, 3 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 | « sync/internal_api/attachments/attachment_uploader_impl.cc ('k') | 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 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_UPLOADER_IMPL_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_
6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Return the URL for the given |sync_service_url| and |attachment_id|. 49 // Return the URL for the given |sync_service_url| and |attachment_id|.
50 static GURL GetURLForAttachmentId(const GURL& sync_service_url, 50 static GURL GetURLForAttachmentId(const GURL& sync_service_url,
51 const AttachmentId& attachment_id); 51 const AttachmentId& attachment_id);
52 52
53 private: 53 private:
54 class UploadState; 54 class UploadState;
55 typedef std::string UniqueId; 55 typedef std::string UniqueId;
56 typedef base::ScopedPtrHashMap<UniqueId, UploadState> StateMap; 56 typedef base::ScopedPtrHashMap<UniqueId, UploadState> StateMap;
57 57
58 void DeleteUploadStateFor(const UniqueId& unique_id); 58 void OnUploadStateStopped(const UniqueId& unique_id);
59 59
60 GURL sync_service_url_; 60 GURL sync_service_url_;
61 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; 61 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
62 std::string account_id_; 62 std::string account_id_;
63 OAuth2TokenService::ScopeSet scopes_; 63 OAuth2TokenService::ScopeSet scopes_;
64 scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider> 64 scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>
65 token_service_provider_; 65 token_service_provider_;
66 StateMap state_map_; 66 StateMap state_map_;
67
68 // Must be last data member.
69 base::WeakPtrFactory<AttachmentUploaderImpl> weak_ptr_factory_;
70
67 DISALLOW_COPY_AND_ASSIGN(AttachmentUploaderImpl); 71 DISALLOW_COPY_AND_ASSIGN(AttachmentUploaderImpl);
68 }; 72 };
69 73
70 } // namespace syncer 74 } // namespace syncer
71 75
72 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ 76 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_
OLDNEW
« no previous file with comments | « sync/internal_api/attachments/attachment_uploader_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698