- Timestamp:
- Sep 2, 2009 11:40:56 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 51827
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/ptr.h
r22702 r22708 67 67 #include <VBox/com/assert.h> 68 68 69 #define LOGREF(prefix, pObj, cRefs) com::LogRef("%s {%p} cRefs=%d\n", (prefix), (pObj), (cRefs)) 70 69 71 namespace com 70 72 { 71 #define LOGREF(prefix, pObj, cRefs) com::LogRef(#pObj "{%p}.refCnt=%d\n", (pObj), (cRefs));72 73 void LogRef(const char *pcszFormat, ...); 73 74 } … … 83 84 static void addref(C *p) 84 85 { 85 size_t cRefs = p->AddRef();86 int cRefs = p->AddRef(); 86 87 LOGREF("ADDREF ", p, cRefs); 87 88 } 88 89 static void release(C *p) 89 90 { 90 size_t cRefs = p->Release(); 91 LOGREF("RELEASE ", p, cRefs); 92 p->Release(); 91 int cRefs = p->Release(); 92 LOGREF("RELEASE", p, cRefs); 93 93 } 94 94 }; … … 102 102 protected: 103 103 104 static void addref 105 static void release 104 static void addref(C * /* p */) {} 105 static void release(C * /* p */) {} 106 106 }; 107 107 … … 120 120 */ 121 121 template <class I1, class I2> 122 inline bool ComPtrEquals 122 inline bool ComPtrEquals(I1 *aThis, I2 *aThat) 123 123 { 124 124 IUnknown *thatUnk = NULL, *thisUnk = NULL; 125 125 if (aThat) 126 aThat->QueryInterface (COM_IIDOF (IUnknown), (void **)&thatUnk);126 aThat->QueryInterface(COM_IIDOF(IUnknown), (void**)&thatUnk); 127 127 if (aThis) 128 aThis->QueryInterface (COM_IIDOF (IUnknown), (void **)&thisUnk);129 bool equal = thisUnk == thatUnk;128 aThis->QueryInterface(COM_IIDOF(IUnknown), (void**)&thisUnk); 129 bool equal = (thisUnk == thatUnk); 130 130 if (thisUnk) 131 131 thisUnk->Release(); … … 137 137 /* specialization for <Any, IUnknown> */ 138 138 template <class I1> 139 inline bool ComPtrEquals 139 inline bool ComPtrEquals(I1 *aThis, IUnknown *aThat) 140 140 { 141 141 IUnknown *thisUnk = NULL; 142 142 if (aThis) 143 aThis->QueryInterface (COM_IIDOF (IUnknown), (void **)&thisUnk);144 bool equal = thisUnk == aThat;143 aThis->QueryInterface(COM_IIDOF(IUnknown), (void**)&thisUnk); 144 bool equal = (thisUnk == aThat); 145 145 if (thisUnk) 146 146 thisUnk->Release(); … … 150 150 /** Specialization for <IUnknown, Any> */ 151 151 template <class I2> 152 inline bool ComPtrEquals 152 inline bool ComPtrEquals(IUnknown *aThis, I2 *aThat) 153 153 { 154 154 IUnknown *thatUnk = NULL; 155 155 if (aThat) 156 aThat->QueryInterface (COM_IIDOF (IUnknown), (void **)&thatUnk);157 bool equal = aThis == thatUnk;156 aThat->QueryInterface(COM_IIDOF(IUnknown), (void**)&thatUnk); 157 bool equal = (aThis == thatUnk); 158 158 if (thatUnk) 159 159 thatUnk->Release(); … … 163 163 /* specialization for IUnknown */ 164 164 template<> 165 inline bool ComPtrEquals <IUnknown, IUnknown>(IUnknown *aThis, IUnknown *aThat)165 inline bool ComPtrEquals<IUnknown, IUnknown>(IUnknown *aThis, IUnknown *aThat) 166 166 { 167 167 return aThis == aThat; -
trunk/include/VBox/log.h
r19315 r22708 325 325 LOG_GROUP_VMM, 326 326 /** VRDP group */ 327 LOG_GROUP_VRDP 327 LOG_GROUP_VRDP, 328 /** Webservice group. */ 329 LOG_GROUP_WEBSERVICE 328 330 /* !!!ALPHABETICALLY!!! */ 329 331 } VBOX_LOGGROUP; … … 478 480 "VMM", \ 479 481 "VRDP", \ 482 "WEBSERVICE", \ 480 483 } 481 484 -
trunk/src/VBox/Main/glue/com.cpp
r22702 r22708 51 51 #include <VBox/err.h> 52 52 53 #include <Logging.h>54 55 53 #ifdef RT_OS_DARWIN 56 54 #define VBOX_USER_HOME_SUFFIX "Library/VirtualBox" … … 59 57 #endif 60 58 59 #include "Logging.h" 61 60 62 61 namespace com -
trunk/src/VBox/Main/webservice/vboxweb.cpp
r22666 r22708 21 21 */ 22 22 23 // shared webservice header 24 #include "vboxweb.h" 25 23 26 // vbox headers 24 27 #include <VBox/com/com.h> 25 #include <VBox/com/string.h>26 #include <VBox/com/Guid.h>27 28 #include <VBox/com/ErrorInfo.h> 28 29 #include <VBox/com/errorprint.h> 29 30 #include <VBox/com/EventQueue.h> 30 #include <VBox/com/VirtualBox.h>31 #include <VBox/err.h>32 31 #include <VBox/VRDPAuth.h> 33 32 #include <VBox/version.h> 34 #include <VBox/log.h>35 33 36 34 #include <iprt/lock.h> … … 40 38 #include <iprt/ctype.h> 41 39 #include <iprt/process.h> 42 #include <iprt/stream.h>43 40 #include <iprt/string.h> 44 41 #include <iprt/ldr.h> … … 54 51 // standard headers 55 52 #include <map> 56 #include <sstream>57 53 58 54 #ifdef __GNUC__ 59 55 #pragma GCC visibility pop 60 56 #endif 61 62 // shared webservice header63 #include "vboxweb.h"64 57 65 58 // include generated namespaces table … … 215 208 va_list args; 216 209 va_start(args, pszFormat); 217 RTPrintfV(pszFormat, args); 210 char *psz = NULL; 211 RTStrAPrintfV(&psz, pszFormat, args); 218 212 va_end(args); 219 213 214 // terminal 215 RTPrintf("%s", psz); 216 217 // log file 220 218 if (g_pstrLog) 221 219 { 222 va_list args2; 223 va_start(args2, pszFormat); 224 RTStrmPrintfV(g_pstrLog, pszFormat, args); 225 va_end(args2); 226 220 RTStrmPrintf(g_pstrLog, "%s", psz); 227 221 RTStrmFlush(g_pstrLog); 228 222 } 223 224 // logger instance 225 RTLogLoggerEx(LOG_INSTANCE, RTLOGGRPFLAGS_DJ, LOG_GROUP, "%s", psz); 226 227 RTStrFree(psz); 229 228 } 230 229 … … 541 540 */ 542 541 void RaiseSoapFault(struct soap *soap, 543 const std::string &str,542 const char *pcsz, 544 543 int extype, 545 544 void *ex) 546 545 { 547 546 // raise the fault 548 soap_sender_fault(soap, str.c_str(), NULL);547 soap_sender_fault(soap, pcsz, NULL); 549 548 550 549 struct SOAP_ENV__Detail *pDetail = (struct SOAP_ENV__Detail*)soap_malloc(soap, sizeof(struct SOAP_ENV__Detail)); … … 587 586 588 587 RaiseSoapFault(soap, 589 str ,588 str.c_str(), 590 589 SOAP_TYPE__vbox__InvalidObjectFault, 591 590 ex); … … 648 647 649 648 // compose descriptive message 650 std::ostringstream ostr; 651 ostr << std::hex << ex->resultCode; 652 653 std::string str("VirtualBox error: "); 654 str += ex->text; 655 str += " (0x"; 656 str += ostr.str(); 657 str += ")"; 649 com::Utf8StrFmt str("VirtualBox error: %s (0x%RU32)", ex->text.c_str(), ex->resultCode); 658 650 659 651 RaiseSoapFault(soap, 660 str ,652 str.c_str(), 661 653 SOAP_TYPE__vbox__RuntimeFault, 662 654 ex); … … 934 926 WSDLT_ID id = pRef->toWSDL(); 935 927 WEBDEBUG((" %s: found existing ref %s for COM obj 0x%lX\n", __FUNCTION__, id.c_str(), ulp)); 928 LogDJ((" %s: found existing ref %s for COM obj 0x%lX\n", __FUNCTION__, id.c_str(), ulp)); 936 929 } 937 930 else … … 1063 1056 1064 1057 WEBDEBUG((" * %s: MOR created for ulp 0x%lX (%s), new ID is %llX; now %lld objects total\n", __FUNCTION__, _ulp, pcszInterface, _id, cTotal)); 1058 LogDJ((" * %s: MOR created for ulp 0x%lX (%s), new ID is %llX; now %lld objects total\n", __FUNCTION__, _ulp, pcszInterface, _id, cTotal)); 1065 1059 } 1066 1060 -
trunk/src/VBox/Main/webservice/vboxweb.h
r22666 r22708 27 27 28 28 #define WEBDEBUG(a) if (g_fVerbose) { WebLog a; } 29 30 #define LOG_GROUP LOG_GROUP_WEBSERVICE 31 #include <VBox/log.h> 32 33 #include <VBox/com/VirtualBox.h> 34 #include <VBox/com/Guid.h> 35 36 #include <VBox/err.h> 37 38 #include <iprt/stream.h> 39 40 #include <string> 41 29 42 30 43 /**************************************************************************** -
trunk/src/VBox/Main/webservice/websrv-cpp.xsl
r22665 r22708 60 60 */ 61 61 62 // shared webservice header 63 #include "vboxweb.h" 64 62 65 // vbox headers 63 66 #include <VBox/com/com.h> 64 67 #include <VBox/com/array.h> 65 #include <VBox/com/string.h>66 #include <VBox/com/Guid.h>67 68 #include <VBox/com/ErrorInfo.h> 68 69 #include <VBox/com/errorprint.h> 69 70 #include <VBox/com/EventQueue.h> 70 #include <VBox/com/VirtualBox.h> 71 #include <VBox/err.h> 72 #include <VBox/log.h> 71 #include <VBox/VRDPAuth.h> 72 #include <VBox/version.h> 73 73 74 74 #include <iprt/initterm.h> … … 82 82 #include <map> 83 83 #include <sstream> 84 85 // shared webservice header86 #include "vboxweb.h"87 84 88 85 // shared strings for debug output
Note:
See TracChangeset
for help on using the changeset viewer.