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

Unified Diff: content/browser/frame_mapper.h

Issue 8760024: Cross-process postMessage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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
Index: content/browser/frame_mapper.h
diff --git a/content/browser/frame_mapper.h b/content/browser/frame_mapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..917fee4118ea6e9666dce50c2ea79036db2bece7
--- /dev/null
+++ b/content/browser/frame_mapper.h
@@ -0,0 +1,51 @@
+// 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/atomic_sequence_num.h"
+#include "base/hash_tables.h"
+#include "content/browser/browsing_instance_frame_id.h"
+#include "content/common/content_export.h"
+
+namespace content {
+class CONTENT_EXPORT FrameMapper {
Charlie Reis 2011/12/01 23:13:02 Maybe FrameMap?
supersat 2011/12/09 23:08:20 Done.
+ public:
+ FrameMapper();
+ virtual ~FrameMapper();
+
+ int64 AllocateFrameId();
+ BrowsingInstanceFrame* InitializeFrameId(int64 frame_id, bool is_top_level);
+
+ BrowsingInstanceFrame* AllocateNewTopLevelFrameId();
+ BrowsingInstanceFrame* FindById(int64 id);
+ BrowsingInstanceFrame* FindByWebKitId(int render_process_host_id,
+ int64 frame_id);
+ BrowsingInstanceFrame* FindTopLevelFrameByProcessAndRoute(int process_id,
+ int route_id);
+
+ void UpdateFrame(BrowsingInstanceFrame* frame,
+ int render_process_host_id,
+ int route_id,
+ int64 frame_id);
+ void RemoveFrame(BrowsingInstanceFrame* frame);
+
+ private:
+ typedef base::hash_map<int64, BrowsingInstanceFrame*> FrameIdMap;
+ typedef base::hash_map<
+ BrowsingInstanceFrame::WebKitFrameIdTuple,
+ BrowsingInstanceFrame*> WebKitFrameIdMap;
+
+
+ // TODO(supersat): Make this 64-bit?
+ base::AtomicSequenceNumber next_frame_id_;
+ FrameIdMap frame_id_map_;
+ WebKitFrameIdMap webkit_frame_id_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(FrameMapper);
+};
+
+} // namespace content
+#endif // CONTENT_BROWSER_FRAME_MAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698