Related to 20904. One solution to too many console messages is to have a cap on how many total messages we show and let it be changeable by the user. <rdar://problem/6229516>
Just to be clear, the cap is on how many messages we store as the primary goal here is to cap memory usage.
This affects chromium extensions significantly, because they are essentially web pages that run for the lifetime of the browser. I'm going to take a crack at a patch.
This might be more complexity than it's worth, but we could have both date and time caps (e.g. message more than 2 days old get dropped). I like the idea of saving as much memory as we can here. Of course, if we do either of these, the value needs to be configurable via a preference that is exposed in the inspector UI in some way.
Created attachment 45242 [details] [PATCH] Proposed fix
Comment on attachment 45242 [details] [PATCH] Proposed fix > + m_expiredConsoleMessageCount += 100; > + for (size_t i = 0; i < 100; ++i) > + delete m_consoleMessages[i]; > + m_consoleMessages.remove(0, 100); Should use a named constant for 100 instead of repeating it 3 times. In fact, I think it would be good to put that constant up at the top of the file along with maximumConsoleMessages. > +void InspectorFrontend::updateConsoleMessageExpiredCount(const int count) The const here should be left out. All it does is prevent the function from modifying its local copy of the argument internally. This is not something we should do in WebKit code. > + void updateConsoleMessageExpiredCount(const int count); Ditto. review- so you can fix these minor quibbles
Comment on attachment 45242 [details] [PATCH] Proposed fix Also seems the argument should be unsigned rather than int.
Created attachment 45243 [details] [PATCH] Review comments addressed
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/English.lproj/localizedStrings.js M WebCore/inspector/InspectorController.cpp M WebCore/inspector/InspectorController.h M WebCore/inspector/InspectorFrontend.cpp M WebCore/inspector/InspectorFrontend.h M WebCore/inspector/front-end/inspector.js Committed r52415