Extract SIGPIPE ignoring code to a common place.
[chromium-blink-merge.git] / ppapi / thunk / ppb_mouse_cursor_thunk.cc
blob1bf9f42a72950c3d41ce30edbb51d001dc198cbd
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_mouse_cursor.h"
6 #include "ppapi/thunk/thunk.h"
7 #include "ppapi/thunk/enter.h"
8 #include "ppapi/thunk/ppb_instance_api.h"
10 namespace ppapi {
11 namespace thunk {
13 namespace {
15 PP_Bool SetCursor(PP_Instance instance,
16 PP_MouseCursor_Type type,
17 PP_Resource image,
18 const PP_Point* hot_spot) {
19 EnterInstance enter(instance);
20 if (enter.failed())
21 return PP_FALSE;
22 return enter.functions()->SetCursor(instance, type, image, hot_spot);
25 const PPB_MouseCursor_1_0 g_ppb_mouse_cursor_thunk = {
26 &SetCursor
29 } // namespace
31 const PPB_MouseCursor_1_0* GetPPB_MouseCursor_1_0_Thunk() {
32 return &g_ppb_mouse_cursor_thunk;
35 } // namespace thunk
36 } // namespace ppapi