OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_DOM_DISTILLER_IOS_WEB_STATE_POOL_H_ |
| 6 #define COMPONENTS_DOM_DISTILLER_IOS_WEB_STATE_POOL_H_ |
| 7 |
| 8 namespace web { |
| 9 class WebState; |
| 10 } |
| 11 |
| 12 namespace dom_distiller { |
| 13 |
| 14 // Delegate for the WebStatePool. |
| 15 class WebStatePoolDelegate { |
| 16 public: |
| 17 // Called by the pool when |web_state| can be used by the delegate. |
| 18 virtual void OnWebStateAvailable(web::WebState* web_state) = 0; |
| 19 }; |
| 20 |
| 21 // Pool for WebStates with Favicon Driver attached. The WebStates from this pool |
| 22 // have time to finish the download of the favicons when then are returned, |
| 23 // before being reused. |
| 24 class WebStatePool { |
| 25 public: |
| 26 // Request a WebState asynchronously. The pool will call |delegate|'s |
| 27 // OnWebStateAvailable when a WebState is available. |
| 28 virtual void RequestWebState(WebStatePoolDelegate* delegate) = 0; |
| 29 // Called by the delegate to return a WebState to the pool. The WebState |
| 30 // should not be used after being returned. |
| 31 virtual void ReturnWebState(web::WebState* web_state) = 0; |
| 32 }; |
| 33 |
| 34 } // namespace dom_distiller |
| 35 |
| 36 #endif // COMPONENTS_DOM_DISTILLER_IOS_WEB_STATE_POOL_H_ |
OLD | NEW |