Hello michaeln,

I'd like you to do a code review.  Please execute
        g4 diff -c 10436382

or point your web browser to
        http://mondrian/10436382

to review the following code:

Change 10436382 by z...@zkuznia-corp on 2009/03/10 17:26:33 *pending*

        Fixing the build break from the httprquest logging.
        
        R=michaeln
        [email protected]
        DELTA=18  (10 added, 0 deleted, 8 changed)
        OCL=10436382

Affected files ...

... //depot/googleclient/gears/opensource/gears/httprequest/httprequest.cc#28 
edit

18 delta lines: 10 added, 0 deleted, 8 changed

Also consider running:
        g4 lint -c 10436382

which verifies that the changelist doesn't introduce new style violations.

If you can't do the review, please let me know as soon as possible.  During
your review, please ensure that all new code has corresponding unit tests and
that existing unit tests are updated appropriately.  Visit
http://www/eng/code_review.html for more information.

This is a semiautomated message from "g4 mail".  Complaints or suggestions?
Mail [email protected].
Change 10436382 by z...@zkuznia-corp on 2009/03/10 17:26:33 *pending*

        Fixing the build break from the httprquest logging.

Affected files ...

... //depot/googleclient/gears/opensource/gears/httprequest/httprequest.cc#28 
edit

==== //depot/googleclient/gears/opensource/gears/httprequest/httprequest.cc#28 
- c:\src-gears/googleclient/gears/opensource/gears/httprequest/httprequest.cc 
====
# action=edit type=text
--- googleclient/gears/opensource/gears/httprequest/httprequest.cc      
2009-03-10 17:26:37.000000000 -0700
+++ googleclient/gears/opensource/gears/httprequest/httprequest.cc      
2009-03-10 17:24:10.000000000 -0700
@@ -85,7 +85,16 @@
 static const char *kDebugLogEnvVarName = "GEARS_HTTPREQUEST_LOGFILE";
 static const char *kDebugBodyEnvVarName = "GEARS_HTTPREQUEST_LOG_BODY";
 
-
+#ifdef OS_WINCE
+// Not implemented on WinCE
+class HttpRequestLog {
+ public:
+  static void LogStart(HttpRequest *request) {
+  }
+  static void LogResponse(HttpRequest *request) {
+  }
+}
+#else
 class HttpRequestLog {
  public:
   static void LogStart(HttpRequest *request) {
@@ -119,7 +128,7 @@
     MutexLock lock(&mutex_);
     Initialize();
 
-    if (logfile_) {
+    if (!logfile_) {
       return;
     }
 
@@ -136,8 +145,8 @@
       log_message += initial_url;
     }
 
-    fwprintf(logfile_, STRING16(L"%S %s\n"), now_str.c_str(),
-             log_message.c_str());
+    fprintf(logfile_, "%s %s\n", now_str.c_str(),
+            String16ToUTF8(log_message).c_str());
   }
 
   void LogResponseInternal(HttpRequest *request) {
@@ -172,16 +181,16 @@
       log_message += AllResponseHeaders;
     }
 
-    fwprintf(logfile_, STRING16(L"%S %s\n"), now_str.c_str(),
-             log_message.c_str());
+    fprintf(logfile_, "%s %s\n", now_str.c_str(),
+            String16ToUTF8(log_message).c_str());
     if (log_body_) {
       scoped_refptr<BlobInterface> blob;
       if (request->GetResponseBody(&blob)) {
         std::string16 text;
         if (BlobToString16(blob.get(), request->GetResponseCharset(),
                            &text)) {
-          fwprintf(logfile_, STRING16(L"%S ResponseBody:\n%s\n"),
-                   now_str.c_str(), text.c_str());
+          fprintf(logfile_, "%s ResponseBody:\n%s\n",
+                  now_str.c_str(), String16ToUTF8(text).c_str());
         }
       }
     }
@@ -195,6 +204,7 @@
   static HttpRequestLog http_request_log_;
 };
 HttpRequestLog HttpRequestLog::http_request_log_;
+#endif
 
 static bool IsValidHeader(const std::string16 &header) {
   if (!IsValidHttpToken(header)) {

Reply via email to