| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 #include "core/inspector/InspectedFrames.h" | 56 #include "core/inspector/InspectedFrames.h" |
| 57 #include "core/inspector/InspectorCSSAgent.h" | 57 #include "core/inspector/InspectorCSSAgent.h" |
| 58 #include "core/inspector/InspectorInstrumentation.h" | 58 #include "core/inspector/InspectorInstrumentation.h" |
| 59 #include "core/inspector/InspectorResourceContentLoader.h" | 59 #include "core/inspector/InspectorResourceContentLoader.h" |
| 60 #include "core/loader/DocumentLoader.h" | 60 #include "core/loader/DocumentLoader.h" |
| 61 #include "core/loader/FrameLoader.h" | 61 #include "core/loader/FrameLoader.h" |
| 62 #include "platform/MIMETypeRegistry.h" | 62 #include "platform/MIMETypeRegistry.h" |
| 63 #include "platform/PlatformResourceLoader.h" | 63 #include "platform/PlatformResourceLoader.h" |
| 64 #include "platform/UserGestureIndicator.h" | 64 #include "platform/UserGestureIndicator.h" |
| 65 #include "platform/inspector_protocol/Values.h" | 65 #include "platform/inspector_protocol/Values.h" |
| 66 #include "platform/v8_inspector/public/V8ContentSearchUtil.h" | |
| 67 #include "platform/v8_inspector/public/V8InspectorSession.h" | 66 #include "platform/v8_inspector/public/V8InspectorSession.h" |
| 68 #include "platform/weborigin/SecurityOrigin.h" | 67 #include "platform/weborigin/SecurityOrigin.h" |
| 69 #include "wtf/CurrentTime.h" | 68 #include "wtf/CurrentTime.h" |
| 70 #include "wtf/ListHashSet.h" | 69 #include "wtf/ListHashSet.h" |
| 71 #include "wtf/Vector.h" | 70 #include "wtf/Vector.h" |
| 72 #include "wtf/text/Base64.h" | 71 #include "wtf/text/Base64.h" |
| 73 #include "wtf/text/TextEncoding.h" | 72 #include "wtf/text/TextEncoding.h" |
| 74 #include <memory> | 73 #include <memory> |
| 75 | 74 |
| 76 namespace blink { | 75 namespace blink { |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 callback->sendFailure("No frame for given id found"); | 508 callback->sendFailure("No frame for given id found"); |
| 510 return; | 509 return; |
| 511 } | 510 } |
| 512 String content; | 511 String content; |
| 513 bool base64Encoded; | 512 bool base64Encoded; |
| 514 if (!InspectorPageAgent::cachedResourceContent(InspectorPageAgent::cachedRes
ource(frame, KURL(ParsedURLString, url)), &content, &base64Encoded)) { | 513 if (!InspectorPageAgent::cachedResourceContent(InspectorPageAgent::cachedRes
ource(frame, KURL(ParsedURLString, url)), &content, &base64Encoded)) { |
| 515 callback->sendFailure("No resource with given URL found"); | 514 callback->sendFailure("No resource with given URL found"); |
| 516 return; | 515 return; |
| 517 } | 516 } |
| 518 | 517 |
| 519 callback->sendSuccess(V8ContentSearchUtil::searchInTextByLines(m_v8Session,
content, query, caseSensitive, isRegex)); | 518 callback->sendSuccess(m_v8Session->searchInTextByLines(content, query, caseS
ensitive, isRegex)); |
| 520 } | 519 } |
| 521 | 520 |
| 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) | 521 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) |
| 523 { | 522 { |
| 524 if (!m_enabled) { | 523 if (!m_enabled) { |
| 525 callback->sendFailure("Agent is not enabled."); | 524 callback->sendFailure("Agent is not enabled."); |
| 526 return; | 525 return; |
| 527 } | 526 } |
| 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)))); | 527 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)))); |
| 529 } | 528 } |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 } | 755 } |
| 757 | 756 |
| 758 DEFINE_TRACE(InspectorPageAgent) | 757 DEFINE_TRACE(InspectorPageAgent) |
| 759 { | 758 { |
| 760 visitor->trace(m_inspectedFrames); | 759 visitor->trace(m_inspectedFrames); |
| 761 visitor->trace(m_inspectorResourceContentLoader); | 760 visitor->trace(m_inspectorResourceContentLoader); |
| 762 InspectorBaseAgent::trace(visitor); | 761 InspectorBaseAgent::trace(visitor); |
| 763 } | 762 } |
| 764 | 763 |
| 765 } // namespace blink | 764 } // namespace blink |
| OLD | NEW |