Make 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. Review URL: https://codereview.chromium.org/387333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283430 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment