| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /* | 5 /* |
| 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 8 * (http://www.torchmobile.com/) | 8 * (http://www.torchmobile.com/) |
| 9 * | 9 * |
| 10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 33 */ | 33 */ |
| 34 | 34 |
| 35 #ifndef CONTENT_RENDERER_HISTORY_ENTRY_H_ | 35 #ifndef CONTENT_RENDERER_HISTORY_ENTRY_H_ |
| 36 #define CONTENT_RENDERER_HISTORY_ENTRY_H_ | 36 #define CONTENT_RENDERER_HISTORY_ENTRY_H_ |
| 37 | 37 |
| 38 #include "base/containers/hash_tables.h" | 38 #include "base/containers/hash_tables.h" |
| 39 #include "base/memory/scoped_ptr.h" | 39 #include "base/memory/scoped_ptr.h" |
| 40 #include "base/memory/scoped_vector.h" | 40 #include "base/memory/scoped_vector.h" |
| 41 #include "content/common/content_export.h" |
| 41 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 42 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 42 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 43 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| 45 class WebFrame; | 46 class WebFrame; |
| 46 } | 47 } |
| 47 | 48 |
| 48 namespace content { | 49 namespace content { |
| 49 class RenderFrameImpl; | 50 class RenderFrameImpl; |
| 50 class RenderViewImpl; | 51 class RenderViewImpl; |
| 51 | 52 |
| 52 const int kInvalidFrameRoutingID = -1; | 53 const int kInvalidFrameRoutingID = -1; |
| 53 | 54 |
| 54 class HistoryEntry { | 55 class CONTENT_EXPORT HistoryEntry { |
| 55 public: | 56 public: |
| 56 class HistoryNode { | 57 class HistoryNode { |
| 57 public: | 58 public: |
| 58 HistoryNode(HistoryEntry* entry, | 59 HistoryNode(HistoryEntry* entry, |
| 59 const blink::WebHistoryItem& item, | 60 const blink::WebHistoryItem& item, |
| 60 int64_t frame_id); | 61 int64_t frame_id); |
| 61 ~HistoryNode(); | 62 ~HistoryNode(); |
| 62 | 63 |
| 63 HistoryNode* AddChild(const blink::WebHistoryItem& item, int64_t frame_id); | 64 HistoryNode* AddChild(const blink::WebHistoryItem& item, int64_t frame_id); |
| 64 HistoryNode* CloneAndReplace(HistoryEntry* new_entry, | 65 HistoryNode* CloneAndReplace(HistoryEntry* new_entry, |
| 65 const blink::WebHistoryItem& new_item, | 66 const blink::WebHistoryItem& new_item, |
| 66 bool clone_children_of_target, | 67 bool clone_children_of_target, |
| 67 RenderFrameImpl* target_frame, | 68 RenderFrameImpl* target_frame, |
| 68 RenderFrameImpl* current_frame); | 69 RenderFrameImpl* current_frame); |
| 69 blink::WebHistoryItem& item() { return item_; } | 70 blink::WebHistoryItem& item() { return item_; } |
| 70 void set_item(const blink::WebHistoryItem& item) { item_ = item; } | 71 void set_item(const blink::WebHistoryItem& item); |
| 71 std::vector<HistoryNode*>& children() const { return children_->get(); } | 72 std::vector<HistoryNode*>& children() const { return children_->get(); } |
| 72 void RemoveChildren(); | 73 void RemoveChildren(); |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 HistoryEntry* entry_; | 76 HistoryEntry* entry_; |
| 76 scoped_ptr<ScopedVector<HistoryNode> > children_; | 77 scoped_ptr<ScopedVector<HistoryNode> > children_; |
| 77 blink::WebHistoryItem item_; | 78 blink::WebHistoryItem item_; |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 HistoryEntry(const blink::WebHistoryItem& root, int64_t frame_id); | 81 HistoryEntry(const blink::WebHistoryItem& root, int64_t frame_id); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 98 typedef base::hash_map<uint64_t, HistoryNode*> FramesToItems; | 99 typedef base::hash_map<uint64_t, HistoryNode*> FramesToItems; |
| 99 FramesToItems frames_to_items_; | 100 FramesToItems frames_to_items_; |
| 100 | 101 |
| 101 typedef base::hash_map<std::string, HistoryNode*> UniqueNamesToItems; | 102 typedef base::hash_map<std::string, HistoryNode*> UniqueNamesToItems; |
| 102 UniqueNamesToItems unique_names_to_items_; | 103 UniqueNamesToItems unique_names_to_items_; |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 } // namespace content | 106 } // namespace content |
| 106 | 107 |
| 107 #endif // CONTENT_RENDERER_HISTORY_ENTRY_H_ | 108 #endif // CONTENT_RENDERER_HISTORY_ENTRY_H_ |
| OLD | NEW |