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

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

Issue 2728683007: Fix crash when de-referencing the WebFrameWidget. (Closed)
Patch Set: 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 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after
2529 page()->willCloseLayerTreeView(*m_layerTreeView, nullptr); 2529 page()->willCloseLayerTreeView(*m_layerTreeView, nullptr);
2530 2530
2531 setRootLayer(nullptr); 2531 setRootLayer(nullptr);
2532 m_animationHost = nullptr; 2532 m_animationHost = nullptr;
2533 2533
2534 m_mutator = nullptr; 2534 m_mutator = nullptr;
2535 m_layerTreeView = nullptr; 2535 m_layerTreeView = nullptr;
2536 } 2536 }
2537 2537
2538 void WebViewImpl::didAcquirePointerLock() { 2538 void WebViewImpl::didAcquirePointerLock() {
2539 mainFrameImpl()->frameWidget()->didAcquirePointerLock(); 2539 if (mainFrameImpl())
2540 mainFrameImpl()->frameWidget()->didAcquirePointerLock();
2540 } 2541 }
2541 2542
2542 void WebViewImpl::didNotAcquirePointerLock() { 2543 void WebViewImpl::didNotAcquirePointerLock() {
2543 mainFrameImpl()->frameWidget()->didNotAcquirePointerLock(); 2544 if (mainFrameImpl())
2545 mainFrameImpl()->frameWidget()->didNotAcquirePointerLock();
2544 } 2546 }
2545 2547
2546 void WebViewImpl::didLosePointerLock() { 2548 void WebViewImpl::didLosePointerLock() {
2547 mainFrameImpl()->frameWidget()->didLosePointerLock(); 2549 if (mainFrameImpl())
dcheng 2017/03/03 23:57:24 Please add some comments here too to document the
lfg 2017/03/06 21:31:01 Done.
2550 mainFrameImpl()->frameWidget()->didLosePointerLock();
2548 } 2551 }
2549 2552
2550 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as 2553 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
2551 // well. This code needs to be refactored (http://crbug.com/629721). 2554 // well. This code needs to be refactored (http://crbug.com/629721).
2552 bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) { 2555 bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) {
2553 WebRange range = compositionRange(); 2556 WebRange range = compositionRange();
2554 if (range.isEmpty()) 2557 if (range.isEmpty())
2555 return false; 2558 return false;
2556 2559
2557 WebLocalFrame* frame = focusedFrame(); 2560 WebLocalFrame* frame = focusedFrame();
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after
4162 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4165 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4163 return nullptr; 4166 return nullptr;
4164 return focusedFrame; 4167 return focusedFrame;
4165 } 4168 }
4166 4169
4167 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4170 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4168 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4171 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4169 } 4172 }
4170 4173
4171 } // namespace blink 4174 } // 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