Extract SIGPIPE ignoring code to a common place.
[chromium-blink-merge.git] / ppapi / thunk / ppb_messaging_thunk.cc
blobc3f464e107cfcc3c22333fad9061cb2f12428448
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
3 // found in the LICENSE file.
5 #include "ppapi/c/ppb_messaging.h"
6 #include "ppapi/thunk/enter.h"
7 #include "ppapi/thunk/thunk.h"
8 #include "ppapi/thunk/ppb_instance_api.h"
10 namespace ppapi {
11 namespace thunk {
13 namespace {
15 void PostMessage(PP_Instance instance, PP_Var message) {
16 EnterInstance enter(instance);
17 if (enter.succeeded())
18 enter.functions()->PostMessage(instance, message);
21 const PPB_Messaging g_ppb_messaging_thunk = {
22 &PostMessage
25 } // namespace
27 const PPB_Messaging_1_0* GetPPB_Messaging_1_0_Thunk() {
28 return &g_ppb_messaging_thunk;
31 } // namespace thunk
32 } // namespace ppapi