creating a tabbed browser using webkit

201 views
Skip to first unread message

bigfatwhale

unread,
Aug 6, 2012, 9:27:53 AM8/6/12
to chromium...@chromium.org
Hi, 

I'm trying to created a browser like app with tabs that render html using webkit. One of the design considerations is to minimize memory usage since the user will be browsing html pages with potentially more than 50 tabs open at a time. Given this i'm thinking of the possibility of using just one WebView control for rendering and just switching the url whenever the user changes to a different tab page.

So I will like to know whether chrome internally uses only 1 instance of the webkit widget to render its tabs, changing the url as the user change tabs, or is the only way to have each of the tab use it's own instance of the webkit widget?

If it's possible to use one instance of the webkit to service one tab, how do I save view state of the user and restore it everytime he comes back to a particular tab? For example I scrolled to halfway of the first page and then decide to switch to tab page 2. Then when i decide to come back to page 1, how do i restore the previous state of being half way thru the html page in page 1?

Can someone kindly point me to the relevant code so i can try and figure how the tabs actually work?

Thanks!

Evans Turner

unread,
Aug 7, 2012, 2:30:24 PM8/7/12
to chromium...@chromium.org
Since Chrome can save / restore tabs, I'm sure it's possible to programmatically save-and-unload tabs that aren't in-use and store their states in storage cache. This way, only the current tab occupies memory (well, the previous tab might take a little while to save when it loses focus). Depending on the storage type, file system, etc...restoring from a saved tab could be slower than re-loading a page in some cases.

-Evans

bigfatwhale

unread,
Aug 8, 2012, 3:50:24 AM8/8/12
to chromium...@chromium.org

I tried loading each of my internal urls into chrome and it's using significantly less mem than if i were to load them in my app ( coded in wxpython ) that has tabs each with their own webkit widget ( integrated using webkit COM )

We would like to cut down on the significant memory use.

In chrome code, is it using a different WebView instance for each of it's tabs?
Reply all
Reply to author
Forward
0 new messages