1b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved.
2b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// found in the LICENSE file.
4b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
5b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "ppapi/cpp/private/ext_crx_file_system_private.h"
6b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
7b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "ppapi/c/private/ppb_ext_crx_file_system_private.h"
8b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "ppapi/cpp/module_impl.h"
9b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
10b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)namespace pp {
11b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
12b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)namespace {
13b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
14b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)template <> const char* interface_name<PPB_Ext_CrxFileSystem_Private_0_1>() {
15b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  return PPB_EXT_CRXFILESYSTEM_PRIVATE_INTERFACE_0_1;
16b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)}
17b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
18b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)}  // namespace
19b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
20b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)ExtCrxFileSystemPrivate::ExtCrxFileSystemPrivate() {
21b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)}
22b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
23b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)ExtCrxFileSystemPrivate::ExtCrxFileSystemPrivate(
24b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)    const InstanceHandle& instance) : instance_(instance.pp_instance()) {
25b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)}
26b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
27b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)ExtCrxFileSystemPrivate::~ExtCrxFileSystemPrivate() {
28b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)}
29b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
30b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)int32_t ExtCrxFileSystemPrivate::Open(
31b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)    const CompletionCallbackWithOutput<pp::FileSystem>& cc) {
32b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  if (!has_interface<PPB_Ext_CrxFileSystem_Private_0_1>())
33b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)    return cc.MayForce(PP_ERROR_NOINTERFACE);
34b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  return get_interface<PPB_Ext_CrxFileSystem_Private_0_1>()->
35b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)      Open(instance_, cc.output(), cc.pp_completion_callback());
36b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)}
37b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
38b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)}  // namespace pp
39