| 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 "content/browser/renderer_host/pepper/pepper_message_filter.h" | 5 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/browser/renderer_host/pepper/pepper_socket_utils.h" | 8 #include "content/browser/renderer_host/pepper/pepper_socket_utils.h" |
| 9 #include "content/public/common/content_client.h" | 9 #include "content/public/common/content_client.h" |
| 10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 PepperMessageFilter::PepperMessageFilter() | 14 PepperMessageFilter::PepperMessageFilter() |
| 15 : BrowserMessageFilter(PpapiMsgStart) {} | 15 : BrowserMessageFilter(PpapiMsgStart) {} |
| 16 | 16 |
| 17 PepperMessageFilter::~PepperMessageFilter() {} | 17 PepperMessageFilter::~PepperMessageFilter() {} |
| 18 | 18 |
| 19 bool PepperMessageFilter::OnMessageReceived(const IPC::Message& msg, | 19 bool PepperMessageFilter::OnMessageReceived(const IPC::Message& msg) { |
| 20 bool* message_was_ok) { | |
| 21 bool handled = true; | 20 bool handled = true; |
| 22 IPC_BEGIN_MESSAGE_MAP_EX(PepperMessageFilter, msg, *message_was_ok) | 21 IPC_BEGIN_MESSAGE_MAP(PepperMessageFilter, msg) |
| 23 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBX509Certificate_ParseDER, | 22 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBX509Certificate_ParseDER, |
| 24 OnX509CertificateParseDER) | 23 OnX509CertificateParseDER) |
| 25 IPC_MESSAGE_UNHANDLED(handled = false) | 24 IPC_MESSAGE_UNHANDLED(handled = false) |
| 26 IPC_END_MESSAGE_MAP_EX() | 25 IPC_END_MESSAGE_MAP() |
| 27 return handled; | 26 return handled; |
| 28 } | 27 } |
| 29 | 28 |
| 30 void PepperMessageFilter::OnX509CertificateParseDER( | 29 void PepperMessageFilter::OnX509CertificateParseDER( |
| 31 const std::vector<char>& der, | 30 const std::vector<char>& der, |
| 32 bool* succeeded, | 31 bool* succeeded, |
| 33 ppapi::PPB_X509Certificate_Fields* result) { | 32 ppapi::PPB_X509Certificate_Fields* result) { |
| 34 *succeeded = (der.size() != 0 && pepper_socket_utils::GetCertificateFields( | 33 *succeeded = (der.size() != 0 && pepper_socket_utils::GetCertificateFields( |
| 35 &der[0], der.size(), result)); | 34 &der[0], der.size(), result)); |
| 36 } | 35 } |
| 37 | 36 |
| 38 } // namespace content | 37 } // namespace content |
| OLD | NEW |