| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h" | 5 #include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <Windows.h> | 8 #include <Windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 fetcher_ = new DeviceIDFetcher(render_process_id); | 129 fetcher_ = new DeviceIDFetcher(render_process_id); |
| 130 monitor_finder_ = new MonitorFinder(render_process_id, render_frame_id); | 130 monitor_finder_ = new MonitorFinder(render_process_id, render_frame_id); |
| 131 monitor_finder_->GetMonitor(); | 131 monitor_finder_->GetMonitor(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 PepperFlashDRMHost::~PepperFlashDRMHost() {} | 134 PepperFlashDRMHost::~PepperFlashDRMHost() {} |
| 135 | 135 |
| 136 int32_t PepperFlashDRMHost::OnResourceMessageReceived( | 136 int32_t PepperFlashDRMHost::OnResourceMessageReceived( |
| 137 const IPC::Message& msg, | 137 const IPC::Message& msg, |
| 138 ppapi::host::HostMessageContext* context) { | 138 ppapi::host::HostMessageContext* context) { |
| 139 IPC_BEGIN_MESSAGE_MAP(PepperFlashDRMHost, msg) | 139 PPAPI_BEGIN_MESSAGE_MAP(PepperFlashDRMHost, msg) |
| 140 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FlashDRM_GetDeviceID, | 140 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FlashDRM_GetDeviceID, |
| 141 OnHostMsgGetDeviceID) | 141 OnHostMsgGetDeviceID) |
| 142 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FlashDRM_GetHmonitor, | 142 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FlashDRM_GetHmonitor, |
| 143 OnHostMsgGetHmonitor) | 143 OnHostMsgGetHmonitor) |
| 144 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FlashDRM_MonitorIsExternal, | 144 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FlashDRM_MonitorIsExternal, |
| 145 OnHostMsgMonitorIsExternal) | 145 OnHostMsgMonitorIsExternal) |
| 146 IPC_END_MESSAGE_MAP() | 146 PPAPI_END_MESSAGE_MAP() |
| 147 return PP_ERROR_FAILED; | 147 return PP_ERROR_FAILED; |
| 148 } | 148 } |
| 149 | 149 |
| 150 int32_t PepperFlashDRMHost::OnHostMsgGetDeviceID( | 150 int32_t PepperFlashDRMHost::OnHostMsgGetDeviceID( |
| 151 ppapi::host::HostMessageContext* context) { | 151 ppapi::host::HostMessageContext* context) { |
| 152 if (!fetcher_->Start(base::Bind(&PepperFlashDRMHost::GotDeviceID, | 152 if (!fetcher_->Start(base::Bind(&PepperFlashDRMHost::GotDeviceID, |
| 153 weak_factory_.GetWeakPtr(), | 153 weak_factory_.GetWeakPtr(), |
| 154 context->MakeReplyMessageContext()))) { | 154 context->MakeReplyMessageContext()))) { |
| 155 return PP_ERROR_INPROGRESS; | 155 return PP_ERROR_INPROGRESS; |
| 156 } | 156 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 186 if (id.empty() && result == PP_OK) { | 186 if (id.empty() && result == PP_OK) { |
| 187 NOTREACHED(); | 187 NOTREACHED(); |
| 188 result = PP_ERROR_FAILED; | 188 result = PP_ERROR_FAILED; |
| 189 } | 189 } |
| 190 reply_context.params.set_result(result); | 190 reply_context.params.set_result(result); |
| 191 host()->SendReply(reply_context, | 191 host()->SendReply(reply_context, |
| 192 PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id)); | 192 PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace chrome | 195 } // namespace chrome |
| OLD | NEW |