| Index: extensions/browser/api/cast_channel/cast_channel_api.cc
|
| diff --git a/extensions/browser/api/cast_channel/cast_channel_api.cc b/extensions/browser/api/cast_channel/cast_channel_api.cc
|
| index e992a49a16ba57cf2ad7243c006b840ea9c86681..6860070f3180abe9750c8388c938e4c00c4524b1 100644
|
| --- a/extensions/browser/api/cast_channel/cast_channel_api.cc
|
| +++ b/extensions/browser/api/cast_channel/cast_channel_api.cc
|
| @@ -453,4 +453,35 @@ void CastChannelCloseFunction::OnClose(int result) {
|
| AsyncWorkCompleted();
|
| }
|
|
|
| +CastChannelGetLogsFunction::CastChannelGetLogsFunction() {
|
| +}
|
| +
|
| +CastChannelGetLogsFunction::~CastChannelGetLogsFunction() {
|
| +}
|
| +
|
| +bool CastChannelGetLogsFunction::PrePrepare() {
|
| + api_ = CastChannelAPI::Get(browser_context());
|
| + return CastChannelAsyncApiFunction::PrePrepare();
|
| +}
|
| +
|
| +bool CastChannelGetLogsFunction::Prepare() {
|
| + return true;
|
| +}
|
| +
|
| +void CastChannelGetLogsFunction::AsyncWorkStart() {
|
| + DCHECK(api_);
|
| +
|
| + int length = 0;
|
| + scoped_ptr<char[]> out = api_->GetLogger()->GetLogs(&length);
|
| + if (out.get()) {
|
| + SetResult(new base::BinaryValue(out.Pass(), length));
|
| + } else {
|
| + SetError("Unable to get logs.");
|
| + }
|
| +
|
| + api_->GetLogger()->Reset();
|
| +
|
| + AsyncWorkCompleted();
|
| +}
|
| +
|
| } // namespace extensions
|
|
|