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_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 // Allocate enough bitmaps so that two frames (proportionally) would be | 2123 // Allocate enough bitmaps so that two frames (proportionally) would be |
2124 // enough hit the handle limit. | 2124 // enough hit the handle limit. |
2125 int handles_per_frame = 5; | 2125 int handles_per_frame = 5; |
2126 RendererFrameManager::GetInstance()->set_max_handles(handles_per_frame * 2); | 2126 RendererFrameManager::GetInstance()->set_max_handles(handles_per_frame * 2); |
2127 | 2127 |
2128 HostSharedBitmapManagerClient bitmap_client( | 2128 HostSharedBitmapManagerClient bitmap_client( |
2129 HostSharedBitmapManager::current()); | 2129 HostSharedBitmapManager::current()); |
2130 | 2130 |
2131 for (size_t i = 0; i < (renderer_count - 1) * handles_per_frame; i++) { | 2131 for (size_t i = 0; i < (renderer_count - 1) * handles_per_frame; i++) { |
2132 bitmap_client.ChildAllocatedSharedBitmap( | 2132 bitmap_client.ChildAllocatedSharedBitmap( |
2133 1, base::SharedMemory::NULLHandle(), base::GetCurrentProcessHandle(), | 2133 1, base::SharedMemory::NULLHandle(), cc::SharedBitmap::GenerateId()); |
2134 cc::SharedBitmap::GenerateId()); | |
2135 } | 2134 } |
2136 | 2135 |
2137 // Hiding this last bitmap should evict all but two frames. | 2136 // Hiding this last bitmap should evict all but two frames. |
2138 views[renderer_count - 1]->Hide(); | 2137 views[renderer_count - 1]->Hide(); |
2139 for (size_t i = 0; i < renderer_count; ++i) { | 2138 for (size_t i = 0; i < renderer_count; ++i) { |
2140 if (i + 2 < renderer_count) | 2139 if (i + 2 < renderer_count) |
2141 EXPECT_FALSE(views[i]->HasFrameData()); | 2140 EXPECT_FALSE(views[i]->HasFrameData()); |
2142 else | 2141 else |
2143 EXPECT_TRUE(views[i]->HasFrameData()); | 2142 EXPECT_TRUE(views[i]->HasFrameData()); |
2144 } | 2143 } |
(...skipping 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4475 view()->OnGestureEvent(&gesture_event); | 4474 view()->OnGestureEvent(&gesture_event); |
4476 | 4475 |
4477 EXPECT_TRUE(delegate->context_menu_request_received()); | 4476 EXPECT_TRUE(delegate->context_menu_request_received()); |
4478 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); | 4477 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); |
4479 #endif | 4478 #endif |
4480 | 4479 |
4481 RenderViewHostFactory::set_is_real_render_view_host(false); | 4480 RenderViewHostFactory::set_is_real_render_view_host(false); |
4482 } | 4481 } |
4483 | 4482 |
4484 } // namespace content | 4483 } // namespace content |
OLD | NEW |