| Index: webkit/plugins/ppapi/npapi_glue.cc
|
| diff --git a/webkit/plugins/ppapi/npapi_glue.cc b/webkit/plugins/ppapi/npapi_glue.cc
|
| index ecc5a41124e000fe6b347329e71ee240c5419c0e..680c1057f50e51d2e327eed63c27132b9452831d 100644
|
| --- a/webkit/plugins/ppapi/npapi_glue.cc
|
| +++ b/webkit/plugins/ppapi/npapi_glue.cc
|
| @@ -95,7 +95,6 @@ PP_Var NPVariantToPPVar(PluginInstance* instance, const NPVariant* variant) {
|
| return PP_MakeDouble(NPVARIANT_TO_DOUBLE(*variant));
|
| case NPVariantType_String:
|
| return StringVar::StringToPPVar(
|
| - instance->module()->pp_module(),
|
| NPVARIANT_TO_STRING(*variant).UTF8Characters,
|
| NPVARIANT_TO_STRING(*variant).UTF8Length);
|
| case NPVariantType_Object:
|
| @@ -120,13 +119,13 @@ NPIdentifier PPVarToNPIdentifier(PP_Var var) {
|
| }
|
| }
|
|
|
| -PP_Var NPIdentifierToPPVar(PP_Module module, NPIdentifier id) {
|
| +PP_Var NPIdentifierToPPVar(NPIdentifier id) {
|
| const NPUTF8* string_value = NULL;
|
| int32_t int_value = 0;
|
| bool is_string = false;
|
| WebBindings::extractIdentifierData(id, string_value, int_value, is_string);
|
| if (is_string)
|
| - return StringVar::StringToPPVar(module, string_value);
|
| + return StringVar::StringToPPVar(string_value);
|
|
|
| return PP_MakeInt32(int_value);
|
| }
|
| @@ -137,8 +136,7 @@ PP_Var NPObjectToPPVar(PluginInstance* instance, NPObject* object) {
|
| HostGlobals::Get()->host_var_tracker()->NPObjectVarForNPObject(
|
| instance->pp_instance(), object));
|
| if (!object_var) { // No object for this module yet, make a new one.
|
| - object_var = new NPObjectVar(instance->module()->pp_module(),
|
| - instance->pp_instance(), object);
|
| + object_var = new NPObjectVar(instance->pp_instance(), object);
|
| }
|
| return object_var->GetPPVar();
|
| }
|
| @@ -262,8 +260,7 @@ NPObjectAccessorWithIdentifier::NPObjectAccessorWithIdentifier(
|
| : object_(PluginObject::FromNPObject(object)),
|
| identifier_(PP_MakeUndefined()) {
|
| if (object_) {
|
| - identifier_ = NPIdentifierToPPVar(
|
| - object_->instance()->module()->pp_module(), identifier);
|
| + identifier_ = NPIdentifierToPPVar(identifier);
|
| if (identifier_.type == PP_VARTYPE_INT32 && !allow_integer_identifier)
|
| identifier_.type = PP_VARTYPE_UNDEFINED; // Mark it invalid.
|
| }
|
| @@ -275,9 +272,8 @@ NPObjectAccessorWithIdentifier::~NPObjectAccessorWithIdentifier() {
|
|
|
| // TryCatch --------------------------------------------------------------------
|
|
|
| -TryCatch::TryCatch(PP_Module module, PP_Var* exception)
|
| - : pp_module_(module),
|
| - has_exception_(exception && exception->type != PP_VARTYPE_UNDEFINED),
|
| +TryCatch::TryCatch(PP_Var* exception)
|
| + : has_exception_(exception && exception->type != PP_VARTYPE_UNDEFINED),
|
| exception_(exception) {
|
| WebBindings::pushExceptionHandler(&TryCatch::Catch, this);
|
| }
|
| @@ -287,31 +283,14 @@ TryCatch::~TryCatch() {
|
| }
|
|
|
| void TryCatch::SetException(const char* message) {
|
| - if (!pp_module_) {
|
| - // Don't have a module to make the string.
|
| - SetInvalidObjectException();
|
| - return;
|
| - }
|
| -
|
| if (!has_exception()) {
|
| has_exception_ = true;
|
| if (exception_) {
|
| - *exception_ = ::ppapi::StringVar::StringToPPVar(pp_module_,
|
| - message, strlen(message));
|
| + *exception_ = ::ppapi::StringVar::StringToPPVar(message, strlen(message));
|
| }
|
| }
|
| }
|
|
|
| -void TryCatch::SetInvalidObjectException() {
|
| - if (!has_exception()) {
|
| - has_exception_ = true;
|
| - // TODO(brettw) bug 54504: Have a global singleton string that can hold
|
| - // a generic error message.
|
| - if (exception_)
|
| - *exception_ = PP_MakeInt32(1);
|
| - }
|
| -}
|
| -
|
| // static
|
| void TryCatch::Catch(void* self, const char* message) {
|
| static_cast<TryCatch*>(self)->SetException(message);
|
|
|