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

Issue 5682008: Make members of Singleton<T> private and only visible to the singleton type. (Closed)

Created:
10 years ago by Satish
Modified:
9 years, 7 months ago
CC:
chromium-reviews, pam+watch_chromium.org, michaeln, cbentzel+watch_chromium.org, Alpha Left Google, Sergey Ulanov, Erik does not do reviews, jam, Aaron Boodman, dmac, darin-cc_chromium.org, awong, garykac, brettw-cc_chromium.org, stuartmorgan+watch_chromium.org, jshin+watch_chromium.org, vrk (LEFT CHROMIUM), amit, annacc, fbarchard, nkostylev+cc_chromium.org, ddorwin+watch_chromium.org, scherkus (not reviewing), sjl, acolwell GONE FROM CHROMIUM, davemoore+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Make members of Singleton<T> private and only visible to the singleton type. This enforces that the Singleton<T> pattern can only be used within classes which want singleton-ness. As part of this CL I have also fixed up files which got missed in my previous CLs to use a GetInstance() method and use Singleton<T> from the source file. There are a small number of places where I have also switched to LazyInstance as that was more appropriate for types used in a single source file. BUG=65298 TEST=all existing tests should continue to pass. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=69107

Patch Set 1 #

Patch Set 2 : . #

Total comments: 26

Patch Set 3 : . #

Total comments: 2

Patch Set 4 : . #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+516 lines, -383 lines) Patch
M base/i18n/number_formatting.cc View 1 2 2 chunks +14 lines, -12 lines 1 comment Download
M base/lazy_instance.h View 1 2 3 2 chunks +13 lines, -1 line 1 comment Download
M base/path_service.cc View 2 chunks +4 lines, -2 lines 1 comment Download
M base/singleton.h View 1 2 3 5 chunks +34 lines, -33 lines 0 comments Download
M base/singleton_unittest.cc View 1 2 3 6 chunks +99 lines, -87 lines 0 comments Download
M base/worker_pool_mac.mm View 1 2 3 chunks +15 lines, -2 lines 1 comment Download
M chrome/browser/chromeos/browser_main_chromeos.cc View 1 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/login/screen_locker.cc View 1 2 3 3 chunks +5 lines, -2 lines 1 comment Download
M chrome/browser/chromeos/login/signed_settings_helper.cc View 1 2 3 3 chunks +6 lines, -3 lines 1 comment Download
M chrome/browser/chromeos/offline/offline_load_service.cc View 1 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/gtk/browser_toolbar_gtk.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page.h View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page.cc View 2 chunks +4 lines, -1 line 0 comments Download
M chrome/common/sqlite_utils.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/common/time_format.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M chrome/plugin/webplugin_proxy.cc View 4 chunks +5 lines, -7 lines 0 comments Download
M chrome/renderer/extensions/bindings_utils.cc View 4 chunks +7 lines, -3 lines 0 comments Download
M chrome/renderer/extensions/renderer_extension_bindings.cc View 2 chunks +8 lines, -5 lines 0 comments Download
M chrome/renderer/ggl/ggl.cc View 3 chunks +6 lines, -2 lines 0 comments Download
M chrome/renderer/render_view.cc View 7 chunks +7 lines, -6 lines 0 comments Download
M chrome_frame/chrome_frame_automation.cc View 1 2 3 3 chunks +5 lines, -3 lines 0 comments Download
M chrome_frame/external_tab.cc View 1 3 chunks +4 lines, -3 lines 0 comments Download
M gfx/window_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/tools/player_wtl/mainfrm.h View 1 6 chunks +31 lines, -30 lines 0 comments Download
M media/tools/player_wtl/movie.h View 1 1 chunk +5 lines, -2 lines 0 comments Download
M media/tools/player_wtl/movie.cc View 1 2 chunks +5 lines, -0 lines 0 comments Download
M media/tools/player_wtl/player_wtl.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M media/tools/player_wtl/props.h View 1 1 chunk +1 line, -1 line 0 comments Download
M media/tools/player_wtl/seek.h View 1 2 chunks +4 lines, -4 lines 0 comments Download
M media/tools/player_wtl/view.h View 1 2 chunks +3 lines, -2 lines 0 comments Download
M net/base/bandwidth_metrics.h View 1 2 1 chunk +4 lines, -18 lines 0 comments Download
M net/base/bandwidth_metrics.cc View 1 2 1 chunk +24 lines, -3 lines 0 comments Download
M net/base/cert_database_nss_unittest.cc View 1 2 3 chunks +4 lines, -15 lines 0 comments Download
M net/base/mime_util.cc View 4 chunks +19 lines, -20 lines 0 comments Download
M net/base/winsock_init.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M net/base/x509_certificate_win.cc View 3 chunks +6 lines, -3 lines 0 comments Download
M net/disk_cache/file_win.cc View 1 2 3 5 chunks +7 lines, -4 lines 0 comments Download
M net/socket/client_socket_factory.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M net/socket/dns_cert_provenance_checker.cc View 4 chunks +7 lines, -4 lines 0 comments Download
M net/socket/ssl_client_socket_mac.cc View 4 chunks +6 lines, -3 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 3 chunks +5 lines, -2 lines 0 comments Download
M net/socket/ssl_client_socket_win.cc View 5 chunks +11 lines, -5 lines 0 comments Download
M net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp View 1 2 chunks +5 lines, -2 lines 0 comments Download
M net/tools/fetch/fetch_client.cc View 5 chunks +5 lines, -4 lines 0 comments Download
M net/websockets/websocket_job.cc View 2 chunks +6 lines, -3 lines 0 comments Download
M printing/backend/print_backend_cups.cc View 1 3 chunks +5 lines, -2 lines 0 comments Download
M printing/printed_document.cc View 4 chunks +8 lines, -7 lines 0 comments Download
M remoting/base/tracer.cc View 5 chunks +10 lines, -4 lines 0 comments Download
M skia/ext/vector_platform_device_linux.cc View 5 chunks +7 lines, -4 lines 0 comments Download
M views/focus/focus_manager.h View 1 chunk +3 lines, -0 lines 0 comments Download
M views/focus/focus_manager.cc View 1 2 3 2 chunks +7 lines, -1 line 0 comments Download
M webkit/appcache/web_application_cache_host_impl.cc View 5 chunks +5 lines, -8 lines 0 comments Download
M webkit/blob/deletable_file_reference.cc View 3 chunks +9 lines, -11 lines 0 comments Download
M webkit/glue/plugins/pepper_graphics_3d.cc View 4 chunks +6 lines, -8 lines 0 comments Download
M webkit/glue/plugins/pepper_resource_tracker.h View 1 2 3 2 chunks +5 lines, -2 lines 0 comments Download
M webkit/glue/plugins/pepper_resource_tracker.cc View 1 2 3 2 chunks +5 lines, -1 line 0 comments Download
M webkit/glue/webkit_glue.cc View 1 3 chunks +14 lines, -13 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Satish
10 years ago (2010-12-10 14:35:17 UTC) #1
M-A Ruel
http://codereview.chromium.org/5682008/diff/2001/base/i18n/number_formatting.cc File base/i18n/number_formatting.cc (right): http://codereview.chromium.org/5682008/diff/2001/base/i18n/number_formatting.cc#newcode24 base/i18n/number_formatting.cc:24: // This can cause problems if a different allocator ...
10 years ago (2010-12-10 14:52:18 UTC) #2
Satish
Thanks for the quick review. http://codereview.chromium.org/5682008/diff/2001/base/singleton.h File base/singleton.h (right): http://codereview.chromium.org/5682008/diff/2001/base/singleton.h#newcode199 base/singleton.h:199: friend typename FriendMaker<Type>::FriendType; On ...
10 years ago (2010-12-10 15:04:57 UTC) #3
M-A Ruel
http://codereview.chromium.org/5682008/diff/2001/base/singleton.h File base/singleton.h (right): http://codereview.chromium.org/5682008/diff/2001/base/singleton.h#newcode199 base/singleton.h:199: friend typename FriendMaker<Type>::FriendType; On 2010/12/10 15:04:57, Satish wrote: > ...
10 years ago (2010-12-10 15:09:42 UTC) #4
Satish
http://codereview.chromium.org/5682008/diff/2001/base/singleton.h File base/singleton.h (right): http://codereview.chromium.org/5682008/diff/2001/base/singleton.h#newcode199 base/singleton.h:199: friend typename FriendMaker<Type>::FriendType; On 2010/12/10 15:09:42, Marc-Antoine Ruel wrote: ...
10 years ago (2010-12-10 16:10:11 UTC) #5
M-A Ruel
http://codereview.chromium.org/5682008/diff/2001/net/base/cert_database_nss_unittest.cc File net/base/cert_database_nss_unittest.cc (right): http://codereview.chromium.org/5682008/diff/2001/net/base/cert_database_nss_unittest.cc#newcode136 net/base/cert_database_nss_unittest.cc:136: scoped_ptr<ScopedTempDir> CertDatabaseNSSTest::temp_db_dir_; On 2010/12/10 16:10:11, Satish wrote: > I ...
10 years ago (2010-12-10 16:18:36 UTC) #6
Satish
New patch uploaded addressing all comments so far. http://codereview.chromium.org/5682008/diff/2001/base/i18n/number_formatting.cc File base/i18n/number_formatting.cc (right): http://codereview.chromium.org/5682008/diff/2001/base/i18n/number_formatting.cc#newcode24 base/i18n/number_formatting.cc:24: // ...
10 years ago (2010-12-10 17:13:47 UTC) #7
M-A Ruel
lgtm
10 years ago (2010-12-10 17:20:20 UTC) #8
rvargas (doing something else)
drive by. http://codereview.chromium.org/5682008/diff/16001/net/disk_cache/file_win.cc File net/disk_cache/file_win.cc (right): http://codereview.chromium.org/5682008/diff/16001/net/disk_cache/file_win.cc#newcode9 net/disk_cache/file_win.cc:9: #include "base/lazy_instance.h" nit: order of includes. http://codereview.chromium.org/5682008/diff/16001/net/disk_cache/file_win.cc#newcode36 ...
10 years ago (2010-12-10 20:55:54 UTC) #9
Satish
The Clang compiler did not like the code Patch 3, singleton.h. So I had to ...
10 years ago (2010-12-13 17:24:16 UTC) #10
M-A Ruel
On 2010/12/13 17:24:16, Satish wrote: > The Clang compiler did not like the code Patch ...
10 years ago (2010-12-13 17:30:50 UTC) #11
M-A Ruel
[Focus failure when pressing enter] I added Evan and Nico in case they want to ...
10 years ago (2010-12-13 17:32:56 UTC) #12
Satish
On 2010/12/13 17:32:56, Marc-Antoine Ruel wrote: > [Focus failure when pressing enter] > > I ...
10 years ago (2010-12-13 17:34:40 UTC) #13
M-A Ruel
On 2010/12/13 17:34:40, Satish wrote: > On 2010/12/13 17:32:56, Marc-Antoine Ruel wrote: > > [Focus ...
10 years ago (2010-12-13 17:35:24 UTC) #14
Evan Martin
I don't think it matters much, but Chrome style is to put file-local variables in ...
10 years ago (2010-12-13 17:38:30 UTC) #15
Nico
10 years ago (2010-12-13 17:38:46 UTC) #16
On Mon, Dec 13, 2010 at 9:34 AM,  <satish@chromium.org> wrote:
> On 2010/12/13 17:32:56, Marc-Antoine Ruel wrote:
>>
>> [Focus failure when pressing enter]
>
>> I added Evan and Nico in case they want to send a bug upstream about the
>> issue
>> Satish faced with the template friend stuff.
>
> Nico knows, he was the one who pointed out the build failure. I also came
> across
> http://stackoverflow.com/questions/702650/making-a-template-parameter-a-friend
> which says the earlier code I used was in fact invalid c++ :) So all seems
> well now.

For posterity, that discussion happened at
http://groups.google.com/a/chromium.org/group/clang/browse_thread/thread/e88c...

>
> http://codereview.chromium.org/5682008/
>

Powered by Google App Engine
This is Rietveld 408576698