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

Issue 2077983003: Intiialize AudioManager and related class lazily (Closed)

Created:
4 years, 6 months ago by qinmin
Modified:
4 years, 5 months ago
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch+vc_chromium.org, miu+watch_chromium.org, nasko+codewatch_chromium.org, phoglund+watch_chromium.org, posciak+watch_chromium.org, tnakamura+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Intiialize AudioManager and related class lazily AudioManager is created when browser process is created. However, for background download resumption, we don't need AudioManager for download to resume. Creating the AudioManager takes about 10KB of memory. This is only needed when the first renderer is created. This CL delays AudioManager creation until it is first referenced. This also involves some other classes that depends on AudioManager. BUG=620479 Committed: https://crrev.com/c8569a7cd8c3cb6f9cd22467e084860721ceadd7 Cr-Commit-Position: refs/heads/master@{#404014}

Patch Set 1 #

Total comments: 6

Patch Set 2 : apply the lazy initialization only to Android #

Total comments: 1

Patch Set 3 : move changes into AudioManagerAndroid #

Patch Set 4 : defer StartHangMonitor() on all platforms #

Total comments: 2

Patch Set 5 : check if StartHangTimer() is called earlier #

Total comments: 2

Patch Set 6 : fix test and lazy init jobj #

Patch Set 7 : fix MediaSessionTest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -49 lines) Patch
M content/browser/browser_main_loop.cc View 1 2 3 4 5 3 chunks +0 lines, -7 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 2 chunks +16 lines, -0 lines 0 comments Download
M content/browser/speech/speech_recognition_browsertest.cc View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M media/audio/android/audio_manager_android.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M media/audio/android/audio_manager_android.cc View 1 2 3 4 5 6 5 chunks +32 lines, -38 lines 0 comments Download
M media/audio/audio_manager.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_manager.cc View 1 2 3 4 5 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 77 (35 generated)
qinmin
PTAL
4 years, 6 months ago (2016-06-17 23:56:05 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2077983003/1
4 years, 6 months ago (2016-06-17 23:56:38 UTC) #6
no sievers
looks like a good idea. did you run it by some desktop folks though to ...
4 years, 6 months ago (2016-06-18 00:17:20 UTC) #7
DaleCurtis
This is not true, the AudioManager has several callers in the browser process.
4 years, 6 months ago (2016-06-18 00:21:14 UTC) #9
DaleCurtis
Can you elaborate on the cost here? On most platforms it does nothing except start ...
4 years, 6 months ago (2016-06-18 00:21:37 UTC) #10
DaleCurtis
+tommi
4 years, 6 months ago (2016-06-18 00:23:05 UTC) #12
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/89834)
4 years, 6 months ago (2016-06-18 00:29:21 UTC) #14
qinmin
On 2016/06/18 00:21:14, DaleCurtis wrote: > This is not true, the AudioManager has several callers ...
4 years, 6 months ago (2016-06-18 04:04:24 UTC) #15
qinmin
On 2016/06/18 00:21:37, DaleCurtis wrote: > Can you elaborate on the cost here? On most ...
4 years, 6 months ago (2016-06-18 04:21:02 UTC) #16
tommi (sloooow) - chröme
are the bot failures related? https://codereview.chromium.org/2077983003/diff/1/content/browser/browser_main_loop.cc File content/browser/browser_main_loop.cc (right): https://codereview.chromium.org/2077983003/diff/1/content/browser/browser_main_loop.cc#newcode1450 content/browser/browser_main_loop.cc:1450: media::AudioManager* BrowserMainLoop::GetAudioManager() { make ...
4 years, 6 months ago (2016-06-18 13:49:03 UTC) #18
DaleCurtis
On 2016/06/18 at 04:04:24, qinmin wrote: > On 2016/06/18 00:21:14, DaleCurtis wrote: > > This ...
4 years, 6 months ago (2016-06-20 16:22:35 UTC) #19
DaleCurtis
On 2016/06/20 at 16:22:35, DaleCurtis wrote: > On 2016/06/18 at 04:04:24, qinmin wrote: > > ...
4 years, 6 months ago (2016-06-20 16:23:25 UTC) #20
qinmin
Chatted with sievers@, and agree to limit the lazy initialization to Android only. https://codereview.chromium.org/2077983003/diff/1/content/browser/browser_main_loop.cc File ...
4 years, 6 months ago (2016-06-20 23:45:29 UTC) #22
no sievers
lgtm if Dale is happy too https://codereview.chromium.org/2077983003/diff/40001/content/browser/browser_main_loop.cc File content/browser/browser_main_loop.cc (right): https://codereview.chromium.org/2077983003/diff/40001/content/browser/browser_main_loop.cc#newcode1233 content/browser/browser_main_loop.cc:1233: TRACE_EVENT0("startup", "BrowserThreadsStarted::InitMediaComponents"); nit: ...
4 years, 6 months ago (2016-06-20 23:50:59 UTC) #23
DaleCurtis
I'd prefer not to add more one-offs just for Android. Sorry to ask a probably-desktop ...
4 years, 6 months ago (2016-06-21 00:16:32 UTC) #24
no sievers
On 2016/06/21 00:16:32, DaleCurtis wrote: > I'd prefer not to add more one-offs just for ...
4 years, 6 months ago (2016-06-21 00:19:17 UTC) #25
qinmin
On 2016/06/21 00:16:32, DaleCurtis wrote: > I'd prefer not to add more one-offs just for ...
4 years, 6 months ago (2016-06-21 04:20:05 UTC) #26
qinmin
On 2016/06/21 00:19:17, sievers wrote: > On 2016/06/21 00:16:32, DaleCurtis wrote: > > I'd prefer ...
4 years, 6 months ago (2016-06-21 17:27:49 UTC) #27
DaleCurtis
On 2016/06/21 at 17:27:49, qinmin wrote: > On 2016/06/21 00:19:17, sievers wrote: > > On ...
4 years, 6 months ago (2016-06-21 19:27:10 UTC) #28
qinmin
On 2016/06/21 19:27:10, DaleCurtis wrote: > On 2016/06/21 at 17:27:49, qinmin wrote: > > On ...
4 years, 6 months ago (2016-06-21 21:21:57 UTC) #29
DaleCurtis
Hmm, why not just always defer StartHangMonitor until a render process is attached? I also ...
4 years, 6 months ago (2016-06-21 21:27:44 UTC) #30
DaleCurtis
On 2016/06/21 at 21:27:44, DaleCurtis wrote: > Hmm, why not just always defer StartHangMonitor until ...
4 years, 6 months ago (2016-06-21 21:28:49 UTC) #31
qinmin
On 2016/06/21 21:28:49, DaleCurtis wrote: > On 2016/06/21 at 21:27:44, DaleCurtis wrote: > > Hmm, ...
4 years, 6 months ago (2016-06-21 22:05:59 UTC) #32
DaleCurtis
lgtm though InitializeIfNeeded() is a bit misleading.
4 years, 6 months ago (2016-06-21 23:48:42 UTC) #33
no sievers
https://codereview.chromium.org/2077983003/diff/80001/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/2077983003/diff/80001/content/browser/renderer_host/render_process_host_impl.cc#newcode609 content/browser/renderer_host/render_process_host_impl.cc:609: media::AudioManager::StartHangMonitor( Doesn't this blow up if being called repeatedly? ...
4 years, 6 months ago (2016-06-21 23:57:22 UTC) #34
qinmin
https://codereview.chromium.org/2077983003/diff/80001/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/2077983003/diff/80001/content/browser/renderer_host/render_process_host_impl.cc#newcode609 content/browser/renderer_host/render_process_host_impl.cc:609: media::AudioManager::StartHangMonitor( On 2016/06/21 23:57:22, sievers wrote: > Doesn't this ...
4 years, 6 months ago (2016-06-22 00:15:56 UTC) #35
no sievers
lgtm https://codereview.chromium.org/2077983003/diff/100001/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/2077983003/diff/100001/content/browser/renderer_host/render_process_host_impl.cc#newcode608 content/browser/renderer_host/render_process_host_impl.cc:608: // necessary or recommended. nit: Can you put ...
4 years, 6 months ago (2016-06-22 00:31:18 UTC) #36
qinmin
On 2016/06/22 00:31:18, sievers wrote: > lgtm > > https://codereview.chromium.org/2077983003/diff/100001/content/browser/renderer_host/render_process_host_impl.cc > File content/browser/renderer_host/render_process_host_impl.cc (right): > ...
4 years, 5 months ago (2016-06-27 21:01:31 UTC) #44
qinmin
https://codereview.chromium.org/2077983003/diff/100001/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/2077983003/diff/100001/content/browser/renderer_host/render_process_host_impl.cc#newcode608 content/browser/renderer_host/render_process_host_impl.cc:608: // necessary or recommended. On 2016/06/22 00:31:18, sievers wrote: ...
4 years, 5 months ago (2016-06-27 21:01:41 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2077983003/260001
4 years, 5 months ago (2016-06-27 21:04:37 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/94535)
4 years, 5 months ago (2016-06-27 22:18:17 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2077983003/260001
4 years, 5 months ago (2016-06-27 22:33:23 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/94593)
4 years, 5 months ago (2016-06-27 23:46:29 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2077983003/320001
4 years, 5 months ago (2016-07-06 17:05:44 UTC) #59
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/212872)
4 years, 5 months ago (2016-07-06 17:13:44 UTC) #61
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2077983003/340001
4 years, 5 months ago (2016-07-06 17:27:06 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2077983003/340001
4 years, 5 months ago (2016-07-06 18:25:29 UTC) #68
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/99162)
4 years, 5 months ago (2016-07-06 21:21:03 UTC) #70
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2077983003/340001
4 years, 5 months ago (2016-07-06 21:25:52 UTC) #72
commit-bot: I haz the power
Committed patchset #7 (id:340001)
4 years, 5 months ago (2016-07-07 00:33:54 UTC) #74
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-07 00:34:11 UTC) #75
commit-bot: I haz the power
4 years, 5 months ago (2016-07-07 00:37:29 UTC) #77
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/c8569a7cd8c3cb6f9cd22467e084860721ceadd7
Cr-Commit-Position: refs/heads/master@{#404014}

Powered by Google App Engine
This is Rietveld 408576698