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 "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h" | 5 #include "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "native_client/src/include/checked_cast.h" | 10 #include "native_client/src/include/checked_cast.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 | 376 |
377 // The component updater's resource throttles + OnDemand update/install | 377 // The component updater's resource throttles + OnDemand update/install |
378 // should block the URL request until the compiler is present. Now we | 378 // should block the URL request until the compiler is present. Now we |
379 // can load the resources (e.g. llc and ld nexes). | 379 // can load the resources (e.g. llc and ld nexes). |
380 resources_.reset(new PnaclResources(plugin_, this)); | 380 resources_.reset(new PnaclResources(plugin_, this)); |
381 CHECK(resources_ != NULL); | 381 CHECK(resources_ != NULL); |
382 | 382 |
383 // The first step of loading resources: read the resource info file. | 383 // The first step of loading resources: read the resource info file. |
384 pp::CompletionCallback resource_info_read_cb = | 384 pp::CompletionCallback resource_info_read_cb = |
385 callback_factory_.NewCallback(&PnaclCoordinator::ResourceInfoWasRead); | 385 callback_factory_.NewCallback(&PnaclCoordinator::ResourceInfoWasRead); |
386 resources_->ReadResourceInfo(PnaclUrls::GetResourceInfoUrl(), | 386 resources_->ReadResourceInfo(resource_info_read_cb); |
387 resource_info_read_cb); | |
388 } | 387 } |
389 | 388 |
390 void PnaclCoordinator::ResourceInfoWasRead(int32_t pp_error) { | 389 void PnaclCoordinator::ResourceInfoWasRead(int32_t pp_error) { |
391 PLUGIN_PRINTF(("PluginCoordinator::ResourceInfoWasRead (pp_error=%" | 390 PLUGIN_PRINTF(("PluginCoordinator::ResourceInfoWasRead (pp_error=%" |
392 NACL_PRId32 ")\n", pp_error)); | 391 NACL_PRId32 ")\n", pp_error)); |
393 // Second step of loading resources: call StartLoad to load pnacl-llc | 392 // Second step of loading resources: call StartLoad to load pnacl-llc |
394 // and pnacl-ld, based on the filenames found in the resource info file. | 393 // and pnacl-ld, based on the filenames found in the resource info file. |
395 pp::CompletionCallback resources_cb = | 394 pp::CompletionCallback resources_cb = |
396 callback_factory_.NewCallback(&PnaclCoordinator::ResourcesDidLoad); | 395 callback_factory_.NewCallback(&PnaclCoordinator::ResourcesDidLoad); |
397 resources_->StartLoad(resources_cb); | 396 resources_->StartLoad(resources_cb); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 invalid_desc_wrapper_.get(), | 619 invalid_desc_wrapper_.get(), |
621 &error_info_, | 620 &error_info_, |
622 resources_.get(), | 621 resources_.get(), |
623 &pnacl_options_, | 622 &pnacl_options_, |
624 architecture_attributes_, | 623 architecture_attributes_, |
625 this, | 624 this, |
626 plugin_); | 625 plugin_); |
627 } | 626 } |
628 | 627 |
629 } // namespace plugin | 628 } // namespace plugin |
OLD | NEW |