Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: ppapi/cpp/file_system.cc

Issue 14188019: CRX FileSystem Pepper private API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/cpp/file_system.h ('k') | ppapi/cpp/private/ext_crx_file_system_private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/cpp/file_system.h" 5 #include "ppapi/cpp/file_system.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_file_system.h" 8 #include "ppapi/c/ppb_file_system.h"
9 #include "ppapi/cpp/completion_callback.h" 9 #include "ppapi/cpp/completion_callback.h"
10 #include "ppapi/cpp/file_ref.h" 10 #include "ppapi/cpp/file_ref.h"
11 #include "ppapi/cpp/instance_handle.h" 11 #include "ppapi/cpp/instance_handle.h"
12 #include "ppapi/cpp/module.h" 12 #include "ppapi/cpp/module.h"
13 #include "ppapi/cpp/module_impl.h" 13 #include "ppapi/cpp/module_impl.h"
14 14
15 namespace pp { 15 namespace pp {
16 16
17 namespace { 17 namespace {
18 18
19 template <> const char* interface_name<PPB_FileSystem_1_0>() { 19 template <> const char* interface_name<PPB_FileSystem_1_0>() {
20 return PPB_FILESYSTEM_INTERFACE_1_0; 20 return PPB_FILESYSTEM_INTERFACE_1_0;
21 } 21 }
22 22
23 } // namespace 23 } // namespace
24 24
25 FileSystem::FileSystem() { 25 FileSystem::FileSystem() {
26 } 26 }
27 27
28 FileSystem::FileSystem(PassRef, PP_Resource resource)
29 : Resource(PASS_REF, resource) {
30 }
31
28 FileSystem::FileSystem(const InstanceHandle& instance, 32 FileSystem::FileSystem(const InstanceHandle& instance,
29 PP_FileSystemType type) { 33 PP_FileSystemType type) {
30 if (!has_interface<PPB_FileSystem_1_0>()) 34 if (!has_interface<PPB_FileSystem_1_0>())
31 return; 35 return;
32 PassRefFromConstructor(get_interface<PPB_FileSystem_1_0>()->Create( 36 PassRefFromConstructor(get_interface<PPB_FileSystem_1_0>()->Create(
33 instance.pp_instance(), type)); 37 instance.pp_instance(), type));
34 } 38 }
35 39
36 int32_t FileSystem::Open(int64_t expected_size, 40 int32_t FileSystem::Open(int64_t expected_size,
37 const CompletionCallback& cc) { 41 const CompletionCallback& cc) {
38 if (!has_interface<PPB_FileSystem_1_0>()) 42 if (!has_interface<PPB_FileSystem_1_0>())
39 return cc.MayForce(PP_ERROR_NOINTERFACE); 43 return cc.MayForce(PP_ERROR_NOINTERFACE);
40 return get_interface<PPB_FileSystem_1_0>()->Open( 44 return get_interface<PPB_FileSystem_1_0>()->Open(
41 pp_resource(), expected_size, cc.pp_completion_callback()); 45 pp_resource(), expected_size, cc.pp_completion_callback());
42 } 46 }
43 47
44 } // namespace pp 48 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/file_system.h ('k') | ppapi/cpp/private/ext_crx_file_system_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698