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

Side by Side Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 23444058: Use downloadToFile option when XHR downloads a Blob (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 2 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) 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 return false; 123 return false;
124 } 124 }
125 125
126 static bool prepareResourceBuffer(Resource* cachedResource, bool* hasZeroSize) 126 static bool prepareResourceBuffer(Resource* cachedResource, bool* hasZeroSize)
127 { 127 {
128 *hasZeroSize = false; 128 *hasZeroSize = false;
129 if (!cachedResource) 129 if (!cachedResource)
130 return false; 130 return false;
131 131
132 if (cachedResource->dataBufferingPolicy() == DoNotBufferData)
133 return false;
134
132 // Zero-sized resources don't have data at all -- so fake the empty buffer, instead of indicating error by returning 0. 135 // Zero-sized resources don't have data at all -- so fake the empty buffer, instead of indicating error by returning 0.
133 if (!cachedResource->encodedSize()) { 136 if (!cachedResource->encodedSize()) {
134 *hasZeroSize = true; 137 *hasZeroSize = true;
135 return true; 138 return true;
136 } 139 }
137 140
138 if (cachedResource->isPurgeable()) { 141 if (cachedResource->isPurgeable()) {
139 // If the resource is purgeable then make it unpurgeable to get 142 // If the resource is purgeable then make it unpurgeable to get
140 // get its data. This might fail, in which case we return an 143 // get its data. This might fail, in which case we return an
141 // empty String. 144 // empty String.
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 } 1292 }
1290 1293
1291 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1294 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1292 { 1295 {
1293 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1296 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1294 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1297 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1295 } 1298 }
1296 1299
1297 } // namespace WebCore 1300 } // namespace WebCore
1298 1301
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698