OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 | 13 |
14 namespace extensions { | 14 namespace extensions { |
15 | 15 |
16 // Tracks the navigation state of all frames in a given tab currently known to | 16 // Tracks the navigation state of all frames in a given tab currently known to |
17 // the webNavigation API. It is mainly used to track in which frames an error | 17 // the webNavigation API. It is mainly used to track in which frames an error |
18 // occurred so no further events for this frame are being sent. | 18 // occurred so no further events for this frame are being sent. |
19 class FrameNavigationState { | 19 class FrameNavigationState { |
20 public: | 20 public: |
21 // A frame is uniquely identified by its frame ID and the render process ID. | 21 // A frame is uniquely identified by its frame ID and the render process ID. |
22 // We use the render process ID instead of e.g. a pointer to the RVH so we | 22 // We use the render process ID instead of e.g. a pointer to the RVH so we |
23 // don't depend on the lifetime of the RVH. | 23 // don't depend on the lifetime of the RVH. |
24 struct FrameID { | 24 struct FrameID { |
25 FrameID(); | 25 FrameID(); |
26 FrameID(int64 frame_num, int render_process_id); | 26 FrameID(int64 frame_num, int render_process_id); |
27 ~FrameID(); | |
28 | 27 |
29 bool operator<(const FrameID& other) const; | 28 bool operator<(const FrameID& other) const; |
30 bool operator==(const FrameID& other) const; | 29 bool operator==(const FrameID& other) const; |
31 bool operator!=(const FrameID& other) const; | 30 bool operator!=(const FrameID& other) const; |
32 | 31 |
33 int64 frame_num; | 32 int64 frame_num; |
34 int render_process_id; | 33 int render_process_id; |
35 }; | 34 }; |
36 typedef std::set<FrameID>::const_iterator const_iterator; | 35 typedef std::set<FrameID>::const_iterator const_iterator; |
37 | 36 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 126 |
128 // If true, also allow events from chrome-extension:// URLs. | 127 // If true, also allow events from chrome-extension:// URLs. |
129 static bool allow_extension_scheme_; | 128 static bool allow_extension_scheme_; |
130 | 129 |
131 DISALLOW_COPY_AND_ASSIGN(FrameNavigationState); | 130 DISALLOW_COPY_AND_ASSIGN(FrameNavigationState); |
132 }; | 131 }; |
133 | 132 |
134 } // namespace extensions | 133 } // namespace extensions |
135 | 134 |
136 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H
_ | 135 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H
_ |
OLD | NEW |