Chromium Code Reviews| 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 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 3308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3319 (*i)->ViewFlushedPaint(); | 3319 (*i)->ViewFlushedPaint(); |
| 3320 } | 3320 } |
| 3321 #endif | 3321 #endif |
| 3322 | 3322 |
| 3323 // If the RenderWidget is closing down then early-exit, otherwise we'll crash. | 3323 // If the RenderWidget is closing down then early-exit, otherwise we'll crash. |
| 3324 // See crbug.com/112921. | 3324 // See crbug.com/112921. |
| 3325 if (!webview()) | 3325 if (!webview()) |
| 3326 return; | 3326 return; |
| 3327 | 3327 |
| 3328 WebFrame* main_frame = webview()->mainFrame(); | 3328 WebFrame* main_frame = webview()->mainFrame(); |
| 3329 for (WebFrame* frame = main_frame; frame; | 3329 for (WebFrame* frame = main_frame; frame; |
|
Charlie Reis
2014/10/21 23:40:20
Yikes. The premise behind this whole loop seems b
Pat Meenan
2014/10/22 12:40:03
Done.
| |
| 3330 frame = frame->traverseNext(false)) { | 3330 frame = frame->traverseNext(false)) { |
| 3331 if (frame->isWebLocalFrame()) | 3331 if (frame->isWebLocalFrame() && !frame->parent()) { |
| 3332 main_frame = frame; | 3332 main_frame = frame; |
| 3333 break; | |
| 3334 } | |
| 3333 } | 3335 } |
| 3334 | 3336 |
| 3335 // If we have a provisional frame we are between the start and commit stages | 3337 // If we have a provisional frame we are between the start and commit stages |
| 3336 // of loading and we don't want to save stats. | 3338 // of loading and we don't want to save stats. |
| 3337 if (!main_frame->provisionalDataSource()) { | 3339 if (!main_frame->provisionalDataSource()) { |
| 3338 WebDataSource* ds = main_frame->dataSource(); | 3340 WebDataSource* ds = main_frame->dataSource(); |
| 3339 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3341 DocumentState* document_state = DocumentState::FromDataSource(ds); |
| 3340 | 3342 |
| 3341 // TODO(jar): The following code should all be inside a method, probably in | 3343 // TODO(jar): The following code should all be inside a method, probably in |
| 3342 // NavigatorState. | 3344 // NavigatorState. |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4199 std::vector<gfx::Size> sizes; | 4201 std::vector<gfx::Size> sizes; |
| 4200 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4202 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4201 if (!url.isEmpty()) | 4203 if (!url.isEmpty()) |
| 4202 urls.push_back( | 4204 urls.push_back( |
| 4203 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4205 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4204 } | 4206 } |
| 4205 SendUpdateFaviconURL(urls); | 4207 SendUpdateFaviconURL(urls); |
| 4206 } | 4208 } |
| 4207 | 4209 |
| 4208 } // namespace content | 4210 } // namespace content |
| OLD | NEW |