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

Side by Side Diff: webkit/api/src/WebPluginContainerImpl.cpp

Issue 182003: Fix a crash that the reliability bots caught.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/data/layout_tests/chrome/plugins/get-url-with-iframe-target-no-crash.html » ('j') | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 const WebURLRequest& request, const WebString& target, bool notifyNeeded, void* notifyData) 248 const WebURLRequest& request, const WebString& target, bool notifyNeeded, void* notifyData)
249 { 249 {
250 Frame* frame = m_element->document()->frame(); 250 Frame* frame = m_element->document()->frame();
251 if (!frame) 251 if (!frame)
252 return; // FIXME: send a notification in this case? 252 return; // FIXME: send a notification in this case?
253 253
254 if (notifyNeeded) { 254 if (notifyNeeded) {
255 // FIXME: This is a bit of hack to allow us to observe completion of 255 // FIXME: This is a bit of hack to allow us to observe completion of
256 // our frame request. It would be better to evolve FrameLoader to 256 // our frame request. It would be better to evolve FrameLoader to
257 // support a completion callback instead. 257 // support a completion callback instead.
258 WebDataSourceImpl::setNextPluginLoadObserver( 258 WebPluginLoadObserver* observer =
259 new WebPluginLoadObserver(this, request.url(), notifyData)); 259 new WebPluginLoadObserver(this, request.url(), notifyData);
260 m_pluginLoadObservers.append(observer);
261 WebDataSourceImpl::setNextPluginLoadObserver(observer);
260 } 262 }
261 263
262 FrameLoadRequest frameRequest(request.toResourceRequest()); 264 FrameLoadRequest frameRequest(request.toResourceRequest());
263 frameRequest.setFrameName(target); 265 frameRequest.setFrameName(target);
264 266
265 frame->loader()->loadFrameRequest( 267 frame->loader()->loadFrameRequest(
266 frameRequest, 268 frameRequest,
267 false, // lock history 269 false, // lock history
268 false, // lock back forward list 270 false, // lock back forward list
269 0, // event 271 0, // event
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 size_t pos = m_pluginLoadObservers.find(observer); 307 size_t pos = m_pluginLoadObservers.find(observer);
306 if (pos == notFound) 308 if (pos == notFound)
307 return; 309 return;
308 m_pluginLoadObservers.remove(pos); 310 m_pluginLoadObservers.remove(pos);
309 } 311 }
310 312
311 // Private methods ------------------------------------------------------------- 313 // Private methods -------------------------------------------------------------
312 314
313 WebPluginContainerImpl::~WebPluginContainerImpl() 315 WebPluginContainerImpl::~WebPluginContainerImpl()
314 { 316 {
317 for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i)
318 m_pluginLoadObservers[i]->clearPluginContainer();
315 m_webPlugin->destroy(); 319 m_webPlugin->destroy();
316 } 320 }
317 321
318 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) 322 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
319 { 323 {
320 ASSERT(parent()->isFrameView()); 324 ASSERT(parent()->isFrameView());
321 325
322 // We cache the parent FrameView here as the plugin widget could be deleted 326 // We cache the parent FrameView here as the plugin widget could be deleted
323 // in the call to HandleEvent. See http://b/issue?id=1362948 327 // in the call to HandleEvent. See http://b/issue?id=1362948
324 FrameView* parentView = static_cast<FrameView*>(parent()); 328 FrameView* parentView = static_cast<FrameView*>(parent());
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 roundedIntPoint(iframeRenderer->localToAbsolute()); 515 roundedIntPoint(iframeRenderer->localToAbsolute());
512 RenderBox* rbox = toRenderBox(iframeRenderer); 516 RenderBox* rbox = toRenderBox(iframeRenderer);
513 IntSize size(rbox->width(), rbox->height()); 517 IntSize size(rbox->width(), rbox->height());
514 cutOutRects.append(IntRect(point, size)); 518 cutOutRects.append(IntRect(point, size));
515 } 519 }
516 } 520 }
517 } 521 }
518 } 522 }
519 523
520 } // namespace WebKit 524 } // namespace WebKit
OLDNEW
« no previous file with comments | « no previous file | webkit/data/layout_tests/chrome/plugins/get-url-with-iframe-target-no-crash.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698