| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome_frame/np_browser_functions.h" | 5 #include "chrome_frame/np_browser_functions.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace npapi { | 9 namespace npapi { |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 NPN_RemovePropertyProcPtr g_removeproperty = NULL; | 57 NPN_RemovePropertyProcPtr g_removeproperty = NULL; |
| 58 NPN_HasPropertyProcPtr g_hasproperty = NULL; | 58 NPN_HasPropertyProcPtr g_hasproperty = NULL; |
| 59 NPN_HasMethodProcPtr g_hasmethod = NULL; | 59 NPN_HasMethodProcPtr g_hasmethod = NULL; |
| 60 NPN_ReleaseVariantValueProcPtr g_releasevariantvalue = NULL; | 60 NPN_ReleaseVariantValueProcPtr g_releasevariantvalue = NULL; |
| 61 NPN_SetExceptionProcPtr g_setexception = NULL; | 61 NPN_SetExceptionProcPtr g_setexception = NULL; |
| 62 NPN_PushPopupsEnabledStateProcPtr g_pushpopupsenabledstate = NULL; | 62 NPN_PushPopupsEnabledStateProcPtr g_pushpopupsenabledstate = NULL; |
| 63 NPN_PopPopupsEnabledStateProcPtr g_poppopupsenabledstate = NULL; | 63 NPN_PopPopupsEnabledStateProcPtr g_poppopupsenabledstate = NULL; |
| 64 NPN_EnumerateProcPtr g_enumerate = NULL; | 64 NPN_EnumerateProcPtr g_enumerate = NULL; |
| 65 NPN_PluginThreadAsyncCallProcPtr g_pluginthreadasynccall = NULL; | 65 NPN_PluginThreadAsyncCallProcPtr g_pluginthreadasynccall = NULL; |
| 66 NPN_ConstructProcPtr g_construct = NULL; | 66 NPN_ConstructProcPtr g_construct = NULL; |
| 67 NPN_GetValueForURLProcPtr g_getvalueforurl = NULL; | 67 NPN_GetValueForURLPtr g_getvalueforurl = NULL; |
| 68 NPN_SetValueForURLProcPtr g_setvalueforurl = NULL; | 68 NPN_SetValueForURLPtr g_setvalueforurl = NULL; |
| 69 NPN_GetAuthenticationInfoProcPtr g_getauthenticationinfo = NULL; | 69 NPN_GetAuthenticationInfoPtr g_getauthenticationinfo = NULL; |
| 70 | 70 |
| 71 // Must be called prior to calling any of the browser functions below. | 71 // Must be called prior to calling any of the browser functions below. |
| 72 void InitializeBrowserFunctions(NPNetscapeFuncs* functions) { | 72 void InitializeBrowserFunctions(NPNetscapeFuncs* functions) { |
| 73 CHECK(functions); | 73 CHECK(functions); |
| 74 DCHECK(g_geturl == NULL || g_geturl == functions->geturl); | 74 DCHECK(g_geturl == NULL || g_geturl == functions->geturl); |
| 75 | 75 |
| 76 g_version.version = functions->version; | 76 g_version.version = functions->version; |
| 77 | 77 |
| 78 g_geturl = functions->geturl; | 78 g_geturl = functions->geturl; |
| 79 g_posturl = functions->posturl; | 79 g_posturl = functions->posturl; |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 NPUTF8* buffer = reinterpret_cast<NPUTF8*>(npapi::MemAlloc(len + 1)); | 503 NPUTF8* buffer = reinterpret_cast<NPUTF8*>(npapi::MemAlloc(len + 1)); |
| 504 if (buffer) { | 504 if (buffer) { |
| 505 buffer[len] = '\0'; | 505 buffer[len] = '\0'; |
| 506 memcpy(buffer, str.c_str(), len); | 506 memcpy(buffer, str.c_str(), len); |
| 507 STRINGN_TO_NPVARIANT(buffer, len, *var); | 507 STRINGN_TO_NPVARIANT(buffer, len, *var); |
| 508 } else { | 508 } else { |
| 509 NULL_TO_NPVARIANT(*var); | 509 NULL_TO_NPVARIANT(*var); |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 | 512 |
| OLD | NEW |