| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2007, 2008, 2009 Google, Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008, 2009 Google, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "bindings/core/v8/npruntime_impl.h" | 38 #include "bindings/core/v8/npruntime_impl.h" |
| 39 #include "bindings/core/v8/npruntime_priv.h" | 39 #include "bindings/core/v8/npruntime_priv.h" |
| 40 #include "core/frame/LocalDOMWindow.h" | 40 #include "core/frame/LocalDOMWindow.h" |
| 41 #include "core/frame/LocalFrame.h" | 41 #include "core/frame/LocalFrame.h" |
| 42 #include "platform/UserGestureIndicator.h" | 42 #include "platform/UserGestureIndicator.h" |
| 43 #include "wtf/OwnPtr.h" | 43 #include "wtf/OwnPtr.h" |
| 44 #include "wtf/StringExtras.h" | 44 #include "wtf/StringExtras.h" |
| 45 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
| 46 #include <stdio.h> | 46 #include <stdio.h> |
| 47 | 47 |
| 48 using namespace WebCore; | 48 using namespace blink; |
| 49 | 49 |
| 50 namespace WebCore { | 50 namespace blink { |
| 51 | 51 |
| 52 const WrapperTypeInfo* npObjectTypeInfo() | 52 const WrapperTypeInfo* npObjectTypeInfo() |
| 53 { | 53 { |
| 54 static const WrapperTypeInfo typeInfo = { gin::kEmbedderBlink, 0, 0, 0, 0, 0
, 0, 0, WrapperTypeObjectPrototype, RefCountedObject }; | 54 static const WrapperTypeInfo typeInfo = { gin::kEmbedderBlink, 0, 0, 0, 0, 0
, 0, 0, WrapperTypeObjectPrototype, RefCountedObject }; |
| 55 return &typeInfo; | 55 return &typeInfo; |
| 56 } | 56 } |
| 57 | 57 |
| 58 // FIXME: Comments on why use malloc and free. | 58 // FIXME: Comments on why use malloc and free. |
| 59 static NPObject* allocV8NPObject(NPP, NPClass*) | 59 static NPObject* allocV8NPObject(NPP, NPClass*) |
| 60 { | 60 { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 if (objects.isEmpty()) | 195 if (objects.isEmpty()) |
| 196 v8NPObjectMap->remove(v8ObjectHash); | 196 v8NPObjectMap->remove(v8ObjectHash); |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 v8NpObject->v8Object.Reset(); | 199 v8NpObject->v8Object.Reset(); |
| 200 v8NpObject->rootObject = 0; | 200 v8NpObject->rootObject = 0; |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace WebCore | 203 } // namespace blink |
| 204 | 204 |
| 205 bool _NPN_Invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPV
ariant* arguments, uint32_t argumentCount, NPVariant* result) | 205 bool _NPN_Invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPV
ariant* arguments, uint32_t argumentCount, NPVariant* result) |
| 206 { | 206 { |
| 207 if (!npObject) | 207 if (!npObject) |
| 208 return false; | 208 return false; |
| 209 | 209 |
| 210 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 210 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 211 | 211 |
| 212 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject); | 212 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject); |
| 213 if (!v8NpObject) { | 213 if (!v8NpObject) { |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 | 594 |
| 595 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate); | 595 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate); |
| 596 return true; | 596 return true; |
| 597 } | 597 } |
| 598 | 598 |
| 599 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class->
construct) | 599 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class->
construct) |
| 600 return npObject->_class->construct(npObject, arguments, argumentCount, r
esult); | 600 return npObject->_class->construct(npObject, arguments, argumentCount, r
esult); |
| 601 | 601 |
| 602 return false; | 602 return false; |
| 603 } | 603 } |
| OLD | NEW |