• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 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 
5 #include "ppapi/cpp/private/isolated_file_system_private.h"
6 
7 #include "ppapi/cpp/module_impl.h"
8 
9 namespace pp {
10 
11 namespace {
12 
interface_name()13 template <> const char* interface_name<PPB_IsolatedFileSystem_Private_0_2>() {
14   return PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_2;
15 }
16 
17 }  // namespace
18 
IsolatedFileSystemPrivate()19 IsolatedFileSystemPrivate::IsolatedFileSystemPrivate()
20     : instance_(0), type_(PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID) {
21 }
22 
IsolatedFileSystemPrivate(const InstanceHandle & instance,PP_IsolatedFileSystemType_Private type)23 IsolatedFileSystemPrivate::IsolatedFileSystemPrivate(
24     const InstanceHandle& instance,
25     PP_IsolatedFileSystemType_Private type)
26     : instance_(instance.pp_instance()), type_(type) {
27 }
28 
~IsolatedFileSystemPrivate()29 IsolatedFileSystemPrivate::~IsolatedFileSystemPrivate() {
30 }
31 
Open(const CompletionCallbackWithOutput<pp::FileSystem> & cc)32 int32_t IsolatedFileSystemPrivate::Open(
33     const CompletionCallbackWithOutput<pp::FileSystem>& cc) {
34   if (!has_interface<PPB_IsolatedFileSystem_Private_0_2>())
35     return cc.MayForce(PP_ERROR_NOINTERFACE);
36   return get_interface<PPB_IsolatedFileSystem_Private_0_2>()->
37       Open(instance_, type_, cc.output(), cc.pp_completion_callback());
38 }
39 
40 }  // namespace pp
41