| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright 2008 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
| 4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * @file | 9 * @file |
| 10 * Defines the basic API for the nacl browser plugin | 10 * Defines the basic API for the nacl browser plugin |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #if defined(EXPIRATION_CHECK) | 48 #if defined(EXPIRATION_CHECK) |
| 49 " and expires on " | 49 " and expires on " |
| 50 EMBED(EXPIRATION_MONTH) "/" | 50 EMBED(EXPIRATION_MONTH) "/" |
| 51 EMBED(EXPIRATION_DAY) "/" | 51 EMBED(EXPIRATION_DAY) "/" |
| 52 EMBED(EXPIRATION_YEAR) | 52 EMBED(EXPIRATION_YEAR) |
| 53 " (mm/dd/yyyy)" | 53 " (mm/dd/yyyy)" |
| 54 #endif | 54 #endif |
| 55 ""; | 55 ""; |
| 56 | 56 |
| 57 char* NPP_GetMIMEDescription() { | 57 char* NPP_GetMIMEDescription() { |
| 58 return const_cast<char*>("application/x-nacl-srpc:nexe:NativeClient" | 58 return const_cast<char*>("application/x-nacl:nexe:NativeClient" |
| 59 " Simple RPC module;"); | 59 " Simple RPC module;"); |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Invoked from NP_Initialize() | 62 // Invoked from NP_Initialize() |
| 63 NPError NPP_Initialize() { | 63 NPError NPP_Initialize() { |
| 64 PLUGIN_PRINTF(("NPP_Initialize\n")); | 64 PLUGIN_PRINTF(("NPP_Initialize\n")); |
| 65 NaClNrdAllModulesInit(); | 65 NaClNrdAllModulesInit(); |
| 66 return NPERR_NO_ERROR; | 66 return NPERR_NO_ERROR; |
| 67 } | 67 } |
| 68 | 68 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 83 UNREFERENCED_PARAMETER(saved); | 83 UNREFERENCED_PARAMETER(saved); |
| 84 PLUGIN_PRINTF(("NPP_New '%s'\n", plugin_type)); | 84 PLUGIN_PRINTF(("NPP_New '%s'\n", plugin_type)); |
| 85 | 85 |
| 86 for (int i = 0; i < argc; ++i) { | 86 for (int i = 0; i < argc; ++i) { |
| 87 PLUGIN_PRINTF(("args %u: '%s' '%s'\n", i, argn[i], argv[i])); | 87 PLUGIN_PRINTF(("args %u: '%s' '%s'\n", i, argn[i], argv[i])); |
| 88 } | 88 } |
| 89 | 89 |
| 90 if (npp == NULL) { | 90 if (npp == NULL) { |
| 91 return NPERR_INVALID_INSTANCE_ERROR; | 91 return NPERR_INVALID_INSTANCE_ERROR; |
| 92 } | 92 } |
| 93 if (strcmp(plugin_type, "application/x-nacl-srpc") == 0) { | 93 if (strcmp(plugin_type, "application/x-nacl") == 0) { |
| 94 npp->pdata = static_cast<nacl::NPInstance*>( | 94 npp->pdata = static_cast<nacl::NPInstance*>( |
| 95 plugin::PluginNpapi::New(npp, argc, argn, argv)); | 95 plugin::PluginNpapi::New(npp, argc, argn, argv)); |
| 96 if (npp->pdata == NULL) { | 96 if (npp->pdata == NULL) { |
| 97 return NPERR_OUT_OF_MEMORY_ERROR; | 97 return NPERR_OUT_OF_MEMORY_ERROR; |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 if (npp->pdata == NULL) { | 100 if (npp->pdata == NULL) { |
| 101 return NPERR_OUT_OF_MEMORY_ERROR; | 101 return NPERR_OUT_OF_MEMORY_ERROR; |
| 102 } | 102 } |
| 103 #ifndef NACL_STANDALONE | 103 #ifndef NACL_STANDALONE |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 void* notify_data) { | 235 void* notify_data) { |
| 236 PLUGIN_PRINTF(("NPP_URLNotify(%s)\n", url)); | 236 PLUGIN_PRINTF(("NPP_URLNotify(%s)\n", url)); |
| 237 if (npp == NULL) { | 237 if (npp == NULL) { |
| 238 return; | 238 return; |
| 239 } | 239 } |
| 240 nacl::NPInstance* module = static_cast<nacl::NPInstance*>(npp->pdata); | 240 nacl::NPInstance* module = static_cast<nacl::NPInstance*>(npp->pdata); |
| 241 if (module != NULL) { | 241 if (module != NULL) { |
| 242 module->URLNotify(url, reason, notify_data); | 242 module->URLNotify(url, reason, notify_data); |
| 243 } | 243 } |
| 244 } | 244 } |
| OLD | NEW |