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

Side by Side Diff: Source/web/tests/SpinLockTest.cpp

Issue 1303153005: Introduce WebTaskRunner Patch 3/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add missing #include Created 5 years, 3 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 | « Source/web/tests/FrameTestHelpers.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 } 76 }
77 77
78 TEST(SpinLockTest, Torture) 78 TEST(SpinLockTest, Torture)
79 { 79 {
80 char sharedBuffer[bufferSize]; 80 char sharedBuffer[bufferSize];
81 81
82 OwnPtr<WebThread> thread1 = adoptPtr(Platform::current()->createThread("thre ad1")); 82 OwnPtr<WebThread> thread1 = adoptPtr(Platform::current()->createThread("thre ad1"));
83 OwnPtr<WebThread> thread2 = adoptPtr(Platform::current()->createThread("thre ad2")); 83 OwnPtr<WebThread> thread2 = adoptPtr(Platform::current()->createThread("thre ad2"));
84 84
85 thread1->postTask(FROM_HERE, new Task(threadSafeBind(&threadMain, AllowCross ThreadAccess(static_cast<char*>(sharedBuffer))))); 85 thread1->taskRunner()->postTask(FROM_HERE, new Task(threadSafeBind(&threadMa in, AllowCrossThreadAccess(static_cast<char*>(sharedBuffer)))));
86 thread2->postTask(FROM_HERE, new Task(threadSafeBind(&threadMain, AllowCross ThreadAccess(static_cast<char*>(sharedBuffer))))); 86 thread2->taskRunner()->postTask(FROM_HERE, new Task(threadSafeBind(&threadMa in, AllowCrossThreadAccess(static_cast<char*>(sharedBuffer)))));
87 87
88 thread1.clear(); 88 thread1.clear();
89 thread2.clear(); 89 thread2.clear();
90 } 90 }
91 91
92 } // namespace blink 92 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/tests/FrameTestHelpers.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698