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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2728683007: Fix crash when de-referencing the WebFrameWidget. (Closed)
Patch Set: add comments Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2531 page()->willCloseLayerTreeView(*m_layerTreeView, nullptr); 2531 page()->willCloseLayerTreeView(*m_layerTreeView, nullptr);
2532 2532
2533 setRootLayer(nullptr); 2533 setRootLayer(nullptr);
2534 m_animationHost = nullptr; 2534 m_animationHost = nullptr;
2535 2535
2536 m_mutator = nullptr; 2536 m_mutator = nullptr;
2537 m_layerTreeView = nullptr; 2537 m_layerTreeView = nullptr;
2538 } 2538 }
2539 2539
2540 void WebViewImpl::didAcquirePointerLock() { 2540 void WebViewImpl::didAcquirePointerLock() {
2541 mainFrameImpl()->frameWidget()->didAcquirePointerLock(); 2541 if (mainFrameImpl())
2542 mainFrameImpl()->frameWidget()->didAcquirePointerLock();
2542 } 2543 }
2543 2544
2544 void WebViewImpl::didNotAcquirePointerLock() { 2545 void WebViewImpl::didNotAcquirePointerLock() {
2545 mainFrameImpl()->frameWidget()->didNotAcquirePointerLock(); 2546 if (mainFrameImpl())
2547 mainFrameImpl()->frameWidget()->didNotAcquirePointerLock();
2546 } 2548 }
2547 2549
2548 void WebViewImpl::didLosePointerLock() { 2550 void WebViewImpl::didLosePointerLock() {
2549 mainFrameImpl()->frameWidget()->didLosePointerLock(); 2551 // Make sure that the main frame wasn't swapped-out when the pointer lock is
2552 // lost. There's a race that can happen when a pointer lock is requested, but
2553 // the browser swaps out the main frame while the pointer lock request is in
2554 // progress. This won't be needed once the main frame is refactored to not use
2555 // the WebViewImpl as its WebWidget.
2556 if (mainFrameImpl())
2557 mainFrameImpl()->frameWidget()->didLosePointerLock();
2550 } 2558 }
2551 2559
2552 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as 2560 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
2553 // well. This code needs to be refactored (http://crbug.com/629721). 2561 // well. This code needs to be refactored (http://crbug.com/629721).
2554 bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) { 2562 bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) {
2555 WebRange range = compositionRange(); 2563 WebRange range = compositionRange();
2556 if (range.isEmpty()) 2564 if (range.isEmpty())
2557 return false; 2565 return false;
2558 2566
2559 WebLocalFrame* frame = focusedFrame(); 2567 WebLocalFrame* frame = focusedFrame();
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after
4166 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4174 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4167 return nullptr; 4175 return nullptr;
4168 return focusedFrame; 4176 return focusedFrame;
4169 } 4177 }
4170 4178
4171 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4179 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4172 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4180 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4173 } 4181 }
4174 4182
4175 } // namespace blink 4183 } // namespace blink
OLDNEW
« 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