diff options
author | benjhayden@chromium.org <benjhayden@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-06 19:56:21 +0000 |
---|---|---|
committer | benjhayden@chromium.org <benjhayden@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-06 19:56:21 +0000 |
commit | 05936b3805e0e25423c6e1b17e187a9954f9b681 (patch) | |
tree | 55e9287c514e797f59be63942fc78c890bcc62a8 /chromeos/dbus | |
parent | 2b87dac7d499aea68ad5f51ff9eaeeb32a4968e0 (diff) | |
download | chromium_src-05936b3805e0e25423c6e1b17e187a9954f9b681.zip chromium_src-05936b3805e0e25423c6e1b17e187a9954f9b681.tar.gz chromium_src-05936b3805e0e25423c6e1b17e187a9954f9b681.tar.bz2 |
Revert 155224 - Add is_fullscreen to video updates
http://build.chromium.org/p/chromium/builders/Win%20Aura/builds/21280/steps/ash_unittests/logs/stdio#failure1
[ RUN ] VideoDetectorTest.FullscreenWindow
wm\video_detector_unittest.cc(250): error: Value of:
observer_->num_invocations()
Actual: 0
Expected: 1
wm\video_detector_unittest.cc(251): error: Value of:
observer_->num_fullscreens()
Actual: 0
Expected: 1
[ FAILED ] VideoDetectorTest.FullscreenWindow (138 ms)
This is a re-attempt at http://codereview.chromium.org/10905026/, which ended up
being reverted.
The crash that caused the revert was actually due to powerd not being able to
parse the protobuf correctly. https://gerrit.chromium.org/gerrit/32243/ corrects
this issue, so once that CL lands this CL is good to go. I confirmed the
combination of CLs works correctly.
This is the original CL description:
This adds a boolean to the video update message sent to powerd that indicates
whether or not the video playing window is fullscreen'd. This is information
used in powerd for controlling when to enable/disable keyboard
backlights. Specifically if video is playing and fullscreen we assume that the
user is doing something like watching a movie so will disable backlight.
An additional change that I have made is to convert the message being sent from
an int64 to a protobuffer that contains a int64 and a boolean. Currently, since
the receiver of this message does not live in the same repo it means that
everytime one wants to change the message format there is a small window where
bad builds can be generated or one has to land two changes to the other repo,
one to add handling of the new message format and then a second one to remove
the old format. Converting to a protobuffer means that for common cases this
issues are removed.
This CL depends on CLs for power_manager
(https://gerrit.chromium.org/gerrit/32092/), one for system_api
(https://gerrit.chromium.org/gerrit/31916), and a DEPS
roll(http://codereview.chromium.org/10915032/). There will be future CLs for
power_manager that will use this information and more thourghly tests this code.
BUG=chrome-os-partner:9203
TEST=Run updated unittests.
Confirm there is no messages in the cros logs about this method being
mishandled.
Make sure that powerd is not crashing due to protocol buffer processing
failing.
Review URL: https://chromiumcodereview.appspot.com/10916123
TBR=rharrison@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10928037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus')
-rw-r--r-- | chromeos/dbus/mock_power_manager_client.h | 2 | ||||
-rw-r--r-- | chromeos/dbus/power_manager_client.cc | 14 | ||||
-rw-r--r-- | chromeos/dbus/power_manager_client.h | 6 |
3 files changed, 6 insertions, 16 deletions
diff --git a/chromeos/dbus/mock_power_manager_client.h b/chromeos/dbus/mock_power_manager_client.h index 6d5ee18..ae828af 100644 --- a/chromeos/dbus/mock_power_manager_client.h +++ b/chromeos/dbus/mock_power_manager_client.h @@ -34,7 +34,7 @@ class MockPowerManagerClient : public PowerManagerClient { MOCK_METHOD1(RequestIdleNotification, void(int64)); MOCK_METHOD0(RequestActiveNotification, void(void)); MOCK_METHOD1(NotifyUserActivity, void(const base::TimeTicks&)); - MOCK_METHOD2(NotifyVideoActivity, void(const base::TimeTicks&, bool)); + MOCK_METHOD1(NotifyVideoActivity, void(const base::TimeTicks&)); MOCK_METHOD4(RequestPowerStateOverrides, void(uint32, uint32, diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc index e325ea2..267ea0c 100644 --- a/chromeos/dbus/power_manager_client.cc +++ b/chromeos/dbus/power_manager_client.cc @@ -16,7 +16,6 @@ #include "base/timer.h" #include "chromeos/dbus/power_state_control.pb.h" #include "chromeos/dbus/power_supply_properties.pb.h" -#include "chromeos/dbus/video_activity_update.pb.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -226,18 +225,12 @@ class PowerManagerClientImpl : public PowerManagerClient { } virtual void NotifyVideoActivity( - const base::TimeTicks& last_activity_time, - bool is_fullscreen) OVERRIDE { + const base::TimeTicks& last_activity_time) OVERRIDE { dbus::MethodCall method_call( power_manager::kPowerManagerInterface, power_manager::kHandleVideoActivityMethod); dbus::MessageWriter writer(&method_call); - - VideoActivityUpdate protobuf; - protobuf.set_last_activity_time(last_activity_time.ToInternalValue()); - protobuf.set_is_fullscreen(is_fullscreen); - - writer.AppendProtoAsArrayOfBytes(protobuf); + writer.AppendInt64(last_activity_time.ToInternalValue()); power_manager_proxy_->CallMethod( &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, @@ -597,8 +590,7 @@ class PowerManagerClientStubImpl : public PowerManagerClient { virtual void NotifyUserActivity( const base::TimeTicks& last_activity_time) OVERRIDE {} virtual void NotifyVideoActivity( - const base::TimeTicks& last_activity_time, - bool is_fullscreen) OVERRIDE {} + const base::TimeTicks& last_activity_time) OVERRIDE {} virtual void RequestPowerStateOverrides( uint32 request_id, uint32 duration, diff --git a/chromeos/dbus/power_manager_client.h b/chromeos/dbus/power_manager_client.h index 5be8298..e910232 100644 --- a/chromeos/dbus/power_manager_client.h +++ b/chromeos/dbus/power_manager_client.h @@ -156,11 +156,9 @@ class CHROMEOS_EXPORT PowerManagerClient { virtual void NotifyUserActivity( const base::TimeTicks& last_activity_time) = 0; - // Notifies the power manager that a video is currently playing. It also - // includes whether or not the containing window for the video is fullscreen. + // Notifies the power manager that a video is currently playing. virtual void NotifyVideoActivity( - const base::TimeTicks& last_activity_time, - bool is_fullscreen) = 0; + const base::TimeTicks& last_activity_time) = 0; // Override the current power state on the machine. The overrides will be // applied to the request ID specified. To specify a new request; use 0 as |