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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 1117023002: Keep event page alive when there's some Pepper plugin on it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Send the event through the correct RenderFrame. Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 } 1172 }
1173 1173
1174 blink::WebView* RenderViewImpl::webview() const { 1174 blink::WebView* RenderViewImpl::webview() const {
1175 return static_cast<blink::WebView*>(webwidget()); 1175 return static_cast<blink::WebView*>(webwidget());
1176 } 1176 }
1177 1177
1178 #if defined(ENABLE_PLUGINS) 1178 #if defined(ENABLE_PLUGINS)
1179 void RenderViewImpl::PepperInstanceCreated( 1179 void RenderViewImpl::PepperInstanceCreated(
1180 PepperPluginInstanceImpl* instance) { 1180 PepperPluginInstanceImpl* instance) {
1181 active_pepper_instances_.insert(instance); 1181 active_pepper_instances_.insert(instance);
1182
1183 RenderFrameImpl* const render_frame = instance->render_frame();
1184 if (render_frame)
nasko 2015/05/19 17:49:34 RenderFrame should never be null, so there is no r
emaxx 2015/05/19 18:14:59 You are right. I've now placed a DCHECK here - to
nasko 2015/05/19 18:51:51 In general, we don't add DCHECK when the line afte
1185 render_frame->Send(
1186 new FrameHostMsg_PepperInstanceCreated(render_frame->GetRoutingID()));
1182 } 1187 }
1183 1188
1184 void RenderViewImpl::PepperInstanceDeleted( 1189 void RenderViewImpl::PepperInstanceDeleted(
1185 PepperPluginInstanceImpl* instance) { 1190 PepperPluginInstanceImpl* instance) {
1186 active_pepper_instances_.erase(instance); 1191 active_pepper_instances_.erase(instance);
1187 1192
1188 if (pepper_last_mouse_event_target_ == instance) 1193 if (pepper_last_mouse_event_target_ == instance)
1189 pepper_last_mouse_event_target_ = NULL; 1194 pepper_last_mouse_event_target_ = NULL;
1190 if (focused_pepper_plugin_ == instance) 1195 if (focused_pepper_plugin_ == instance)
1191 PepperFocusChanged(instance, false); 1196 PepperFocusChanged(instance, false);
1197
1198 RenderFrameImpl* const render_frame = instance->render_frame();
1199 if (render_frame)
1200 render_frame->Send(
1201 new FrameHostMsg_PepperInstanceDeleted(render_frame->GetRoutingID()));
1192 } 1202 }
1193 1203
1194 void RenderViewImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, 1204 void RenderViewImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance,
1195 bool focused) { 1205 bool focused) {
1196 if (focused) 1206 if (focused)
1197 focused_pepper_plugin_ = instance; 1207 focused_pepper_plugin_ = instance;
1198 else if (focused_pepper_plugin_ == instance) 1208 else if (focused_pepper_plugin_ == instance)
1199 focused_pepper_plugin_ = NULL; 1209 focused_pepper_plugin_ = NULL;
1200 1210
1201 UpdateTextInputType(); 1211 UpdateTextInputType();
(...skipping 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after
3769 std::vector<gfx::Size> sizes; 3779 std::vector<gfx::Size> sizes;
3770 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 3780 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
3771 if (!url.isEmpty()) 3781 if (!url.isEmpty())
3772 urls.push_back( 3782 urls.push_back(
3773 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 3783 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
3774 } 3784 }
3775 SendUpdateFaviconURL(urls); 3785 SendUpdateFaviconURL(urls);
3776 } 3786 }
3777 3787
3778 } // namespace content 3788 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/web_contents_observer.h ('k') | extensions/browser/extension_web_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698