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

Side by Side Diff: ppapi/cpp/private/pass_file_handle.h

Issue 18611004: PPAPI: Initialize CompletionCallbackWithOutput storage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 7 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
« no previous file with comments | « ppapi/cpp/output_traits.h ('k') | ppapi/cpp/private/video_frame_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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef PPAPI_CPP_PRIVATE_PASS_FILE_HANDLE_H_ 5 #ifndef PPAPI_CPP_PRIVATE_PASS_FILE_HANDLE_H_
6 #define PPAPI_CPP_PRIVATE_PASS_FILE_HANDLE_H_ 6 #define PPAPI_CPP_PRIVATE_PASS_FILE_HANDLE_H_
7 7
8 #include <string.h>
9
8 #include "ppapi/c/private/pp_file_handle.h" 10 #include "ppapi/c/private/pp_file_handle.h"
9 #include "ppapi/cpp/output_traits.h" 11 #include "ppapi/cpp/output_traits.h"
10 12
11 namespace pp { 13 namespace pp {
12 14
13 // A wrapper class for PP_FileHandle to make sure a file handle is 15 // A wrapper class for PP_FileHandle to make sure a file handle is
14 // closed. This object takes the ownership of the file handle when it 16 // closed. This object takes the ownership of the file handle when it
15 // is constructed. This loses the ownership when this object is 17 // is constructed. This loses the ownership when this object is
16 // assigned to another object, just like auto_ptr. 18 // assigned to another object, just like auto_ptr.
17 class PassFileHandle { 19 class PassFileHandle {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 typedef PP_FileHandle* APIArgType; 62 typedef PP_FileHandle* APIArgType;
61 typedef PP_FileHandle StorageType; 63 typedef PP_FileHandle StorageType;
62 64
63 static inline APIArgType StorageToAPIArg(StorageType& t) { 65 static inline APIArgType StorageToAPIArg(StorageType& t) {
64 return &t; 66 return &t;
65 } 67 }
66 68
67 static inline PassFileHandle StorageToPluginArg(StorageType& t) { 69 static inline PassFileHandle StorageToPluginArg(StorageType& t) {
68 return PassFileHandle(t); 70 return PassFileHandle(t);
69 } 71 }
72
73 static inline void Initialize(StorageType* t) {
74 memset(t, 0, sizeof(*t));
75 }
70 }; 76 };
71 77
72 } // namespace internal 78 } // namespace internal
73 } // namespace pp 79 } // namespace pp
74 80
75 #endif // PPAPI_CPP_PRIVATE_PASS_FILE_HANDLE_H_ 81 #endif // PPAPI_CPP_PRIVATE_PASS_FILE_HANDLE_H_
OLDNEW
« no previous file with comments | « ppapi/cpp/output_traits.h ('k') | ppapi/cpp/private/video_frame_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698