OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_FRAME_MAPPER_H_ | |
6 #define CONTENT_BROWSER_FRAME_MAPPER_H_ | |
7 | |
8 #include "base/hash_tables.h" | |
9 #include "content/browser/content_frame.h" | |
10 #include "content/common/content_export.h" | |
11 | |
12 class TabContents; | |
13 | |
14 namespace content { | |
15 // This class tracks all ContentFrames, allowing them to be looked up by a | |
16 // variety of identifiers. Additionally, it allocates the ContentFrames' | |
17 // globally-unique identifiers. | |
awong
2011/12/21 01:06:38
Should ContentFrames only be created via FrameMap?
| |
18 class CONTENT_EXPORT FrameMap { | |
awong
2011/12/21 01:06:38
Would a better name be ContentFrameMap, ContentFra
| |
19 public: | |
20 FrameMap(); | |
21 virtual ~FrameMap(); | |
awong
2011/12/21 01:06:38
Why is this virtual?
| |
22 | |
23 // Returns a new globally-unique ContentFrame id. | |
24 int64 AllocateFrameId(); | |
jam
2011/12/22 20:06:53
why are these global frame ids? since for each Con
| |
25 | |
26 // Creates and initializes a ContentFrame with a given id. | |
27 ContentFrame* InitializeFrame(int64 frame_id, | |
awong
2011/12/21 01:06:38
Since this returns an object, CreateFrame() is mor
| |
28 bool is_top_level, | |
29 TabContents& tab_contents, | |
30 ContentFrame* opener); | |
31 | |
32 ContentFrame* FindFrame(int64 id); | |
awong
2011/12/21 01:06:38
Which id space is |id| from? In particular, how i
| |
33 ContentFrame* FindRendererFrame(int render_process_host_id, | |
awong
2011/12/21 01:06:38
The class comment should explain the various cance
| |
34 int64 frame_id); | |
35 ContentFrame* FindTopLevelFrame(int process_id, int route_id); | |
36 | |
37 void UpdateFrame(ContentFrame* frame, | |
38 int render_process_host_id, | |
39 int route_id, | |
40 int64 frame_id); | |
41 void AddSwappedOutRendererToFrame(ContentFrame* frame, | |
42 int render_process_host_id, | |
43 int route_id, | |
44 int64 frame_id); | |
45 void RemoveFrame(ContentFrame* frame); | |
46 | |
47 private: | |
48 typedef base::hash_map<int64, ContentFrame*> FrameIdMap; | |
49 typedef base::hash_map< | |
50 ContentFrame::WebKitFrameIdTuple, | |
51 ContentFrame*> WebKitFrameIdMap; | |
52 | |
53 int64 next_frame_id_; | |
54 FrameIdMap frame_id_map_; | |
55 WebKitFrameIdMap webkit_frame_id_map_; | |
56 | |
57 DISALLOW_COPY_AND_ASSIGN(FrameMap); | |
58 }; | |
59 | |
60 } // namespace content | |
awong
2011/12/21 01:06:38
newline before #endif
| |
61 #endif // CONTENT_BROWSER_FRAME_MAPPER_H_ | |
OLD | NEW |