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

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

Issue 350263002: Remove an unneccessary special case for the main resource from InspectorPageAgent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 242
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:
252 return false;
253 case Resource::Raw: { 251 case Resource::Raw: {
254 SharedBuffer* buffer = cachedResource->resourceBuffer(); 252 SharedBuffer* buffer = cachedResource->resourceBuffer();
255 if (!buffer) 253 if (!buffer)
256 return false; 254 return false;
257 OwnPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedRes ource->response().mimeType(), cachedResource->response().textEncodingName()); 255 OwnPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedRes ource->response().mimeType(), cachedResource->response().textEncodingName());
258 String content = decoder->decode(buffer->data(), buffer->size()); 256 String content = decoder->decode(buffer->data(), buffer->size());
259 *result = content + decoder->flush(); 257 *result = content + decoder->flush();
260 return true; 258 return true;
261 } 259 }
262 default: 260 default:
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con tent) 1385 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con tent)
1388 { 1386 {
1389 if (!m_editedResourceContent.contains(url)) 1387 if (!m_editedResourceContent.contains(url))
1390 return false; 1388 return false;
1391 *content = m_editedResourceContent.get(url); 1389 *content = m_editedResourceContent.get(url);
1392 return true; 1390 return true;
1393 } 1391 }
1394 1392
1395 } // namespace WebCore 1393 } // namespace WebCore
1396 1394
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698