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

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

Issue 8370003: Merge 97702 - Web Inspector: Search in resource crashes when there is no resource with given url. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 9 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
« no previous file with comments | « LayoutTests/http/tests/inspector/search/search-in-non-existing-resource-expected.txt ('k') | 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 if (!loader) 496 if (!loader)
497 return; 497 return;
498 498
499 String content; 499 String content;
500 bool success = false; 500 bool success = false;
501 if (equalIgnoringFragmentIdentifier(kurl, loader->url())) 501 if (equalIgnoringFragmentIdentifier(kurl, loader->url()))
502 success = mainResourceContent(frame, false, &content); 502 success = mainResourceContent(frame, false, &content);
503 503
504 if (!success) { 504 if (!success) {
505 CachedResource* resource = cachedResource(frame, kurl); 505 CachedResource* resource = cachedResource(frame, kurl);
506 success = textContentForCachedResource(resource, &content); 506 if (resource)
507 success = textContentForCachedResource(resource, &content);
507 } 508 }
508 509
509 if (!success) 510 if (!success)
510 return; 511 return;
511 512
512 *results = ContentSearchUtils::searchInTextByLines(query, content); 513 *results = ContentSearchUtils::searchInTextByLines(query, content);
513 } 514 }
514 515
515 static PassRefPtr<InspectorObject> buildObjectForSearchResult(const String& fram eId, const String& url, int matchesCount) 516 static PassRefPtr<InspectorObject> buildObjectForSearchResult(const String& fram eId, const String& url, int matchesCount)
516 { 517 {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 result->setArray("childFrames", childrenArray); 681 result->setArray("childFrames", childrenArray);
681 } 682 }
682 childrenArray->pushObject(buildObjectForFrameTree(child)); 683 childrenArray->pushObject(buildObjectForFrameTree(child));
683 } 684 }
684 return result; 685 return result;
685 } 686 }
686 687
687 } // namespace WebCore 688 } // namespace WebCore
688 689
689 #endif // ENABLE(INSPECTOR) 690 #endif // ENABLE(INSPECTOR)
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/search/search-in-non-existing-resource-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698