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

Unified Diff: chrome/plugin/webplugin_delegate_stub.cc

Issue 3404024: Add NULL-checks to plugin delegate message handlers (Closed)
Patch Set: Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/webplugin_delegate_stub.cc
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 8e74aa7df290a6a4e4cb82cf67ed748a6d12837e..17f02222b28887e3e0f17ab1d65f5d94244334ba 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -337,29 +337,35 @@ void WebPluginDelegateStub::OnSendJavaScriptStream(const GURL& url,
}
void WebPluginDelegateStub::OnSetContentAreaFocus(bool has_focus) {
- delegate_->SetContentAreaHasFocus(has_focus);
+ if (delegate_)
+ delegate_->SetContentAreaHasFocus(has_focus);
}
#if defined(OS_MACOSX)
void WebPluginDelegateStub::OnSetWindowFocus(bool has_focus) {
- delegate_->SetWindowHasFocus(has_focus);
+ if (delegate_)
+ delegate_->SetWindowHasFocus(has_focus);
}
void WebPluginDelegateStub::OnContainerHidden() {
- delegate_->SetContainerVisibility(false);
+ if (delegate_)
+ delegate_->SetContainerVisibility(false);
}
void WebPluginDelegateStub::OnContainerShown(gfx::Rect window_frame,
gfx::Rect view_frame,
bool has_focus) {
- delegate_->WindowFrameChanged(window_frame, view_frame);
- delegate_->SetContainerVisibility(true);
- delegate_->SetWindowHasFocus(has_focus);
+ if (delegate_) {
+ delegate_->WindowFrameChanged(window_frame, view_frame);
+ delegate_->SetContainerVisibility(true);
+ delegate_->SetWindowHasFocus(has_focus);
+ }
}
void WebPluginDelegateStub::OnWindowFrameChanged(const gfx::Rect& window_frame,
const gfx::Rect& view_frame) {
- delegate_->WindowFrameChanged(window_frame, view_frame);
+ if (delegate_)
+ delegate_->WindowFrameChanged(window_frame, view_frame);
}
#endif // OS_MACOSX
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698