Index: components/dom_distiller/ios/web_state_pool.h |
diff --git a/components/dom_distiller/ios/web_state_pool.h b/components/dom_distiller/ios/web_state_pool.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..97a40c1ca889a4ed76df412f34d7bb9ffe8633e1 |
--- /dev/null |
+++ b/components/dom_distiller/ios/web_state_pool.h |
@@ -0,0 +1,36 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_DOM_DISTILLER_IOS_WEB_STATE_POOL_H_ |
+#define COMPONENTS_DOM_DISTILLER_IOS_WEB_STATE_POOL_H_ |
+ |
+namespace web { |
+class WebState; |
+} |
+ |
+namespace dom_distiller { |
+ |
+// Delegate for the WebStatePool. |
+class WebStatePoolDelegate { |
+ public: |
+ // Called by the pool when |web_state| can be used by the delegate. |
+ virtual void OnWebStateAvailable(web::WebState* web_state) = 0; |
+}; |
+ |
+// Pool for WebStates with Favicon Driver attached. The WebStates from this pool |
+// have time to finish the download of the favicons when then are returned, |
+// before being reused. |
+class WebStatePool { |
+ public: |
+ // Request a WebState asynchronously. The pool will call |delegate|'s |
+ // OnWebStateAvailable when a WebState is available. |
+ virtual void RequestWebState(WebStatePoolDelegate* delegate) = 0; |
+ // Called by the delegate to return a WebState to the pool. The WebState |
+ // should not be used after being returned. |
+ virtual void ReturnWebState(web::WebState* web_state) = 0; |
+}; |
+ |
+} // namespace dom_distiller |
+ |
+#endif // COMPONENTS_DOM_DISTILLER_IOS_WEB_STATE_POOL_H_ |