Hello noel,
I'd like you to do a code review. Please execute
g4 diff -c 8966921
or point your web browser to
http://mondrian/8966921
to review the following code:
Change 8966921 by [EMAIL PROTECTED] on 2008/11/12 17:28:26 *pending*
Pull the shared DropTargetXx HandleEvent code up into their
base class.
PRESUBMIT=passed
R=noel
[EMAIL PROTECTED]
DELTA=49 (12 added, 34 deleted, 3 changed)
OCL=8966921
Affected files ...
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_base.cc#2
edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_base.h#2
edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_ff.cc#12
edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_ff.h#7 edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_ie.cc#11
edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_ie.h#8 edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_sf.cc#1 edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_sf.h#1 edit
49 delta lines: 12 added, 34 deleted, 3 changed
Also consider running:
g4 lint -c 8966921
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 8966921 by [EMAIL PROTECTED] on 2008/11/12 17:28:26 *pending*
Pull the shared DropTargetXx HandleEvent code up into their
base class.
Affected files ...
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_base.cc#2
edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_base.h#2
edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_ff.cc#12
edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_ff.h#7 edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_ie.cc#11
edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_ie.h#8 edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_sf.cc#1 edit
... //depot/googleclient/gears/opensource/gears/desktop/drop_target_sf.h#1 edit
==== //depot/googleclient/gears/opensource/gears/desktop/drop_target_base.cc#2
-
/home/nigeltao/srcgears3/googleclient/gears/opensource/gears/desktop/drop_target_base.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drop_target_base.cc
2008-11-12 17:24:35.000000000 +1100
+++ googleclient/gears/opensource/gears/desktop/drop_target_base.cc
2008-11-12 17:23:49.000000000 +1100
@@ -81,5 +81,11 @@
}
+void DropTargetBase::HandleEvent(JsEventType event_type) {
+ assert(event_type == JSEVENT_UNLOAD);
+ UnregisterSelf();
+}
+
+
#endif // GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
#endif // OFFICIAL_BUILD
==== //depot/googleclient/gears/opensource/gears/desktop/drop_target_base.h#2 -
/home/nigeltao/srcgears3/googleclient/gears/opensource/gears/desktop/drop_target_base.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drop_target_base.h
2008-11-12 17:24:35.000000000 +1100
+++ googleclient/gears/opensource/gears/desktop/drop_target_base.h
2008-11-12 17:24:09.000000000 +1100
@@ -61,6 +61,9 @@
JsObject *options,
std::string16 *error_out);
+ virtual void HandleEvent(JsEventType event_type);
+ virtual void UnregisterSelf() = 0;
+
private:
DISALLOW_EVIL_CONSTRUCTORS(DropTargetBase);
};
==== //depot/googleclient/gears/opensource/gears/desktop/drop_target_ff.cc#12 -
/home/nigeltao/srcgears3/googleclient/gears/opensource/gears/desktop/drop_target_ff.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drop_target_ff.cc
2008-11-12 17:24:35.000000000 +1100
+++ googleclient/gears/opensource/gears/desktop/drop_target_ff.cc
2008-11-12 17:24:10.000000000 +1100
@@ -389,13 +389,6 @@
}
-// A DropTarget instance automatically de-registers itself, on page unload.
-void DropTarget::HandleEvent(JsEventType event_type) {
- assert(event_type == JSEVENT_UNLOAD);
- UnregisterSelf();
-}
-
-
void DropTarget::Ref() {
AddRef();
}
==== //depot/googleclient/gears/opensource/gears/desktop/drop_target_ff.h#7 -
/home/nigeltao/srcgears3/googleclient/gears/opensource/gears/desktop/drop_target_ff.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drop_target_ff.h
2008-11-12 17:24:35.000000000 +1100
+++ googleclient/gears/opensource/gears/desktop/drop_target_ff.h
2008-11-12 17:24:12.000000000 +1100
@@ -50,16 +50,7 @@
JsObject *options,
std::string16 *error_out);
- void UnregisterSelf();
-
- // This is the JsEventHandlerInterface callback, not the
- // nsIDOMEventListener one. The latter is declared by the
- // NS_DECL_NSIDOMEVENTLISTENER above.
- virtual void HandleEvent(JsEventType event_type);
-
- bool GetDroppedFiles(nsIDragSession *drag_session,
- JsArray *files_out,
- std::string16 *error_out);
+ virtual void UnregisterSelf();
void Ref();
void Unref();
@@ -76,6 +67,9 @@
std::string16 *error_out);
void AddEventToJsObject(JsObject *js_object, nsIDOMEvent *event);
+ bool GetDroppedFiles(nsIDragSession *drag_session,
+ JsArray *files_out,
+ std::string16 *error_out);
void ProvideDebugVisualFeedback(bool is_drag_enter);
DISALLOW_EVIL_CONSTRUCTORS(DropTarget);
==== //depot/googleclient/gears/opensource/gears/desktop/drop_target_ie.cc#11 -
/home/nigeltao/srcgears3/googleclient/gears/opensource/gears/desktop/drop_target_ie.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drop_target_ie.cc
2008-11-12 17:24:35.000000000 +1100
+++ googleclient/gears/opensource/gears/desktop/drop_target_ie.cc
2008-11-12 17:24:14.000000000 +1100
@@ -329,12 +329,5 @@
}
-// A DropTarget instance automatically de-registers itself, on page unload.
-void DropTarget::HandleEvent(JsEventType event_type) {
- assert(event_type == JSEVENT_UNLOAD);
- UnregisterSelf();
-}
-
-
#endif // OS_WINCE
#endif // OFFICIAL_BUILD
==== //depot/googleclient/gears/opensource/gears/desktop/drop_target_ie.h#8 -
/home/nigeltao/srcgears3/googleclient/gears/opensource/gears/desktop/drop_target_ie.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drop_target_ie.h
2008-11-12 17:24:36.000000000 +1100
+++ googleclient/gears/opensource/gears/desktop/drop_target_ie.h
2008-11-12 17:24:15.000000000 +1100
@@ -90,9 +90,7 @@
STDMETHOD(HandleOnDragLeave)();
STDMETHOD(HandleOnDragDrop)();
- void UnregisterSelf();
-
- virtual void HandleEvent(JsEventType event_type);
+ virtual void UnregisterSelf();
private:
CComPtr<IDispatch> event_source_;
==== //depot/googleclient/gears/opensource/gears/desktop/drop_target_sf.cc#1 -
/home/nigeltao/srcgears3/googleclient/gears/opensource/gears/desktop/drop_target_sf.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drop_target_sf.cc
2008-11-12 17:24:36.000000000 +1100
+++ googleclient/gears/opensource/gears/desktop/drop_target_sf.cc
2008-11-12 17:25:38.000000000 +1100
@@ -327,11 +327,4 @@
}
-// A DropTarget instance automatically de-registers itself, on page unload.
-void DropTarget::HandleEvent(JsEventType event_type) {
- assert(event_type == JSEVENT_UNLOAD);
- UnregisterSelf();
-}
-
-
#endif // OFFICIAL_BUILD
==== //depot/googleclient/gears/opensource/gears/desktop/drop_target_sf.h#1 -
/home/nigeltao/srcgears3/googleclient/gears/opensource/gears/desktop/drop_target_sf.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drop_target_sf.h
2008-11-12 17:24:36.000000000 +1100
+++ googleclient/gears/opensource/gears/desktop/drop_target_sf.h
2008-11-12 17:26:06.000000000 +1100
@@ -51,9 +51,7 @@
JsObject *options,
std::string16 *error_out);
- void UnregisterSelf();
-
- virtual void HandleEvent(JsEventType event_type);
+ virtual void UnregisterSelf();
enum HtmlEventType {
HTML_EVENT_TYPE_DRAG_ENTER,