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) {} | |
16 | |
17 PepperMessageFilter::~PepperMessageFilter() {} | 15 PepperMessageFilter::~PepperMessageFilter() {} |
18 | 16 |
19 bool PepperMessageFilter::OnMessageReceived(const IPC::Message& msg, | 17 bool PepperMessageFilter::OnMessageReceived(const IPC::Message& msg, |
20 bool* message_was_ok) { | 18 bool* message_was_ok) { |
21 bool handled = true; | 19 bool handled = true; |
22 IPC_BEGIN_MESSAGE_MAP_EX(PepperMessageFilter, msg, *message_was_ok) | 20 IPC_BEGIN_MESSAGE_MAP_EX(PepperMessageFilter, msg, *message_was_ok) |
23 // X509 certificate messages. | 21 // X509 certificate messages. |
24 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBX509Certificate_ParseDER, | 22 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBX509Certificate_ParseDER, |
25 OnX509CertificateParseDER); | 23 OnX509CertificateParseDER); |
26 | 24 |
27 IPC_MESSAGE_UNHANDLED(handled = false) | 25 IPC_MESSAGE_UNHANDLED(handled = false) |
28 IPC_END_MESSAGE_MAP_EX() | 26 IPC_END_MESSAGE_MAP_EX() |
29 return handled; | 27 return handled; |
30 } | 28 } |
31 | 29 |
32 void PepperMessageFilter::OnX509CertificateParseDER( | 30 void PepperMessageFilter::OnX509CertificateParseDER( |
33 const std::vector<char>& der, | 31 const std::vector<char>& der, |
34 bool* succeeded, | 32 bool* succeeded, |
35 ppapi::PPB_X509Certificate_Fields* result) { | 33 ppapi::PPB_X509Certificate_Fields* result) { |
36 *succeeded = (der.size() != 0 && pepper_socket_utils::GetCertificateFields( | 34 *succeeded = (der.size() != 0 && pepper_socket_utils::GetCertificateFields( |
37 &der[0], der.size(), result)); | 35 &der[0], der.size(), result)); |
38 } | 36 } |
39 | 37 |
40 } // namespace content | 38 } // namespace content |
OLD | NEW |