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

Issue 431183003: Rotate screen in response to accelerator or device orientation sensors. (Closed)

Created:
6 years, 4 months ago by flackr
Modified:
6 years, 4 months ago
Reviewers:
danakj, oshima, sadrul
CC:
chromium-reviews, jam
Project:
chromium
Visibility:
Public.

Description

Rotate screen in response to accelerator or device orientation sensors. BUG=385295 TEST=Press Ctrl+Shift+F3, screen rotates. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=290007

Patch Set 1 #

Total comments: 15

Patch Set 2 : Addressing comments and nits. #

Total comments: 3

Patch Set 3 : Update DEPS to specific file used in ui/gfx. #

Total comments: 2

Patch Set 4 : Use TestScreen::SetDisplayRotation to apply screen rotation. #

Total comments: 2

Patch Set 5 : Pass in task runner to avoid new dependency on content/public/browser/browser_thread.h. #

Total comments: 6

Patch Set 6 : Use IO thread for FilePathWatcher. #

Patch Set 7 : Remove unnecessary aura export. #

Total comments: 1

Patch Set 8 : Remove one pixel offset. #

Total comments: 2

Patch Set 9 : Use the FILE thread for IO #

Total comments: 14

Patch Set 10 : Address comments #

Patch Set 11 : Address comments. #

Patch Set 12 : Add dependencies on ipc and content. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+639 lines, -11 lines) Patch
M athena/athena.gyp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -0 lines 2 comments Download
M athena/main/athena_launcher.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -1 line 0 comments Download
M athena/screen/public/screen_manager.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -0 lines 0 comments Download
M athena/screen/screen_accelerator_handler.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +24 lines, -0 lines 0 comments Download
M athena/screen/screen_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +16 lines, -0 lines 0 comments Download
A athena/system/device_socket_listener.h View 1 2 3 4 1 chunk +48 lines, -0 lines 0 comments Download
A athena/system/device_socket_listener.cc View 1 2 3 4 1 chunk +287 lines, -0 lines 0 comments Download
A athena/system/orientation_controller.h View 1 2 3 4 5 1 chunk +65 lines, -0 lines 0 comments Download
A athena/system/orientation_controller.cc View 1 2 3 4 5 6 7 8 9 1 chunk +143 lines, -0 lines 0 comments Download
M athena/system/public/system_ui.h View 1 2 3 4 1 chunk +6 lines, -1 line 0 comments Download
M athena/system/system_ui_impl.cc View 1 2 3 4 5 4 chunks +12 lines, -3 lines 0 comments Download
M ui/aura/test/test_screen.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +20 lines, -6 lines 0 comments Download

Messages

Total messages: 38 (0 generated)
flackr
Hey, this is my first cut at doing screen rotation. Can you have a look? ...
6 years, 4 months ago (2014-07-31 22:21:16 UTC) #1
oshima
lgtm with nits and comments https://codereview.chromium.org/431183003/diff/1/athena/screen/public/screen_manager.h File athena/screen/public/screen_manager.h (right): https://codereview.chromium.org/431183003/diff/1/athena/screen/public/screen_manager.h#newcode70 athena/screen/public/screen_manager.h:70: virtual void SetRotation(gfx::Display::Rotation rotation) ...
6 years, 4 months ago (2014-08-01 17:15:12 UTC) #2
flackr
+danakj for +ui/gfx in athena/system/DEPS +jam for +content/public/browser/browser_thread.h in athena/system/DEPS https://codereview.chromium.org/431183003/diff/1/athena/screen/public/screen_manager.h File athena/screen/public/screen_manager.h (right): https://codereview.chromium.org/431183003/diff/1/athena/screen/public/screen_manager.h#newcode70 ...
6 years, 4 months ago (2014-08-06 14:13:52 UTC) #3
danakj
https://codereview.chromium.org/431183003/diff/20001/athena/system/DEPS File athena/system/DEPS (right): https://codereview.chromium.org/431183003/diff/20001/athena/system/DEPS#newcode6 athena/system/DEPS:6: "+ui/gfx", do you need all of ui/gfx?
6 years, 4 months ago (2014-08-06 14:14:28 UTC) #4
flackr
https://codereview.chromium.org/431183003/diff/20001/athena/system/DEPS File athena/system/DEPS (right): https://codereview.chromium.org/431183003/diff/20001/athena/system/DEPS#newcode6 athena/system/DEPS:6: "+ui/gfx", On 2014/08/06 14:14:28, danakj wrote: > do you ...
6 years, 4 months ago (2014-08-06 14:17:17 UTC) #5
danakj
https://codereview.chromium.org/431183003/diff/20001/athena/system/DEPS File athena/system/DEPS (right): https://codereview.chromium.org/431183003/diff/20001/athena/system/DEPS#newcode6 athena/system/DEPS:6: "+ui/gfx", On 2014/08/06 14:17:17, flackr wrote: > On 2014/08/06 ...
6 years, 4 months ago (2014-08-06 14:18:52 UTC) #6
flackr
On 2014/08/06 14:18:52, danakj wrote: > https://codereview.chromium.org/431183003/diff/20001/athena/system/DEPS > File athena/system/DEPS (right): > > https://codereview.chromium.org/431183003/diff/20001/athena/system/DEPS#newcode6 > ...
6 years, 4 months ago (2014-08-06 14:26:51 UTC) #7
danakj
On Wed, Aug 6, 2014 at 4:26 PM, <flackr@chromium.org> wrote: > On 2014/08/06 14:18:52, danakj ...
6 years, 4 months ago (2014-08-06 14:34:21 UTC) #8
danakj
Oh, LGTM not-from-email
6 years, 4 months ago (2014-08-06 15:57:08 UTC) #9
oshima
https://codereview.chromium.org/431183003/diff/40001/athena/screen/screen_manager_impl.cc File athena/screen/screen_manager_impl.cc (right): https://codereview.chromium.org/431183003/diff/40001/athena/screen/screen_manager_impl.cc#newcode369 athena/screen/screen_manager_impl.cc:369: root_window_->layer()->SetTransform(transform); Actually, can you use TestScreen::SetDisplayRotation() ? That should ...
6 years, 4 months ago (2014-08-06 21:26:00 UTC) #10
flackr
https://codereview.chromium.org/431183003/diff/40001/athena/screen/screen_manager_impl.cc File athena/screen/screen_manager_impl.cc (right): https://codereview.chromium.org/431183003/diff/40001/athena/screen/screen_manager_impl.cc#newcode369 athena/screen/screen_manager_impl.cc:369: root_window_->layer()->SetTransform(transform); On 2014/08/06 21:26:00, oshima wrote: > Actually, can ...
6 years, 4 months ago (2014-08-06 23:35:37 UTC) #11
oshima
lgtm thanks
6 years, 4 months ago (2014-08-06 23:47:23 UTC) #12
jam
https://codereview.chromium.org/431183003/diff/80001/athena/system/DEPS File athena/system/DEPS (right): https://codereview.chromium.org/431183003/diff/80001/athena/system/DEPS#newcode5 athena/system/DEPS:5: "+content/public/browser/browser_thread.h", why not use dependency injection to avoid having ...
6 years, 4 months ago (2014-08-07 05:54:16 UTC) #13
flackr
-jam as reviewer since no longer adding browser_thread dependency. +sadrul for ui/aura/ oshima, can you ...
6 years, 4 months ago (2014-08-11 18:23:30 UTC) #14
sadrul
LGTM Do we have tests that test .. TestScreen? https://codereview.chromium.org/431183003/diff/100001/ui/aura/test/test_screen.h File ui/aura/test/test_screen.h (right): https://codereview.chromium.org/431183003/diff/100001/ui/aura/test/test_screen.h#newcode25 ui/aura/test/test_screen.h:25: ...
6 years, 4 months ago (2014-08-11 18:35:41 UTC) #15
oshima
On 2014/08/11 18:23:30, flackr wrote: > -jam as reviewer since no longer adding browser_thread dependency. ...
6 years, 4 months ago (2014-08-11 21:30:00 UTC) #16
oshima
and here are comments https://codereview.chromium.org/431183003/diff/100001/athena/system/orientation_controller.cc File athena/system/orientation_controller.cc (right): https://codereview.chromium.org/431183003/diff/100001/athena/system/orientation_controller.cc#newcode63 athena/system/orientation_controller.cc:63: CHECK(base::MessageLoop::current()); base::MessageLoopForUI::current() ? https://codereview.chromium.org/431183003/diff/100001/athena/system/orientation_controller.cc#newcode73 athena/system/orientation_controller.cc:73: ...
6 years, 4 months ago (2014-08-11 21:30:18 UTC) #17
flackr
https://codereview.chromium.org/431183003/diff/100001/athena/system/orientation_controller.cc File athena/system/orientation_controller.cc (right): https://codereview.chromium.org/431183003/diff/100001/athena/system/orientation_controller.cc#newcode63 athena/system/orientation_controller.cc:63: CHECK(base::MessageLoop::current()); On 2014/08/11 21:30:17, oshima wrote: > base::MessageLoopForUI::current() ? ...
6 years, 4 months ago (2014-08-13 15:52:36 UTC) #18
flackr
+sky for content/browser
6 years, 4 months ago (2014-08-13 17:48:51 UTC) #19
sky
https://codereview.chromium.org/431183003/diff/160001/content/browser/browser_thread_impl.cc File content/browser/browser_thread_impl.cc (right): https://codereview.chromium.org/431183003/diff/160001/content/browser/browser_thread_impl.cc#newcode217 content/browser/browser_thread_impl.cc:217: base::ThreadRestrictions::SetIOAllowed(true); Isn't true the default?
6 years, 4 months ago (2014-08-13 19:49:23 UTC) #20
flackr
https://codereview.chromium.org/431183003/diff/160001/content/browser/browser_thread_impl.cc File content/browser/browser_thread_impl.cc (right): https://codereview.chromium.org/431183003/diff/160001/content/browser/browser_thread_impl.cc#newcode217 content/browser/browser_thread_impl.cc:217: base::ThreadRestrictions::SetIOAllowed(true); On 2014/08/13 19:49:23, sky wrote: > Isn't true ...
6 years, 4 months ago (2014-08-13 20:45:54 UTC) #21
oshima
https://codereview.chromium.org/431183003/diff/180001/athena/screen/public/screen_manager.h File athena/screen/public/screen_manager.h (right): https://codereview.chromium.org/431183003/diff/180001/athena/screen/public/screen_manager.h#newcode75 athena/screen/public/screen_manager.h:75: virtual gfx::Display::Rotation GetRotation() = 0; can you change to ...
6 years, 4 months ago (2014-08-13 22:46:35 UTC) #22
flackr
https://codereview.chromium.org/431183003/diff/180001/athena/screen/public/screen_manager.h File athena/screen/public/screen_manager.h (right): https://codereview.chromium.org/431183003/diff/180001/athena/screen/public/screen_manager.h#newcode75 athena/screen/public/screen_manager.h:75: virtual gfx::Display::Rotation GetRotation() = 0; On 2014/08/13 22:46:34, oshima ...
6 years, 4 months ago (2014-08-14 17:29:51 UTC) #23
oshima
https://codereview.chromium.org/431183003/diff/180001/athena/screen/public/screen_manager.h File athena/screen/public/screen_manager.h (right): https://codereview.chromium.org/431183003/diff/180001/athena/screen/public/screen_manager.h#newcode75 athena/screen/public/screen_manager.h:75: virtual gfx::Display::Rotation GetRotation() = 0; On 2014/08/14 17:29:51, flackr ...
6 years, 4 months ago (2014-08-14 19:28:53 UTC) #24
flackr
https://codereview.chromium.org/431183003/diff/180001/athena/screen/public/screen_manager.h File athena/screen/public/screen_manager.h (right): https://codereview.chromium.org/431183003/diff/180001/athena/screen/public/screen_manager.h#newcode75 athena/screen/public/screen_manager.h:75: virtual gfx::Display::Rotation GetRotation() = 0; On 2014/08/14 19:28:53, oshima ...
6 years, 4 months ago (2014-08-14 21:04:10 UTC) #25
oshima
lgtm thanks!
6 years, 4 months ago (2014-08-14 21:09:12 UTC) #26
flackr
The CQ bit was checked by flackr@chromium.org
6 years, 4 months ago (2014-08-14 21:12:19 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/flackr@chromium.org/431183003/220001
6 years, 4 months ago (2014-08-14 21:16:22 UTC) #28
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-15 03:24:35 UTC) #29
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-15 03:36:09 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_swarming/builds/4550)
6 years, 4 months ago (2014-08-15 03:36:10 UTC) #31
flackr
Can you take another look at athena.gyp? I was missing some dependencies for building athena_unittests.
6 years, 4 months ago (2014-08-15 13:49:04 UTC) #32
oshima
lgtm https://codereview.chromium.org/431183003/diff/240001/athena/athena.gyp File athena/athena.gyp (right): https://codereview.chromium.org/431183003/diff/240001/athena/athena.gyp#newcode149 athena/athena.gyp:149: 'athena_content_lib', can you add comment that this is ...
6 years, 4 months ago (2014-08-15 13:53:29 UTC) #33
flackr
https://codereview.chromium.org/431183003/diff/240001/athena/athena.gyp File athena/athena.gyp (right): https://codereview.chromium.org/431183003/diff/240001/athena/athena.gyp#newcode149 athena/athena.gyp:149: 'athena_content_lib', On 2014/08/15 13:53:29, oshima wrote: > can you ...
6 years, 4 months ago (2014-08-15 13:55:54 UTC) #34
flackr
The CQ bit was checked by flackr@chromium.org
6 years, 4 months ago (2014-08-15 17:09:45 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/flackr@chromium.org/431183003/240001
6 years, 4 months ago (2014-08-15 17:17:10 UTC) #36
commit-bot: I haz the power
Committed patchset #12 (240001) as 290007
6 years, 4 months ago (2014-08-15 21:07:39 UTC) #37
Nico
6 years, 4 months ago (2014-08-16 05:15:40 UTC) #38
Message was sent while issue was closed.
A revert of this CL (patchset #12) has been created in
https://codereview.chromium.org/475533008/ by thakis@chromium.org.

The reason for reverting is: Speculative, athena_unittests and ui_unittests
started failing in this
build:http://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%283%29/builds/2771

==6568==ERROR: AddressSanitizer: heap-use-after-free on address 0x60700000ba10
at pc 0x00000167d52a bp 0x7fff95f266f0 sp 0x7fff95f266e8
READ of size 8 at 0x60700000ba10 thread T0
    #0 0x167d529 in DeleteInternal base/memory/ref_counted.h:190:44
    #1 0x167d529 in Destruct base/memory/ref_counted.h:153
    #2 0x167d529 in Release base/memory/ref_counted.h:181
    #3 0x167d529 in ~scoped_refptr base/memory/ref_counted.h:289
    #4 0x167d529 in ~SystemUIImpl athena/system/system_ui_impl.cc:27
    #5 0x167d529 in athena::(anonymous namespace)::SystemUIImpl::~SystemUIImpl()
athena/system/system_ui_impl.cc:26
    #6 0x167d257 in athena::SystemUI::Shutdown()
athena/system/system_ui_impl.cc:49:3
    #7 0x577fa6 in athena::ShutdownAthena() athena/main/athena_launcher.cc:92:3
    #8 0x57645f in athena::test::AthenaTestHelper::TearDown()
athena/test/athena_test_helper.cc:98:3
    #9 0x575266 in athena::test::AthenaTestBase::TearDown()
athena/test/athena_test_base.cc:53:3
    #10 0x505bc8 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2610:5
    #11 0x506906 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2728:5
    #12 0x51cb85 in testing::internal::UnitTestImpl::RunAllTests()
testing/gtest/src/gtest.cc:4591:11
    #13 0x51c176 in
HandleExceptionsInMethodIfSupported\u003Ctesting::internal::UnitTestImpl, bool>
testing/gtest/src/gtest.cc:2418:12
    #14 0x51c176 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4209
    #15 0xac6fb4 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2304:10
    #16 0xac6fb4 in base::TestSuite::Run() base/test/test_suite.cc:227
    #17 0xabe39d in Run base/callback.h:401:12
    #18 0xabe39d in base::(anonymous
namespace)::LaunchUnitTestsInternal(base::Callback\u003Cint ()> const&, int,
bool, base::Callback\u003Cvoid ()> const&)
base/test/launcher/unit_test_launcher.cc:498
    #19 0xabf0de in base::LaunchUnitTestsSerially(int, char**,
base::Callback\u003Cint ()> const&)
base/test/launcher/unit_test_launcher.cc:564:10
    #20 0x4d7bba in main athena/test/athena_unittests.cc:51:10
    #21 0x7fd394e3476c in __libc_start_main
/build/buildd/eglibc-2.15/csu/libc-start.c:226
    #22 0x4d795c in _start
(/mnt/data/b/build/slave/Linux_Chromium_OS_ASan_LSan_Tests__3_/build/src/out/Release/athena_unittests+0x4d795c)

0x60700000ba10 is located 0 bytes inside of 72-byte region
[0x60700000ba10,0x60700000ba58)
freed by thread T0 here:
    #0 0x452fcb in operator delete(void*)
(/mnt/data/b/build/slave/Linux_Chromium_OS_ASan_LSan_Tests__3_/build/src/out/Release/athena_unittests+0x452fcb)
    #1 0x168323d in DeleteInternal base/memory/ref_counted.h:190:44
    #2 0x168323d in Destruct base/memory/ref_counted.h:153
    #3 0x168323d in Release base/memory/ref_counted.h:181
    #4 0x168323d in ~scoped_refptr base/memory/ref_counted.h:289
    #5 0x168323d in
athena::OrientationController::OrientationController(scoped_refptr\u003Cbase::TaskRunner>)
athena/system/orientation_controller.cc:66
    #6 0x167cfea in SystemUIImpl athena/system/system_ui_impl.cc:23:61
    #7 0x167cfea in
athena::SystemUI::Create(scoped_refptr\u003Cbase::TaskRunner>)
athena/system/system_ui_impl.cc:42
    #8 0x577db0 in athena::StartAthena(aura::Window*, athena::ActivityFactory*,
athena::AppModelBuilder*) athena/main/athena_launcher.cc:73:3
    #9 0x576159 in athena::test::AthenaTestHelper::SetUp(ui::ContextFactory*)
athena/test/athena_test_helper.cc:90:3
    #10 0x503eb1 in HandleExceptionsInMethodIfSupported\u003Ctesting::Test,
void> testing/gtest/src/gtest.cc:2418:12
    #11 0x503eb1 in testing::Test::Run() testing/gtest/src/gtest.cc:2430
    #12 0x505bc8 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2610:5
    #13 0x506906 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2728:5
    #14 0x51cb85 in testing::internal::UnitTestImpl::RunAllTests()
testing/gtest/src/gtest.cc:4591:11
    #15 0x51c176 in
HandleExceptionsInMethodIfSupported\u003Ctesting::internal::UnitTestImpl, bool>
testing/gtest/src/gtest.cc:2418:12
    #16 0x51c176 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4209
    #17 0xac6fb4 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2304:10
    #18 0xac6fb4 in base::TestSuite::Run() base/test/test_suite.cc:227
    #19 0xabe39d in Run base/callback.h:401:12
    #20 0xabe39d in base::(anonymous
namespace)::LaunchUnitTestsInternal(base::Callback\u003Cint ()> const&, int,
bool, base::Callback\u003Cvoid ()> const&)
base/test/launcher/unit_test_launcher.cc:498
    #21 0xabf0de in base::LaunchUnitTestsSerially(int, char**,
base::Callback\u003Cint ()> const&)
base/test/launcher/unit_test_launcher.cc:564:10
    #22 0x4d7bba in main athena/test/athena_unittests.cc:51:10
    #23 0x7fd394e3476c in __libc_start_main
/build/buildd/eglibc-2.15/csu/libc-start.c:226

previously allocated by thread T0 here:
    #0 0x452a8b in operator new(unsigned long)
(/mnt/data/b/build/slave/Linux_Chromium_OS_ASan_LSan_Tests__3_/build/src/out/Release/athena_unittests+0x452a8b)
    #1 0x167cfb5 in SystemUIImpl athena/system/system_ui_impl.cc:23:61
    #2 0x167cfb5 in
athena::SystemUI::Create(scoped_refptr\u003Cbase::TaskRunner>)
athena/system/system_ui_impl.cc:42
    #3 0x577db0 in athena::StartAthena(aura::Window*, athena::ActivityFactory*,
athena::AppModelBuilder*) athena/main/athena_launcher.cc:73:3
    #4 0x576159 in athena::test::AthenaTestHelper::SetUp(ui::ContextFactory*)
athena/test/athena_test_helper.cc:90:3
    #5 0x503eb1 in HandleExceptionsInMethodIfSupported\u003Ctesting::Test, void>
testing/gtest/src/gtest.cc:2418:12
    #6 0x503eb1 in testing::Test::Run() testing/gtest/src/gtest.cc:2430
    #7 0x505bc8 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2610:5
    #8 0x506906 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2728:5
    #9 0x51cb85 in testing::internal::UnitTestImpl::RunAllTests()
testing/gtest/src/gtest.cc:4591:11
    #10 0x51c176 in
HandleExceptionsInMethodIfSupported\u003Ctesting::internal::UnitTestImpl, bool>
testing/gtest/src/gtest.cc:2418:12
    #11 0x51c176 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4209
    #12 0xac6fb4 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2304:10
    #13 0xac6fb4 in base::TestSuite::Run() base/test/test_suite.cc:227
    #14 0xabe39d in Run base/callback.h:401:12
    #15 0xabe39d in base::(anonymous
namespace)::LaunchUnitTestsInternal(base::Callback\u003Cint ()> const&, int,
bool, base::Callback\u003Cvoid ()> const&)
base/test/launcher/unit_test_launcher.cc:498
    #16 0xabf0de in base::LaunchUnitTestsSerially(int, char**,
base::Callback\u003Cint ()> const&)
base/test/launcher/unit_test_launcher.cc:564:10
    #17 0x4d7bba in main athena/test/athena_unittests.cc:51:10
    #18 0x7fd394e3476c in __libc_start_main
/build/buildd/eglibc-2.15/csu/libc-start.c:226
.

Powered by Google App Engine
This is Rietveld 408576698