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
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_PUBLIC_WEB_VIEW_COUNTER_H_
6 #define IOS_WEB_PUBLIC_WEB_VIEW_COUNTER_H_
10 #include "base/macros.h"
16 // Maintains the count of web views associated with a particular BrowserState.
17 // Must be used only from the UI thread.
18 class WebViewCounter
{
20 // Returns the web::WebViewCounter for the given |browser_state|. Lazily
21 // attaches one if it does not exist. |browser_state| cannot be null.
22 static web::WebViewCounter
* FromBrowserState(
23 web::BrowserState
* browser_state
);
25 // Returns the count of WKWebViews associated with a BrowserState.
26 virtual size_t GetWKWebViewCount() = 0;
30 virtual ~WebViewCounter() {}
33 DISALLOW_COPY_AND_ASSIGN(WebViewCounter
);
38 #endif // IOS_WEB_PUBLIC_WEB_VIEW_COUNTER_H_