I have instrumented oxide, and I’m seeing the following:

Start playback of video, two instances of PowerSaveBlocker (one for
video, one for audio) are created and request a lock:

[1015/201111:INFO:oxide_power_save_blocker.cc(260)] 
PowerSaveBlocker::PowerSaveBlocker() 0xb8d11938 : Playing video
[1015/201111:INFO:oxide_power_save_blocker.cc(88)] PowerSaveBlocker::Init() 
0xb8d11938 : -1
[1015/201111:INFO:oxide_power_save_blocker.cc(107)] 
PowerSaveBlocker::ApplyBlock() 0xb8d11938 : -1
[1015/201111:INFO:oxide_power_save_blocker.cc(157)] 
PowerSaveBlocker::ApplyBlockUnityScreenService() 0xb8d11938 : 3

[1015/201111:INFO:oxide_power_save_blocker.cc(260)] 
PowerSaveBlocker::PowerSaveBlocker() 0xb8a15ad0 : Playing audio
[1015/201111:INFO:oxide_power_save_blocker.cc(88)] PowerSaveBlocker::Init() 
0xb8a15ad0 : -1
[1015/201111:INFO:oxide_power_save_blocker.cc(107)] 
PowerSaveBlocker::ApplyBlock() 0xb8a15ad0 : -1
[1015/201111:INFO:oxide_power_save_blocker.cc(157)] 
PowerSaveBlocker::ApplyBlockUnityScreenService() 0xb8a15ad0 : 4


Press power button, the two PowerSaveBlocker instances correctly release
their locks, as expected:

[1015/201117:INFO:oxide_power_save_blocker.cc(99)] PowerSaveBlocker::CleanUp() 
0xb8d11938 : 3
[1015/201117:INFO:oxide_power_save_blocker.cc(99)] PowerSaveBlocker::CleanUp() 
0xb8a15ad0 : 4
[1015/201117:INFO:oxide_power_save_blocker.cc(119)] 
PowerSaveBlocker::RemoveBlock() 0xb8d11938 : 3
[1015/201117:INFO:oxide_power_save_blocker.cc(119)] 
PowerSaveBlocker::RemoveBlock() 0xb8a15ad0 : 4


Press power button again to wake screen, unlock screen, playback resumes
but Init() appears to be called twice on each instance:

[1015/201130:INFO:oxide_power_save_blocker.cc(88)] PowerSaveBlocker::Init() 
0xb8d11938 : -1
[1015/201130:INFO:oxide_power_save_blocker.cc(88)] PowerSaveBlocker::Init() 
0xb8a15ad0 : -1
[1015/201130:INFO:oxide_power_save_blocker.cc(107)] 
PowerSaveBlocker::ApplyBlock() 0xb8d11938 : -1
[1015/201130:INFO:oxide_power_save_blocker.cc(88)] PowerSaveBlocker::Init() 
0xb8d11938 : -1
[1015/201130:INFO:oxide_power_save_blocker.cc(88)] PowerSaveBlocker::Init() 
0xb8a15ad0 : -1
[1015/201130:INFO:oxide_power_save_blocker.cc(157)] 
PowerSaveBlocker::ApplyBlockUnityScreenService() 0xb8d11938 : 5
[1015/201130:INFO:oxide_power_save_blocker.cc(107)] 
PowerSaveBlocker::ApplyBlock() 0xb8a15ad0 : -1
[1015/201131:INFO:oxide_power_save_blocker.cc(157)] 
PowerSaveBlocker::ApplyBlockUnityScreenService() 0xb8a15ad0 : 6
[1015/201131:INFO:oxide_power_save_blocker.cc(107)] 
PowerSaveBlocker::ApplyBlock() 0xb8d11938 : 5
[1015/201131:INFO:oxide_power_save_blocker.cc(157)] 
PowerSaveBlocker::ApplyBlockUnityScreenService() 0xb8d11938 : 7
[1015/201131:INFO:oxide_power_save_blocker.cc(107)] 
PowerSaveBlocker::ApplyBlock() 0xb8a15ad0 : 6
[1015/201131:INFO:oxide_power_save_blocker.cc(157)] 
PowerSaveBlocker::ApplyBlockUnityScreenService() 0xb8a15ad0 : 8


I’m suspecting that Init() is called once by chromium itself when it resumes 
the paused playback, and a second time in the meantime by the code that handles 
application state changes, when oxide detects that the application got focused.

This is a bug in oxide: a call to Init() should bail out if another
Init() has already been requested, to avoid two concurrent lock
requests.

** Also affects: oxide
   Importance: Undecided
       Status: New

** Changed in: oxide
     Assignee: (unassigned) => Olivier Tilloy (osomon)

** Changed in: oxide
   Importance: Undecided => Critical

** Changed in: oxide
       Status: New => Confirmed

** Changed in: webbrowser-app (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1502145

Title:
  Apps can keep screen lit permanently

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1502145/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to