Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #define NACL_LOG_MODULE_NAME "Plugin_ServiceRuntime" | 7 #define NACL_LOG_MODULE_NAME "Plugin_ServiceRuntime" |
| 8 | 8 |
| 9 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h" | 9 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h" |
| 10 | 10 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 // OpenManifestEntry() is waiting on a condvar for this continuation to | 169 // OpenManifestEntry() is waiting on a condvar for this continuation to |
| 170 // complete. We Broadcast and awaken OpenManifestEntry() whenever we are done | 170 // complete. We Broadcast and awaken OpenManifestEntry() whenever we are done |
| 171 // either here, or in a later MainThreadContinuation step, if there are | 171 // either here, or in a later MainThreadContinuation step, if there are |
| 172 // multiple steps. | 172 // multiple steps. |
| 173 void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation( | 173 void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation( |
| 174 OpenManifestEntryResource* p, | 174 OpenManifestEntryResource* p, |
| 175 int32_t err) { | 175 int32_t err) { |
| 176 UNREFERENCED_PARAMETER(err); | 176 UNREFERENCED_PARAMETER(err); |
| 177 // CallOnMainThread continuations always called with err == PP_OK. | 177 // CallOnMainThread continuations always called with err == PP_OK. |
| 178 | 178 |
| 179 // This method should only ever be called from the PNaCl translator, as the | |
| 180 // IRT is not available there. | |
| 181 if (service_runtime_->main_service_runtime()) { | |
| 182 NaClLog(LOG_ERROR, | |
|
Mark Seaborn
2014/08/28 21:33:49
Can you make this reject the request, as a securit
teravest
2014/09/04 22:13:30
Sure, I've changed this to reject the request (and
| |
| 183 "OpenManifestEntry should only be used by PNaCl translator.\n"); | |
| 184 } | |
| 185 | |
| 179 NaClLog(4, "Entered OpenManifestEntry_MainThreadContinuation\n"); | 186 NaClLog(4, "Entered OpenManifestEntry_MainThreadContinuation\n"); |
| 180 | 187 |
| 181 // Because p is owned by the callback of this invocation, so it is necessary | 188 // Because p is owned by the callback of this invocation, so it is necessary |
| 182 // to create another instance. | 189 // to create another instance. |
| 183 OpenManifestEntryResource* open_cont = new OpenManifestEntryResource(*p); | 190 OpenManifestEntryResource* open_cont = new OpenManifestEntryResource(*p); |
| 184 pp::CompletionCallback stream_cc = WeakRefNewCallback( | 191 pp::CompletionCallback stream_cc = WeakRefNewCallback( |
| 185 anchor_, | 192 anchor_, |
| 186 this, | 193 this, |
| 187 &PluginReverseInterface::StreamAsFile_MainThreadContinuation, | 194 &PluginReverseInterface::StreamAsFile_MainThreadContinuation, |
| 188 open_cont); | 195 open_cont); |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 577 reverse_service_->Unref(); | 584 reverse_service_->Unref(); |
| 578 | 585 |
| 579 rev_interface_->Unref(); | 586 rev_interface_->Unref(); |
| 580 | 587 |
| 581 anchor_->Unref(); | 588 anchor_->Unref(); |
| 582 NaClCondVarDtor(&cond_); | 589 NaClCondVarDtor(&cond_); |
| 583 NaClMutexDtor(&mu_); | 590 NaClMutexDtor(&mu_); |
| 584 } | 591 } |
| 585 | 592 |
| 586 } // namespace plugin | 593 } // namespace plugin |
| OLD | NEW |