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

Side by Side Diff: third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp

Issue 1915153004: [K5] Replace bind() + non-GC pointers with unretained() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_4
Patch Set: Rebase Created 4 years, 7 months 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
« no previous file with comments | « third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // 7. At this point, all parsing, resource loads, and layout should be finished. 73 // 7. At this point, all parsing, resource loads, and layout should be finished.
74 TestWebFrameClient* testClientForFrame(WebFrame* frame) 74 TestWebFrameClient* testClientForFrame(WebFrame* frame)
75 { 75 {
76 return static_cast<TestWebFrameClient*>(toWebLocalFrameImpl(frame)->client() ); 76 return static_cast<TestWebFrameClient*>(toWebLocalFrameImpl(frame)->client() );
77 } 77 }
78 78
79 void runServeAsyncRequestsTask(TestWebFrameClient* client) 79 void runServeAsyncRequestsTask(TestWebFrameClient* client)
80 { 80 {
81 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); 81 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests();
82 if (client->isLoading()) 82 if (client->isLoading())
83 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK _FROM_HERE, bind(&runServeAsyncRequestsTask, client)); 83 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK _FROM_HERE, bind(&runServeAsyncRequestsTask, unretained(client)));
84 else 84 else
85 testing::exitRunLoop(); 85 testing::exitRunLoop();
86 } 86 }
87 87
88 TestWebFrameClient* defaultWebFrameClient() 88 TestWebFrameClient* defaultWebFrameClient()
89 { 89 {
90 DEFINE_STATIC_LOCAL(TestWebFrameClient, client, ()); 90 DEFINE_STATIC_LOCAL(TestWebFrameClient, client, ());
91 return &client; 91 return &client;
92 } 92 }
93 93
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 void reloadFrameIgnoringCache(WebFrame* frame) 143 void reloadFrameIgnoringCache(WebFrame* frame)
144 { 144 {
145 frame->reload(WebFrameLoadType::ReloadBypassingCache); 145 frame->reload(WebFrameLoadType::ReloadBypassingCache);
146 pumpPendingRequestsForFrameToLoad(frame); 146 pumpPendingRequestsForFrameToLoad(frame);
147 } 147 }
148 148
149 void pumpPendingRequestsForFrameToLoad(WebFrame* frame) 149 void pumpPendingRequestsForFrameToLoad(WebFrame* frame)
150 { 150 {
151 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FRO M_HERE, bind(&runServeAsyncRequestsTask, testClientForFrame(frame))); 151 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FRO M_HERE, bind(&runServeAsyncRequestsTask, unretained(testClientForFrame(frame)))) ;
152 testing::enterRunLoop(); 152 testing::enterRunLoop();
153 } 153 }
154 154
155 WebMouseEvent createMouseEvent(WebInputEvent::Type type, WebMouseEvent::Button b utton, const IntPoint& point, int modifiers) 155 WebMouseEvent createMouseEvent(WebInputEvent::Type type, WebMouseEvent::Button b utton, const IntPoint& point, int modifiers)
156 { 156 {
157 WebMouseEvent result; 157 WebMouseEvent result;
158 result.type = type; 158 result.type = type;
159 result.x = result.windowX = result.globalX = point.x(); 159 result.x = result.windowX = result.globalX = point.x();
160 result.y = result.windowX = result.globalX = point.y(); 160 result.y = result.windowX = result.globalX = point.y();
161 result.modifiers = modifiers; 161 result.modifiers = modifiers;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 m_frame->close(); 302 m_frame->close();
303 } 303 }
304 304
305 void TestWebViewClient::initializeLayerTreeView() 305 void TestWebViewClient::initializeLayerTreeView()
306 { 306 {
307 m_layerTreeView = adoptPtr(new WebLayerTreeViewImplForTesting); 307 m_layerTreeView = adoptPtr(new WebLayerTreeViewImplForTesting);
308 } 308 }
309 309
310 } // namespace FrameTestHelpers 310 } // namespace FrameTestHelpers
311 } // namespace blink 311 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698