OLD | NEW |
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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 callback->sendFailure("No frame for given id found"); | 509 callback->sendFailure("No frame for given id found"); |
510 return; | 510 return; |
511 } | 511 } |
512 String content; | 512 String content; |
513 bool base64Encoded; | 513 bool base64Encoded; |
514 if (!InspectorPageAgent::cachedResourceContent(InspectorPageAgent::cachedRes
ource(frame, KURL(ParsedURLString, url)), &content, &base64Encoded)) { | 514 if (!InspectorPageAgent::cachedResourceContent(InspectorPageAgent::cachedRes
ource(frame, KURL(ParsedURLString, url)), &content, &base64Encoded)) { |
515 callback->sendFailure("No resource with given URL found"); | 515 callback->sendFailure("No resource with given URL found"); |
516 return; | 516 return; |
517 } | 517 } |
518 | 518 |
519 std::unique_ptr<protocol::Array<protocol::Debugger::SearchMatch>> results; | 519 callback->sendSuccess(V8ContentSearchUtil::searchInTextByLines(m_v8Session,
content, query, caseSensitive, isRegex)); |
520 results = V8ContentSearchUtil::searchInTextByLines(m_v8Session, content, que
ry, caseSensitive, isRegex); | |
521 callback->sendSuccess(std::move(results)); | |
522 } | 520 } |
523 | 521 |
524 void InspectorPageAgent::searchInResource(ErrorString*, const String& frameId, c
onst String& url, const String& query, const Maybe<bool>& optionalCaseSensitive,
const Maybe<bool>& optionalIsRegex, std::unique_ptr<SearchInResourceCallback> c
allback) | 522 void InspectorPageAgent::searchInResource(ErrorString*, const String& frameId, c
onst String& url, const String& query, const Maybe<bool>& optionalCaseSensitive,
const Maybe<bool>& optionalIsRegex, std::unique_ptr<SearchInResourceCallback> c
allback) |
525 { | 523 { |
526 if (!m_enabled) { | 524 if (!m_enabled) { |
527 callback->sendFailure("Agent is not enabled."); | 525 callback->sendFailure("Agent is not enabled."); |
528 return; | 526 return; |
529 } | 527 } |
530 m_inspectorResourceContentLoader->ensureResourcesContentLoaded(m_resourceCon
tentLoaderClientId, WTF::bind(&InspectorPageAgent::searchContentAfterResourcesCo
ntentLoaded, wrapPersistent(this), frameId, url, query, optionalCaseSensitive.fr
omMaybe(false), optionalIsRegex.fromMaybe(false), passed(std::move(callback)))); | 528 m_inspectorResourceContentLoader->ensureResourcesContentLoaded(m_resourceCon
tentLoaderClientId, WTF::bind(&InspectorPageAgent::searchContentAfterResourcesCo
ntentLoaded, wrapPersistent(this), frameId, url, query, optionalCaseSensitive.fr
omMaybe(false), optionalIsRegex.fromMaybe(false), passed(std::move(callback)))); |
531 } | 529 } |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 } | 756 } |
759 | 757 |
760 DEFINE_TRACE(InspectorPageAgent) | 758 DEFINE_TRACE(InspectorPageAgent) |
761 { | 759 { |
762 visitor->trace(m_inspectedFrames); | 760 visitor->trace(m_inspectedFrames); |
763 visitor->trace(m_inspectorResourceContentLoader); | 761 visitor->trace(m_inspectorResourceContentLoader); |
764 InspectorBaseAgent::trace(visitor); | 762 InspectorBaseAgent::trace(visitor); |
765 } | 763 } |
766 | 764 |
767 } // namespace blink | 765 } // namespace blink |
OLD | NEW |