OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple 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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 // | 412 // |
413 // Inside the javascript engine, the engine can keep a reference to the | 413 // Inside the javascript engine, the engine can keep a reference to the |
414 // NPObject as part of its wrapper. However, before accessing the object | 414 // NPObject as part of its wrapper. However, before accessing the object |
415 // it must consult the _NPN_Registry. | 415 // it must consult the _NPN_Registry. |
416 | 416 |
417 v8::Local<v8::Object> wrapper = createV8ObjectForNPObject(npObject, 0, m_iso
late); | 417 v8::Local<v8::Object> wrapper = createV8ObjectForNPObject(npObject, 0, m_iso
late); |
418 | 418 |
419 // Track the plugin object. We've been given a reference to the object. | 419 // Track the plugin object. We've been given a reference to the object. |
420 m_pluginObjects.set(widget, npObject); | 420 m_pluginObjects.set(widget, npObject); |
421 | 421 |
422 return V8ScriptInstance::create(wrapper); | 422 return V8ScriptInstance::create(wrapper, m_isolate); |
423 } | 423 } |
424 | 424 |
425 void ScriptController::cleanupScriptObjectsForPlugin(Widget* nativeHandle) | 425 void ScriptController::cleanupScriptObjectsForPlugin(Widget* nativeHandle) |
426 { | 426 { |
427 PluginObjectMap::iterator it = m_pluginObjects.find(nativeHandle); | 427 PluginObjectMap::iterator it = m_pluginObjects.find(nativeHandle); |
428 if (it == m_pluginObjects.end()) | 428 if (it == m_pluginObjects.end()) |
429 return; | 429 return; |
430 _NPN_UnregisterObject(it->value); | 430 _NPN_UnregisterObject(it->value); |
431 _NPN_ReleaseObject(it->value); | 431 _NPN_ReleaseObject(it->value); |
432 m_pluginObjects.remove(it); | 432 m_pluginObjects.remove(it); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 v8Results = evaluateHandleScope.Close(resultArray); | 714 v8Results = evaluateHandleScope.Close(resultArray); |
715 } | 715 } |
716 | 716 |
717 if (results && !v8Results.IsEmpty()) { | 717 if (results && !v8Results.IsEmpty()) { |
718 for (size_t i = 0; i < v8Results->Length(); ++i) | 718 for (size_t i = 0; i < v8Results->Length(); ++i) |
719 results->append(ScriptValue(v8Results->Get(i))); | 719 results->append(ScriptValue(v8Results->Get(i))); |
720 } | 720 } |
721 } | 721 } |
722 | 722 |
723 } // namespace WebCore | 723 } // namespace WebCore |
OLD | NEW |