diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 19:09:28 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 19:09:28 +0000 |
commit | 3ab20f3c57298ee24e15ec802b7e4b2e33598ca0 (patch) | |
tree | a10aa65bd80c00b2422f2ed94576677f1b5d2909 /chrome/common/render_messages.h | |
parent | 5e6aacc34dd3f8e9b6483e897fb7da1cf582edcd (diff) | |
download | chromium_src-3ab20f3c57298ee24e15ec802b7e4b2e33598ca0.zip chromium_src-3ab20f3c57298ee24e15ec802b7e4b2e33598ca0.tar.gz chromium_src-3ab20f3c57298ee24e15ec802b7e4b2e33598ca0.tar.bz2 |
AudioRendererHost send ViewMsg_AudioStreamState
AudioRendererHost should use ViewMsg_AudioStreamState to
notify renderer of its state instead of AudioOutputStream::State.
The enum of AudioOutputStream::State is not used anywhere, thus
removed.
TEST=unit_tests --gtest_filter=Audio*
Review URL: http://codereview.chromium.org/165255
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23061 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/render_messages.h')
-rw-r--r-- | chrome/common/render_messages.h | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index af9ded8..63d91c0 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -82,6 +82,20 @@ struct ViewMsg_Navigate_Params { base::Time request_time; }; +// Current status of the audio output stream in the browser process. Browser +// sends information about the current playback state and error to the +// renderer process using this type. +struct ViewMsg_AudioStreamState { + enum State { + kPlaying, + kPaused, + kError + }; + + // Carries the current playback state. + State state; +}; + // Parameters structure for ViewHostMsg_FrameNavigate, which has too many data // parameters to be reasonably put in a predefined IPC message. struct ViewHostMsg_FrameNavigate_Params { @@ -1805,44 +1819,34 @@ struct ParamTraits<gfx::NativeView> { #endif // defined(OS_POSIX) template <> -struct ParamTraits<AudioOutputStream::State> { - typedef AudioOutputStream::State param_type; +struct ParamTraits<ViewMsg_AudioStreamState> { + typedef ViewMsg_AudioStreamState param_type; static void Write(Message* m, const param_type& p) { - m->WriteInt(p); + m->WriteInt(p.state); } static bool Read(const Message* m, void** iter, param_type* p) { int type; if (!m->ReadInt(iter, &type)) return false; - *p = static_cast<AudioOutputStream::State>(type); + p->state = static_cast<ViewMsg_AudioStreamState::State>(type); return true; } static void Log(const param_type& p, std::wstring* l) { std::wstring state; - switch (p) { - case AudioOutputStream::STATE_CREATED: - state = L"AudioOutputStream::STATE_CREATED"; - break; - case AudioOutputStream::STATE_STARTED: - state = L"AudioOutputStream::STATE_STARTED"; - break; - case AudioOutputStream::STATE_PAUSED: - state = L"AudioOutputStream::STATE_PAUSED"; + switch (p.state) { + case ViewMsg_AudioStreamState::kPlaying: + state = L"ViewMsg_AudioStreamState::kPlaying"; break; - case AudioOutputStream::STATE_STOPPED: - state = L"AudioOutputStream::STATE_STOPPED"; + case ViewMsg_AudioStreamState::kPaused: + state = L"ViewMsg_AudioStreamState::kPaused"; break; - case AudioOutputStream::STATE_CLOSED: - state = L"AudioOutputStream::STATE_CLOSED"; - break; - case AudioOutputStream::STATE_ERROR: - state = L"AudioOutputStream::STATE_ERROR"; + case ViewMsg_AudioStreamState::kError: + state = L"ViewMsg_AudioStreamState::kError"; break; default: state = L"UNKNOWN"; break; } - LogParam(state, l); } }; |