| 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/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2383 latency_tracker_.SetDelegate(nullptr); | 2383 latency_tracker_.SetDelegate(nullptr); |
| 2384 } | 2384 } |
| 2385 | 2385 |
| 2386 void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { | 2386 void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { |
| 2387 ui::LatencyInfo::LatencyComponent window_snapshot_component; | 2387 ui::LatencyInfo::LatencyComponent window_snapshot_component; |
| 2388 if (latency_info.FindLatency(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, | 2388 if (latency_info.FindLatency(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
| 2389 GetLatencyComponentId(), | 2389 GetLatencyComponentId(), |
| 2390 &window_snapshot_component)) { | 2390 &window_snapshot_component)) { |
| 2391 int sequence_number = static_cast<int>( | 2391 int sequence_number = static_cast<int>( |
| 2392 window_snapshot_component.sequence_number); | 2392 window_snapshot_component.sequence_number); |
| 2393 #if defined(OS_MACOSX) | 2393 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 2394 // On Mac, when using CoreAnmation, there is a delay between when content | 2394 // On Mac, when using CoreAnmation or on Win32 when using GDI, there is a |
| 2395 // is drawn to the screen, and when the snapshot will actually pick up | 2395 // delay between when content is drawn to the screen, and when the |
| 2396 // that content. Insert a manual delay of 1/6th of a second (to simulate | 2396 // snapshot will actually pick up that content. Insert a manual delay of |
| 2397 // 10 frames at 60 fps) before actually taking the snapshot. | 2397 // 1/6th of a second (to simulate 10 frames at 60 fps) before actually |
| 2398 // taking the snapshot. |
| 2398 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 2399 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 2399 FROM_HERE, | 2400 FROM_HERE, |
| 2400 base::Bind(&RenderWidgetHostImpl::WindowSnapshotReachedScreen, | 2401 base::Bind(&RenderWidgetHostImpl::WindowSnapshotReachedScreen, |
| 2401 weak_factory_.GetWeakPtr(), sequence_number), | 2402 weak_factory_.GetWeakPtr(), sequence_number), |
| 2402 base::TimeDelta::FromSecondsD(1. / 6)); | 2403 base::TimeDelta::FromSecondsD(1. / 6)); |
| 2403 #else | 2404 #else |
| 2404 WindowSnapshotReachedScreen(sequence_number); | 2405 WindowSnapshotReachedScreen(sequence_number); |
| 2405 #endif | 2406 #endif |
| 2406 } | 2407 } |
| 2407 | 2408 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2615 // different from the receiver's. | 2616 // different from the receiver's. |
| 2616 file_system_file.url = | 2617 file_system_file.url = |
| 2617 GURL(storage::GetIsolatedFileSystemRootURIString( | 2618 GURL(storage::GetIsolatedFileSystemRootURIString( |
| 2618 file_system_url.origin(), filesystem_id, std::string()) | 2619 file_system_url.origin(), filesystem_id, std::string()) |
| 2619 .append(register_name)); | 2620 .append(register_name)); |
| 2620 file_system_file.filesystem_id = filesystem_id; | 2621 file_system_file.filesystem_id = filesystem_id; |
| 2621 } | 2622 } |
| 2622 } | 2623 } |
| 2623 | 2624 |
| 2624 } // namespace content | 2625 } // namespace content |
| OLD | NEW |