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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 callback->sendFailure("No frame for given id found"); | 505 callback->sendFailure("No frame for given id found"); |
505 return; | 506 return; |
506 } | 507 } |
507 String content; | 508 String content; |
508 bool base64Encoded; | 509 bool base64Encoded; |
509 if (!InspectorPageAgent::cachedResourceContent(InspectorPageAgent::cachedRes
ource(frame, KURL(ParsedURLString, url)), &content, &base64Encoded)) { | 510 if (!InspectorPageAgent::cachedResourceContent(InspectorPageAgent::cachedRes
ource(frame, KURL(ParsedURLString, url)), &content, &base64Encoded)) { |
510 callback->sendFailure("No resource with given URL found"); | 511 callback->sendFailure("No resource with given URL found"); |
511 return; | 512 return; |
512 } | 513 } |
513 | 514 |
514 callback->sendSuccess(m_v8Session->searchInTextByLines(content, query, caseS
ensitive, isRegex)); | 515 callback->sendSuccess(m_v8Session->searchInTextByLines(toV8InspectorStringVi
ew(content), toV8InspectorStringView(query), caseSensitive, isRegex)); |
515 } | 516 } |
516 | 517 |
517 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) | 518 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) |
518 { | 519 { |
519 if (!m_enabled) { | 520 if (!m_enabled) { |
520 callback->sendFailure("Agent is not enabled."); | 521 callback->sendFailure("Agent is not enabled."); |
521 return; | 522 return; |
522 } | 523 } |
523 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)))); | 524 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)))); |
524 } | 525 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 } | 754 } |
754 | 755 |
755 DEFINE_TRACE(InspectorPageAgent) | 756 DEFINE_TRACE(InspectorPageAgent) |
756 { | 757 { |
757 visitor->trace(m_inspectedFrames); | 758 visitor->trace(m_inspectedFrames); |
758 visitor->trace(m_inspectorResourceContentLoader); | 759 visitor->trace(m_inspectorResourceContentLoader); |
759 InspectorBaseAgent::trace(visitor); | 760 InspectorBaseAgent::trace(visitor); |
760 } | 761 } |
761 | 762 |
762 } // namespace blink | 763 } // namespace blink |
OLD | NEW |