diff options
author | japhet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 18:32:26 +0000 |
---|---|---|
committer | japhet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 18:32:26 +0000 |
commit | 1279ace64f4bdd009ec06528cf6c94e11b48bf69 (patch) | |
tree | 3c6206d29aa75a8b01931a50b4676b43c4281612 | |
parent | e01aba81b9989267f9e25f9acb2a32d071392265 (diff) | |
download | chromium_src-1279ace64f4bdd009ec06528cf6c94e11b48bf69.zip chromium_src-1279ace64f4bdd009ec06528cf6c94e11b48bf69.tar.gz chromium_src-1279ace64f4bdd009ec06528cf6c94e11b48bf69.tar.bz2 |
Delete the v8 npruntime bindings and use the upstreamed ones.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/149357
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20284 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/port/bindings/v8/V8MessagePortCustom.cpp | 0 | ||||
-rw-r--r-- | webkit/port/bindings/v8/npruntime.cpp | 437 | ||||
-rw-r--r-- | webkit/port/bindings/v8/npruntime_impl.h | 43 | ||||
-rw-r--r-- | webkit/port/bindings/v8/npruntime_internal.h | 41 | ||||
-rw-r--r-- | webkit/port/bindings/v8/npruntime_priv.h | 92 | ||||
-rw-r--r-- | webkit/webkit.gyp | 10 |
6 files changed, 5 insertions, 618 deletions
diff --git a/webkit/port/bindings/v8/V8MessagePortCustom.cpp b/webkit/port/bindings/v8/V8MessagePortCustom.cpp deleted file mode 100644 index e69de29..0000000 --- a/webkit/port/bindings/v8/V8MessagePortCustom.cpp +++ /dev/null diff --git a/webkit/port/bindings/v8/npruntime.cpp b/webkit/port/bindings/v8/npruntime.cpp deleted file mode 100644 index 6a2faeb..0000000 --- a/webkit/port/bindings/v8/npruntime.cpp +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2007-2009 Google, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" - -#include "NPV8Object.h" -#include "npruntime_priv.h" -#include "V8NPObject.h" - -#include <wtf/HashMap.h> -#include <wtf/HashSet.h> -#include <wtf/Assertions.h> - -// FIXME: Consider removing locks if we're singlethreaded already. -// The static initializer here should work okay, but we want to avoid -// static initialization in general. -// -// Commenting out the locks to avoid dependencies on chrome for now. -// Need a platform abstraction which we can use. -// static Lock StringIdentifierMapLock; - -namespace { - -// We use StringKey here as the key-type to avoid a string copy to -// construct the map key and for faster comparisons than strcmp. -class StringKey { - public: - explicit StringKey(const char* str) - : m_string(str), m_length(strlen(str)) {} - StringKey() : m_string(0), m_length(0) {} - explicit StringKey(WTF::HashTableDeletedValueType) - : m_string(hashTableDeletedValue()), m_length(0) { } - - StringKey& operator=(const StringKey& other) { - this->m_string = other.m_string; - this->m_length = other.m_length; - return *this; - } - - bool isHashTableDeletedValue() const { - return m_string == hashTableDeletedValue(); - } - - const char* m_string; - size_t m_length; - private: - const char* hashTableDeletedValue() const { - return reinterpret_cast<const char*>(-1); - } -}; - -inline bool operator==(const StringKey& x, const StringKey& y) { - if (x.m_length != y.m_length) { - return false; - } else if (x.m_string == y.m_string) { - return true; - } else { - ASSERT(!x.isHashTableDeletedValue() && !y.isHashTableDeletedValue()); - return memcmp(x.m_string, y.m_string, y.m_length) == 0; - } -} - -// Implement WTF::DefaultHash<StringKey>::Hash interface. -struct StringKeyHash { - static unsigned hash(const StringKey& key) { - // Compute string hash. - unsigned hash = 0; - size_t len = key.m_length; - const char* str = key.m_string; - for (size_t i = 0; i < len; i++) { - char c = str[i]; - hash += c; - hash += (hash << 10); - hash ^= (hash >> 6); - } - hash += (hash << 3); - hash ^= (hash >> 11); - hash += (hash << 15); - if (hash == 0) { - hash = 27; - } - return hash; - } - - static bool equal(const StringKey& x, const StringKey& y) { - return x == y; - } - - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -} // namespace - -// Implement HashTraits<StringKey> -struct StringKeyHashTraits : WTF::GenericHashTraits<StringKey> { - static void constructDeletedValue(StringKey& slot) { - new (&slot) StringKey(WTF::HashTableDeletedValue); - } - static bool isDeletedValue(const StringKey& value) { - return value.isHashTableDeletedValue(); - } -}; - -typedef WTF::HashMap<StringKey, PrivateIdentifier*, \ - StringKeyHash, StringKeyHashTraits> StringIdentifierMap; - -static StringIdentifierMap* getStringIdentifierMap() { - static StringIdentifierMap* stringIdentifierMap = 0; - if (!stringIdentifierMap) - stringIdentifierMap = new StringIdentifierMap(); - return stringIdentifierMap; -} - -// FIXME: Consider removing locks if we're singlethreaded already. -// static Lock IntIdentifierMapLock; - -typedef WTF::HashMap<int, PrivateIdentifier*> IntIdentifierMap; - -static IntIdentifierMap* getIntIdentifierMap() { - static IntIdentifierMap* intIdentifierMap = 0; - if (!intIdentifierMap) - intIdentifierMap = new IntIdentifierMap(); - return intIdentifierMap; -} - -extern "C" { - -NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name) { - ASSERT(name); - - if (name) { - // AutoLock safeLock(StringIdentifierMapLock); - - StringKey key(name); - StringIdentifierMap* identMap = getStringIdentifierMap(); - StringIdentifierMap::iterator iter = identMap->find(key); - if (iter != identMap->end()) - return static_cast<NPIdentifier>(iter->second); - - size_t nameLen = key.m_length; - - // We never release identifiers, so this dictionary will grow. - PrivateIdentifier* identifier = static_cast<PrivateIdentifier*>( - malloc(sizeof(PrivateIdentifier) + nameLen + 1)); - char* nameStorage = reinterpret_cast<char*>(identifier + 1); - memcpy(nameStorage, name, nameLen + 1); - identifier->isString = true; - identifier->value.string = reinterpret_cast<NPUTF8*>(nameStorage); - key.m_string = nameStorage; - identMap->set(key, identifier); - return (NPIdentifier)identifier; - } - - return 0; -} - -void NPN_GetStringIdentifiers(const NPUTF8** names, int32_t nameCount, - NPIdentifier* identifiers) { - ASSERT(names); - ASSERT(identifiers); - - if (names && identifiers) - for (int i = 0; i < nameCount; i++) - identifiers[i] = NPN_GetStringIdentifier(names[i]); -} - -NPIdentifier NPN_GetIntIdentifier(int32_t intid) { - // AutoLock safeLock(IntIdentifierMapLock); - // Special case for -1 and 0, both cannot be used as key in HashMap. - if (intid == 0 || intid == -1) { - static PrivateIdentifier* minusOneOrZeroIds[2]; - PrivateIdentifier* id = minusOneOrZeroIds[intid + 1]; - if (!id) { - id = reinterpret_cast<PrivateIdentifier*>( - malloc(sizeof(PrivateIdentifier))); - id->isString = false; - id->value.number = intid; - minusOneOrZeroIds[intid + 1] = id; - } - return (NPIdentifier)id; - } - - IntIdentifierMap* identMap = getIntIdentifierMap(); - IntIdentifierMap::iterator iter = identMap->find(intid); - if (iter != identMap->end()) - return static_cast<NPIdentifier>(iter->second); - - // We never release identifiers, so this dictionary will grow. - PrivateIdentifier* identifier = reinterpret_cast<PrivateIdentifier*>( - malloc(sizeof(PrivateIdentifier))); - identifier->isString = false; - identifier->value.number = intid; - identMap->set(intid, identifier); - return (NPIdentifier)identifier; -} - -bool NPN_IdentifierIsString(NPIdentifier identifier) { - PrivateIdentifier* i = reinterpret_cast<PrivateIdentifier*>(identifier); - return i->isString; -} - -NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier) { - PrivateIdentifier* i = reinterpret_cast<PrivateIdentifier*>(identifier); - if (!i->isString || !i->value.string) - return NULL; - - return (NPUTF8 *)strdup(i->value.string); -} - -int32_t NPN_IntFromIdentifier(NPIdentifier identifier) { - PrivateIdentifier* i = reinterpret_cast<PrivateIdentifier*>(identifier); - if (i->isString) - return 0; - return i->value.number; -} - -void NPN_ReleaseVariantValue(NPVariant* variant) { - ASSERT(variant); - - if (variant->type == NPVariantType_Object) { - NPN_ReleaseObject(variant->value.objectValue); - variant->value.objectValue = 0; - } else if (variant->type == NPVariantType_String) { - free((void*)variant->value.stringValue.UTF8Characters); - variant->value.stringValue.UTF8Characters = 0; - variant->value.stringValue.UTF8Length = 0; - } - - variant->type = NPVariantType_Void; -} - -NPObject *NPN_CreateObject(NPP npp, NPClass* aClass) { - ASSERT(aClass); - - if (aClass) { - NPObject* obj; - if (aClass->allocate != NULL) - obj = aClass->allocate(npp, aClass); - else - obj = reinterpret_cast<NPObject*>(malloc(sizeof(NPObject))); - - obj->_class = aClass; - obj->referenceCount = 1; - return obj; - } - - return 0; -} - -NPObject* NPN_RetainObject(NPObject* obj) { - ASSERT(obj); - ASSERT(obj->referenceCount > 0); - - if (obj) - obj->referenceCount++; - - return obj; -} - -// _NPN_DeallocateObject actually deletes the object. Technically, -// callers should use NPN_ReleaseObject. Webkit exposes this function -// to kill objects which plugins may not have properly released. -void _NPN_DeallocateObject(NPObject *obj) { - ASSERT(obj); - ASSERT(obj->referenceCount >= 0); - - if (obj) { - // NPObjects that remain in pure C++ may never have wrappers. - // Hence, if it's not already alive, don't unregister it. - // If it is alive, unregister it as the *last* thing we do - // so that it can do as much cleanup as possible on its own. - if (_NPN_IsAlive(obj)) - _NPN_UnregisterObject(obj); - - obj->referenceCount = -1; - if (obj->_class->deallocate) - obj->_class->deallocate(obj); - else - free(obj); - } -} - -void NPN_ReleaseObject(NPObject* obj) { - ASSERT(obj); - ASSERT(obj->referenceCount >= 1); - - if (obj && obj->referenceCount >= 1) { - if (--obj->referenceCount == 0) - _NPN_DeallocateObject(obj); - } -} - -void _NPN_InitializeVariantWithStringCopy(NPVariant* variant, - const NPString* value) { - variant->type = NPVariantType_String; - variant->value.stringValue.UTF8Length = value->UTF8Length; - variant->value.stringValue.UTF8Characters = - reinterpret_cast<NPUTF8*>(malloc(sizeof(NPUTF8) * value->UTF8Length)); - memcpy((void*)variant->value.stringValue.UTF8Characters, - value->UTF8Characters, - sizeof(NPUTF8) * value->UTF8Length); -} - - -// NPN_Registry -// -// The registry is designed for quick lookup of NPObjects. -// JS needs to be able to quickly lookup a given NPObject to determine -// if it is alive or not. -// The browser needs to be able to quickly lookup all NPObjects which are -// "owned" by an object. -// -// The g_live_objects is a hash table of all live objects to their owner -// objects. Presence in this table is used primarily to determine if -// objects are live or not. -// -// The g_root_objects is a hash table of root objects to a set of -// objects that should be deactivated in sync with the root. A -// root is defined as a top-level owner object. This is used on -// Frame teardown to deactivate all objects associated -// with a particular plugin. - -typedef WTF::HashSet<NPObject*> NPObjectSet; -typedef WTF::HashMap<NPObject*, NPObject*> NPObjectMap; -typedef WTF::HashMap<NPObject*, NPObjectSet*> NPRootObjectMap; - -// A map of live NPObjects with pointers to their Roots. -NPObjectMap g_live_objects; - -// A map of the root objects and the list of NPObjects -// associated with that object. -NPRootObjectMap g_root_objects; - -void _NPN_RegisterObject(NPObject* obj, NPObject* owner) { - ASSERT(obj); - - // Check if already registered. - if (g_live_objects.find(obj) != g_live_objects.end()) { - return; - } - - if (!owner) { - // Registering a new owner object. - ASSERT(g_root_objects.find(obj) == g_root_objects.end()); - g_root_objects.set(obj, new NPObjectSet()); - } else { - // Always associate this object with it's top-most parent. - // Since we always flatten, we only have to look up one level. - NPObjectMap::iterator owner_entry = g_live_objects.find(owner); - NPObject* parent = NULL; - if (g_live_objects.end() != owner_entry) - parent = owner_entry->second; - - if (parent) { - owner = parent; - } - ASSERT(g_root_objects.find(obj) == g_root_objects.end()); - if (g_root_objects.find(owner) != g_root_objects.end()) - g_root_objects.get(owner)->add(obj); - } - - ASSERT(g_live_objects.find(obj) == g_live_objects.end()); - g_live_objects.set(obj, owner); -} - -void _NPN_UnregisterObject(NPObject* obj) { - ASSERT(obj); - ASSERT(g_live_objects.find(obj) != g_live_objects.end()); - - NPObject* owner = NULL; - if (g_live_objects.find(obj) != g_live_objects.end()) - owner = g_live_objects.find(obj)->second; - - if (owner == NULL) { - // Unregistering a owner object; also unregister it's descendants. - ASSERT(g_root_objects.find(obj) != g_root_objects.end()); - NPObjectSet* set = g_root_objects.get(obj); - while (set->size() > 0) { -#ifndef NDEBUG - int size = set->size(); -#endif - NPObject* sub_object = *(set->begin()); - // The sub-object should not be a owner! - ASSERT(g_root_objects.find(sub_object) == g_root_objects.end()); - - // First, unregister the object. - set->remove(sub_object); - g_live_objects.remove(sub_object); - - // Remove the JS references to the object. - forgetV8ObjectForNPObject(sub_object); - - ASSERT(set->size() < size); - } - delete set; - g_root_objects.remove(obj); - } else { - NPRootObjectMap::iterator owner_entry = g_root_objects.find(owner); - if (owner_entry != g_root_objects.end()) { - NPObjectSet* list = owner_entry->second; - ASSERT(list->find(obj) != list->end()); - list->remove(obj); - } - } - - g_live_objects.remove(obj); - forgetV8ObjectForNPObject(obj); -} - -bool _NPN_IsAlive(NPObject* obj) { - return g_live_objects.find(obj) != g_live_objects.end(); -} - -} // extern "C" diff --git a/webkit/port/bindings/v8/npruntime_impl.h b/webkit/port/bindings/v8/npruntime_impl.h deleted file mode 100644 index 9a9b612..0000000 --- a/webkit/port/bindings/v8/npruntime_impl.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef npruntime_impl_h -#define npruntime_impl_h - -#include "bindings/npruntime.h" - -// This file exists to support WebCore, which expects to be able to call upon -// portions of the NPRuntime implementation. - -// A simple mapping for now. FIXME We should probably just adopt the -// underscore prefix as our naming convention too. -#define _NPN_ReleaseObject NPN_ReleaseObject - -#endif diff --git a/webkit/port/bindings/v8/npruntime_internal.h b/webkit/port/bindings/v8/npruntime_internal.h deleted file mode 100644 index 75bf2b0..0000000 --- a/webkit/port/bindings/v8/npruntime_internal.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2007 Collabora, Ltd. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - * This is a internal include header for npapi.h - * - * Some of the #defines which are in X11 headers conflict with type and enum - * names in JavaScriptCore and WebCore - * This header #undefs those defines to fix the conflicts - * If you need to include npapi.h or npruntime.h when building on X11, - * include this file instead of the actual npapi.h or npruntime.h - */ - -#include "npapi.h" -#include "npruntime.h" -#include "npfunctions.h" - -#ifdef XP_UNIX - #include <X11/Xresource.h> - - #undef None - #undef Above - #undef Below - #undef Auto - #undef Complex - #undef Status -#endif diff --git a/webkit/port/bindings/v8/npruntime_priv.h b/webkit/port/bindings/v8/npruntime_priv.h deleted file mode 100644 index 0aa952c..0000000 --- a/webkit/port/bindings/v8/npruntime_priv.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef NP_RUNTIME_PRIV_H_ -#define NP_RUNTIME_PRIV_H_ - - -#include "third_party/npapi/bindings/npruntime.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - _NPN_InitializeVariantWithStringCopy() will copy string data. The string data - will be deallocated by calls to NPReleaseVariantValue(). -*/ -void _NPN_InitializeVariantWithStringCopy(NPVariant*, const NPString*); -void _NPN_DeallocateObject(NPObject *obj); - -// The following routines allow the browser to aggressively cleanup NPObjects -// on a per plugin basis. All NPObjects used through the NPRuntime API should -// be "registered" while they are alive. After an object has been -// deleted, it is possible for Javascript to have a reference to that object -// which has not yet been garbage collected. Javascript access to NPObjects -// will reference this registry to determine if the object is accessible or -// not. - -// Windows introduces an additional complication for objects created by the -// plugin. Plugins load inside of a DLL. Each DLL has it's own heap. If -// the browser unloads the plugin DLL, all objects created within the DLL's -// heap instantly become invalid. Normally, when WebKit drops the reference -// on the top-level plugin object, it tells the plugin manager that the -// plugin can be destroyed, which can unload the DLL. So, we must eliminate -// all pointers to any object ever created by the plugin. - -// We generally associate NPObjects with an owner. The owner of an NPObject -// is an NPObject which, when destroyed, also destroys all objects it owns. -// For example, if an NPAPI plugin creates 10 sub-NPObjects, all 11 objects -// (the NPAPI plugin + its 10 sub-objects) should become inaccessible -// simultaneously. - -// The ownership hierarchy is flat, and not a tree. Imagine the following -// object creation: -// PluginObject -// | -// +-- Creates -----> Object1 -// | -// +-- Creates -----> Object2 -// -// PluginObject will be the "owner" for both Object1 and Object2. - -// Register an NPObject with the runtime. If the owner is NULL, the -// object is treated as an owning object. If owner is not NULL, -// this object will be registered as owned by owner's top-level owner. -void _NPN_RegisterObject(NPObject* obj, NPObject* owner); - -// Unregister an NPObject with the runtime. If obj is an owning -// object, this call will also unregister all of the owned objects. -void _NPN_UnregisterObject(NPObject* obj); - -// Check to see if an object is registered with the runtime. -// Return true if registered, false otherwise. -bool _NPN_IsAlive(NPObject* obj); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index c104be7..30a39a2 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -175,7 +175,7 @@ 'inputs': [ '../third_party/WebKit/WebCore/bridge/npapi.h', '../third_party/WebKit/WebCore/bridge/npruntime.h', - 'port/bindings/v8/npruntime_priv.h', + '../third_party/WebKit/WebCore/bindings/v8/npruntime_priv.h', '../third_party/WebKit/JavaScriptCore/os-win32/stdint.h', ], }], @@ -1151,6 +1151,10 @@ '../third_party/WebKit/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp', '../third_party/WebKit/WebCore/bindings/v8/WorkerScriptController.h', '../third_party/WebKit/WebCore/bindings/v8/WorkerScriptController.cpp', + '../third_party/WebKit/WebCore/bindings/v8/npruntime.cpp', + '../third_party/WebKit/WebCore/bindings/v8/npruntime_impl.h', + '../third_party/WebKit/WebCore/bindings/v8/npruntime_internal.h', + '../third_party/WebKit/WebCore/bindings/v8/npruntime_priv.h', 'extensions/v8/gc_extension.cc', 'extensions/v8/gc_extension.h', 'extensions/v8/gears_extension.cc', @@ -1167,10 +1171,6 @@ 'port/bindings/v8/RGBColor.h', 'port/bindings/v8/NPV8Object.cpp', 'port/bindings/v8/NPV8Object.h', - 'port/bindings/v8/npruntime.cpp', - 'port/bindings/v8/npruntime_impl.h', - 'port/bindings/v8/npruntime_internal.h', - 'port/bindings/v8/npruntime_priv.h', 'port/bindings/v8/V8NPUtils.cpp', 'port/bindings/v8/V8NPUtils.h', 'port/bindings/v8/V8NPObject.cpp', |