Pepper_47_C++_interfaces
file_io_private.cc
Go to the documentation of this file.
1 // Copyright (c) 2013 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.
4 
6 
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/private/ppb_file_io_private.h"
9 #include "ppapi/cpp/file_io.h"
10 #include "ppapi/cpp/module_impl.h"
11 
12 namespace pp {
13 
14 namespace {
15 
16 template <> const char* interface_name<PPB_FileIO_Private>() {
17  return PPB_FILEIO_PRIVATE_INTERFACE_0_1;
18 }
19 
20 } // namespace
21 
23  : FileIO() {
24 }
25 
27  : FileIO(instance) {
28 }
29 
32  if (has_interface<PPB_FileIO_Private>())
33  return get_interface<PPB_FileIO_Private>()->RequestOSFileHandle(
34  pp_resource(),
35  cc.output(),
37  return cc.MayForce(PP_ERROR_NOINTERFACE);
38 }
39 
40 } // namespace pp
int32_t RequestOSFileHandle(const CompletionCallbackWithOutput< PassFileHandle > &cc)
The FileIO class represents a regular file.
Definition: file_io.h:23
int32_t MayForce(int32_t result) const
const PP_CompletionCallback & pp_completion_callback() const
PP_Resource pp_resource() const
Definition: resource.h:47