Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Unified Diff: content/browser/frame_map.h

Issue 8760024: Cross-process postMessage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Current checkpoint Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/content_frame.cc ('k') | content/browser/frame_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « content/browser/content_frame.cc ('k') | content/browser/frame_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698