| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // How we handle the base tag better. | 5 // How we handle the base tag better. |
| 6 // Current status: | 6 // Current status: |
| 7 // At now the normal way we use to handling base tag is | 7 // At now the normal way we use to handling base tag is |
| 8 // a) For those links which have corresponding local saved files, such as | 8 // a) For those links which have corresponding local saved files, such as |
| 9 // savable CSS, JavaScript files, they will be written to relative URLs which | 9 // savable CSS, JavaScript files, they will be written to relative URLs which |
| 10 // point to local saved file. Why those links can not be resolved as absolute | 10 // point to local saved file. Why those links can not be resolved as absolute |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // correctly loading local saved resource files. Also I think we need to inherit | 42 // correctly loading local saved resource files. Also I think we need to inherit |
| 43 // the base target value from document object when appending new base tag. | 43 // the base target value from document object when appending new base tag. |
| 44 // If there are multiple base tags in original document, we will comment all old | 44 // If there are multiple base tags in original document, we will comment all old |
| 45 // base tags and append new base tag after each old base tag because we do not | 45 // base tags and append new base tag after each old base tag because we do not |
| 46 // know those old base tags are original content or added by JavaScript. If | 46 // know those old base tags are original content or added by JavaScript. If |
| 47 // they are added by JavaScript, it means when loading saved page, the script(s) | 47 // they are added by JavaScript, it means when loading saved page, the script(s) |
| 48 // will still insert base tag(s) to DOM, so the new added base tag(s) can | 48 // will still insert base tag(s) to DOM, so the new added base tag(s) can |
| 49 // override the incorrect base URL and make sure we alway load correct local | 49 // override the incorrect base URL and make sure we alway load correct local |
| 50 // saved resource files. | 50 // saved resource files. |
| 51 | 51 |
| 52 // We must include format_macros up here, before any WebKit headers |
| 53 // include inttypes.h. |
| 54 #include "base/format_macros.h" |
| 55 |
| 52 #include "config.h" | 56 #include "config.h" |
| 53 | 57 |
| 54 #include "base/compiler_specific.h" | 58 #include "base/compiler_specific.h" |
| 55 | 59 |
| 56 MSVC_PUSH_WARNING_LEVEL(0); | 60 MSVC_PUSH_WARNING_LEVEL(0); |
| 57 #include "DocumentType.h" | 61 #include "DocumentType.h" |
| 58 #include "FrameLoader.h" | 62 #include "FrameLoader.h" |
| 59 #include "Document.h" | 63 #include "Document.h" |
| 60 #include "Element.h" | 64 #include "Element.h" |
| 61 #include "HTMLAllCollection.h" | 65 #include "HTMLAllCollection.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 80 #include "webkit/glue/entity_map.h" | 84 #include "webkit/glue/entity_map.h" |
| 81 #include "webkit/glue/glue_util.h" | 85 #include "webkit/glue/glue_util.h" |
| 82 | 86 |
| 83 using WebKit::WebFrame; | 87 using WebKit::WebFrame; |
| 84 using WebKit::WebFrameImpl; | 88 using WebKit::WebFrameImpl; |
| 85 | 89 |
| 86 namespace { | 90 namespace { |
| 87 | 91 |
| 88 // Default "mark of the web" declaration | 92 // Default "mark of the web" declaration |
| 89 static const char* const kDefaultMarkOfTheWeb = | 93 static const char* const kDefaultMarkOfTheWeb = |
| 90 "\n<!-- saved from url=(%04d)%s -->\n"; | 94 "\n<!-- saved from url=(%04" PRIuS ")%s -->\n"; |
| 91 | 95 |
| 92 // Default meat content for writing correct charset declaration. | 96 // Default meat content for writing correct charset declaration. |
| 93 static const wchar_t* const kDefaultMetaContent = | 97 static const wchar_t* const kDefaultMetaContent = |
| 94 L"<META http-equiv=\"Content-Type\" content=\"text/html; charset=%ls\">"; | 98 L"<META http-equiv=\"Content-Type\" content=\"text/html; charset=%ls\">"; |
| 95 | 99 |
| 96 // Notation of start comment. | 100 // Notation of start comment. |
| 97 static const wchar_t* const kStartCommentNotation = L"<!-- "; | 101 static const wchar_t* const kStartCommentNotation = L"<!-- "; |
| 98 | 102 |
| 99 // Notation of end comment. | 103 // Notation of end comment. |
| 100 static const wchar_t* const kEndCommentNotation = L" -->"; | 104 static const wchar_t* const kEndCommentNotation = L" -->"; |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 // We have done call frames, so we send message to embedder to tell it that | 618 // We have done call frames, so we send message to embedder to tell it that |
| 615 // frames are finished serializing. | 619 // frames are finished serializing. |
| 616 DCHECK(data_buffer_.empty()); | 620 DCHECK(data_buffer_.empty()); |
| 617 delegate_->DidSerializeDataForFrame(GURL(), data_buffer_, | 621 delegate_->DidSerializeDataForFrame(GURL(), data_buffer_, |
| 618 DomSerializerDelegate::ALL_FRAMES_ARE_FINISHED); | 622 DomSerializerDelegate::ALL_FRAMES_ARE_FINISHED); |
| 619 | 623 |
| 620 return did_serialization; | 624 return did_serialization; |
| 621 } | 625 } |
| 622 | 626 |
| 623 } // namespace webkit_glue | 627 } // namespace webkit_glue |
| OLD | NEW |