| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_PROXY_NACL_MESSAGE_SCANNER_H_ | 5 #ifndef PPAPI_PROXY_NACL_MESSAGE_SCANNER_H_ |
| 6 #define PPAPI_PROXY_NACL_MESSAGE_SCANNER_H_ | 6 #define PPAPI_PROXY_NACL_MESSAGE_SCANNER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
| 17 #include "ppapi/proxy/ppapi_proxy_export.h" | 17 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 18 | 18 |
| 19 namespace IPC { | 19 namespace IPC { |
| 20 class Message; | 20 class Message; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace ppapi { | 23 namespace ppapi { |
| 24 namespace proxy { | 24 namespace proxy { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 40 // a reply to a synchronous message, |type| is the id of the original | 40 // a reply to a synchronous message, |type| is the id of the original |
| 41 // message. | 41 // message. |
| 42 // | 42 // |
| 43 // See more explanation in the method definition. | 43 // See more explanation in the method definition. |
| 44 // | 44 // |
| 45 // See chrome/nacl/nacl_ipc_adapter.cc for where this is used to help convert | 45 // See chrome/nacl/nacl_ipc_adapter.cc for where this is used to help convert |
| 46 // native handles to NaClDescs. | 46 // native handles to NaClDescs. |
| 47 bool ScanMessage(const IPC::Message& msg, | 47 bool ScanMessage(const IPC::Message& msg, |
| 48 uint32_t type, | 48 uint32_t type, |
| 49 std::vector<SerializedHandle>* handles, | 49 std::vector<SerializedHandle>* handles, |
| 50 scoped_ptr<IPC::Message>* new_msg_ptr); | 50 std::unique_ptr<IPC::Message>* new_msg_ptr); |
| 51 | 51 |
| 52 // Scans an untrusted message for items that require special handling. If the | 52 // Scans an untrusted message for items that require special handling. If the |
| 53 // message had to be rewritten, sets |new_msg_ptr| to the new message. | 53 // message had to be rewritten, sets |new_msg_ptr| to the new message. |
| 54 void ScanUntrustedMessage(const IPC::Message& untrusted_msg, | 54 void ScanUntrustedMessage(const IPC::Message& untrusted_msg, |
| 55 scoped_ptr<IPC::Message>* new_msg_ptr); | 55 std::unique_ptr<IPC::Message>* new_msg_ptr); |
| 56 | 56 |
| 57 // FileSystem information for quota auditing. | 57 // FileSystem information for quota auditing. |
| 58 class PPAPI_PROXY_EXPORT FileSystem { | 58 class PPAPI_PROXY_EXPORT FileSystem { |
| 59 public: | 59 public: |
| 60 FileSystem(); | 60 FileSystem(); |
| 61 ~FileSystem(); | 61 ~FileSystem(); |
| 62 | 62 |
| 63 int64_t reserved_quota() const { return reserved_quota_; } | 63 int64_t reserved_quota() const { return reserved_quota_; } |
| 64 | 64 |
| 65 // Adds amount to reserved quota. Returns true if reserved quota >= 0. | 65 // Adds amount to reserved quota. Returns true if reserved quota >= 0. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 typedef std::map<int32_t, FileIO*> FileIOMap; | 118 typedef std::map<int32_t, FileIO*> FileIOMap; |
| 119 FileIOMap files_; | 119 FileIOMap files_; |
| 120 | 120 |
| 121 DISALLOW_COPY_AND_ASSIGN(NaClMessageScanner); | 121 DISALLOW_COPY_AND_ASSIGN(NaClMessageScanner); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace proxy | 124 } // namespace proxy |
| 125 } // namespace ppapi | 125 } // namespace ppapi |
| 126 | 126 |
| 127 #endif // PPAPI_PROXY_NACL_MESSAGE_SCANNER_H_ | 127 #endif // PPAPI_PROXY_NACL_MESSAGE_SCANNER_H_ |
| OLD | NEW |