Index: content/browser/frame_map.h |
diff --git a/content/browser/frame_map.h b/content/browser/frame_map.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..34686ca5fa845b5e980dc02fbc8188f3f01b6869 |
--- /dev/null |
+++ b/content/browser/frame_map.h |
@@ -0,0 +1,60 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_BROWSER_FRAME_MAPPER_H_ |
+#define CONTENT_BROWSER_FRAME_MAPPER_H_ |
+ |
+#include "base/hash_tables.h" |
+#include "content/browser/content_frame.h" |
+#include "content/common/content_export.h" |
+ |
+class TabContents; |
+ |
+namespace content { |
+// This class tracks all ContentFrames, allowing them to be looked up by a |
+// variety of identifiers. Additionally, it allocates the ContentFrames' |
+// globally-unique identifiers. |
+ |
+class CONTENT_EXPORT FrameMap { |
+ public: |
+ FrameMap(); |
+ virtual ~FrameMap(); |
+ |
+ // Creates and initializes a ContentFrame. |
+ ContentFrame* InitializeFrame(bool is_top_level, |
+ TabContents& tab_contents, |
+ ContentFrame* opener); |
+ |
+ ContentFrame* FindFrame(int64 id); |
+ ContentFrame* FindRendererFrame(int render_process_host_id, |
+ int64 frame_id); |
+ ContentFrame* FindTopLevelFrame(int process_id, int route_id); |
+ |
+ void UpdateFrame(ContentFrame* frame, |
+ int render_process_host_id, |
+ int route_id, |
+ int64 frame_id); |
+ void AddSwappedOutRendererToFrame(ContentFrame* frame, |
+ int render_process_host_id, |
+ int route_id, |
+ int64 frame_id); |
+ void RemoveFrame(ContentFrame* frame); |
+ |
+ private: |
+ void ClearChildren(ContentFrame* frame); |
+ |
+ typedef base::hash_map<int64, ContentFrame*> FrameIdMap; |
+ typedef base::hash_map< |
+ WebKitFrameIdentifier, |
+ ContentFrame*> WebKitFrameIdMap; |
+ |
+ int64 next_frame_id_; |
+ FrameIdMap frame_id_map_; |
+ WebKitFrameIdMap webkit_frame_id_map_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FrameMap); |
+}; |
+ |
+} // namespace content |
+#endif // CONTENT_BROWSER_FRAME_MAPPER_H_ |