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

Side by Side Diff: ppapi/cpp/dev/file_system_dev.cc

Issue 7387011: Clean up the file dev interfaces. The combination of some dev and some non (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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/dev/file_system_dev.h"
6
7 #include "ppapi/c/dev/ppb_file_system_dev.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/cpp/completion_callback.h"
10 #include "ppapi/cpp/dev/file_ref_dev.h"
11 #include "ppapi/cpp/module.h"
12 #include "ppapi/cpp/module_impl.h"
13
14 namespace pp {
15
16 namespace {
17
18 template <> const char* interface_name<PPB_FileSystem_Dev>() {
19 return PPB_FILESYSTEM_DEV_INTERFACE;
20 }
21
22 } // namespace
23
24 FileSystem_Dev::FileSystem_Dev(Instance* instance,
25 PP_FileSystemType_Dev type) {
26 if (!has_interface<PPB_FileSystem_Dev>())
27 return;
28 PassRefFromConstructor(get_interface<PPB_FileSystem_Dev>()->Create(
29 instance->pp_instance(), type));
30 }
31
32 int32_t FileSystem_Dev::Open(int64_t expected_size,
33 const CompletionCallback& cc) {
34 if (!has_interface<PPB_FileSystem_Dev>())
35 return cc.MayForce(PP_ERROR_NOINTERFACE);
36 return get_interface<PPB_FileSystem_Dev>()->Open(
37 pp_resource(), expected_size, cc.pp_completion_callback());
38 }
39
40 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698