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

Side by Side Diff: chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc

Issue 10823169: Another attempt at fixing dead frames being tracked by webNavigation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/web_navigation/web_navigation_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/extensions/api/web_navigation/frame_navigation_state.h" 5 #include "chrome/browser/extensions/api/web_navigation/frame_navigation_state.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/common/url_constants.h" 8 #include "chrome/common/url_constants.h"
9 9
10 namespace extensions { 10 namespace extensions {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 bool FrameNavigationState::GetNavigationCompleted(FrameID frame_id) const { 177 bool FrameNavigationState::GetNavigationCompleted(FrameID frame_id) const {
178 FrameIdToStateMap::const_iterator frame_state = 178 FrameIdToStateMap::const_iterator frame_state =
179 frame_state_map_.find(frame_id); 179 frame_state_map_.find(frame_id);
180 return (frame_state == frame_state_map_.end() || 180 return (frame_state == frame_state_map_.end() ||
181 !frame_state->second.is_navigating); 181 !frame_state->second.is_navigating);
182 } 182 }
183 183
184 void FrameNavigationState::SetNavigationCommitted(FrameID frame_id) { 184 void FrameNavigationState::SetNavigationCommitted(FrameID frame_id) {
185 DCHECK(frame_state_map_.find(frame_id) != frame_state_map_.end()); 185 DCHECK(frame_state_map_.find(frame_id) != frame_state_map_.end());
186 frame_state_map_[frame_id].is_committed = true; 186 frame_state_map_[frame_id].is_committed = true;
187 if (frame_state_map_[frame_id].is_main_frame) { 187 if (frame_state_map_[frame_id].is_main_frame)
188 DCHECK_EQ(1u, frame_ids_.size());
189 main_frame_id_ = frame_id; 188 main_frame_id_ = frame_id;
190 }
191 } 189 }
192 190
193 bool FrameNavigationState::GetNavigationCommitted(FrameID frame_id) const { 191 bool FrameNavigationState::GetNavigationCommitted(FrameID frame_id) const {
194 FrameIdToStateMap::const_iterator frame_state = 192 FrameIdToStateMap::const_iterator frame_state =
195 frame_state_map_.find(frame_id); 193 frame_state_map_.find(frame_id);
196 return (frame_state != frame_state_map_.end() && 194 return (frame_state != frame_state_map_.end() &&
197 frame_state->second.is_committed); 195 frame_state->second.is_committed);
198 } 196 }
199 197
200 void FrameNavigationState::SetIsServerRedirected(FrameID frame_id) { 198 void FrameNavigationState::SetIsServerRedirected(FrameID frame_id) {
201 DCHECK(frame_state_map_.find(frame_id) != frame_state_map_.end()); 199 DCHECK(frame_state_map_.find(frame_id) != frame_state_map_.end());
202 frame_state_map_[frame_id].is_server_redirected = true; 200 frame_state_map_[frame_id].is_server_redirected = true;
203 } 201 }
204 202
205 bool FrameNavigationState::GetIsServerRedirected(FrameID frame_id) const { 203 bool FrameNavigationState::GetIsServerRedirected(FrameID frame_id) const {
206 FrameIdToStateMap::const_iterator frame_state = 204 FrameIdToStateMap::const_iterator frame_state =
207 frame_state_map_.find(frame_id); 205 frame_state_map_.find(frame_id);
208 return (frame_state != frame_state_map_.end() && 206 return (frame_state != frame_state_map_.end() &&
209 frame_state->second.is_server_redirected); 207 frame_state->second.is_server_redirected);
210 } 208 }
211 209
212 } // namespace extensions 210 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/web_navigation/web_navigation_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698