|
From: <br...@us...> - 2008-10-26 07:36:54
|
Revision: 3751
http://openvrml.svn.sourceforge.net/openvrml/?rev=3751&view=rev
Author: braden
Date: 2008-10-26 07:36:50 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
Set GErrors on failure of the XEmbed browser control's stream handling functions.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/openvrml-xembed/browser.cpp
trunk/src/openvrml-xembed/browser.h
trunk/src/openvrml-xembed/browserfactory.cpp
Property Changed:
----------------
trunk/
trunk/src/libopenvrml/openvrml/bad_url.cpp
trunk/src/libopenvrml/openvrml/scene.cpp
trunk/src/libopenvrml/openvrml/scene.h
trunk/src/libopenvrml/openvrml/script.cpp
Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748
/branches/local:3677-3689
/branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688
+ /branches/0.17:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750
/branches/local:3677-3689
/branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-10-26 07:30:36 UTC (rev 3750)
+++ trunk/ChangeLog 2008-10-26 07:36:50 UTC (rev 3751)
@@ -1,3 +1,28 @@
+2008-10-26 Braden McDaniel <br...@en...>
+
+ Set GErrors on failure of the XEmbed browser control's stream
+ handling functions.
+
+ * src/openvrml-xembed/browser.cpp
+ (openvrml_xembed_error_quark()): Moved from browserfactory.cpp.
+ (openvrml_xembed_browser_new_stream(OpenvrmlXembedStreamClient *,
+ guint64, const char *, const char *, GError **)): Set an
+ OPENVRML_XEMBED_ERROR_UNKNOWN_STREAM GError if the new stream URI
+ is not recognized.
+ (openvrml_xembed_browser_destroy_stream(OpenvrmlXembedStreamClient *,
+ guint64, GError **)): Set an OPENVRML_XEMBED_ERROR_UNKNOWN_STREAM
+ GError if the stream id is not recognized.
+ (openvrml_xembed_browser_write(OpenvrmlXembedStreamClient *,
+ guint64, const GArray *, GError **)): Set an
+ OPENVRML_XEMBED_ERROR_UNKNOWN_STREAM GError if the stream id is
+ not recognized.
+ * src/openvrml-xembed/browser.h
+ (OpenvrmlXembedError): Moved from browserfactory.cpp; added
+ OPENVRML_XEMBED_ERROR_UNKNOWN_STREAM.
+ * src/openvrml-xembed/browserfactory.cpp
+ (openvrml_xembed_error_quark()): Moved to browser.cpp.
+ (OpenvrmlXembedError): Moved to browser.h.
+
2008-10-25 Braden McDaniel <br...@en...>
Ensure the XEmbed control host identifier is consistently treated
Property changes on: trunk/src/libopenvrml/openvrml/bad_url.cpp
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748
+ /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750
Property changes on: trunk/src/libopenvrml/openvrml/scene.cpp
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748
+ /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750
Property changes on: trunk/src/libopenvrml/openvrml/scene.h
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748
+ /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750
Property changes on: trunk/src/libopenvrml/openvrml/script.cpp
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748
+ /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750
Modified: trunk/src/openvrml-xembed/browser.cpp
===================================================================
--- trunk/src/openvrml-xembed/browser.cpp 2008-10-26 07:30:36 UTC (rev 3750)
+++ trunk/src/openvrml-xembed/browser.cpp 2008-10-26 07:36:50 UTC (rev 3751)
@@ -37,6 +37,11 @@
using namespace boost::multi_index::detail; // for scope_guard
+GQuark openvrml_xembed_error_quark()
+{
+ return g_quark_from_static_string("openvrml-xembed-error-quark");
+}
+
extern "C" {
//
// GObject overrides
@@ -558,16 +563,13 @@
return browser;
}
-/**
- * @todo We need to do something with the GError here.
- */
gboolean
openvrml_xembed_browser_new_stream(
OpenvrmlXembedStreamClient * const stream_client,
const guint64 stream_id,
- const char * type,
+ const char * const type,
const char * const url,
- GError ** /* error */)
+ GError ** const error)
{
using namespace openvrml_xembed;
using boost::shared_ptr;
@@ -587,7 +589,12 @@
browser->priv->uninitialized_streambuf_map->front();
got_initial_stream = true;
} else {
- g_warning("Attempt to create an unrequested stream");
+ g_set_error(
+ error,
+ OPENVRML_XEMBED_ERROR,
+ OPENVRML_XEMBED_ERROR_UNKNOWN_STREAM,
+ "Attempt to create a stream that has not been requested: %s",
+ url);
return false;
}
}
@@ -596,14 +603,11 @@
return true;
}
-/**
- * @todo We need to do something with the GError here.
- */
gboolean
openvrml_xembed_browser_destroy_stream(
OpenvrmlXembedStreamClient * const stream_client,
const guint64 stream_id,
- GError ** /* error */)
+ GError ** const error)
{
using namespace openvrml_xembed;
using boost::shared_ptr;
@@ -614,8 +618,12 @@
const shared_ptr<plugin_streambuf> streambuf =
browser->priv->streambuf_map->find(stream_id);
if (!streambuf) {
- g_warning("Attempt to destroy a nonexistent stream (with stream ID "
- "%lu)", stream_id);
+ g_set_error(
+ error,
+ OPENVRML_XEMBED_ERROR,
+ OPENVRML_XEMBED_ERROR_UNKNOWN_STREAM,
+ "Attempt to destroy a nonexistent stream: %lu",
+ stream_id);
return false;
}
streambuf->buf_.set_eof();
@@ -623,14 +631,11 @@
return true;
}
-/**
- * @todo We need to do something with the GError here.
- */
gboolean
openvrml_xembed_browser_write(OpenvrmlXembedStreamClient * const stream_client,
const guint64 stream_id,
const GArray * const data,
- GError ** /* error */)
+ GError ** const error)
{
using namespace openvrml_xembed;
using boost::shared_ptr;
@@ -641,7 +646,12 @@
const shared_ptr<plugin_streambuf> streambuf =
browser->priv->streambuf_map->find(stream_id);
if (!streambuf) {
- g_warning("Attempt to write to a nonexistent stream");
+ g_set_error(
+ error,
+ OPENVRML_XEMBED_ERROR,
+ OPENVRML_XEMBED_ERROR_UNKNOWN_STREAM,
+ "Attempt to write to a nonexistent stream: %lu",
+ stream_id);
return false;
}
for (size_t i = 0; i < data->len; ++i) {
Modified: trunk/src/openvrml-xembed/browser.h
===================================================================
--- trunk/src/openvrml-xembed/browser.h 2008-10-26 07:30:36 UTC (rev 3750)
+++ trunk/src/openvrml-xembed/browser.h 2008-10-26 07:36:50 UTC (rev 3751)
@@ -27,6 +27,16 @@
G_BEGIN_DECLS
+# define OPENVRML_XEMBED_ERROR openvrml_xembed_error_quark()
+
+GQuark openvrml_xembed_error_quark(void);
+
+typedef enum {
+ OPENVRML_XEMBED_ERROR_FAILED,
+ OPENVRML_XEMBED_ERROR_NO_MEMORY,
+ OPENVRML_XEMBED_ERROR_UNKNOWN_STREAM
+} OpenvrmlXembedError;
+
# define OPENVRML_XEMBED_TYPE_BROWSER (openvrml_xembed_browser_get_type ())
# define OPENVRML_XEMBED_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OPENVRML_XEMBED_TYPE_BROWSER, OpenvrmlXembedBrowser))
# define OPENVRML_XEMBED_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OPENVRML_XEMBED_TYPE_BROWSER, OpenvrmlXembedBrowserClass))
Modified: trunk/src/openvrml-xembed/browserfactory.cpp
===================================================================
--- trunk/src/openvrml-xembed/browserfactory.cpp 2008-10-26 07:30:36 UTC (rev 3750)
+++ trunk/src/openvrml-xembed/browserfactory.cpp 2008-10-26 07:36:50 UTC (rev 3751)
@@ -36,17 +36,6 @@
using namespace boost::multi_index::detail; // for scope_guard
-# define OPENVRML_XEMBED_ERROR openvrml_xembed_error_quark()
-GQuark openvrml_xembed_error_quark()
-{
- return g_quark_from_static_string("openvrml-xembed-error-quark");
-}
-
-enum OpenvrmlXembedError {
- OPENVRML_XEMBED_ERROR_FAILED,
- OPENVRML_XEMBED_ERROR_NO_MEMORY
-};
-
G_DEFINE_TYPE(OpenvrmlXembedBrowserFactory,
openvrml_xembed_browser_factory,
G_TYPE_OBJECT);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|