| 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/loader/nonsfi/nonsfi_main.h" | 5 #include "components/nacl/loader/nonsfi/nonsfi_main.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 class PluginMainDelegate : public base::PlatformThread::Delegate { | 25 class PluginMainDelegate : public base::PlatformThread::Delegate { |
| 26 public: | 26 public: |
| 27 explicit PluginMainDelegate(EntryPointType entry_point) | 27 explicit PluginMainDelegate(EntryPointType entry_point) |
| 28 : entry_point_(entry_point) { | 28 : entry_point_(entry_point) { |
| 29 } | 29 } |
| 30 | 30 |
| 31 virtual ~PluginMainDelegate() { | 31 virtual ~PluginMainDelegate() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual void ThreadMain() OVERRIDE { | 34 virtual void ThreadMain() override { |
| 35 base::PlatformThread::SetName("NaClMainThread"); | 35 base::PlatformThread::SetName("NaClMainThread"); |
| 36 | 36 |
| 37 // This will only happen once per process, so we give the permission to | 37 // This will only happen once per process, so we give the permission to |
| 38 // create Singletons. | 38 // create Singletons. |
| 39 base::ThreadRestrictions::SetSingletonAllowed(true); | 39 base::ThreadRestrictions::SetSingletonAllowed(true); |
| 40 uintptr_t info[] = { | 40 uintptr_t info[] = { |
| 41 0, // Do not use fini. | 41 0, // Do not use fini. |
| 42 0, // envc. | 42 0, // envc. |
| 43 0, // argc. | 43 0, // argc. |
| 44 0, // Null terminate for argv. | 44 0, // Null terminate for argv. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 reinterpret_cast<EntryPointType>(image.entry_point()); | 84 reinterpret_cast<EntryPointType>(image.entry_point()); |
| 85 if (!base::PlatformThread::CreateNonJoinable( | 85 if (!base::PlatformThread::CreateNonJoinable( |
| 86 kStackSize, new PluginMainDelegate(entry_point))) { | 86 kStackSize, new PluginMainDelegate(entry_point))) { |
| 87 LOG(ERROR) << "LoadModuleRpc: Failed to create plugin main thread."; | 87 LOG(ERROR) << "LoadModuleRpc: Failed to create plugin main thread."; |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace nonsfi | 92 } // namespace nonsfi |
| 93 } // namespace nacl | 93 } // namespace nacl |
| OLD | NEW |