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

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

Issue 836283002: Fix a crash in WebViewImpl::copyImageAt. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 3432 matching lines...) Expand 10 before | Expand all | Expand 10 after
3443 scaledPoint.scale(1 / pageScaleFactor(), 1 / pageScaleFactor()); 3443 scaledPoint.scale(1 / pageScaleFactor(), 1 / pageScaleFactor());
3444 return hitTestResultForWindowPos(scaledPoint); 3444 return hitTestResultForWindowPos(scaledPoint);
3445 } 3445 }
3446 3446
3447 void WebViewImpl::copyImageAt(const WebPoint& point) 3447 void WebViewImpl::copyImageAt(const WebPoint& point)
3448 { 3448 {
3449 if (!m_page) 3449 if (!m_page)
3450 return; 3450 return;
3451 3451
3452 HitTestResult result = hitTestResultForWindowPos(point); 3452 HitTestResult result = hitTestResultForWindowPos(point);
3453 Node* node = result.innerNonSharedNode(); 3453 if (!isHTMLCanvasElement(result.innerNonSharedNode()) && result.absoluteImag eURL().isEmpty()) {
3454 ASSERT(node);
3455
3456 if (!isHTMLCanvasElement(*node) && result.absoluteImageURL().isEmpty()) {
3457 // There isn't actually an image at these coordinates. Might be because 3454 // There isn't actually an image at these coordinates. Might be because
3458 // the window scrolled while the context menu was open or because the pa ge 3455 // the window scrolled while the context menu was open or because the pa ge
3459 // changed itself between when we thought there was an image here and wh en 3456 // changed itself between when we thought there was an image here and wh en
3460 // we actually tried to retreive the image. 3457 // we actually tried to retreive the image.
3461 // 3458 //
3462 // FIXME: implement a cache of the most recent HitTestResult to avoid ha ving 3459 // FIXME: implement a cache of the most recent HitTestResult to avoid ha ving
3463 // to do two hit tests. 3460 // to do two hit tests.
3464 return; 3461 return;
3465 } 3462 }
3466 3463
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
4507 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4504 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4508 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4505 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4509 } 4506 }
4510 4507
4511 void WebViewImpl::forceNextWebGLContextCreationToFail() 4508 void WebViewImpl::forceNextWebGLContextCreationToFail()
4512 { 4509 {
4513 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4510 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4514 } 4511 }
4515 4512
4516 } // namespace blink 4513 } // 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