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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "core/html/VoidCallback.h" | 50 #include "core/html/VoidCallback.h" |
51 #include "core/html/imports/HTMLImportLoader.h" | 51 #include "core/html/imports/HTMLImportLoader.h" |
52 #include "core/html/imports/HTMLImportsController.h" | 52 #include "core/html/imports/HTMLImportsController.h" |
53 #include "core/html/parser/TextResourceDecoder.h" | 53 #include "core/html/parser/TextResourceDecoder.h" |
54 #include "core/inspector/DOMPatchSupport.h" | 54 #include "core/inspector/DOMPatchSupport.h" |
55 #include "core/inspector/IdentifiersFactory.h" | 55 #include "core/inspector/IdentifiersFactory.h" |
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/inspector/V8InspectorString.h" |
60 #include "core/loader/DocumentLoader.h" | 61 #include "core/loader/DocumentLoader.h" |
61 #include "core/loader/FrameLoader.h" | 62 #include "core/loader/FrameLoader.h" |
62 #include "platform/MIMETypeRegistry.h" | 63 #include "platform/MIMETypeRegistry.h" |
63 #include "platform/PlatformResourceLoader.h" | 64 #include "platform/PlatformResourceLoader.h" |
64 #include "platform/UserGestureIndicator.h" | 65 #include "platform/UserGestureIndicator.h" |
65 #include "platform/v8_inspector/public/V8InspectorSession.h" | 66 #include "platform/v8_inspector/public/V8InspectorSession.h" |
66 #include "platform/weborigin/SecurityOrigin.h" | 67 #include "platform/weborigin/SecurityOrigin.h" |
67 #include "wtf/CurrentTime.h" | 68 #include "wtf/CurrentTime.h" |
68 #include "wtf/ListHashSet.h" | 69 #include "wtf/ListHashSet.h" |
69 #include "wtf/Vector.h" | 70 #include "wtf/Vector.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 callback->sendFailure("No frame for given id found"); | 516 callback->sendFailure("No frame for given id found"); |
516 return; | 517 return; |
517 } | 518 } |
518 String content; | 519 String content; |
519 bool base64Encoded; | 520 bool base64Encoded; |
520 if (!InspectorPageAgent::cachedResourceContent(InspectorPageAgent::cachedRes
ource(frame, KURL(ParsedURLString, url)), &content, &base64Encoded)) { | 521 if (!InspectorPageAgent::cachedResourceContent(InspectorPageAgent::cachedRes
ource(frame, KURL(ParsedURLString, url)), &content, &base64Encoded)) { |
521 callback->sendFailure("No resource with given URL found"); | 522 callback->sendFailure("No resource with given URL found"); |
522 return; | 523 return; |
523 } | 524 } |
524 | 525 |
525 callback->sendSuccess(m_v8Session->searchInTextByLines(content, query, caseS
ensitive, isRegex)); | 526 callback->sendSuccess(m_v8Session->searchInTextByLines(toV8InspectorStringVi
ew(content), toV8InspectorStringView(query), caseSensitive, isRegex)); |
526 } | 527 } |
527 | 528 |
528 void InspectorPageAgent::searchInResource(const String& frameId, const String& u
rl, const String& query, const Maybe<bool>& optionalCaseSensitive, const Maybe<b
ool>& optionalIsRegex, std::unique_ptr<SearchInResourceCallback> callback) | 529 void InspectorPageAgent::searchInResource(const String& frameId, const String& u
rl, const String& query, const Maybe<bool>& optionalCaseSensitive, const Maybe<b
ool>& optionalIsRegex, std::unique_ptr<SearchInResourceCallback> callback) |
529 { | 530 { |
530 if (!m_enabled) { | 531 if (!m_enabled) { |
531 callback->sendFailure("Agent is not enabled."); | 532 callback->sendFailure("Agent is not enabled."); |
532 return; | 533 return; |
533 } | 534 } |
534 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)))); | 535 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)))); |
535 } | 536 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 } | 765 } |
765 | 766 |
766 DEFINE_TRACE(InspectorPageAgent) | 767 DEFINE_TRACE(InspectorPageAgent) |
767 { | 768 { |
768 visitor->trace(m_inspectedFrames); | 769 visitor->trace(m_inspectedFrames); |
769 visitor->trace(m_inspectorResourceContentLoader); | 770 visitor->trace(m_inspectorResourceContentLoader); |
770 InspectorBaseAgent::trace(visitor); | 771 InspectorBaseAgent::trace(visitor); |
771 } | 772 } |
772 | 773 |
773 } // namespace blink | 774 } // namespace blink |
OLD | NEW |