Hello michaeln,

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

or point your web browser to
        http://mondrian/11137659
(this changelist has been uploaded to Mondrian)

to review the following code:

Change 11137659 by n...@noel-gears on 2009/05/14 21:01:07 *pending*

        We moved the defense check against NULL NPObject *event input closer
        to the GetDragData() CPAPI call entry point when we considered the
        unusual circumstances that might produce a NULL event.  Here protect
        the gears side from a possible event NULL pointer dereference.
        
        Second part: remove the per file mimeTypes information provided when
        files are dropped.  It's not supported by the other drag and drop
        drivers, so remove it from chrome for now.
        
        PRESUBMIT=passed
        R=michaeln
        [email protected]
        DELTA=10  (0 added, 7 deleted, 3 changed)
        OCL=11137659

Affected files ...

... 
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_cr.cc#1 
edit

10 delta lines: 0 added, 7 deleted, 3 changed

Also consider running:
        g4 lint -c 11137659

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 11137659 by n...@noel-gears on 2009/05/14 21:01:07 *pending*

        We moved the defense check against NULL NPObject *event input closer
        to the GetDragData() CPAPI call entry point when we considered the
        unusual circumstances that might produce a NULL event.  Here protect
        the gears side from a possible event NULL pointer dereference.
        
        Second part: remove the per file mimeTypes information provided when
        files are dropped.  It's not supported by the other drag and drop
        drivers, so remove it from chrome for now.

Affected files ...

... 
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_cr.cc#1 
edit

==== 
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_cr.cc#1 
- 
c:\Users\noel.GOOGLE\src-gears/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_cr.cc
 ====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_cr.cc       
2009-05-14 21:03:52.000000000 +1000
+++ googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_cr.cc       
2009-05-14 20:48:57.000000000 +1000
@@ -50,7 +50,7 @@
  public:
   DragSession(NPP npp, JsObject *event)
       : identity_(0), event_id_(0), type_(NULL), data_(NULL) {
-    event_ = NPVARIANT_TO_OBJECT(event->token());
+    event_ = event ? NPVARIANT_TO_OBJECT(event->token()) : NULL;
     context_ = CP::GetBrowsingContext(npp);
   }
 
@@ -322,7 +322,7 @@
   DragSession drag(runner->GetContext(), event);
   if (!drag.SetDropEffect(cursor)) {
     if (drag.BrowserSupportsDragDrop()) {
-      *error = STRING16(L"The drag-n-drop event is invalid.");
+      *error = STRING16(L"The drag-and-drop event is invalid.");
     }
   }
 }
@@ -334,7 +334,7 @@
   DragSession drag(runner->GetContext(), event);
   if (!drag.GetDragType()) {
     if (drag.BrowserSupportsDragDrop()) {
-      *error = STRING16(L"The drag-n-drop event is invalid.");
+      *error = STRING16(L"The drag-and-drop event is invalid.");
     }
     return false;
   }
@@ -379,13 +379,6 @@
     return true;
   }
 
-  scoped_ptr<JsObject> file;  // Add the per-file mimeType.
-  for (size_t i = 0; i < g_mimes.size(); ++i) {
-    array->GetElementAsObject(i, as_out_parameter(file));
-    file->SetPropertyString(STRING16(L"mimeType"), g_mimes[i]);
-    file.reset();
-  }
-
   static const std::string16 kFiles(STRING16(L"files"));
   bool success = data->SetPropertyArray(kFiles, array.get());
   LOG16((L"drop %s\n", success ? L"success" : L"failed"));

Reply via email to