| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 "PluginReverseInterface::StartupInitializationComplete:" | 98 "PluginReverseInterface::StartupInitializationComplete:" |
| 99 " init_done_cb_ not valid, skipping.\n"); | 99 " init_done_cb_ not valid, skipping.\n"); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 // TODO(bsy): OpenManifestEntry should use the manifest to ResolveKey | 103 // TODO(bsy): OpenManifestEntry should use the manifest to ResolveKey |
| 104 // and invoke StreamAsFile with a completion callback that invokes | 104 // and invoke StreamAsFile with a completion callback that invokes |
| 105 // GetPOSIXFileDesc. | 105 // GetPOSIXFileDesc. |
| 106 bool PluginReverseInterface::OpenManifestEntry(nacl::string url_key, | 106 bool PluginReverseInterface::OpenManifestEntry(nacl::string url_key, |
| 107 struct NaClFileInfo* info) { | 107 struct NaClFileInfo* info) { |
| 108 // This method should only ever be called from the PNaCl translator, as the |
| 109 // IRT is not available there. |
| 110 // TODO(teravest): Remove support for OpenManifestEntry here once |
| 111 // crbug.com/302078 is resolved. |
| 112 if (service_runtime_->main_service_runtime()) { |
| 113 NaClLog(LOG_ERROR, |
| 114 "OpenManifestEntry should only be used by PNaCl translator.\n"); |
| 115 return false; |
| 116 } |
| 117 |
| 108 bool op_complete = false; // NB: mu_ and cv_ also controls access to this! | 118 bool op_complete = false; // NB: mu_ and cv_ also controls access to this! |
| 109 // The to_open object is owned by the weak ref callback. Because this function | 119 // The to_open object is owned by the weak ref callback. Because this function |
| 110 // waits for the callback to finish, the to_open object will be deallocated on | 120 // waits for the callback to finish, the to_open object will be deallocated on |
| 111 // the main thread before this function can return. The pointers it contains | 121 // the main thread before this function can return. The pointers it contains |
| 112 // to stack variables will not leak. | 122 // to stack variables will not leak. |
| 113 OpenManifestEntryResource* to_open = | 123 OpenManifestEntryResource* to_open = |
| 114 new OpenManifestEntryResource(url_key, info, &op_complete); | 124 new OpenManifestEntryResource(url_key, info, &op_complete); |
| 115 CHECK(to_open != NULL); | 125 CHECK(to_open != NULL); |
| 116 NaClLog(4, "PluginReverseInterface::OpenManifestEntry: %s\n", | 126 NaClLog(4, "PluginReverseInterface::OpenManifestEntry: %s\n", |
| 117 url_key.c_str()); | 127 url_key.c_str()); |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 reverse_service_->Unref(); | 569 reverse_service_->Unref(); |
| 560 | 570 |
| 561 rev_interface_->Unref(); | 571 rev_interface_->Unref(); |
| 562 | 572 |
| 563 anchor_->Unref(); | 573 anchor_->Unref(); |
| 564 NaClCondVarDtor(&cond_); | 574 NaClCondVarDtor(&cond_); |
| 565 NaClMutexDtor(&mu_); | 575 NaClMutexDtor(&mu_); |
| 566 } | 576 } |
| 567 | 577 |
| 568 } // namespace plugin | 578 } // namespace plugin |
| OLD | NEW |