| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 namespace WTF { | 46 namespace WTF { |
| 47 class TextEncoding; | 47 class TextEncoding; |
| 48 } | 48 } |
| 49 | 49 |
| 50 namespace blink { | 50 namespace blink { |
| 51 | 51 |
| 52 class Document; | 52 class Document; |
| 53 class Element; | 53 class Element; |
| 54 class Node; | 54 class Node; |
| 55 class WebLocalFrame; | 55 class WebLocalFrame; |
| 56 class WebLocalFrameImpl; | 56 class WebLocalFrameBase; |
| 57 | 57 |
| 58 // Responsible for serializing the specified frame into html | 58 // Responsible for serializing the specified frame into html |
| 59 // (replacing links with paths to local files). | 59 // (replacing links with paths to local files). |
| 60 class WebFrameSerializerImpl { | 60 class WebFrameSerializerImpl { |
| 61 STACK_ALLOCATED(); | 61 STACK_ALLOCATED(); |
| 62 | 62 |
| 63 public: | 63 public: |
| 64 // Do serialization action. | 64 // Do serialization action. |
| 65 // | 65 // |
| 66 // Returns false to indicate that no data has been serialized (i.e. because | 66 // Returns false to indicate that no data has been serialized (i.e. because |
| 67 // the target frame didn't have a valid url). | 67 // the target frame didn't have a valid url). |
| 68 // | 68 // |
| 69 // Synchronously calls WebFrameSerializerClient methods to report | 69 // Synchronously calls WebFrameSerializerClient methods to report |
| 70 // serialization results. See WebFrameSerializerClient comments for more | 70 // serialization results. See WebFrameSerializerClient comments for more |
| 71 // details. | 71 // details. |
| 72 bool Serialize(); | 72 bool Serialize(); |
| 73 | 73 |
| 74 // The parameter specifies which frame need to be serialized. | 74 // The parameter specifies which frame need to be serialized. |
| 75 // The parameter delegate specifies the pointer of interface | 75 // The parameter delegate specifies the pointer of interface |
| 76 // DomSerializerDelegate provide sink interface which can receive the | 76 // DomSerializerDelegate provide sink interface which can receive the |
| 77 // individual chunks of data to be saved. | 77 // individual chunks of data to be saved. |
| 78 WebFrameSerializerImpl(WebLocalFrame*, | 78 WebFrameSerializerImpl(WebLocalFrame*, |
| 79 WebFrameSerializerClient*, | 79 WebFrameSerializerClient*, |
| 80 WebFrameSerializer::LinkRewritingDelegate*); | 80 WebFrameSerializer::LinkRewritingDelegate*); |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 // Specified frame which need to be serialized; | 83 // Specified frame which need to be serialized; |
| 84 Member<WebLocalFrameImpl> specified_web_local_frame_impl_; | 84 Member<WebLocalFrameBase> specified_web_local_frame_impl_; |
| 85 // Pointer of WebFrameSerializerClient | 85 // Pointer of WebFrameSerializerClient |
| 86 WebFrameSerializerClient* client_; | 86 WebFrameSerializerClient* client_; |
| 87 // Pointer of WebFrameSerializer::LinkRewritingDelegate | 87 // Pointer of WebFrameSerializer::LinkRewritingDelegate |
| 88 WebFrameSerializer::LinkRewritingDelegate* delegate_; | 88 WebFrameSerializer::LinkRewritingDelegate* delegate_; |
| 89 // Data buffer for saving result of serialized DOM data. | 89 // Data buffer for saving result of serialized DOM data. |
| 90 StringBuilder data_buffer_; | 90 StringBuilder data_buffer_; |
| 91 | 91 |
| 92 // Web entities conversion maps. | 92 // Web entities conversion maps. |
| 93 WebEntities html_entities_; | 93 WebEntities html_entities_; |
| 94 WebEntities xml_entities_; | 94 WebEntities xml_entities_; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // Appends attrName="escapedAttrValue" to result. | 165 // Appends attrName="escapedAttrValue" to result. |
| 166 void AppendAttribute(StringBuilder& result, | 166 void AppendAttribute(StringBuilder& result, |
| 167 bool is_html_document, | 167 bool is_html_document, |
| 168 const String& attr_name, | 168 const String& attr_name, |
| 169 const String& attr_value); | 169 const String& attr_value); |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 } // namespace blink | 172 } // namespace blink |
| 173 | 173 |
| 174 #endif | 174 #endif |
| OLD | NEW |