| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/pepper/pepper_video_destination_host.h" | 5 #include "content/renderer/pepper/pepper_video_destination_host.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "content/public/renderer/renderer_ppapi_host.h" | 8 #include "content/public/renderer/renderer_ppapi_host.h" |
| 9 #include "content/renderer/pepper/ppb_image_data_impl.h" | 9 #include "content/renderer/pepper/ppb_image_data_impl.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 PP_Resource resource) | 25 PP_Resource resource) |
| 26 : ResourceHost(host->GetPpapiHost(), instance, resource), | 26 : ResourceHost(host->GetPpapiHost(), instance, resource), |
| 27 renderer_ppapi_host_(host), | 27 renderer_ppapi_host_(host), |
| 28 weak_factory_(this) {} | 28 weak_factory_(this) {} |
| 29 | 29 |
| 30 PepperVideoDestinationHost::~PepperVideoDestinationHost() {} | 30 PepperVideoDestinationHost::~PepperVideoDestinationHost() {} |
| 31 | 31 |
| 32 int32_t PepperVideoDestinationHost::OnResourceMessageReceived( | 32 int32_t PepperVideoDestinationHost::OnResourceMessageReceived( |
| 33 const IPC::Message& msg, | 33 const IPC::Message& msg, |
| 34 HostMessageContext* context) { | 34 HostMessageContext* context) { |
| 35 IPC_BEGIN_MESSAGE_MAP(PepperVideoDestinationHost, msg) | 35 PPAPI_BEGIN_MESSAGE_MAP(PepperVideoDestinationHost, msg) |
| 36 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_VideoDestination_Open, | 36 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_VideoDestination_Open, |
| 37 OnHostMsgOpen) | 37 OnHostMsgOpen) |
| 38 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_VideoDestination_PutFrame, | 38 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_VideoDestination_PutFrame, |
| 39 OnHostMsgPutFrame) | 39 OnHostMsgPutFrame) |
| 40 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_VideoDestination_Close, | 40 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_VideoDestination_Close, |
| 41 OnHostMsgClose) | 41 OnHostMsgClose) |
| 42 IPC_END_MESSAGE_MAP() | 42 PPAPI_END_MESSAGE_MAP() |
| 43 return PP_ERROR_FAILED; | 43 return PP_ERROR_FAILED; |
| 44 } | 44 } |
| 45 | 45 |
| 46 int32_t PepperVideoDestinationHost::OnHostMsgOpen( | 46 int32_t PepperVideoDestinationHost::OnHostMsgOpen( |
| 47 HostMessageContext* context, | 47 HostMessageContext* context, |
| 48 const std::string& stream_url) { | 48 const std::string& stream_url) { |
| 49 GURL gurl(stream_url); | 49 GURL gurl(stream_url); |
| 50 if (!gurl.is_valid()) | 50 if (!gurl.is_valid()) |
| 51 return PP_ERROR_BADARGUMENT; | 51 return PP_ERROR_BADARGUMENT; |
| 52 | 52 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return PP_OK; | 92 return PP_OK; |
| 93 } | 93 } |
| 94 | 94 |
| 95 int32_t PepperVideoDestinationHost::OnHostMsgClose( | 95 int32_t PepperVideoDestinationHost::OnHostMsgClose( |
| 96 HostMessageContext* context) { | 96 HostMessageContext* context) { |
| 97 frame_writer_.reset(NULL); | 97 frame_writer_.reset(NULL); |
| 98 return PP_OK; | 98 return PP_OK; |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace content | 101 } // namespace content |
| OLD | NEW |