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

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

Issue 356723003: Add 'XHR' to the Resource::Type enum, and use it for XHR requests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Preflight. Created 6 years, 6 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 | Annotate | Revision Log
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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 if (cachedResource) { 243 if (cachedResource) {
244 switch (cachedResource->type()) { 244 switch (cachedResource->type()) {
245 case Resource::CSSStyleSheet: 245 case Resource::CSSStyleSheet:
246 *result = toCSSStyleSheetResource(cachedResource)->sheetText(false); 246 *result = toCSSStyleSheetResource(cachedResource)->sheetText(false);
247 return true; 247 return true;
248 case Resource::Script: 248 case Resource::Script:
249 *result = toScriptResource(cachedResource)->script(); 249 *result = toScriptResource(cachedResource)->script();
250 return true; 250 return true;
251 case Resource::MainResource: 251 case Resource::MainResource:
252 return false; 252 return false;
253 case Resource::XMLHttpRequest:
253 case Resource::Raw: { 254 case Resource::Raw: {
254 SharedBuffer* buffer = cachedResource->resourceBuffer(); 255 SharedBuffer* buffer = cachedResource->resourceBuffer();
255 if (!buffer) 256 if (!buffer)
256 return false; 257 return false;
257 OwnPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedRes ource->response().mimeType(), cachedResource->response().textEncodingName()); 258 OwnPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedRes ource->response().mimeType(), cachedResource->response().textEncodingName());
258 String content = decoder->decode(buffer->data(), buffer->size()); 259 String content = decoder->decode(buffer->data(), buffer->size());
259 *result = content + decoder->flush(); 260 *result = content + decoder->flush();
260 return true; 261 return true;
261 } 262 }
262 default: 263 default:
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 return InspectorPageAgent::MediaResource; 347 return InspectorPageAgent::MediaResource;
347 case Resource::TextTrack: 348 case Resource::TextTrack:
348 return InspectorPageAgent::TextTrackResource; 349 return InspectorPageAgent::TextTrackResource;
349 case Resource::CSSStyleSheet: 350 case Resource::CSSStyleSheet:
350 // Fall through. 351 // Fall through.
351 case Resource::XSLStyleSheet: 352 case Resource::XSLStyleSheet:
352 return InspectorPageAgent::StylesheetResource; 353 return InspectorPageAgent::StylesheetResource;
353 case Resource::Script: 354 case Resource::Script:
354 return InspectorPageAgent::ScriptResource; 355 return InspectorPageAgent::ScriptResource;
355 case Resource::Raw: 356 case Resource::Raw:
357 case Resource::XMLHttpRequest:
356 return InspectorPageAgent::XHRResource; 358 return InspectorPageAgent::XHRResource;
357 case Resource::ImportResource: 359 case Resource::ImportResource:
358 // Fall through. 360 // Fall through.
359 case Resource::MainResource: 361 case Resource::MainResource:
360 return InspectorPageAgent::DocumentResource; 362 return InspectorPageAgent::DocumentResource;
361 default: 363 default:
362 break; 364 break;
363 } 365 }
364 return InspectorPageAgent::OtherResource; 366 return InspectorPageAgent::OtherResource;
365 } 367 }
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con tent) 1389 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con tent)
1388 { 1390 {
1389 if (!m_editedResourceContent.contains(url)) 1391 if (!m_editedResourceContent.contains(url))
1390 return false; 1392 return false;
1391 *content = m_editedResourceContent.get(url); 1393 *content = m_editedResourceContent.get(url);
1392 return true; 1394 return true;
1393 } 1395 }
1394 1396
1395 } // namespace WebCore 1397 } // namespace WebCore
1396 1398
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceLoaderOptions.h ('k') | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698