OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ | 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ |
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ | 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "native_client/src/include/nacl_macros.h" | 11 #include "native_client/src/include/nacl_macros.h" |
12 #include "native_client/src/include/nacl_string.h" | 12 #include "native_client/src/include/nacl_string.h" |
13 #include "native_client/src/shared/srpc/nacl_srpc.h" | 13 #include "native_client/src/shared/srpc/nacl_srpc.h" |
14 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 14 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
15 #include "native_client/src/trusted/plugin/delayed_callback.h" | 15 #include "native_client/src/trusted/plugin/delayed_callback.h" |
| 16 #include "native_client/src/trusted/plugin/nexe_arch.h" |
16 #include "native_client/src/trusted/plugin/plugin_error.h" | 17 #include "native_client/src/trusted/plugin/plugin_error.h" |
17 #include "ppapi/utility/completion_callback_factory.h" | 18 #include "ppapi/utility/completion_callback_factory.h" |
18 | 19 |
19 namespace plugin { | 20 namespace plugin { |
20 | 21 |
21 class Manifest; | 22 class Manifest; |
22 class Plugin; | 23 class Plugin; |
23 class PnaclCoordinator; | 24 class PnaclCoordinator; |
24 | 25 |
| 26 class PnaclUrls { |
| 27 public: |
| 28 static nacl::string GetExtensionUrl() { |
| 29 return nacl::string(kExtensionOrigin) + GetSandboxISA() + "/"; |
| 30 } |
| 31 static const nacl::string GetLlcUrl() { return nacl::string(kLlcUrl); } |
| 32 static const nacl::string GetLdUrl() { return nacl::string(kLdUrl); } |
| 33 private: |
| 34 static const char kExtensionOrigin[]; |
| 35 static const char kLlcUrl[]; |
| 36 static const char kLdUrl[]; |
| 37 }; |
25 | 38 |
26 // Loads a list of remote resources, providing a way to get file descriptors for | 39 // Loads a list of remote resources, providing a way to get file descriptors for |
27 // thse resources. All URLs in relative to resource_base_url_. | 40 // thse resources. All URLs in relative to resource_base_url_. |
28 class PnaclResources { | 41 class PnaclResources { |
29 public: | 42 public: |
30 PnaclResources(Plugin* plugin, | 43 PnaclResources(Plugin* plugin, |
31 PnaclCoordinator* coordinator, | 44 PnaclCoordinator* coordinator, |
32 const Manifest* manifest, | 45 const Manifest* manifest, |
33 const std::vector<nacl::string>& resource_urls, | 46 const std::vector<nacl::string>& resource_urls, |
34 const pp::CompletionCallback& all_loaded_callback) | 47 const pp::CompletionCallback& all_loaded_callback) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // Because we may be loading multiple resources, we need a callback that | 87 // Because we may be loading multiple resources, we need a callback that |
75 // is invoked each time a resource arrives, and finally invokes | 88 // is invoked each time a resource arrives, and finally invokes |
76 // all_loaded_callback_ when done. | 89 // all_loaded_callback_ when done. |
77 nacl::scoped_ptr<DelayedCallback> delayed_callback_; | 90 nacl::scoped_ptr<DelayedCallback> delayed_callback_; |
78 // Factory for ready callbacks, etc. | 91 // Factory for ready callbacks, etc. |
79 pp::CompletionCallbackFactory<PnaclResources> callback_factory_; | 92 pp::CompletionCallbackFactory<PnaclResources> callback_factory_; |
80 }; | 93 }; |
81 | 94 |
82 } // namespace plugin; | 95 } // namespace plugin; |
83 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ | 96 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ |
OLD | NEW |