DescriptionMake DownloadController singleton instance thread safe.
As the cost of creating download controller instance is not
too heavy its better to switch to eager initialization which
creates a ready to use instance and ensures thread safety
This method has a number of advantages:
* The instance is not constructed until the class is used.
* There is no need to synchronize the getInstance() method,
meaning all threads will see the same instance and no (expensive)
locking is required.
* The final keyword means that the instance cannot be redefined,
ensuring that one (and only one) instance ever exists.
(source: http://en.wikipedia.org/wiki/Singleton_pattern#Eager_initialization)
BUG=None.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283430
Patch Set 1 #
Messages
Total messages: 13 (0 generated)
|