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

Side by Side Diff: webkit/glue/webplugin_impl.cc

Issue 75026: Ensure we check the page pointer before using it after we come out of NPP_Han... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "webkit/glue/webplugin_impl.h" 6 #include "webkit/glue/webplugin_impl.h"
7 7
8 #include "Cursor.h" 8 #include "Cursor.h"
9 #include "Document.h" 9 #include "Document.h"
10 #include "DocumentLoader.h" 10 #include "DocumentLoader.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 return; 856 return;
857 } 857 }
858 858
859 // TODO(pkasting): http://b/1119691 This conditional seems exactly backwards, 859 // TODO(pkasting): http://b/1119691 This conditional seems exactly backwards,
860 // but it matches Safari's code, and if I reverse it, giving focus to a 860 // but it matches Safari's code, and if I reverse it, giving focus to a
861 // transparent (windowless) plugin fails. 861 // transparent (windowless) plugin fails.
862 WebCursor cursor; 862 WebCursor cursor;
863 if (!delegate_->HandleEvent(&np_event, &cursor)) 863 if (!delegate_->HandleEvent(&np_event, &cursor))
864 event->setDefaultHandled(); 864 event->setDefaultHandled();
865 865
866 WebCore::Page* page = parent_view->frame()->page();
867 if (!page)
868 return;
869
866 ChromeClientImpl* chrome_client = 870 ChromeClientImpl* chrome_client =
867 static_cast<ChromeClientImpl*>( 871 static_cast<ChromeClientImpl*>(page->chrome()->client());
868 parent_view->frame()->page()->chrome()->client());
869 872
870 // A windowless plugin can change the cursor in response to the WM_MOUSEMOVE 873 // A windowless plugin can change the cursor in response to the WM_MOUSEMOVE
871 // event. We need to reflect the changed cursor in the frame view as the 874 // event. We need to reflect the changed cursor in the frame view as the
872 // mouse is moved in the boundaries of the windowless plugin. 875 // mouse is moved in the boundaries of the windowless plugin.
873 chrome_client->SetCursorForPlugin(cursor); 876 chrome_client->SetCursorForPlugin(cursor);
874 877
875 #else 878 #else
876 NOTIMPLEMENTED(); 879 NOTIMPLEMENTED();
877 #endif 880 #endif
878 } 881 }
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 client_index = clients_.erase(client_index); 1424 client_index = clients_.erase(client_index);
1422 if (resource_client) 1425 if (resource_client)
1423 resource_client->DidFail(); 1426 resource_client->DidFail();
1424 } 1427 }
1425 1428
1426 // This needs to be called now and not in the destructor since the 1429 // This needs to be called now and not in the destructor since the
1427 // webframe_ might not be valid anymore. 1430 // webframe_ might not be valid anymore.
1428 webframe_->set_plugin_delegate(NULL); 1431 webframe_->set_plugin_delegate(NULL);
1429 webframe_ = NULL; 1432 webframe_ = NULL;
1430 } 1433 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698