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 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2131 // Allocate enough bitmaps so that two frames (proportionally) would be | 2131 // Allocate enough bitmaps so that two frames (proportionally) would be |
2132 // enough hit the handle limit. | 2132 // enough hit the handle limit. |
2133 int handles_per_frame = 5; | 2133 int handles_per_frame = 5; |
2134 RendererFrameManager::GetInstance()->set_max_handles(handles_per_frame * 2); | 2134 RendererFrameManager::GetInstance()->set_max_handles(handles_per_frame * 2); |
2135 | 2135 |
2136 HostSharedBitmapManagerClient bitmap_client( | 2136 HostSharedBitmapManagerClient bitmap_client( |
2137 HostSharedBitmapManager::current()); | 2137 HostSharedBitmapManager::current()); |
2138 | 2138 |
2139 for (size_t i = 0; i < (renderer_count - 1) * handles_per_frame; i++) { | 2139 for (size_t i = 0; i < (renderer_count - 1) * handles_per_frame; i++) { |
2140 bitmap_client.ChildAllocatedSharedBitmap( | 2140 bitmap_client.ChildAllocatedSharedBitmap( |
2141 1, base::SharedMemory::NULLHandle(), base::GetCurrentProcessHandle(), | 2141 1, base::SharedMemory::NULLHandle(), cc::SharedBitmap::GenerateId()); |
2142 cc::SharedBitmap::GenerateId()); | |
2143 } | 2142 } |
2144 | 2143 |
2145 // Hiding this last bitmap should evict all but two frames. | 2144 // Hiding this last bitmap should evict all but two frames. |
2146 views[renderer_count - 1]->Hide(); | 2145 views[renderer_count - 1]->Hide(); |
2147 for (size_t i = 0; i < renderer_count; ++i) { | 2146 for (size_t i = 0; i < renderer_count; ++i) { |
2148 if (i + 2 < renderer_count) | 2147 if (i + 2 < renderer_count) |
2149 EXPECT_FALSE(views[i]->HasFrameData()); | 2148 EXPECT_FALSE(views[i]->HasFrameData()); |
2150 else | 2149 else |
2151 EXPECT_TRUE(views[i]->HasFrameData()); | 2150 EXPECT_TRUE(views[i]->HasFrameData()); |
2152 } | 2151 } |
(...skipping 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4483 view()->OnGestureEvent(&gesture_event); | 4482 view()->OnGestureEvent(&gesture_event); |
4484 | 4483 |
4485 EXPECT_TRUE(delegate->context_menu_request_received()); | 4484 EXPECT_TRUE(delegate->context_menu_request_received()); |
4486 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); | 4485 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); |
4487 #endif | 4486 #endif |
4488 | 4487 |
4489 RenderViewHostFactory::set_is_real_render_view_host(false); | 4488 RenderViewHostFactory::set_is_real_render_view_host(false); |
4490 } | 4489 } |
4491 | 4490 |
4492 } // namespace content | 4491 } // namespace content |
OLD | NEW |