OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/nexe_load_manager.h" | 5 #include "components/nacl/renderer/nexe_load_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
11 #include "components/nacl/common/nacl_host_messages.h" | 11 #include "components/nacl/common/nacl_host_messages.h" |
12 #include "components/nacl/common/nacl_types.h" | 12 #include "components/nacl/common/nacl_types.h" |
| 13 #include "components/nacl/renderer/manifest_service_channel.h" |
13 #include "components/nacl/renderer/pnacl_translation_resource_host.h" | 14 #include "components/nacl/renderer/pnacl_translation_resource_host.h" |
14 #include "components/nacl/renderer/sandbox_arch.h" | 15 #include "components/nacl/renderer/sandbox_arch.h" |
15 #include "components/nacl/renderer/trusted_plugin_channel.h" | 16 #include "components/nacl/renderer/trusted_plugin_channel.h" |
16 #include "content/public/common/content_client.h" | 17 #include "content/public/common/content_client.h" |
17 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
18 #include "content/public/common/sandbox_init.h" | 19 #include "content/public/common/sandbox_init.h" |
19 #include "content/public/renderer/pepper_plugin_instance.h" | 20 #include "content/public/renderer/pepper_plugin_instance.h" |
20 #include "content/public/renderer/render_thread.h" | 21 #include "content/public/renderer/render_thread.h" |
21 #include "content/public/renderer/render_view.h" | 22 #include "content/public/renderer/render_view.h" |
22 #include "content/public/renderer/renderer_ppapi_host.h" | 23 #include "content/public/renderer/renderer_ppapi_host.h" |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 event.total_bytes); | 487 event.total_bytes); |
487 container->element().dispatchEvent(blink_event); | 488 container->element().dispatchEvent(blink_event); |
488 } | 489 } |
489 } | 490 } |
490 | 491 |
491 void NexeLoadManager::set_trusted_plugin_channel( | 492 void NexeLoadManager::set_trusted_plugin_channel( |
492 scoped_ptr<TrustedPluginChannel> channel) { | 493 scoped_ptr<TrustedPluginChannel> channel) { |
493 trusted_plugin_channel_ = channel.Pass(); | 494 trusted_plugin_channel_ = channel.Pass(); |
494 } | 495 } |
495 | 496 |
| 497 void NexeLoadManager::set_manifest_service_channel( |
| 498 scoped_ptr<ManifestServiceChannel> channel) { |
| 499 manifest_service_channel_ = channel.Pass(); |
| 500 } |
| 501 |
496 PP_NaClReadyState NexeLoadManager::nacl_ready_state() { | 502 PP_NaClReadyState NexeLoadManager::nacl_ready_state() { |
497 return nacl_ready_state_; | 503 return nacl_ready_state_; |
498 } | 504 } |
499 | 505 |
500 void NexeLoadManager::set_nacl_ready_state(PP_NaClReadyState ready_state) { | 506 void NexeLoadManager::set_nacl_ready_state(PP_NaClReadyState ready_state) { |
501 nacl_ready_state_ = ready_state; | 507 nacl_ready_state_ = ready_state; |
502 ppapi::ScopedPPVar ready_state_name( | 508 ppapi::ScopedPPVar ready_state_name( |
503 ppapi::ScopedPPVar::PassRef(), | 509 ppapi::ScopedPPVar::PassRef(), |
504 ppapi::StringVar::StringToPPVar("readyState")); | 510 ppapi::StringVar::StringToPPVar("readyState")); |
505 SetReadOnlyProperty(ready_state_name.get(), PP_MakeInt32(ready_state)); | 511 SetReadOnlyProperty(ready_state_name.get(), PP_MakeInt32(ready_state)); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 // to provide error handling. | 567 // to provide error handling. |
562 } | 568 } |
563 | 569 |
564 void NexeLoadManager::CopyCrashLogToJsConsole(const std::string& crash_log) { | 570 void NexeLoadManager::CopyCrashLogToJsConsole(const std::string& crash_log) { |
565 base::StringTokenizer t(crash_log, "\n"); | 571 base::StringTokenizer t(crash_log, "\n"); |
566 while (t.GetNext()) | 572 while (t.GetNext()) |
567 LogToConsole(t.token()); | 573 LogToConsole(t.token()); |
568 } | 574 } |
569 | 575 |
570 } // namespace nacl | 576 } // namespace nacl |
OLD | NEW |