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

Side by Side Diff: ppapi/thunk/ppb_file_system_thunk.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export AssertLockHeld Created 8 years, 6 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
« no previous file with comments | « ppapi/thunk/ppb_file_system_api.h ('k') | ppapi/thunk/ppb_flash_menu_api.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/c/pp_completion_callback.h" 5 #include "ppapi/c/pp_completion_callback.h"
6 #include "ppapi/c/pp_errors.h" 6 #include "ppapi/c/pp_errors.h"
7 #include "ppapi/c/ppb_file_system.h" 7 #include "ppapi/c/ppb_file_system.h"
8 #include "ppapi/shared_impl/tracked_callback.h"
8 #include "ppapi/thunk/enter.h" 9 #include "ppapi/thunk/enter.h"
9 #include "ppapi/thunk/thunk.h" 10 #include "ppapi/thunk/thunk.h"
10 #include "ppapi/thunk/ppb_file_system_api.h" 11 #include "ppapi/thunk/ppb_file_system_api.h"
11 #include "ppapi/thunk/resource_creation_api.h" 12 #include "ppapi/thunk/resource_creation_api.h"
12 13
13 namespace ppapi { 14 namespace ppapi {
14 namespace thunk { 15 namespace thunk {
15 16
16 namespace { 17 namespace {
17 18
(...skipping 10 matching lines...) Expand all
28 EnterFileSystem enter(resource, false); 29 EnterFileSystem enter(resource, false);
29 return PP_FromBool(enter.succeeded()); 30 return PP_FromBool(enter.succeeded());
30 } 31 }
31 32
32 int32_t Open(PP_Resource file_system, 33 int32_t Open(PP_Resource file_system,
33 int64 expected_size, 34 int64 expected_size,
34 PP_CompletionCallback callback) { 35 PP_CompletionCallback callback) {
35 EnterFileSystem enter(file_system, callback, true); 36 EnterFileSystem enter(file_system, callback, true);
36 if (enter.failed()) 37 if (enter.failed())
37 return enter.retval(); 38 return enter.retval();
38 return enter.SetResult(enter.object()->Open(expected_size, callback)); 39 return enter.SetResult(enter.object()->Open(expected_size, enter.callback()));
39 } 40 }
40 41
41 PP_FileSystemType GetType(PP_Resource file_system) { 42 PP_FileSystemType GetType(PP_Resource file_system) {
42 EnterFileSystem enter(file_system, true); 43 EnterFileSystem enter(file_system, true);
43 if (enter.failed()) 44 if (enter.failed())
44 return PP_FILESYSTEMTYPE_INVALID; 45 return PP_FILESYSTEMTYPE_INVALID;
45 return enter.object()->GetType(); 46 return enter.object()->GetType();
46 } 47 }
47 48
48 const PPB_FileSystem g_ppb_file_system_thunk = { 49 const PPB_FileSystem g_ppb_file_system_thunk = {
49 &Create, 50 &Create,
50 &IsFileSystem, 51 &IsFileSystem,
51 &Open, 52 &Open,
52 &GetType 53 &GetType
53 }; 54 };
54 55
55 } // namespace 56 } // namespace
56 57
57 const PPB_FileSystem_1_0* GetPPB_FileSystem_1_0_Thunk() { 58 const PPB_FileSystem_1_0* GetPPB_FileSystem_1_0_Thunk() {
58 return &g_ppb_file_system_thunk; 59 return &g_ppb_file_system_thunk;
59 } 60 }
60 61
61 } // namespace thunk 62 } // namespace thunk
62 } // namespace ppapi 63 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_file_system_api.h ('k') | ppapi/thunk/ppb_flash_menu_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698