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

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

Issue 2093603002: Wrap non-GCed raw pointer parameters of WTF::bind with WTF::unretained (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unretained_wrapper
Patch Set: rebase Created 4 years, 5 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // 7. At this point, all parsing, resource loads, and layout should be finished. 74 // 7. At this point, all parsing, resource loads, and layout should be finished.
75 TestWebFrameClient* testClientForFrame(WebFrame* frame) 75 TestWebFrameClient* testClientForFrame(WebFrame* frame)
76 { 76 {
77 return static_cast<TestWebFrameClient*>(toWebLocalFrameImpl(frame)->client() ); 77 return static_cast<TestWebFrameClient*>(toWebLocalFrameImpl(frame)->client() );
78 } 78 }
79 79
80 void runServeAsyncRequestsTask(TestWebFrameClient* client) 80 void runServeAsyncRequestsTask(TestWebFrameClient* client)
81 { 81 {
82 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); 82 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests();
83 if (client->isLoading()) 83 if (client->isLoading())
84 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK _FROM_HERE, bind(&runServeAsyncRequestsTask, client)); 84 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK _FROM_HERE, bind(&runServeAsyncRequestsTask, WTF::unretained(client)));
85 else 85 else
86 testing::exitRunLoop(); 86 testing::exitRunLoop();
87 } 87 }
88 88
89 TestWebFrameClient* defaultWebFrameClient() 89 TestWebFrameClient* defaultWebFrameClient()
90 { 90 {
91 DEFINE_STATIC_LOCAL(TestWebFrameClient, client, ()); 91 DEFINE_STATIC_LOCAL(TestWebFrameClient, client, ());
92 return &client; 92 return &client;
93 } 93 }
94 94
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 void reloadFrameIgnoringCache(WebFrame* frame) 144 void reloadFrameIgnoringCache(WebFrame* frame)
145 { 145 {
146 frame->reload(WebFrameLoadType::ReloadBypassingCache); 146 frame->reload(WebFrameLoadType::ReloadBypassingCache);
147 pumpPendingRequestsForFrameToLoad(frame); 147 pumpPendingRequestsForFrameToLoad(frame);
148 } 148 }
149 149
150 void pumpPendingRequestsForFrameToLoad(WebFrame* frame) 150 void pumpPendingRequestsForFrameToLoad(WebFrame* frame)
151 { 151 {
152 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FRO M_HERE, bind(&runServeAsyncRequestsTask, testClientForFrame(frame))); 152 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FRO M_HERE, bind(&runServeAsyncRequestsTask, WTF::unretained(testClientForFrame(fram e))));
153 testing::enterRunLoop(); 153 testing::enterRunLoop();
154 } 154 }
155 155
156 WebMouseEvent createMouseEvent(WebInputEvent::Type type, WebMouseEvent::Button b utton, const IntPoint& point, int modifiers) 156 WebMouseEvent createMouseEvent(WebInputEvent::Type type, WebMouseEvent::Button b utton, const IntPoint& point, int modifiers)
157 { 157 {
158 WebMouseEvent result; 158 WebMouseEvent result;
159 result.type = type; 159 result.type = type;
160 result.x = result.windowX = result.globalX = point.x(); 160 result.x = result.windowX = result.globalX = point.x();
161 result.y = result.windowX = result.globalX = point.y(); 161 result.y = result.windowX = result.globalX = point.y();
162 result.modifiers = modifiers; 162 result.modifiers = modifiers;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 m_frame->close(); 305 m_frame->close();
306 } 306 }
307 307
308 void TestWebViewClient::initializeLayerTreeView() 308 void TestWebViewClient::initializeLayerTreeView()
309 { 309 {
310 m_layerTreeView = wrapUnique(new WebLayerTreeViewImplForTesting); 310 m_layerTreeView = wrapUnique(new WebLayerTreeViewImplForTesting);
311 } 311 }
312 312
313 } // namespace FrameTestHelpers 313 } // namespace FrameTestHelpers
314 } // namespace blink 314 } // 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