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

Side by Side Diff: ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.h

Issue 1861593005: Convert //ios from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_IMPL_IO_DATA_H_ 5 #ifndef IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_IMPL_IO_DATA_H_
6 #define IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_IMPL_IO_DATA_H_ 6 #define IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_IMPL_IO_DATA_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // Lazily initialize ProfileParams. We do this on the calls to 72 // Lazily initialize ProfileParams. We do this on the calls to
73 // Get*RequestContextGetter(), so we only initialize ProfileParams right 73 // Get*RequestContextGetter(), so we only initialize ProfileParams right
74 // before posting a task to the IO thread to start using them. This prevents 74 // before posting a task to the IO thread to start using them. This prevents
75 // objects that are supposed to be deleted on the IO thread, but are created 75 // objects that are supposed to be deleted on the IO thread, but are created
76 // on the UI thread from being unnecessarily initialized. 76 // on the UI thread from being unnecessarily initialized.
77 void LazyInitialize() const; 77 void LazyInitialize() const;
78 78
79 // Collect references to context getters in reverse order, i.e. last item 79 // Collect references to context getters in reverse order, i.e. last item
80 // will be main request getter. This list is passed to |io_data_| 80 // will be main request getter. This list is passed to |io_data_|
81 // for invalidation on IO thread. 81 // for invalidation on IO thread.
82 scoped_ptr<IOSChromeURLRequestContextGetterVector> GetAllContextGetters(); 82 std::unique_ptr<IOSChromeURLRequestContextGetterVector>
83 GetAllContextGetters();
83 84
84 // The getters will be invalidated on the IO thread before 85 // The getters will be invalidated on the IO thread before
85 // ChromeBrowserStateIOData instance is deleted. 86 // ChromeBrowserStateIOData instance is deleted.
86 mutable scoped_refptr<IOSChromeURLRequestContextGetter> 87 mutable scoped_refptr<IOSChromeURLRequestContextGetter>
87 main_request_context_getter_; 88 main_request_context_getter_;
88 mutable IOSChromeURLRequestContextGetterMap app_request_context_getter_map_; 89 mutable IOSChromeURLRequestContextGetterMap app_request_context_getter_map_;
89 ChromeBrowserStateImplIOData* const io_data_; 90 ChromeBrowserStateImplIOData* const io_data_;
90 91
91 ios::ChromeBrowserState* const browser_state_; 92 ios::ChromeBrowserState* const browser_state_;
92 93
(...skipping 13 matching lines...) Expand all
106 base::FilePath cookie_path; 107 base::FilePath cookie_path;
107 base::FilePath channel_id_path; 108 base::FilePath channel_id_path;
108 base::FilePath cache_path; 109 base::FilePath cache_path;
109 int cache_max_size; 110 int cache_max_size;
110 }; 111 };
111 112
112 ChromeBrowserStateImplIOData(); 113 ChromeBrowserStateImplIOData();
113 ~ChromeBrowserStateImplIOData() override; 114 ~ChromeBrowserStateImplIOData() override;
114 115
115 void InitializeInternal( 116 void InitializeInternal(
116 scoped_ptr<IOSChromeNetworkDelegate> chrome_network_delegate, 117 std::unique_ptr<IOSChromeNetworkDelegate> chrome_network_delegate,
117 ProfileParams* profile_params, 118 ProfileParams* profile_params,
118 ProtocolHandlerMap* protocol_handlers) const override; 119 ProtocolHandlerMap* protocol_handlers) const override;
119 AppRequestContext* InitializeAppRequestContext( 120 AppRequestContext* InitializeAppRequestContext(
120 net::URLRequestContext* main_context) const override; 121 net::URLRequestContext* main_context) const override;
121 AppRequestContext* AcquireIsolatedAppRequestContext( 122 AppRequestContext* AcquireIsolatedAppRequestContext(
122 net::URLRequestContext* main_context) const override; 123 net::URLRequestContext* main_context) const override;
123 124
124 // Deletes all network related data since |time|. It deletes transport 125 // Deletes all network related data since |time|. It deletes transport
125 // security state since |time| and also deletes HttpServerProperties data. 126 // security state since |time| and also deletes HttpServerProperties data.
126 // Works asynchronously, however if the |completion| callback is non-null, 127 // Works asynchronously, however if the |completion| callback is non-null,
127 // it will be posted on the UI thread once the removal process completes. 128 // it will be posted on the UI thread once the removal process completes.
128 void ClearNetworkingHistorySinceOnIOThread(base::Time time, 129 void ClearNetworkingHistorySinceOnIOThread(base::Time time,
129 const base::Closure& completion); 130 const base::Closure& completion);
130 131
131 mutable scoped_ptr<IOSChromeNetworkDelegate> network_delegate_; 132 mutable std::unique_ptr<IOSChromeNetworkDelegate> network_delegate_;
132 133
133 // Lazy initialization params. 134 // Lazy initialization params.
134 mutable scoped_ptr<LazyParams> lazy_params_; 135 mutable std::unique_ptr<LazyParams> lazy_params_;
135 136
136 mutable scoped_refptr<JsonPrefStore> network_json_store_; 137 mutable scoped_refptr<JsonPrefStore> network_json_store_;
137 138
138 mutable scoped_ptr<net::HttpNetworkSession> http_network_session_; 139 mutable std::unique_ptr<net::HttpNetworkSession> http_network_session_;
139 mutable scoped_ptr<net::HttpTransactionFactory> main_http_factory_; 140 mutable std::unique_ptr<net::HttpTransactionFactory> main_http_factory_;
140 141
141 // Same as |ChromeBrowserState::http_server_properties_|, owned there to 142 // Same as |ChromeBrowserState::http_server_properties_|, owned there to
142 // maintain destruction ordering. 143 // maintain destruction ordering.
143 mutable net::HttpServerPropertiesManager* http_server_properties_manager_; 144 mutable net::HttpServerPropertiesManager* http_server_properties_manager_;
144 145
145 mutable scoped_ptr<net::CookieStore> main_cookie_store_; 146 mutable std::unique_ptr<net::CookieStore> main_cookie_store_;
146 147
147 mutable scoped_ptr<net::URLRequestJobFactory> main_job_factory_; 148 mutable std::unique_ptr<net::URLRequestJobFactory> main_job_factory_;
148 149
149 mutable scoped_ptr<net::SdchManager> sdch_manager_; 150 mutable std::unique_ptr<net::SdchManager> sdch_manager_;
150 mutable scoped_ptr<net::SdchOwner> sdch_policy_; 151 mutable std::unique_ptr<net::SdchOwner> sdch_policy_;
151 152
152 // Parameters needed for isolated apps. 153 // Parameters needed for isolated apps.
153 base::FilePath profile_path_; 154 base::FilePath profile_path_;
154 int app_cache_max_size_; 155 int app_cache_max_size_;
155 156
156 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserStateImplIOData); 157 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserStateImplIOData);
157 }; 158 };
158 159
159 #endif // IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_IMPL_IO_DATA_H_ 160 #endif // IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_IMPL_IO_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698