| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 return false; | 122 return false; |
| 123 } | 123 } |
| 124 | 124 |
| 125 static bool prepareResourceBuffer(Resource* cachedResource, bool* hasZeroSize) | 125 static bool prepareResourceBuffer(Resource* cachedResource, bool* hasZeroSize) |
| 126 { | 126 { |
| 127 *hasZeroSize = false; | 127 *hasZeroSize = false; |
| 128 if (!cachedResource) | 128 if (!cachedResource) |
| 129 return false; | 129 return false; |
| 130 | 130 |
| 131 if (cachedResource->dataBufferingPolicy() == DoNotBufferData) |
| 132 return false; |
| 133 |
| 131 // Zero-sized resources don't have data at all -- so fake the empty buffer,
instead of indicating error by returning 0. | 134 // Zero-sized resources don't have data at all -- so fake the empty buffer,
instead of indicating error by returning 0. |
| 132 if (!cachedResource->encodedSize()) { | 135 if (!cachedResource->encodedSize()) { |
| 133 *hasZeroSize = true; | 136 *hasZeroSize = true; |
| 134 return true; | 137 return true; |
| 135 } | 138 } |
| 136 | 139 |
| 137 if (cachedResource->isPurgeable()) { | 140 if (cachedResource->isPurgeable()) { |
| 138 // If the resource is purgeable then make it unpurgeable to get | 141 // If the resource is purgeable then make it unpurgeable to get |
| 139 // get its data. This might fail, in which case we return an | 142 // get its data. This might fail, in which case we return an |
| 140 // empty String. | 143 // empty String. |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 } | 1299 } |
| 1297 | 1300 |
| 1298 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) | 1301 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) |
| 1299 { | 1302 { |
| 1300 m_state->setBoolean(PageAgentState::showSizeOnResize, show); | 1303 m_state->setBoolean(PageAgentState::showSizeOnResize, show); |
| 1301 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; | 1304 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; |
| 1302 } | 1305 } |
| 1303 | 1306 |
| 1304 } // namespace WebCore | 1307 } // namespace WebCore |
| 1305 | 1308 |
| OLD | NEW |