diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 18:13:40 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 18:13:40 +0000 |
commit | 5edab80091453ee38f28e2240649bf91c9e3e658 (patch) | |
tree | 5ed0b46ca44e9f93c0d64986d3b309dcbb94d3ef /o3d/plugin | |
parent | 89382b154bfcf431169b6ded5ebcd26e0ec94aea (diff) | |
download | chromium_src-5edab80091453ee38f28e2240649bf91c9e3e658.zip chromium_src-5edab80091453ee38f28e2240649bf91c9e3e658.tar.gz chromium_src-5edab80091453ee38f28e2240649bf91c9e3e658.tar.bz2 |
Fix for archive request. It turns out this thing
can be called recursively. Because of that
ArchiveRequest::raw_data_ would be invalid when the
outer call came back. This way we mostly don't use
that field.
Also updated the docs so it can me marked as
deprecated.
Review URL: http://codereview.chromium.org/173620
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin')
-rw-r--r-- | o3d/plugin/idl/archive_request.idl | 23 | ||||
-rw-r--r-- | o3d/plugin/idl/raw_data.idl | 4 |
2 files changed, 14 insertions, 13 deletions
diff --git a/o3d/plugin/idl/archive_request.idl b/o3d/plugin/idl/archive_request.idl index ef87f3e..36283b6 100644 --- a/o3d/plugin/idl/archive_request.idl +++ b/o3d/plugin/idl/archive_request.idl @@ -53,19 +53,19 @@ callback void ArchiveFileAvailableCallback(RawData rawData); request.onreadystatechange = myReadyStateChangeCallback; request.send(); - function myFileAvailableCallback() { - dump("uri: " + request.data.uri + "\n"); - dump("content: " + request.data.stringValue + "\n"); + function myFileAvailableCallback(rawData) { + dump("uri: " + rawData.uri + "\n"); + dump("content: " + rawData.stringValue + "\n"); - // You can pass a RawData to various creation functions. Note: request.data - // is only valid during an onfileavailable callback. + // You can pass a RawData to various creation functions. Note: rawData + // is only valid until you remove the request. // Examples: - if (request.data.uri == 'mytexture.jpg') - pack.createTexture2d(request.data, makeMips); - if (request.data.uri == 'myvertices.bin') - vertexBuffer.set(request.data); - if (request.data.uri == 'myAudio.mp3') - audioSystem.createSound(request.data); + if (rawData.uri == 'mytexture.jpg') + pack.createTexture2d(rawData, makeMips); + if (rawData.uri == 'myvertices.bin') + vertexBuffer.set(rawData); + if (rawData.uri == 'myAudio.mp3') + audioSystem.createSound(rawData); } function myReadyStateChangeCallback() { @@ -109,6 +109,7 @@ callback void ArchiveFileAvailableCallback(RawData rawData); Note: This value is only valid inside the onfileavailable callback. Note: This property is deprecated. It is now an argument of the onfileavailable callback. + @deprecated %] [getter] RawData? data; diff --git a/o3d/plugin/idl/raw_data.idl b/o3d/plugin/idl/raw_data.idl index 8089d71..c252f46 100644 --- a/o3d/plugin/idl/raw_data.idl +++ b/o3d/plugin/idl/raw_data.idl @@ -38,8 +38,8 @@ namespace o3d { \code var request = g_pack.createArchiveRequest(); - request.onfileavailable = function() { - var texture = g_pack.createTextureFromRawData(request.data, true); + request.onfileavailable = function(rawData) { + var texture = g_pack.createTextureFromRawData(rawData, true); ... }; |