Issue 2141: Drag and Drop, dataTransfer.getData("URL") returns undefined
http://code.google.com/p/chromium/issues/detail?id=2141
Comment #2 by noel.gordon:
So the drag and drop events fire, but you can't extract the dropped data
from
the ondrop event.
For the most basic case (text drag and drop) then in the ondrop event
handler,
the following javascript evaluates to 'undefined' in Chrome.
typeof event.dataTransfer.getData('Text');
typeof event.dataTransfer.getData('text/plain');
On Safari, the result is 'String', and the event.dataTransfer object
contains
the dropped text, and you can extract/display that text.
Problem: event.dataTransfer.getData() calls into the V8/WebKit C++ layers
and
they, in turn, try to access a IDataObject* present in the V8/WebKit
abstract
clipboard C++ class. However, that IDataObject* COM pointer actually
resides
in the memory space/COM apartment of the Chrome process id, not the
rendering
process id.
WIN32 spots the cross-process memory access request, blocks it, and
correctly
throws a memory access violation exception back to V8.
Works in Safari-WIn32 because it's all single process, but not in Chrome,
due
to the multiple process architecture.
During drag and drop operations, the Chrome process id sends the
IDataObject*
COM pointer, via a pickle IPC, to the rendering process id. But it is just
a
bear pointer, one that exists in the Chrome process id COM apartment, and
the
OS prevents any other process from accessing it, and that includes the
Chrome
rendering process id and its subsystems (V8/WebKit).
The way to share a COM object inter-process, is to marshal it from the
owning
process id COM apartment, into the COM apartment of the receiving process
id.
See for example, "Interface Mashaling" in ...
http://www.go4expert.com/forums/showthread.php?t=784
~noel
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Chromium-bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/chromium-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---