remove RT_post_url

This commit is contained in:
David Rose 2009-08-23 06:13:47 +00:00
parent d5528ab21f
commit 9c576983f9
4 changed files with 27 additions and 52 deletions

View File

@ -5,8 +5,8 @@ code that runs in a browser via the web plugin. """
class UndefinedObject: class UndefinedObject:
""" This is a special object that is returned by the browser to """ This is a special object that is returned by the browser to
represent an "undefined" value, typically the value for an represent an "undefined" or "void" value, typically the value for
uninitialized variable or undefined property. It has no an uninitialized variable or undefined property. It has no
attributes, similar to None, but it is a slightly different attributes, similar to None, but it is a slightly different
concept in JavaScript. """ concept in JavaScript. """
@ -32,9 +32,11 @@ class ConcreteStruct:
pass pass
def getConcreteProperties(self): def getConcreteProperties(self):
""" Returns a list of 2-tuples of the (key, value) pairs """ Returns a list of 2-tuples of the (key, value) pairs that
that are to be passed to the concrete instance. By default, are to be passed to the concrete instance. By default, this
this returns all properties of the object. """ returns all properties of the object. You can override this
to restrict the set of properties that are uploaded. """
return self.__dict__.items() return self.__dict__.items()
class BrowserObject: class BrowserObject:

View File

@ -532,11 +532,6 @@ finish_request(P3D_request *request, bool handled) {
free((char *)request->_request._get_url._url); free((char *)request->_request._get_url._url);
break; break;
case P3D_RT_post_url:
free((char *)request->_request._post_url._url);
free((char *)request->_request._post_url._post_data);
break;
case P3D_RT_notify: case P3D_RT_notify:
free((char *)request->_request._notify._message); free((char *)request->_request._notify._message);
break; break;
@ -548,9 +543,9 @@ finish_request(P3D_request *request, bool handled) {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: P3DInstance::feed_url_stream // Function: P3DInstance::feed_url_stream
// Access: Public // Access: Public
// Description: Called by the host in response to a get_url or // Description: Called by the host in response to a get_url request,
// post_url request, this sends the data retrieved from // this sends the data retrieved from the requested URL,
// the requested URL, a piece at a time. // a piece at a time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
bool P3DInstance:: bool P3DInstance::
feed_url_stream(int unique_id, feed_url_stream(int unique_id,

View File

@ -100,13 +100,15 @@ extern "C" {
If verify_contents is true, it means that the download server will If verify_contents is true, it means that the download server will
be contacted to verify that contents.xml is current, before be contacted to verify that contents.xml is current, before
continuing. If it is false, it means that contents.xml will be continuing, for any contents.xml file that is loaded. If it is
loaded without checking the download server, if possible. This can false, it means that the contents.xml will be loaded without
be used to minimize unnecessary network operations for standalone checking the download server, if possible. This can be used to
minimize unnecessary network operations for standalone
applications. For a web plugin, it should be set true. applications. For a web plugin, it should be set true.
If platform is not NULL or empty, it specifies the current platform If platform is not NULL or empty, it specifies the current platform
string; otherwise, the compiled-in default is used. string; otherwise, the compiled-in default is used. This should
generally be left at NULL.
If log_directory is not NULL or empty, it specifies the directory If log_directory is not NULL or empty, it specifies the directory
into which all log files will be written; otherwise, the into which all log files will be written; otherwise, the
@ -164,6 +166,7 @@ typedef struct {
HWND _hwnd; HWND _hwnd;
#elif defined(__APPLE__) #elif defined(__APPLE__)
/* As provided by Mozilla. */
GrafPtr _port; GrafPtr _port;
#elif defined(HAVE_X11) #elif defined(HAVE_X11)
@ -205,8 +208,8 @@ typedef enum {
} P3D_window_type; } P3D_window_type;
/* This function pointer must be passed to P3D_new_instance(), below. /* This function pointer is passed to P3D_new_instance(), below. The
The host must pass in a pointer to a valid function in the host's host must pass in a pointer to a valid function in the host's
address space, or NULL. If not NULL, this function will be called address space, or NULL. If not NULL, this function will be called
asynchronously by the core API when it needs to make a request from asynchronously by the core API when it needs to make a request from
the host. After this notification has been received, the host the host. After this notification has been received, the host
@ -319,9 +322,10 @@ P3D_instance_setup_window_func(P3D_instance *instance,
These function types define the methods available on a class. These function types define the methods available on a class.
These are function type declarations only; they do not correspond These are function type declarations only; they do not correspond
to named functions within the core API DLL. Instead, the function to named functions within the core API DLL (but see the named
function pointers, further below). Instead, the function
pointers themselves are stored within the P3D_class_definition pointers themselves are stored within the P3D_class_definition
structure, below. */ structure. */
/* A forward declaration of P3D_object. */ /* A forward declaration of P3D_object. */
typedef struct _P3D_object P3D_object; typedef struct _P3D_object P3D_object;
@ -513,6 +517,10 @@ struct _P3D_object {
#define P3D_OBJECT_DECREF(object) { if (--(object)->_ref_count <= 0) { (object)->_class->_finish((object)); } } #define P3D_OBJECT_DECREF(object) { if (--(object)->_ref_count <= 0) { (object)->_class->_finish((object)); } }
#define P3D_OBJECT_XDECREF(object) { if ((object) != (P3D_object *)NULL) { P3D_OBJECT_DECREF(object); } } #define P3D_OBJECT_XDECREF(object) { if ((object) != (P3D_object *)NULL) { P3D_OBJECT_DECREF(object); } }
/* End of method pointer definitions. The following function types
are once again meant to define actual function pointers to be found
within the core API DLL. */
/* Use these functions for thread-safe variants of the above macros. */ /* Use these functions for thread-safe variants of the above macros. */
typedef P3D_object_type typedef P3D_object_type
P3D_object_get_type_func(P3D_object *object); P3D_object_get_type_func(P3D_object *object);
@ -548,10 +556,6 @@ typedef void
P3D_object_decref_func(P3D_object *object); P3D_object_decref_func(P3D_object *object);
/* End of method pointer definitions. The following function types
are once again meant to define actual function pointers to be found
within the core API DLL. */
/* Returns a new P3D_class_definition object, filled with generic /* Returns a new P3D_class_definition object, filled with generic
function pointers that have reasonable default behavior for all function pointers that have reasonable default behavior for all
methods. The host should use this function to get a clean methods. The host should use this function to get a clean
@ -566,7 +570,7 @@ P3D_make_class_definition_func();
corresponds to the undefined or void type on JavaScript. It is corresponds to the undefined or void type on JavaScript. It is
similar to Python's None, but has a subtly different shade of similar to Python's None, but has a subtly different shade of
meaning; we map it to an explicit Undefined instance in meaning; we map it to an explicit Undefined instance in
runp3d.py. */ AppRunner.py. */
typedef P3D_object * typedef P3D_object *
P3D_new_undefined_object_func(); P3D_new_undefined_object_func();
@ -658,7 +662,6 @@ P3D_instance_set_browser_script_object_func(P3D_instance *instance,
typedef enum { typedef enum {
P3D_RT_stop, P3D_RT_stop,
P3D_RT_get_url, P3D_RT_get_url,
P3D_RT_post_url,
P3D_RT_notify, P3D_RT_notify,
P3D_RT_refresh, P3D_RT_refresh,
} P3D_request_type; } P3D_request_type;
@ -685,17 +688,6 @@ typedef struct {
int _unique_id; int _unique_id;
} P3D_request_get_url; } P3D_request_get_url;
/* A post_url request. Similar to get_url, but additional data is to
be sent via POST to the indicated URL. The result of the POST is
returned in a mechanism similar to get_url.
*/
typedef struct {
const char *_url;
const char *_post_data;
size_t _post_data_size;
int _unique_id;
} P3D_request_post_url;
/* A general notification. This is just a message of some event /* A general notification. This is just a message of some event
having occurred within the Panda3D instance. It may be safely having occurred within the Panda3D instance. It may be safely
ignored. ignored.
@ -718,7 +710,6 @@ typedef struct {
union { union {
P3D_request_stop _stop; P3D_request_stop _stop;
P3D_request_get_url _get_url; P3D_request_get_url _get_url;
P3D_request_post_url _post_url;
P3D_request_notify _notify; P3D_request_notify _notify;
P3D_request_refresh _refresh; P3D_request_refresh _refresh;
} _request; } _request;

View File

@ -534,19 +534,6 @@ handle_request(P3D_request *request) {
} }
break; break;
case P3D_RT_post_url:
{
int unique_id = request->_request._post_url._unique_id;
const string &url = request->_request._post_url._url;
string post_data(request->_request._post_url._post_data,
request->_request._post_url._post_data_size);
URLGetter *getter = new URLGetter
(request->_instance, unique_id, URLSpec(url), post_data);
_url_getters.insert(getter);
handled = true;
}
break;
case P3D_RT_notify: case P3D_RT_notify:
{ {
if (strcmp(request->_request._notify._message, "ondownloadnext") == 0) { if (strcmp(request->_request._notify._message, "ondownloadnext") == 0) {