OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROXY_FILE_MAPPING_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_FILE_MAPPING_RESOURCE_H_ |
6 #define PPAPI_PROXY_FILE_MAPPING_RESOURCE_H_ | 6 #define PPAPI_PROXY_FILE_MAPPING_RESOURCE_H_ |
7 | 7 |
8 #include "ppapi/proxy/file_io_resource.h" | 8 #include "ppapi/proxy/file_io_resource.h" |
9 #include "ppapi/proxy/plugin_resource.h" | 9 #include "ppapi/proxy/plugin_resource.h" |
10 #include "ppapi/proxy/ppapi_proxy_export.h" | 10 #include "ppapi/proxy/ppapi_proxy_export.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void OnMapCompleted(void** mapped_address_out_param, | 50 void OnMapCompleted(void** mapped_address_out_param, |
51 int64_t length, | 51 int64_t length, |
52 scoped_refptr<TrackedCallback> callback, | 52 scoped_refptr<TrackedCallback> callback, |
53 const MapResult& map_result); | 53 const MapResult& map_result); |
54 | 54 |
55 // These functions perform potentially blocking operations so they should not | 55 // These functions perform potentially blocking operations so they should not |
56 // be called on the main thread or while we hold the proxy lock. Their | 56 // be called on the main thread or while we hold the proxy lock. Their |
57 // implementation is platform specific. See file_mapping_resource_posix.cc and | 57 // implementation is platform specific. See file_mapping_resource_posix.cc and |
58 // file_mapping_resource_win.cc. | 58 // file_mapping_resource_win.cc. |
59 static MapResult DoMapBlocking( | 59 static MapResult DoMapBlocking( |
60 scoped_refptr<FileIOResource::FileHandleHolder> handle, | 60 scoped_refptr<FileIOResource::FileHolder> file_holder, |
61 void* address_hint, | 61 void* address_hint, |
62 int64_t length, | 62 int64_t length, |
63 uint32_t protection, | 63 uint32_t protection, |
64 uint32_t flags, | 64 uint32_t flags, |
65 int64_t offset); | 65 int64_t offset); |
66 static int32_t DoUnmapBlocking(const void* address, int64_t length); | 66 static int32_t DoUnmapBlocking(const void* address, int64_t length); |
67 // DoGetMapPageSize is platform-specific, but fast enough that we can call it | 67 // DoGetMapPageSize is platform-specific, but fast enough that we can call it |
68 // on the main thread with the lock. | 68 // on the main thread with the lock. |
69 static int64_t DoGetMapPageSize(); | 69 static int64_t DoGetMapPageSize(); |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(FileMappingResource); | 71 DISALLOW_COPY_AND_ASSIGN(FileMappingResource); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace proxy | 74 } // namespace proxy |
75 } // namespace ppapi | 75 } // namespace ppapi |
76 | 76 |
77 #endif // PPAPI_PROXY_FILE_MAPPING_RESOURCE_H_ | 77 #endif // PPAPI_PROXY_FILE_MAPPING_RESOURCE_H_ |
OLD | NEW |