| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_FRAME_TREE_NODE_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_FRAME_TREE_NODE_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_FRAME_TREE_NODE_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_FRAME_TREE_NODE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "googleurl/src/gurl.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 // Any page that contains iframes has a tree structure of the frames in the | 17 // Any page that contains iframes has a tree structure of the frames in the |
| 17 // renderer process. We are mirroring this tree in the browser process. This | 18 // renderer process. We are mirroring this tree in the browser process. This |
| 18 // class represents a node in this tree and is a wrapper for all objects that | 19 // class represents a node in this tree and is a wrapper for all objects that |
| 19 // are frame-specific (as opposed to page-specific). | 20 // are frame-specific (as opposed to page-specific). |
| 20 class CONTENT_EXPORT FrameTreeNode { | 21 class CONTENT_EXPORT FrameTreeNode { |
| 21 public: | 22 public: |
| 22 FrameTreeNode(int64 frame_id, const std::string& name); | 23 FrameTreeNode(int64 frame_id, const std::string& name); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 } | 36 } |
| 36 | 37 |
| 37 size_t child_count() const { | 38 size_t child_count() const { |
| 38 return children_.size(); | 39 return children_.size(); |
| 39 } | 40 } |
| 40 | 41 |
| 41 FrameTreeNode* child_at(size_t index) const { | 42 FrameTreeNode* child_at(size_t index) const { |
| 42 return children_[index]; | 43 return children_[index]; |
| 43 } | 44 } |
| 44 | 45 |
| 46 const GURL& current_url() const { |
| 47 return current_url_; |
| 48 } |
| 49 |
| 50 void set_current_url(const GURL& url) { |
| 51 current_url_ = url; |
| 52 } |
| 53 |
| 45 private: | 54 private: |
| 46 // The unique identifier for the frame in the page. | 55 // The unique identifier for the frame in the page. |
| 47 int64 frame_id_; | 56 int64 frame_id_; |
| 48 | 57 |
| 49 // The assigned name of the frame. This name can be empty, unlike the unique | 58 // The assigned name of the frame. This name can be empty, unlike the unique |
| 50 // name generated internally in the DOM tree. | 59 // name generated internally in the DOM tree. |
| 51 std::string frame_name_; | 60 std::string frame_name_; |
| 52 | 61 |
| 53 // The immediate children of this specific frame. | 62 // The immediate children of this specific frame. |
| 54 std::vector<FrameTreeNode*> children_; | 63 std::vector<FrameTreeNode*> children_; |
| 55 | 64 |
| 65 // Track the current frame's last committed URL, so we can estimate the |
| 66 // process impact of out-of-process iframes. |
| 67 // TODO(creis): Remove this when we can store subframe URLs in the |
| 68 // NavigationController. |
| 69 GURL current_url_; |
| 70 |
| 56 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 71 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
| 57 }; | 72 }; |
| 58 | 73 |
| 59 } // namespace content | 74 } // namespace content |
| 60 | 75 |
| 61 #endif // CONTENT_BROWSER_WEB_CONTENTS_FRAME_TREE_NODE_H_ | 76 #endif // CONTENT_BROWSER_WEB_CONTENTS_FRAME_TREE_NODE_H_ |
| OLD | NEW |