OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/plugin/plugin.h" | 5 #include "components/nacl/renderer/plugin/plugin.h" |
6 | 6 |
7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 wrapper_factory_ = new nacl::DescWrapperFactory(); | 133 wrapper_factory_ = new nacl::DescWrapperFactory(); |
134 pp::CompletionCallback open_cb = | 134 pp::CompletionCallback open_cb = |
135 callback_factory_.NewCallback(&Plugin::NaClManifestFileDidOpen); | 135 callback_factory_.NewCallback(&Plugin::NaClManifestFileDidOpen); |
136 nacl_interface_->RequestNaClManifest(pp_instance(), | 136 nacl_interface_->RequestNaClManifest(pp_instance(), |
137 open_cb.pp_completion_callback()); | 137 open_cb.pp_completion_callback()); |
138 return true; | 138 return true; |
139 } | 139 } |
140 | 140 |
141 Plugin::Plugin(PP_Instance pp_instance) | 141 Plugin::Plugin(PP_Instance pp_instance) |
142 : pp::Instance(pp_instance), | 142 : pp::Instance(pp_instance), |
143 main_subprocess_("main subprocess", NULL, NULL), | 143 main_subprocess_("main subprocess", NULL), |
144 uses_nonsfi_mode_(false), | 144 uses_nonsfi_mode_(false), |
145 wrapper_factory_(NULL), | 145 wrapper_factory_(NULL), |
146 nacl_interface_(NULL), | 146 nacl_interface_(NULL), |
147 uma_interface_(this) { | 147 uma_interface_(this) { |
148 callback_factory_.Initialize(this); | 148 callback_factory_.Initialize(this); |
149 nacl_interface_ = GetNaClInterface(); | 149 nacl_interface_ = GetNaClInterface(); |
150 CHECK(nacl_interface_ != NULL); | 150 CHECK(nacl_interface_ != NULL); |
151 | 151 |
152 // Notify PPB_NaCl_Private that the instance is created before altering any | 152 // Notify PPB_NaCl_Private that the instance is created before altering any |
153 // state that it tracks. | 153 // state that it tracks. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 void Plugin::ReportLoadError(const ErrorInfo& error_info) { | 267 void Plugin::ReportLoadError(const ErrorInfo& error_info) { |
268 nacl_interface_->ReportLoadError(pp_instance(), | 268 nacl_interface_->ReportLoadError(pp_instance(), |
269 error_info.error_code(), | 269 error_info.error_code(), |
270 error_info.message().c_str()); | 270 error_info.message().c_str()); |
271 } | 271 } |
272 | 272 |
273 } // namespace plugin | 273 } // namespace plugin |
OLD | NEW |