gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog plugin/plugin.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog plugin/plugin.cpp
Date: Fri, 24 Nov 2006 23:42:57 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/11/24 23:42:57

Modified files:
        .              : ChangeLog 
        plugin         : plugin.cpp 

Log message:
        cleanups in plugin.cpp code

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1752&r2=1.1753
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/plugin.cpp?cvsroot=gnash&r1=1.68&r2=1.69

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1752
retrieving revision 1.1753
diff -u -b -r1.1752 -r1.1753
--- ChangeLog   24 Nov 2006 23:23:43 -0000      1.1752
+++ ChangeLog   24 Nov 2006 23:42:56 -0000      1.1753
@@ -1,7 +1,8 @@
 2006-11-24 Sandro Santilli <address@hidden>
 
        * plugin/plugin.cpp: wait for gdb if GNASH_OPTIONS
-         environment variable contains the substring 'waitforgdb'
+         environment variable contains the substring 'waitforgdb';
+         cleanups.
        * testsuite/actionscript.all/Date.as:
          case-sensitiveness tests pass now.
 

Index: plugin/plugin.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/plugin.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- plugin/plugin.cpp   24 Nov 2006 23:23:43 -0000      1.68
+++ plugin/plugin.cpp   24 Nov 2006 23:42:57 -0000      1.69
@@ -17,7 +17,7 @@
 // 
 //
 
-/* $Id: plugin.cpp,v 1.68 2006/11/24 23:23:43 strk Exp $ */
+/* $Id: plugin.cpp,v 1.69 2006/11/24 23:42:57 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -382,94 +382,20 @@
 nsPluginInstance::NewStream(NPMIMEType /* type */, NPStream * stream,
                             NPBool /* seekable */, uint16_t * /* stype */)
 {
-    string url = stream->url;
-    string opts;
-    size_t start, end, eq;
-    bool dumpopts = false;
+    _swf_url = stream->url;
+
+    cout << __FUNCTION__ << ": The full URL is " << _swf_url << endl;
 
-#if 0
-    log_msg("%s: this = %p, URL is %s", __FUNCTION__,
-      (void *)this, stream->url);
-#endif
 
-    // extract the parameters from the URL
 #ifdef WRITE_FILE
+    size_t start, end;
     string fname;
-    end   = url.find(".swf", 0) + 4;
-    start = url.rfind("/", end) + 1;
+    end   = _swf_url.find(".swf", 0) + 4;
+    start = _swf_url.rfind("/", end) + 1;
     fname = "/tmp/";
-    fname += url.substr(start, end - start);
+    fname += _swf_url.substr(start, end - start);
     cout << "The Flash movie name is: " << fname << endl;
-#endif
-    end   = url.find(".swf", 0) + 4;
-    start = url.find("?", end);
-    end   = url.size();
-    if (start != string::npos) {
-       opts = url.substr(start+1, end);
-    }
-
-    string name;
-    string value;
-
-    cout << __FUNCTION__ << ": The full URL is " << url << endl;
-    while (opts.size() > 0) {
-       start = 0; // TODO: An empty name seems useless to me. If this is 
-                  //       indeed the case, we should set `start' to one.
-
-       eq = opts.find("=", start);
-       if (eq == string::npos) {
-           cout << "INFO: Ignoring URL appendix without name." << endl;
-           goto process;
-       } 
-
-       if (opts[0] == '&') {
-           // A (technically invalid) URL like movie.swf?&option=value.
-           start++;
-       }
 
-       end = opts.find("&", start);
-       if (end == string::npos) {
-           // We have only one name=value pair remaining.
-           end = opts.size();
-       }
-       
-       name = opts.substr(start, eq);
-       value = opts.substr(eq+1, end-eq-1);
-       
-       if (dumpopts) {
-           cout << __FUNCTION__ << "Option " << name << " = "
-                      << value << endl;
-       }
-       // Look for our special debug flags
-       if (name == "debug") {
-           cout << __FUNCTION__ << "Debug flag is " << value << endl;
-           if (value == "waitforgdb") {
-               waitforgdb = true;
-           }
-           if (value == "dumpopts") {
-               dumpopts = true;
-           }
-       } else {
-           _options[name] = value;
-       }
-       if ((opts.size() > end) && (opts[end] == '&')) {
-               end++;
-       }
-       if (end != string::npos) {
-           opts.erase(start, end);
-       }
-    }
-
-#if 0
-    log_msg("%s: URL is %s", __PRETTY_FUNCTION__, url.c_str());
-    log_msg("%s: Open stream for %s, this = %p", __FUNCTION__,
-    fname.c_str(), (void *)this);
-#endif
-
-process:
-    _swf_url = url;
-
-#ifdef WRITE_FILE
     _filefd = open(fname.c_str(), O_CREAT | O_WRONLY, 
S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
     if (_filefd < 0) {
         _filefd = open(fname.c_str(), O_TRUNC | O_WRONLY, 
S_IRUSR|S_IRGRP|S_IROTH);
@@ -510,16 +436,6 @@
     }
 #endif
 
-    if (waitforgdb) {
-       cout << "Attach GDB to PID " << getpid() << " to debug!" << endl;
-       cout << "This thread will block until then!..." << endl;
-       cout <<"Once blocked here, you can set other breakpoints." << endl;
-       cout << "do a \"set variable waitforgdb=false\" to continue" << endl;
-       while (waitforgdb) {
-           sleep(1);
-       }
-    }
-
     return NPERR_NO_ERROR;
 }
 
@@ -688,6 +604,16 @@
     }
     cout << endl;
 
+    if (waitforgdb) {
+       cout << endl << "  Attach GDB to PID " << getpid() << " to debug!" << 
endl;
+       cout << "  This thread will block until then!..." << endl;
+       cout << "  Once blocked here, you can set other breakpoints." << endl;
+       cout << "  do a \"set variable waitforgdb=false\" to continue" << endl 
<< endl;
+       while (waitforgdb) {
+           sleep(1);
+       }
+    }
+
     execv(argv[0], argv);
     // if execv returns, an error has occurred.
     perror(strerror(errno));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]