summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 23:09:47 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 23:09:47 +0000
commit89c452823997708a50f11730d94615e4e701a003 (patch)
tree2fc12cba9cb3b3e4bef017fc00cf88e899335d73 /webkit/glue
parentc7e162722290bdc92c58a0e975fae0b4e0718a92 (diff)
downloadchromium_src-89c452823997708a50f11730d94615e4e701a003.zip
chromium_src-89c452823997708a50f11730d94615e4e701a003.tar.gz
chromium_src-89c452823997708a50f11730d94615e4e701a003.tar.bz2
Fix SetProp leaks in plugin tests.
Bug=63779 Review URL: http://codereview.chromium.org/5224003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/plugins/test/plugin_create_instance_in_paint.cc1
-rw-r--r--webkit/glue/plugins/test/plugin_get_javascript_url_test.cc21
-rw-r--r--webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc2
-rw-r--r--webkit/glue/plugins/test/plugin_windowed_test.cc4
4 files changed, 21 insertions, 7 deletions
diff --git a/webkit/glue/plugins/test/plugin_create_instance_in_paint.cc b/webkit/glue/plugins/test/plugin_create_instance_in_paint.cc
index 305e86f..f98f89b 100644
--- a/webkit/glue/plugins/test/plugin_create_instance_in_paint.cc
+++ b/webkit/glue/plugins/test/plugin_create_instance_in_paint.cc
@@ -64,6 +64,7 @@ LRESULT CALLBACK CreateInstanceInPaintTest::WindowProc(
reinterpret_cast<CreateInstanceInPaintTest*>
(::GetProp(window, L"Plugin_Instance"));
if (this_instance->test_id() == "1" && !this_instance->created_) {
+ ::RemoveProp(window, L"Plugin_Instance");
this_instance->created_ = true;
this_instance->HostFunctions()->geturlnotify(
this_instance->id(), "javascript:CreateNewInstance()", NULL,
diff --git a/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc b/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc
index 344cae3..50f5e5a 100644
--- a/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc
+++ b/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc
@@ -23,7 +23,8 @@ const int kNPNEvaluateTimerElapse = 50;
namespace NPAPIClient {
-ExecuteGetJavascriptUrlTest::ExecuteGetJavascriptUrlTest(NPP id, NPNetscapeFuncs *host_functions)
+ExecuteGetJavascriptUrlTest::ExecuteGetJavascriptUrlTest(
+ NPP id, NPNetscapeFuncs *host_functions)
: PluginTest(id, host_functions),
test_started_(false),
#ifdef OS_WIN
@@ -67,6 +68,8 @@ void CALLBACK ExecuteGetJavascriptUrlTest::TimerProc(
reinterpret_cast<ExecuteGetJavascriptUrlTest*>
(::GetProp(window, L"Plugin_Instance"));
+ ::RemoveProp(window, L"Plugin_Instance");
+
NPObject *window_obj = NULL;
this_instance->HostFunctions()->getvalue(this_instance->id(),
NPNVWindowNPObject,
@@ -90,8 +93,10 @@ void CALLBACK ExecuteGetJavascriptUrlTest::TimerProc(
}
#endif
-NPError ExecuteGetJavascriptUrlTest::NewStream(NPMIMEType type, NPStream* stream,
- NPBool seekable, uint16* stype) {
+NPError ExecuteGetJavascriptUrlTest::NewStream(NPMIMEType type,
+ NPStream* stream,
+ NPBool seekable,
+ uint16* stype) {
if (stream == NULL) {
SetError("NewStream got null stream");
return NPERR_INVALID_PARAM;
@@ -123,8 +128,8 @@ int32 ExecuteGetJavascriptUrlTest::WriteReady(NPStream *stream) {
return STREAM_CHUNK;
}
-int32 ExecuteGetJavascriptUrlTest::Write(NPStream *stream, int32 offset, int32 len,
- void *buffer) {
+int32 ExecuteGetJavascriptUrlTest::Write(NPStream *stream, int32 offset,
+ int32 len, void *buffer) {
if (stream == NULL) {
SetError("Write got null stream");
return -1;
@@ -155,7 +160,8 @@ int32 ExecuteGetJavascriptUrlTest::Write(NPStream *stream, int32 offset, int32 l
}
-NPError ExecuteGetJavascriptUrlTest::DestroyStream(NPStream *stream, NPError reason) {
+NPError ExecuteGetJavascriptUrlTest::DestroyStream(NPStream *stream,
+ NPError reason) {
if (stream == NULL) {
SetError("NewStream got null stream");
return NPERR_INVALID_PARAM;
@@ -184,7 +190,8 @@ NPError ExecuteGetJavascriptUrlTest::DestroyStream(NPStream *stream, NPError rea
return NPERR_NO_ERROR;
}
-void ExecuteGetJavascriptUrlTest::URLNotify(const char* url, NPReason reason, void* data) {
+void ExecuteGetJavascriptUrlTest::URLNotify(const char* url, NPReason reason,
+ void* data) {
COMPILE_ASSERT(sizeof(unsigned long) <= sizeof(data),
cast_validity_check);
diff --git a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc b/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc
index 7277211..4564506 100644
--- a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc
+++ b/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc
@@ -46,6 +46,8 @@ void CALLBACK NPObjectLifetimeTest::TimerProc(
reinterpret_cast<NPObjectLifetimeTest*>
(::GetProp(window, L"Plugin_Instance"));
KillTimer(window, this_instance->timer_id_);
+ ::RemoveProp(window, L"Plugin_Instance");
+
this_instance->timer_id_ = 0;
this_instance->other_plugin_instance_object_ =
diff --git a/webkit/glue/plugins/test/plugin_windowed_test.cc b/webkit/glue/plugins/test/plugin_windowed_test.cc
index 0c46d68..2ed3ae6 100644
--- a/webkit/glue/plugins/test/plugin_windowed_test.cc
+++ b/webkit/glue/plugins/test/plugin_windowed_test.cc
@@ -138,6 +138,10 @@ LRESULT CALLBACK WindowedPluginTest::WindowProc(
this_ptr->done_ = true;
CallJSFunction(this_ptr, "PluginCreated");
}
+
+ if (this_ptr->done_) {
+ ::RemoveProp(window, L"Plugin_Instance");
+ }
}
return DefWindowProc(window, message, wparam, lparam);