Index: third_party/WebKit/Source/modules/document_metadata/CopylessPasteExtractor.h |
diff --git a/third_party/WebKit/Source/modules/document_metadata/CopylessPasteExtractor.h b/third_party/WebKit/Source/modules/document_metadata/CopylessPasteExtractor.h |
index c91e8f2541ae815cf53da2c60a6980f5f9f1a193..3a7bf06d3863350087fe66c69c281f6851eec343 100644 |
--- a/third_party/WebKit/Source/modules/document_metadata/CopylessPasteExtractor.h |
+++ b/third_party/WebKit/Source/modules/document_metadata/CopylessPasteExtractor.h |
@@ -6,18 +6,35 @@ |
#define CopylessPasteExtractor_h |
#include "modules/ModulesExport.h" |
-#include "wtf/text/WTFString.h" |
+#include "public/platform/modules/document_metadata/copyless_paste.mojom-blink.h" |
namespace blink { |
class Document; |
+class Element; |
+class JSONArray; |
+class JSONObject; |
+ |
+using mojom::blink::Entity; |
+using mojom::blink::EntityPtr; |
+using mojom::blink::Values; |
+using mojom::blink::WebPage; |
// Extract structured metadata (currently schema.org in JSON-LD) for the |
// Copyless Paste feature. The extraction must be done after the document |
// has finished parsing. |
class MODULES_EXPORT CopylessPasteExtractor final { |
public: |
- static String extract(Document&); |
+ static bool extract(const Document&, mojom::blink::WebPage&); |
+ |
+ private: |
+ static bool extractMetadata(const Element&, Vector<EntityPtr>&); |
wychen
2017/04/04 23:15:32
Can these be non-member local functions like befor
dproctor
2017/04/04 23:42:22
Done.
|
+ static void extractEntityFromTopLevelObject(const JSONObject&, |
+ Vector<EntityPtr>&); |
+ static void extractEntitiesFromArray(JSONArray&, Vector<EntityPtr>&); |
+ static void extractTopLevelEntity(const JSONObject&, Vector<EntityPtr>&); |
+ static void extractEntity(const JSONObject&, Entity&, int); |
+ static bool parseRepeatedValue(JSONArray*, Values&, int); |
}; |
} // namespace blink |