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

Side by Side Diff: content/public/test/render_view_test.cc

Issue 664963002: content: Add RendererScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Daniel and Jared's comments and move renderer_scheduler ownership to render_thread_impl Created 6 years, 1 month 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
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 "content/public/test/render_view_test.h" 5 #include "content/public/test/render_view_test.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/common/dom_storage/dom_storage_types.h" 8 #include "content/common/dom_storage/dom_storage_types.h"
9 #include "content/common/frame_messages.h" 9 #include "content/common/frame_messages.h"
10 #include "content/common/input_messages.h" 10 #include "content/common/input_messages.h"
11 #include "content/common/view_messages.h" 11 #include "content/common/view_messages.h"
12 #include "content/public/browser/content_browser_client.h" 12 #include "content/public/browser/content_browser_client.h"
13 #include "content/public/browser/native_web_keyboard_event.h" 13 #include "content/public/browser/native_web_keyboard_event.h"
14 #include "content/public/common/content_client.h" 14 #include "content/public/common/content_client.h"
15 #include "content/public/common/renderer_preferences.h" 15 #include "content/public/common/renderer_preferences.h"
16 #include "content/public/renderer/content_renderer_client.h" 16 #include "content/public/renderer/content_renderer_client.h"
17 #include "content/public/test/frame_load_waiter.h" 17 #include "content/public/test/frame_load_waiter.h"
18 #include "content/renderer/history_controller.h" 18 #include "content/renderer/history_controller.h"
19 #include "content/renderer/history_serialization.h" 19 #include "content/renderer/history_serialization.h"
20 #include "content/renderer/render_thread_impl.h" 20 #include "content/renderer/render_thread_impl.h"
21 #include "content/renderer/render_view_impl.h" 21 #include "content/renderer/render_view_impl.h"
22 #include "content/renderer/renderer_blink_platform_impl.h" 22 #include "content/renderer/renderer_blink_platform_impl.h"
23 #include "content/renderer/renderer_main_platform_delegate.h" 23 #include "content/renderer/renderer_main_platform_delegate.h"
24 #include "content/renderer/scheduler/renderer_scheduler.h"
24 #include "content/test/mock_render_process.h" 25 #include "content/test/mock_render_process.h"
25 #include "content/test/test_content_client.h" 26 #include "content/test/test_content_client.h"
26 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 27 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
27 #include "third_party/WebKit/public/platform/WebURLRequest.h" 28 #include "third_party/WebKit/public/platform/WebURLRequest.h"
28 #include "third_party/WebKit/public/web/WebHistoryItem.h" 29 #include "third_party/WebKit/public/web/WebHistoryItem.h"
29 #include "third_party/WebKit/public/web/WebInputEvent.h" 30 #include "third_party/WebKit/public/web/WebInputEvent.h"
30 #include "third_party/WebKit/public/web/WebKit.h" 31 #include "third_party/WebKit/public/web/WebKit.h"
31 #include "third_party/WebKit/public/web/WebLocalFrame.h" 32 #include "third_party/WebKit/public/web/WebLocalFrame.h"
32 #include "third_party/WebKit/public/web/WebScriptSource.h" 33 #include "third_party/WebKit/public/web/WebScriptSource.h"
33 #include "third_party/WebKit/public/web/WebView.h" 34 #include "third_party/WebKit/public/web/WebView.h"
(...skipping 19 matching lines...) Expand all
53 const int32 kNewFrameRouteId = 10; 54 const int32 kNewFrameRouteId = 10;
54 const int32 kSurfaceId = 42; 55 const int32 kSurfaceId = 42;
55 56
56 } // namespace 57 } // namespace
57 58
58 namespace content { 59 namespace content {
59 60
60 class RendererBlinkPlatformImplNoSandboxImpl 61 class RendererBlinkPlatformImplNoSandboxImpl
61 : public RendererBlinkPlatformImpl { 62 : public RendererBlinkPlatformImpl {
62 public: 63 public:
64 RendererBlinkPlatformImplNoSandboxImpl(RendererScheduler* scheduler)
65 : RendererBlinkPlatformImpl(scheduler) {
66 }
67
63 virtual blink::WebSandboxSupport* sandboxSupport() { 68 virtual blink::WebSandboxSupport* sandboxSupport() {
64 return NULL; 69 return NULL;
65 } 70 }
66 }; 71 };
67 72
68 RenderViewTest::RendererBlinkPlatformImplNoSandbox:: 73 RenderViewTest::RendererBlinkPlatformImplNoSandbox::
69 RendererBlinkPlatformImplNoSandbox() { 74 RendererBlinkPlatformImplNoSandbox() {
70 blink_platform_impl_.reset(new RendererBlinkPlatformImplNoSandboxImpl()); 75 renderer_scheduler_ = RendererScheduler::Create();
76 blink_platform_impl_.reset(
77 new RendererBlinkPlatformImplNoSandboxImpl(renderer_scheduler_.get()));
Sami 2014/11/04 17:46:35 indent += 2 (or git cl format :)
rmcilroy 2014/11/05 00:34:00 Done.
71 } 78 }
72 79
73 RenderViewTest::RendererBlinkPlatformImplNoSandbox:: 80 RenderViewTest::RendererBlinkPlatformImplNoSandbox::
74 ~RendererBlinkPlatformImplNoSandbox() { 81 ~RendererBlinkPlatformImplNoSandbox() {
75 } 82 }
76 83
77 blink::Platform* RenderViewTest::RendererBlinkPlatformImplNoSandbox::Get() { 84 blink::Platform* RenderViewTest::RendererBlinkPlatformImplNoSandbox::Get() {
78 return blink_platform_impl_.get(); 85 return blink_platform_impl_.get();
79 } 86 }
80 87
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(), 429 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(),
423 navigate_params); 430 navigate_params);
424 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message); 431 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message);
425 432
426 // The load actually happens asynchronously, so we pump messages to process 433 // The load actually happens asynchronously, so we pump messages to process
427 // the pending continuation. 434 // the pending continuation.
428 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); 435 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait();
429 } 436 }
430 437
431 } // namespace content 438 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698