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

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

Issue 1839643009: RELEASE_ASSERT -> CHECK and ASSERT -> DCHECK in web. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return DCHECK_IS_ON checks. Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 m_private = new BMPImageDecoder(ImageDecoder::AlphaPremultiplied, ImageD ecoder::GammaAndColorProfileApplied, maxDecodedBytes); 57 m_private = new BMPImageDecoder(ImageDecoder::AlphaPremultiplied, ImageD ecoder::GammaAndColorProfileApplied, maxDecodedBytes);
58 break; 58 break;
59 case TypeICO: 59 case TypeICO:
60 m_private = new ICOImageDecoder(ImageDecoder::AlphaPremultiplied, ImageD ecoder::GammaAndColorProfileApplied, maxDecodedBytes); 60 m_private = new ICOImageDecoder(ImageDecoder::AlphaPremultiplied, ImageD ecoder::GammaAndColorProfileApplied, maxDecodedBytes);
61 break; 61 break;
62 } 62 }
63 } 63 }
64 64
65 void WebImageDecoder::setData(const WebData& data, bool allDataReceived) 65 void WebImageDecoder::setData(const WebData& data, bool allDataReceived)
66 { 66 {
67 ASSERT(m_private); 67 DCHECK(m_private);
68 m_private->setData(PassRefPtr<SharedBuffer>(data).get(), allDataReceived); 68 m_private->setData(PassRefPtr<SharedBuffer>(data).get(), allDataReceived);
69 } 69 }
70 70
71 bool WebImageDecoder::isFailed() const 71 bool WebImageDecoder::isFailed() const
72 { 72 {
73 ASSERT(m_private); 73 DCHECK(m_private);
74 return m_private->failed(); 74 return m_private->failed();
75 } 75 }
76 76
77 bool WebImageDecoder::isSizeAvailable() const 77 bool WebImageDecoder::isSizeAvailable() const
78 { 78 {
79 ASSERT(m_private); 79 DCHECK(m_private);
80 return m_private->isSizeAvailable(); 80 return m_private->isSizeAvailable();
81 } 81 }
82 82
83 WebSize WebImageDecoder::size() const 83 WebSize WebImageDecoder::size() const
84 { 84 {
85 ASSERT(m_private); 85 DCHECK(m_private);
86 return m_private->size(); 86 return m_private->size();
87 } 87 }
88 88
89 size_t WebImageDecoder::frameCount() const 89 size_t WebImageDecoder::frameCount() const
90 { 90 {
91 ASSERT(m_private); 91 DCHECK(m_private);
92 return m_private->frameCount(); 92 return m_private->frameCount();
93 } 93 }
94 94
95 bool WebImageDecoder::isFrameCompleteAtIndex(int index) const 95 bool WebImageDecoder::isFrameCompleteAtIndex(int index) const
96 { 96 {
97 ASSERT(m_private); 97 DCHECK(m_private);
98 ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index); 98 ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index);
99 if (!frameBuffer) 99 if (!frameBuffer)
100 return false; 100 return false;
101 return frameBuffer->getStatus() == ImageFrame::FrameComplete; 101 return frameBuffer->getStatus() == ImageFrame::FrameComplete;
102 } 102 }
103 103
104 WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const 104 WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const
105 { 105 {
106 ASSERT(m_private); 106 DCHECK(m_private);
107 ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index); 107 ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index);
108 if (!frameBuffer) 108 if (!frameBuffer)
109 return WebImage(); 109 return WebImage();
110 return WebImage(frameBuffer->bitmap()); 110 return WebImage(frameBuffer->bitmap());
111 } 111 }
112 112
113 } // namespace blink 113 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebHelperPluginImpl.cpp ('k') | third_party/WebKit/Source/web/WebInputEventConversion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698