Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: Source/testing/runner/EventSender.cpp

Issue 22548008: EventSender::contextClick leaks NPObject used as its return value, leading to a leak of DOMWindow. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/events/event-sender-context-click-leak-document-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 initMouseEvent(WebInputEvent::MouseDown, WebMouseEvent::ButtonRight, lastMou sePos, &event, getCurrentEventTimeSec(m_delegate)); 884 initMouseEvent(WebInputEvent::MouseDown, WebMouseEvent::ButtonRight, lastMou sePos, &event, getCurrentEventTimeSec(m_delegate));
885 webview()->handleInputEvent(event); 885 webview()->handleInputEvent(event);
886 886
887 #ifdef WIN32 887 #ifdef WIN32
888 initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMouse Pos, &event, getCurrentEventTimeSec(m_delegate)); 888 initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMouse Pos, &event, getCurrentEventTimeSec(m_delegate));
889 webview()->handleInputEvent(event); 889 webview()->handleInputEvent(event);
890 890
891 pressedButton = WebMouseEvent::ButtonNone; 891 pressedButton = WebMouseEvent::ButtonNone;
892 #endif 892 #endif
893 893
894 result->set(WebBindings::makeStringArray(makeMenuItemStringsFor(m_lastContex tMenuData.get(), m_delegate))); 894 NPObject* resultArray = WebBindings::makeStringArray(makeMenuItemStringsFor( m_lastContextMenuData.get(), m_delegate));
895 result->set(resultArray);
896 WebBindings::releaseObject(resultArray);
897
898 m_lastContextMenuData.reset();
895 } 899 }
896 900
897 class MouseDownTask: public WebMethodTask<EventSender> { 901 class MouseDownTask: public WebMethodTask<EventSender> {
898 public: 902 public:
899 MouseDownTask(EventSender* obj, const CppArgumentList& arg) 903 MouseDownTask(EventSender* obj, const CppArgumentList& arg)
900 : WebMethodTask<EventSender>(obj), m_arguments(arg) { } 904 : WebMethodTask<EventSender>(obj), m_arguments(arg) { }
901 virtual void runIfValid() { m_object->mouseDown(m_arguments, 0); } 905 virtual void runIfValid() { m_object->mouseDown(m_arguments, 0); }
902 906
903 private: 907 private:
904 CppArgumentList m_arguments; 908 CppArgumentList m_arguments;
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 { 1378 {
1375 result->setNull(); 1379 result->setNull();
1376 } 1380 }
1377 1381
1378 void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result) 1382 void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result)
1379 { 1383 {
1380 result->setNull(); 1384 result->setNull();
1381 } 1385 }
1382 1386
1383 } 1387 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/event-sender-context-click-leak-document-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698