Revert of Use ExtensionRegistryObserver instead of deprecated extension notification...
[chromium-blink-merge.git] / ppapi / cpp / private / isolated_file_system_private.cc
blobf0a20ca60f5d12c1294a14a2db87f9c5e795a9f4
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.
5 #include "ppapi/cpp/private/isolated_file_system_private.h"
7 #include "ppapi/cpp/module_impl.h"
9 namespace pp {
11 namespace {
13 template <> const char* interface_name<PPB_IsolatedFileSystem_Private_0_2>() {
14 return PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_2;
17 } // namespace
19 IsolatedFileSystemPrivate::IsolatedFileSystemPrivate()
20 : instance_(0), type_(PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID) {
23 IsolatedFileSystemPrivate::IsolatedFileSystemPrivate(
24 const InstanceHandle& instance,
25 PP_IsolatedFileSystemType_Private type)
26 : instance_(instance.pp_instance()), type_(type) {
29 IsolatedFileSystemPrivate::~IsolatedFileSystemPrivate() {
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());
40 } // namespace pp