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

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 test style and XHR Created 7 years 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 | « Source/core/fetch/ResourceLoaderHost.h ('k') | Source/core/loader/FrameFetchContext.h » ('j') | 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 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 return false; 124 return false;
125 } 125 }
126 126
127 static bool prepareResourceBuffer(Resource* cachedResource, bool* hasZeroSize) 127 static bool prepareResourceBuffer(Resource* cachedResource, bool* hasZeroSize)
128 { 128 {
129 *hasZeroSize = false; 129 *hasZeroSize = false;
130 if (!cachedResource) 130 if (!cachedResource)
131 return false; 131 return false;
132 132
133 if (cachedResource->dataBufferingPolicy() == DoNotBufferData)
134 return false;
135
133 // Zero-sized resources don't have data at all -- so fake the empty buffer, instead of indicating error by returning 0. 136 // Zero-sized resources don't have data at all -- so fake the empty buffer, instead of indicating error by returning 0.
134 if (!cachedResource->encodedSize()) { 137 if (!cachedResource->encodedSize()) {
135 *hasZeroSize = true; 138 *hasZeroSize = true;
136 return true; 139 return true;
137 } 140 }
138 141
139 if (cachedResource->isPurgeable()) { 142 if (cachedResource->isPurgeable()) {
140 // If the resource is purgeable then make it unpurgeable to get 143 // If the resource is purgeable then make it unpurgeable to get
141 // get its data. This might fail, in which case we return an 144 // get its data. This might fail, in which case we return an
142 // empty String. 145 // empty String.
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 } 1251 }
1249 1252
1250 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1253 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1251 { 1254 {
1252 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1255 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1253 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1256 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1254 } 1257 }
1255 1258
1256 } // namespace WebCore 1259 } // namespace WebCore
1257 1260
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceLoaderHost.h ('k') | Source/core/loader/FrameFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698