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

Issue 387333002: Make DownloadController singleton instance thread safe. (Closed)

Created:
6 years, 5 months ago by wajahat
Modified:
6 years, 5 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, jdduke (slow)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

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. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283430

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -4 lines) Patch
M content/public/android/java/src/org/chromium/content/browser/DownloadController.java View 2 chunks +1 line, -4 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
wajahat
PTAL!
6 years, 5 months ago (2014-07-14 12:30:17 UTC) #1
jdduke (slow)
I'm not a good reviewer for this (and I'm only an owner for input-related changes ...
6 years, 5 months ago (2014-07-14 15:01:06 UTC) #2
Yaron
lgtm
6 years, 5 months ago (2014-07-14 17:01:44 UTC) #3
wajahat
The CQ bit was checked by wajahat.s@samsung.com
6 years, 5 months ago (2014-07-15 10:33:14 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wajahat.s@samsung.com/387333002/1
6 years, 5 months ago (2014-07-15 10:35:58 UTC) #5
Sergiy Byelozyorov
The CQ bit was unchecked by sergiyb@chromium.org
6 years, 5 months ago (2014-07-16 08:51:39 UTC) #6
Sergiy Byelozyorov
The CQ bit was checked by sergiyb@chromium.org
6 years, 5 months ago (2014-07-16 08:51:43 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wajahat.s@samsung.com/387333002/1
6 years, 5 months ago (2014-07-16 08:52:10 UTC) #8
wajahat
On 2014/07/16 08:51:43, Sergiy Byelozyorov wrote: > The CQ bit was checked by mailto:sergiyb@chromium.org @Dear ...
6 years, 5 months ago (2014-07-16 12:52:16 UTC) #9
Sergiy Byelozyorov
On 2014/07/16 12:52:16, wajahat wrote: > On 2014/07/16 08:51:43, Sergiy Byelozyorov wrote: > > The ...
6 years, 5 months ago (2014-07-16 15:30:33 UTC) #10
Sergiy Byelozyorov
Also it appears the tree is closed, so CQ can't commit your change. I'll talk ...
6 years, 5 months ago (2014-07-16 15:32:49 UTC) #11
commit-bot: I haz the power
Change committed as 283430
6 years, 5 months ago (2014-07-16 18:03:17 UTC) #12
wajahat
6 years, 5 months ago (2014-07-17 05:32:55 UTC) #13
Message was sent while issue was closed.
On 2014/07/16 15:32:49, Sergiy Byelozyorov wrote:
> Also it appears the tree is closed, so CQ can't commit your change. I'll talk
to
> the sheriff.

Thanks Sergiy!

Powered by Google App Engine
This is Rietveld 408576698