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 #include "components/nacl/renderer/ppb_nacl_private_impl.h" | 5 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
6 | 6 |
7 #include <numeric> | 7 #include <numeric> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // Thin adapter from PPP_ManifestService to ManifestServiceChannel::Delegate. | 158 // Thin adapter from PPP_ManifestService to ManifestServiceChannel::Delegate. |
159 // Note that user_data is managed by the caller of LaunchSelLdr. Please see | 159 // Note that user_data is managed by the caller of LaunchSelLdr. Please see |
160 // also PP_ManifestService's comment for more details about resource | 160 // also PP_ManifestService's comment for more details about resource |
161 // management. | 161 // management. |
162 class ManifestServiceProxy : public ManifestServiceChannel::Delegate { | 162 class ManifestServiceProxy : public ManifestServiceChannel::Delegate { |
163 public: | 163 public: |
164 ManifestServiceProxy(PP_Instance pp_instance) | 164 ManifestServiceProxy(PP_Instance pp_instance) |
165 : pp_instance_(pp_instance) { | 165 : pp_instance_(pp_instance) { |
166 } | 166 } |
167 | 167 |
168 virtual ~ManifestServiceProxy() { } | 168 ~ManifestServiceProxy() override {} |
169 | 169 |
170 virtual void StartupInitializationComplete() override { | 170 void StartupInitializationComplete() override { |
171 if (StartPpapiProxy(pp_instance_) == PP_TRUE) { | 171 if (StartPpapiProxy(pp_instance_) == PP_TRUE) { |
172 JsonManifest* manifest = GetJsonManifest(pp_instance_); | 172 JsonManifest* manifest = GetJsonManifest(pp_instance_); |
173 NexeLoadManager* load_manager = NexeLoadManager::Get(pp_instance_); | 173 NexeLoadManager* load_manager = NexeLoadManager::Get(pp_instance_); |
174 if (load_manager && manifest) { | 174 if (load_manager && manifest) { |
175 std::string full_url; | 175 std::string full_url; |
176 PP_PNaClOptions pnacl_options; | 176 PP_PNaClOptions pnacl_options; |
177 bool uses_nonsfi_mode; | 177 bool uses_nonsfi_mode; |
178 JsonManifest::ErrorInfo error_info; | 178 JsonManifest::ErrorInfo error_info; |
179 if (manifest->GetProgramURL(&full_url, | 179 if (manifest->GetProgramURL(&full_url, |
180 &pnacl_options, | 180 &pnacl_options, |
181 &uses_nonsfi_mode, | 181 &uses_nonsfi_mode, |
182 &error_info)) { | 182 &error_info)) { |
183 int64_t nexe_size = load_manager->nexe_size(); | 183 int64_t nexe_size = load_manager->nexe_size(); |
184 load_manager->ReportLoadSuccess(full_url, nexe_size, nexe_size); | 184 load_manager->ReportLoadSuccess(full_url, nexe_size, nexe_size); |
185 } | 185 } |
186 } | 186 } |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 virtual void OpenResource( | 190 void OpenResource( |
191 const std::string& key, | 191 const std::string& key, |
192 const ManifestServiceChannel::OpenResourceCallback& callback) override { | 192 const ManifestServiceChannel::OpenResourceCallback& callback) override { |
193 DCHECK(ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()-> | 193 DCHECK(ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()-> |
194 BelongsToCurrentThread()); | 194 BelongsToCurrentThread()); |
195 | 195 |
196 std::string url; | 196 std::string url; |
197 // TODO(teravest): Clean up pnacl_options logic in JsonManifest so we don't | 197 // TODO(teravest): Clean up pnacl_options logic in JsonManifest so we don't |
198 // have to initialize it like this here. | 198 // have to initialize it like this here. |
199 PP_PNaClOptions pnacl_options; | 199 PP_PNaClOptions pnacl_options; |
200 pnacl_options.translate = PP_FALSE; | 200 pnacl_options.translate = PP_FALSE; |
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1698 &StreamPexe | 1698 &StreamPexe |
1699 }; | 1699 }; |
1700 | 1700 |
1701 } // namespace | 1701 } // namespace |
1702 | 1702 |
1703 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 1703 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
1704 return &nacl_interface; | 1704 return &nacl_interface; |
1705 } | 1705 } |
1706 | 1706 |
1707 } // namespace nacl | 1707 } // namespace nacl |
OLD | NEW |