| 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 #ifdef _MSC_VER | 5 #ifdef _MSC_VER |
| 6 // Do not warn about use of std::copy with raw pointers. | 6 // Do not warn about use of std::copy with raw pointers. |
| 7 #pragma warning(disable : 4996) | 7 #pragma warning(disable : 4996) |
| 8 #endif | 8 #endif |
| 9 | 9 |
| 10 #include "ppapi/native_client/src/trusted/plugin/plugin.h" | 10 #include "ppapi/native_client/src/trusted/plugin/plugin.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 28 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
| 29 #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" | 29 #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" |
| 30 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" | 30 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" |
| 31 | 31 |
| 32 #include "ppapi/c/pp_errors.h" | 32 #include "ppapi/c/pp_errors.h" |
| 33 #include "ppapi/c/ppb_console.h" | 33 #include "ppapi/c/ppb_console.h" |
| 34 #include "ppapi/c/ppb_var.h" | 34 #include "ppapi/c/ppb_var.h" |
| 35 #include "ppapi/c/private/ppb_nacl_private.h" | 35 #include "ppapi/c/private/ppb_nacl_private.h" |
| 36 #include "ppapi/cpp/dev/url_util_dev.h" | 36 #include "ppapi/cpp/dev/url_util_dev.h" |
| 37 #include "ppapi/cpp/module.h" | 37 #include "ppapi/cpp/module.h" |
| 38 #include "ppapi/cpp/text_input_controller.h" | |
| 39 | 38 |
| 40 #include "ppapi/native_client/src/trusted/plugin/file_utils.h" | 39 #include "ppapi/native_client/src/trusted/plugin/file_utils.h" |
| 41 #include "ppapi/native_client/src/trusted/plugin/json_manifest.h" | 40 #include "ppapi/native_client/src/trusted/plugin/json_manifest.h" |
| 42 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" | 41 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" |
| 43 #include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h" | 42 #include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h" |
| 44 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" | 43 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" |
| 45 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h" | 44 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h" |
| 46 #include "ppapi/native_client/src/trusted/plugin/utility.h" | 45 #include "ppapi/native_client/src/trusted/plugin/utility.h" |
| 47 | 46 |
| 48 namespace plugin { | 47 namespace plugin { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 78 const int64_t kSizeKBMin = 1; | 77 const int64_t kSizeKBMin = 1; |
| 79 const int64_t kSizeKBMax = 512*1024; // very large .nexe | 78 const int64_t kSizeKBMax = 512*1024; // very large .nexe |
| 80 const uint32_t kSizeKBBuckets = 100; | 79 const uint32_t kSizeKBBuckets = 100; |
| 81 | 80 |
| 82 } // namespace | 81 } // namespace |
| 83 | 82 |
| 84 bool Plugin::EarlyInit(int argc, const char* argn[], const char* argv[]) { | 83 bool Plugin::EarlyInit(int argc, const char* argn[], const char* argv[]) { |
| 85 PLUGIN_PRINTF(("Plugin::EarlyInit (instance=%p)\n", | 84 PLUGIN_PRINTF(("Plugin::EarlyInit (instance=%p)\n", |
| 86 static_cast<void*>(this))); | 85 static_cast<void*>(this))); |
| 87 | 86 |
| 88 #ifdef NACL_OSX | |
| 89 // TODO(kochi): For crbug.com/102808, this is a stopgap solution for Lion | |
| 90 // until we expose IME API to .nexe. This disables any IME interference | |
| 91 // against key inputs, so you cannot use off-the-spot IME input for NaCl apps. | |
| 92 // This makes discrepancy among platforms and therefore we should remove | |
| 93 // this hack when IME API is made available. | |
| 94 // The default for non-Mac platforms is still off-the-spot IME mode. | |
| 95 pp::TextInputController(this).SetTextInputType(PP_TEXTINPUT_TYPE_NONE); | |
| 96 #endif | |
| 97 | |
| 98 for (int i = 0; i < argc; ++i) { | 87 for (int i = 0; i < argc; ++i) { |
| 99 std::string name(argn[i]); | 88 std::string name(argn[i]); |
| 100 std::string value(argv[i]); | 89 std::string value(argv[i]); |
| 101 args_[name] = value; | 90 args_[name] = value; |
| 102 } | 91 } |
| 103 | 92 |
| 104 // Set up the factory used to produce DescWrappers. | 93 // Set up the factory used to produce DescWrappers. |
| 105 wrapper_factory_ = new nacl::DescWrapperFactory(); | 94 wrapper_factory_ = new nacl::DescWrapperFactory(); |
| 106 if (NULL == wrapper_factory_) { | 95 if (NULL == wrapper_factory_) { |
| 107 return false; | 96 return false; |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 | 1090 |
| 1102 void Plugin::SetExitStatusOnMainThread(int32_t pp_error, | 1091 void Plugin::SetExitStatusOnMainThread(int32_t pp_error, |
| 1103 int exit_status) { | 1092 int exit_status) { |
| 1104 DCHECK(pp::Module::Get()->core()->IsMainThread()); | 1093 DCHECK(pp::Module::Get()->core()->IsMainThread()); |
| 1105 DCHECK(nacl_interface_); | 1094 DCHECK(nacl_interface_); |
| 1106 nacl_interface_->SetExitStatus(pp_instance(), exit_status); | 1095 nacl_interface_->SetExitStatus(pp_instance(), exit_status); |
| 1107 } | 1096 } |
| 1108 | 1097 |
| 1109 | 1098 |
| 1110 } // namespace plugin | 1099 } // namespace plugin |
| OLD | NEW |