New issue
Advanced search Search tips

Issue 800760 link

Starred by 3 users

Issue metadata

Status: Available
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on: View detail
issue 800808
issue 801563
issue 802391



Sign in to add a comment

Reduce usage of LazyInstance

Project Member Reported by gab@chromium.org, Jan 10 2018

Issue description

Usage of LazyInstance to avoid static initializers can be replaced with constexpr initialization for trivially constructible types :)

On top of being cleaner, this mitigates issues like  crbug.com/797129  :)
 

Comment 1 by gab@chromium.org, Jan 10 2018

I'm doing a sweep over the types in base:: as those are typically under the most contention.

Comment 2 by gab@chromium.org, Jan 10 2018

Did a survey of base:: types (and their usage in LazyInstances) :

Can be made constexpr easily (https://chromium-review.googlesource.com/c/chromium/src/+/860157):
  android::ScopedJavaGlobalRef
  circular_deque
  PlatformThreadHandle
  PlatformThreadRef
  scoped_nsobject
  scoped_refptr
  subtle::SpinLock
  TestDiscardableMemoryAllocator
  Time
  TimeTicks (already is but still has LazyInstances around)
  VectorBuffer

Should work but getting weird Clang errors about inline constructor which isn't inline?
  (Once|Repeating)?(Callback|Closure)
  PartitionAllocatorGeneric
  SizeSpecificPartitionAllocator

With some work:
  ThreadLocalStorage::Slot
  ThreadLocalBoolean
  ThreadLocalPointer

  SequenceChecker (tricky -- need to avoid use of Lock)
  AtomicFlag (depends on SequenceChecker)
  WeakPtr (depends on SequenceChecker)
  ObserverList (depends on WeakPtr)
  ThreadChecker

Don't think so:
  android::ApplicationStatusListener
  internal::LazySysInfoValue
  Lock

Depends on std:
  FilePath (std::string)
  hash_map (std::unordered_map)
  hash_set (std::unordered_set)
  IDMap
  queue
  stack
  string16
  Thread (std::string)

Comment 3 by gab@chromium.org, Jan 10 2018

Blockedon: 800808
Need to be careful with no adding more static uninitializers by replacing LazyInstance::Leaky's with constexpr variables.

I'm planning to go with step #1 of proposal @ crbug.com/800808 to mitigate that : always terminate process at end of main :).
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d74c23a26e423c3fb70b6216f5dcd2acb85f9157

commit d74c23a26e423c3fb70b6216f5dcd2acb85f9157
Author: Gabriel Charette <gab@chromium.org>
Date: Thu Jan 11 23:20:38 2018

Make many base:: classes constexpr default constructible

Bug: 800760
Change-Id: Ib713771347283825ff53a8517b38a8abccd9d1bb
Reviewed-on: https://chromium-review.googlesource.com/860157
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528805}
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/allocator/partition_allocator/spin_lock.cc
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/allocator/partition_allocator/spin_lock.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/android/scoped_java_ref.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/containers/circular_deque.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/containers/vector_buffer.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/mac/scoped_dispatch_object.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/mac/scoped_nsobject.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/mac/scoped_typeref.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/memory/ref_counted.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/memory/scoped_refptr.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/test/test_discardable_memory_allocator.cc
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/test/test_discardable_memory_allocator.h
[modify] https://crrev.com/d74c23a26e423c3fb70b6216f5dcd2acb85f9157/base/threading/platform_thread.h

Project Member

Comment 5 by bugdroid1@chromium.org, Jan 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02

commit 5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02
Author: Nate Chapin <japhet@chromium.org>
Date: Fri Jan 12 00:36:58 2018

Revert "Make many base:: classes constexpr default constructible"

This reverts commit d74c23a26e423c3fb70b6216f5dcd2acb85f9157.

Reason for revert: Suspected cause of ios-simulator-xcode-clang compile
break: https://ci.chromium.org/buildbot/chromium.mac/ios-simulator-xcode-clang/40592

Original change's description:
> Make many base:: classes constexpr default constructible
> 
> Bug: 800760
> Change-Id: Ib713771347283825ff53a8517b38a8abccd9d1bb
> Reviewed-on: https://chromium-review.googlesource.com/860157
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#528805}

TBR=dcheng@chromium.org,gab@chromium.org

Change-Id: I762e202b958b70da6a2f332741fcf563b2705f6c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 800760
Reviewed-on: https://chromium-review.googlesource.com/862110
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528831}
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/allocator/partition_allocator/spin_lock.cc
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/allocator/partition_allocator/spin_lock.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/android/scoped_java_ref.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/containers/circular_deque.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/containers/vector_buffer.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/mac/scoped_dispatch_object.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/mac/scoped_nsobject.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/mac/scoped_typeref.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/memory/ref_counted.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/memory/scoped_refptr.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/test/test_discardable_memory_allocator.cc
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/test/test_discardable_memory_allocator.h
[modify] https://crrev.com/5bd4ea8c88ca46dc3669e39298cb388aa4dd9f02/base/threading/platform_thread.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jan 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ea041086367e1221895300997b2d0b38dba240f4

commit ea041086367e1221895300997b2d0b38dba240f4
Author: Gabriel Charette <gab@chromium.org>
Date: Fri Jan 12 09:22:25 2018

constexpr base::Time constructor

Caught a bunch of unused base::Time variables.

Bug: 800760
Change-Id: I1e1d170d844e6ff1c689c1903c22945ab3fe8341
Reviewed-on: https://chromium-review.googlesource.com/861642
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Reviewed-by: calamity <calamity@chromium.org>
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528911}
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/base/time/time.h
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/chrome/browser/engagement/site_engagement_service_unittest.cc
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/chrome/browser/sessions/session_service_test_helper.cc
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/components/history/core/browser/browsing_history_service.cc
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/components/history/core/browser/expire_history_backend_unittest.cc
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/components/omnibox/browser/search_provider.cc
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/net/cookies/cookie_monster_unittest.cc
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/net/disk_cache/simple/simple_synchronous_entry.cc
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/net/http/http_server_properties_manager.cc
[modify] https://crrev.com/ea041086367e1221895300997b2d0b38dba240f4/storage/browser/quota/quota_database_unittest.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Jan 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2e4eab147b94a947ed4650234637b85802000b2b

commit 2e4eab147b94a947ed4650234637b85802000b2b
Author: Gabriel Charette <gab@chromium.org>
Date: Fri Jan 12 13:40:21 2018

Reland "Make many base:: classes constexpr default constructible"

This is a reland of d74c23a26e423c3fb70b6216f5dcd2acb85f9157
Original change's description:
> Make many base:: classes constexpr default constructible

Same CL but extracted scoped_refptr changes to separate CL.

>
> Bug: 800760
> Change-Id: Ib713771347283825ff53a8517b38a8abccd9d1bb
> Reviewed-on: https://chromium-review.googlesource.com/860157
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#528805}

Bug: 800760
Change-Id: Ia989d978f632075c21f11cd81687f52b9e2bd2ca

TBR=dcheng@chromium.org

Change-Id: Ia989d978f632075c21f11cd81687f52b9e2bd2ca
Reviewed-on: https://chromium-review.googlesource.com/863622
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528934}
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/allocator/partition_allocator/spin_lock.cc
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/allocator/partition_allocator/spin_lock.h
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/android/scoped_java_ref.h
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/containers/circular_deque.h
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/containers/vector_buffer.h
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/mac/scoped_dispatch_object.h
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/mac/scoped_nsobject.h
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/mac/scoped_typeref.h
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/memory/ref_counted.h
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/test/test_discardable_memory_allocator.cc
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/test/test_discardable_memory_allocator.h
[modify] https://crrev.com/2e4eab147b94a947ed4650234637b85802000b2b/base/threading/platform_thread.h

Comment 8 by gab@chromium.org, Jan 12 2018

Blockedon: 801563
Project Member

Comment 9 by bugdroid1@chromium.org, Jan 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e73967a0699e1e8af0554735822abb2985c52a73

commit e73967a0699e1e8af0554735822abb2985c52a73
Author: Gabriel Charette <gab@chromium.org>
Date: Mon Jan 15 15:24:27 2018

Make scoped_refptr constexpr default constructible.

Just like std::unique_ptr and std::shared_ptr.

Remove support for opaque types in scoped_refptr. These weren't used
anywhere and already strongly discouraged.
"constexpr" implies "inline" and as such template instantiation being
out-of-line in a single translation unit makes it invisible to other
translation units which expect to have its full definition (per
"inline"), generating errors like the following:
FAILED: obj/base/x64/base_unittests
Undefined symbols for architecture x86_64:
  "scoped_refptr<base::OpaqueRefCounted>::scoped_refptr()", referenced from:
      RefCountedUnitTest_ScopedRefPtrToOpaque_Test::TestBody() in ref_counted_unittest.o
  "scoped_refptr<base::OpaqueRefCountedThreadSafe>::scoped_refptr()", referenced from:
      RefCountedUnitTest_ScopedRefPtrToOpaqueThreadSafe_Test::TestBody() in ref_counted_unittest.o
ld: symbol(s) not found for architecture x86_64

Not supporting opaque types is a fallout of scoped_refptr needing to know
the type is a subclass of RefCounted(ThreadSafe). Workarounds have already
been attempted and failed.

Prior discussion and conclusion to discourage their usage :
https://groups.google.com/a/chromium.org/d/topic/chromium-dev/0khIRhxDq6E/discussion

Bug: 800760
Change-Id: I1a413cad642e1703f4722dc597a91436f6c0c711
Reviewed-on: https://chromium-review.googlesource.com/863671
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529283}
[modify] https://crrev.com/e73967a0699e1e8af0554735822abb2985c52a73/base/memory/ref_counted_unittest.cc
[modify] https://crrev.com/e73967a0699e1e8af0554735822abb2985c52a73/base/memory/scoped_refptr.h
[modify] https://crrev.com/e73967a0699e1e8af0554735822abb2985c52a73/base/test/BUILD.gn
[delete] https://crrev.com/5bc544493e96018f011162c09186d317a558674f/base/test/opaque_ref_counted.cc
[delete] https://crrev.com/5bc544493e96018f011162c09186d317a558674f/base/test/opaque_ref_counted.h

Blockedon: 802391
Project Member

Comment 11 by bugdroid1@chromium.org, Jan 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a9698a9ad30bff2bfc150fddd4b380b05d6c6eff

commit a9698a9ad30bff2bfc150fddd4b380b05d6c6eff
Author: Gabriel Charette <gab@chromium.org>
Date: Fri Jan 19 09:57:35 2018

Enable -Wglobal-constructors in //base.

Fix an unintentional dynamic allocation in base/android.

Explicitly allow dynamic allocation in two other places
where compile-time isn't possible and I *think* are benign.

Bug: 801563, 800760
Change-Id: I183e18d21af31625a8729aff44b89be85dcd1220
Reviewed-on: https://chromium-review.googlesource.com/866738
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530465}
[modify] https://crrev.com/a9698a9ad30bff2bfc150fddd4b380b05d6c6eff/base/BUILD.gn
[modify] https://crrev.com/a9698a9ad30bff2bfc150fddd4b380b05d6c6eff/base/android/library_loader/library_prefetcher.cc
[modify] https://crrev.com/a9698a9ad30bff2bfc150fddd4b380b05d6c6eff/base/message_loop/message_pump_mac.mm
[modify] https://crrev.com/a9698a9ad30bff2bfc150fddd4b380b05d6c6eff/base/process/memory_win.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Jan 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef

commit 804a46fc4b631b3a6c25cc6ee782c1c5dac14aef
Author: Gabriel Charette <gab@chromium.org>
Date: Tue Jan 23 17:12:57 2018

Revert "Reland "Make many base:: classes constexpr default constructible""

This reverts commit 2e4eab147b94a947ed4650234637b85802000b2b.

Reason for revert: Testing as culprit for  crbug.com/803517 

Original change's description:
> Reland "Make many base:: classes constexpr default constructible"
> 
> This is a reland of d74c23a26e423c3fb70b6216f5dcd2acb85f9157
> Original change's description:
> > Make many base:: classes constexpr default constructible
> 
> Same CL but extracted scoped_refptr changes to separate CL.
> 
> >
> > Bug: 800760
> > Change-Id: Ib713771347283825ff53a8517b38a8abccd9d1bb
> > Reviewed-on: https://chromium-review.googlesource.com/860157
> > Commit-Queue: Gabriel Charette <gab@chromium.org>
> > Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#528805}
> 
> Bug: 800760
> Change-Id: Ia989d978f632075c21f11cd81687f52b9e2bd2ca
> 
> TBR=dcheng@chromium.org
> 
> Change-Id: Ia989d978f632075c21f11cd81687f52b9e2bd2ca
> Reviewed-on: https://chromium-review.googlesource.com/863622
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#528934}

TBR=dcheng@chromium.org,gab@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 800760,  803517 
Change-Id: I1c2e3be23dbde603befffa0f7ec2153e0e5a1851
Reviewed-on: https://chromium-review.googlesource.com/881342
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531267}
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/allocator/partition_allocator/spin_lock.cc
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/allocator/partition_allocator/spin_lock.h
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/android/scoped_java_ref.h
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/containers/circular_deque.h
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/containers/vector_buffer.h
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/mac/scoped_dispatch_object.h
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/mac/scoped_nsobject.h
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/mac/scoped_typeref.h
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/memory/ref_counted.h
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/test/test_discardable_memory_allocator.cc
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/test/test_discardable_memory_allocator.h
[modify] https://crrev.com/804a46fc4b631b3a6c25cc6ee782c1c5dac14aef/base/threading/platform_thread.h

Project Member

Comment 13 by bugdroid1@chromium.org, Jan 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/63fe7062928e18ef60169819ae5ab3934c0b22b0

commit 63fe7062928e18ef60169819ae5ab3934c0b22b0
Author: Gabriel Charette <gab@chromium.org>
Date: Thu Jan 25 14:14:29 2018

Reland "Reland "Make many base:: classes constexpr default constructible""

This is a reland of 2e4eab147b94a947ed4650234637b85802000b2b.

Doesn't appear to be at fault for  crbug.com/803517  as suspected.

Original change's description:
> Reland "Make many base:: classes constexpr default constructible"
>
> This is a reland of d74c23a26e423c3fb70b6216f5dcd2acb85f9157
> Original change's description:
> > Make many base:: classes constexpr default constructible
>
> Same CL but extracted scoped_refptr changes to separate CL.
>
> >
> > Bug: 800760
> > Change-Id: Ib713771347283825ff53a8517b38a8abccd9d1bb
> > Reviewed-on: https://chromium-review.googlesource.com/860157
> > Commit-Queue: Gabriel Charette <gab@chromium.org>
> > Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#528805}
>
> Bug: 800760
> Change-Id: Ia989d978f632075c21f11cd81687f52b9e2bd2ca
>
> TBR=dcheng@chromium.org
>
> Change-Id: Ia989d978f632075c21f11cd81687f52b9e2bd2ca
> Reviewed-on: https://chromium-review.googlesource.com/863622
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#528934}

TBR=dcheng@chromium.org

Bug: 800760,  803517 
Change-Id: Ic987b883e6ccacaa0b2e26b55d875cf4b484a5cc
Reviewed-on: https://chromium-review.googlesource.com/886323
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531890}
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/allocator/partition_allocator/spin_lock.cc
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/allocator/partition_allocator/spin_lock.h
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/android/scoped_java_ref.h
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/containers/circular_deque.h
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/containers/vector_buffer.h
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/mac/scoped_dispatch_object.h
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/mac/scoped_nsobject.h
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/mac/scoped_typeref.h
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/memory/ref_counted.h
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/test/test_discardable_memory_allocator.cc
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/test/test_discardable_memory_allocator.h
[modify] https://crrev.com/63fe7062928e18ef60169819ae5ab3934c0b22b0/base/threading/platform_thread.h

Components: -Internals
I would argue that LazyInstance can and should be removed entirely in favor of base::NoDestructor.
There is at least one LazyInstance that needs to be destroyed: https://chromium-review.googlesource.com/c/chromium/src/+/1375146/3#message-4d3a7f9c1918a992b9da9150cb719daa061c8830 Would the recommendation be to manually register an AtExitDestructor if an object needs to be destroyed?
Status: Available (was: Started)
There are also instances where DestructorAtExit is useful to clean up state between unit tests (leaking in prod is fine).

(Available : no longer actively working on this)

Sign in to add a comment