Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Issue 5516004: Clean up PluginGroup and related code. (Closed)

Created:
10 years ago by Jakob Kummerow
Modified:
9 years, 6 months ago
CC:
chromium-reviews, ben+cc_chromium.org, Paweł Hajdan Jr., jam, darin-cc_chromium.org, brettw-cc_chromium.org, stuartmorgan+watch_chromium.org, pastarmovj, pam+watch_chromium.org
Visibility:
Public.

Description

Clean up PluginGroup and related code. To avoid data races, do not pass pointers to PluginGroup around. Instead, create copies as plain objects. BUG=61210 TEST=existing unit tests still work; TSan no longer reports the race (see bug) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=68471

Patch Set 1 #

Total comments: 34

Patch Set 2 : address comments; fix problems; port to ToT #

Total comments: 1

Patch Set 3 : fix compilation on Mac #

Total comments: 10

Patch Set 4 : address comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+393 lines, -307 lines) Patch
M chrome/browser/gtk/content_setting_bubble_gtk.cc View 1 2 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/mock_plugin_exceptions_table_model.h View 1 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/mock_plugin_exceptions_table_model.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/plugin_exceptions_table_model.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/plugin_exceptions_table_model.cc View 1 2 chunks +6 lines, -7 lines 0 comments Download
M chrome/browser/plugin_exceptions_table_model_unittest.cc View 1 1 chunk +7 lines, -5 lines 0 comments Download
M chrome/browser/plugin_updater.h View 1 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/plugin_updater.cc View 1 5 chunks +9 lines, -13 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.cc View 1 1 chunk +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/cocoa/content_setting_bubble_cocoa.mm View 1 2 1 chunk +3 lines, -6 lines 0 comments Download
M chrome/browser/ui/cocoa/table_model_array_controller_unittest.mm View 1 2 3 chunks +10 lines, -11 lines 0 comments Download
M chrome/browser/ui/views/content_setting_bubble_contents.cc View 1 1 chunk +3 lines, -6 lines 0 comments Download
M chrome/renderer/render_view.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/render_view.cc View 1 4 chunks +7 lines, -6 lines 0 comments Download
M webkit/glue/plugins/plugin_group.h View 1 2 3 7 chunks +29 lines, -35 lines 0 comments Download
M webkit/glue/plugins/plugin_group.cc View 1 2 3 5 chunks +64 lines, -116 lines 2 comments Download
M webkit/glue/plugins/plugin_group_unittest.cc View 1 2 3 9 chunks +26 lines, -13 lines 0 comments Download
M webkit/glue/plugins/plugin_list.h View 1 2 3 6 chunks +42 lines, -14 lines 0 comments Download
M webkit/glue/plugins/plugin_list.cc View 1 2 3 7 chunks +160 lines, -53 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Jakob Kummerow
Please review. Also, please (compile and) run this on Win and/or Mac for a manual ...
10 years ago (2010-12-03 13:48:05 UTC) #1
Bernhard Bauer
There's still some stuff to be done (see the trybot logs for the compile errors ...
10 years ago (2010-12-03 16:13:28 UTC) #2
Jakob Kummerow
Addressed your comments and (hopefully) fixed the problems reported by the trybots. Please review again. ...
10 years ago (2010-12-06 18:21:12 UTC) #3
Bernhard Bauer
http://codereview.chromium.org/5516004/diff/20001/webkit/glue/plugins/plugin_group.h File webkit/glue/plugins/plugin_group.h (right): http://codereview.chromium.org/5516004/diff/20001/webkit/glue/plugins/plugin_group.h#newcode120 webkit/glue/plugins/plugin_group.h:120: FRIEND_TEST_ALL_PREFIXES(PluginGroupTest, PluginGroupDefinition); I think this is unnecessary now. http://codereview.chromium.org/5516004/diff/33001/webkit/glue/plugins/plugin_group.h#newcode125 ...
10 years ago (2010-12-07 10:32:05 UTC) #4
Jakob Kummerow
http://codereview.chromium.org/5516004/diff/33001/webkit/glue/plugins/plugin_group.h File webkit/glue/plugins/plugin_group.h (right): http://codereview.chromium.org/5516004/diff/33001/webkit/glue/plugins/plugin_group.h#newcode125 webkit/glue/plugins/plugin_group.h:125: static size_t GetPluginGroupDefinitionsSize(); On 2010/12/07 10:32:05, Bernhard Bauer wrote: ...
10 years ago (2010-12-07 11:43:08 UTC) #5
Bernhard Bauer
LGTM with a nit I forgot earlier. http://codereview.chromium.org/5516004/diff/38001/webkit/glue/plugins/plugin_group.cc File webkit/glue/plugins/plugin_group.cc (right): http://codereview.chromium.org/5516004/diff/38001/webkit/glue/plugins/plugin_group.cc#newcode103 webkit/glue/plugins/plugin_group.cc:103: DCHECK(other.web_plugin_infos_.size() == ...
10 years ago (2010-12-07 12:09:50 UTC) #6
Jakob Kummerow
http://codereview.chromium.org/5516004/diff/38001/webkit/glue/plugins/plugin_group.cc File webkit/glue/plugins/plugin_group.cc (right): http://codereview.chromium.org/5516004/diff/38001/webkit/glue/plugins/plugin_group.cc#newcode103 webkit/glue/plugins/plugin_group.cc:103: DCHECK(other.web_plugin_infos_.size() == other.web_plugin_positions_.size()); On 2010/12/07 12:09:51, Bernhard Bauer wrote: ...
10 years ago (2010-12-07 17:08:56 UTC) #7
Timur Iskhodzhanov
This CL has made almost all the memory waterfall red. Please revert if possible or/and ...
10 years ago (2010-12-07 19:28:50 UTC) #8
Jakob Kummerow
On 2010/12/07 19:28:50, Timur Iskhodzhanov wrote: > This CL has made almost all the memory ...
10 years ago (2010-12-07 20:18:28 UTC) #9
Hironori Bono
On 2010/12/07 20:18:28, jkummerow wrote: > Damn. Sorry about that. PluginList is a singleton that ...
10 years ago (2010-12-08 04:18:21 UTC) #10
willchan no longer on Chromium
10 years ago (2010-12-11 05:04:36 UTC) #11
On Tue, Dec 7, 2010 at 8:18 PM, <hbono@chromium.org> wrote:

> On 2010/12/07 20:18:28, jkummerow wrote:
>
>> Damn. Sorry about that. PluginList is a singleton that doesn't
>> clean up after itself. We knew this, and didn't care since it
>> doesn't hurt in the real world, but we didn't consider that it'd
>> make the valgrind bots cry :-(
>>
>
> This is just for your information.
> Our LazyInstance<T> class adds the destructor of the class T to
> AtExitManager,
> i.e. we call the destructor 'T::~T()' when Chrome exits. So, it would be
> definitely helpful to add code that cleans up the resources used by a
> singleton
> in its destructor, as listed in the change of leiz
> <http://codereview.chromium.org/5574005>.
>

That shutdown code looks slightly weird.  It only runs if we're running in
Valgrind.  This is wrong.

We should say that we either care or don't care about leaking the object.
 If we don't care, use LeakySingletonTraits or LeakyLazyInstanceTraits.  If
we do care, then make sure the destructor cleans up.

Why would one care?  Well, ChromeFrame loads some Chrome code into IE's
address space.  If you don't delete the global, then when ChromeFrame
unloads, it will be leaking in IE's address space.  That'd be lame of us.

So, the moral of the story is that using RUNNING_IN_VALGRIND makes no sense.
 You either care or you don't care.  If you don't care, then you should use
Leaky*Traits, which shouldn't cause valgrind leaks (although I've seen it
happen before for LazyInstance, in which case you should just add a
suppression until that issue is fixed).


> Regards,
>
> Hironori Bono
>
>
> http://codereview.chromium.org/5516004/
>

Powered by Google App Engine
This is Rietveld 408576698