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

Side by Side Diff: ppapi/thunk/ppb_directory_reader_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_directory_reader_api.h ('k') | ppapi/thunk/ppb_file_chooser_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/dev/ppb_directory_reader_dev.h" 5 #include "ppapi/c/dev/ppb_directory_reader_dev.h"
6 #include "ppapi/c/pp_completion_callback.h" 6 #include "ppapi/c/pp_completion_callback.h"
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.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_directory_reader_api.h" 11 #include "ppapi/thunk/ppb_directory_reader_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 13 matching lines...) Expand all
31 return PP_FromBool(enter.succeeded()); 32 return PP_FromBool(enter.succeeded());
32 } 33 }
33 34
34 int32_t GetNextEntry(PP_Resource directory_reader, 35 int32_t GetNextEntry(PP_Resource directory_reader,
35 PP_DirectoryEntry_Dev* entry, 36 PP_DirectoryEntry_Dev* entry,
36 PP_CompletionCallback callback) { 37 PP_CompletionCallback callback) {
37 EnterResource<PPB_DirectoryReader_API> enter( 38 EnterResource<PPB_DirectoryReader_API> enter(
38 directory_reader, callback, true); 39 directory_reader, callback, true);
39 if (enter.failed()) 40 if (enter.failed())
40 return enter.retval(); 41 return enter.retval();
41 return enter.SetResult(enter.object()->GetNextEntry(entry, callback)); 42 return enter.SetResult(enter.object()->GetNextEntry(entry, enter.callback()));
42 } 43 }
43 44
44 const PPB_DirectoryReader_Dev g_ppb_directory_reader_thunk = { 45 const PPB_DirectoryReader_Dev g_ppb_directory_reader_thunk = {
45 &Create, 46 &Create,
46 &IsDirectoryReader, 47 &IsDirectoryReader,
47 &GetNextEntry 48 &GetNextEntry
48 }; 49 };
49 50
50 } // namespace 51 } // namespace
51 52
52 const PPB_DirectoryReader_Dev_0_5* GetPPB_DirectoryReader_Dev_0_5_Thunk() { 53 const PPB_DirectoryReader_Dev_0_5* GetPPB_DirectoryReader_Dev_0_5_Thunk() {
53 return &g_ppb_directory_reader_thunk; 54 return &g_ppb_directory_reader_thunk;
54 } 55 }
55 56
56 } // namespace thunk 57 } // namespace thunk
57 } // namespace ppapi 58 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_directory_reader_api.h ('k') | ppapi/thunk/ppb_file_chooser_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698