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

Issue 251012: Assert that thread-safe reference counting is used with... (Closed)

Created:
11 years, 2 months ago by darin (slow to review)
Modified:
9 years, 7 months ago
Reviewers:
brettw
CC:
chromium-reviews_googlegroups.com, ben+cc_chromium.org, Erik does not do reviews, jam, pam+watch_chromium.org, Paweł Hajdan Jr., darin (slow to review), brettw, tim (not reviewing)
Visibility:
Public.

Description

Assert that thread-safe reference counting is used with cross-thread NewRunnableMethod. This assertion caught such an error in VisitedLinkMaster! My approach, modify RunnableMethodTraits<T> to assert that when ReleaseCallee happens on a different thread from RetainCallee that the type supports thread-safe reference counting. I do this by adding a static method to both RefCounted<T> and RefCountedThreadSafe<T>. This results in a little ugliness in cases where people implement AddRef and Release by hand (to make the no-ops). There may be a nicer way to deal with those few cases. R=brettw BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=27379

Patch Set 1 #

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -124 lines) Patch
M base/message_pump_glib_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M base/ref_counted.h View 2 chunks +4 lines, -0 lines 0 comments Download
M base/task.h View 4 chunks +28 lines, -6 lines 0 comments Download
M chrome/browser/browser_process_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/browsing_data_remover.cc View 1 chunk +6 lines, -9 lines 0 comments Download
M chrome/browser/chrome_plugin_host.cc View 1 chunk +5 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/touchpad.cc View 1 chunk +5 lines, -8 lines 0 comments Download
M chrome/browser/dom_ui/chrome_url_data_manager.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/gears_integration.cc View 2 chunks +10 lines, -16 lines 0 comments Download
M chrome/browser/history/history_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/printing/print_job.h View 3 chunks +1 line, -10 lines 0 comments Download
M chrome/browser/printing/print_job_unittest.cc View 2 chunks +2 lines, -8 lines 0 comments Download
M chrome/browser/printing/print_job_worker.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/printing/print_job_worker.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/printing/print_job_worker_owner.h View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/printing/printer_query.h View 3 chunks +1 line, -9 lines 0 comments Download
M chrome/browser/renderer_host/render_crash_handler_host_linux.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/visitedlink_master.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/common/extensions/extension_error_reporter.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/in_process_browser_test.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/interactive_ui/view_event_test_base.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome_frame/chrome_frame_automation.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
M chrome_frame/chrome_frame_delegate.h View 1 1 chunk +2 lines, -5 lines 0 comments Download
M chrome_frame/test/chrome_frame_unittests.cc View 1 6 chunks +12 lines, -12 lines 0 comments Download
M ipc/ipc_logging.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ipc/ipc_sync_channel_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M net/proxy/proxy_config_service_linux_unittest.cc View 1 chunk +5 lines, -6 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
darin (slow to review)
11 years, 2 months ago (2009-09-26 20:16:54 UTC) #1
brettw
11 years, 2 months ago (2009-09-28 17:38:05 UTC) #2
I think this is a really good solution. LGTM

Powered by Google App Engine
This is Rietveld 408576698