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

Side by Side Diff: third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp

Issue 2605733002: [TEST] Forbid ImageResourceContent::updateImage() reentrancy
Patch Set: Created 3 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 | « third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h ('k') | 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/loader/resource/ImageResourceContent.h" 5 #include "core/loader/resource/ImageResourceContent.h"
6 6
7 #include "core/loader/resource/ImageResource.h" 7 #include "core/loader/resource/ImageResource.h"
8 #include "core/loader/resource/ImageResourceInfo.h" 8 #include "core/loader/resource/ImageResourceInfo.h"
9 #include "core/loader/resource/ImageResourceObserver.h" 9 #include "core/loader/resource/ImageResourceObserver.h"
10 #include "core/svg/graphics/SVGImage.h" 10 #include "core/svg/graphics/SVGImage.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 NotifyFinishOption notifyingFinishOption) { 301 NotifyFinishOption notifyingFinishOption) {
302 clearImage(); 302 clearImage();
303 notifyObservers(notifyingFinishOption); 303 notifyObservers(notifyingFinishOption);
304 } 304 }
305 305
306 void ImageResourceContent::updateImage(PassRefPtr<SharedBuffer> data, 306 void ImageResourceContent::updateImage(PassRefPtr<SharedBuffer> data,
307 ClearImageOption clearImageOption, 307 ClearImageOption clearImageOption,
308 bool allDataReceived) { 308 bool allDataReceived) {
309 TRACE_EVENT0("blink", "ImageResourceContent::updateImage"); 309 TRACE_EVENT0("blink", "ImageResourceContent::updateImage");
310 310
311 DCHECK(!m_isUpdateImageBeingCalled);
312 AutoReset<bool> scope(&m_isUpdateImageBeingCalled, true);
313
311 if (clearImageOption == ImageResourceContent::ClearExistingImage) { 314 if (clearImageOption == ImageResourceContent::ClearExistingImage) {
312 clearImage(); 315 clearImage();
313 } 316 }
314 317
315 // Have the image update its data from its internal buffer. It will not do 318 // Have the image update its data from its internal buffer. It will not do
316 // anything now, but will delay decoding until queried for info (like size or 319 // anything now, but will delay decoding until queried for info (like size or
317 // specific image frames). 320 // specific image frames).
318 if (data) { 321 if (data) {
319 if (!m_image) 322 if (!m_image)
320 m_image = createImage(); 323 m_image = createImage();
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 471
469 const ResourceResponse& ImageResourceContent::response() const { 472 const ResourceResponse& ImageResourceContent::response() const {
470 return m_info->response(); 473 return m_info->response();
471 } 474 }
472 475
473 const ResourceError& ImageResourceContent::resourceError() const { 476 const ResourceError& ImageResourceContent::resourceError() const {
474 return m_info->resourceError(); 477 return m_info->resourceError();
475 } 478 }
476 479
477 } // namespace blink 480 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698