summaryrefslogtreecommitdiffstats
path: root/content/common/pepper_file_util.cc
blob: 4e5df94d705ce5c4853947c659cefcc0d0f9348d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/common/pepper_file_util.h"
#include "ppapi/shared_impl/platform_file.h"

namespace content {

storage::FileSystemType PepperFileSystemTypeToFileSystemType(
    PP_FileSystemType type) {
  switch (type) {
    case PP_FILESYSTEMTYPE_LOCALTEMPORARY:
      return storage::kFileSystemTypeTemporary;
    case PP_FILESYSTEMTYPE_LOCALPERSISTENT:
      return storage::kFileSystemTypePersistent;
    case PP_FILESYSTEMTYPE_EXTERNAL:
      return storage::kFileSystemTypeExternal;
    default:
      return storage::kFileSystemTypeUnknown;
  }
}

int IntegerFromSyncSocketHandle(
    const base::SyncSocket::Handle& socket_handle) {
  return ppapi::PlatformFileToInt(socket_handle);
}

}  // namespace content