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

Side by Side Diff: tests/OnceTest.cpp

Issue 1037793002: C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: git cl web Created 5 years, 9 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 | « tests/LazyPtrTest.cpp ('k') | tests/PDFInvalidBitmapTest.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkOnce.h" 8 #include "SkOnce.h"
9 #include "SkRunnable.h" 9 #include "SkRunnable.h"
10 #include "SkTaskGroup.h" 10 #include "SkTaskGroup.h"
(...skipping 21 matching lines...) Expand all
32 *x += 6; 32 *x += 6;
33 } 33 }
34 34
35 namespace { 35 namespace {
36 36
37 class Racer : public SkRunnable { 37 class Racer : public SkRunnable {
38 public: 38 public:
39 SkOnceFlag* once; 39 SkOnceFlag* once;
40 int* ptr; 40 int* ptr;
41 41
42 void run() SK_OVERRIDE { 42 void run() override {
43 SkOnce(once, add_six, ptr); 43 SkOnce(once, add_six, ptr);
44 } 44 }
45 }; 45 };
46 46
47 } // namespace 47 } // namespace
48 48
49 SK_DECLARE_STATIC_ONCE(mt_once); 49 SK_DECLARE_STATIC_ONCE(mt_once);
50 DEF_TEST(SkOnce_Multithreaded, r) { 50 DEF_TEST(SkOnce_Multithreaded, r) {
51 const int kTasks = 16; 51 const int kTasks = 16;
52 52
(...skipping 19 matching lines...) Expand all
72 static int gX = 0; 72 static int gX = 0;
73 static void inc_gX() { gX++; } 73 static void inc_gX() { gX++; }
74 74
75 SK_DECLARE_STATIC_ONCE(noarg_once); 75 SK_DECLARE_STATIC_ONCE(noarg_once);
76 DEF_TEST(SkOnce_NoArg, r) { 76 DEF_TEST(SkOnce_NoArg, r) {
77 SkOnce(&noarg_once, inc_gX); 77 SkOnce(&noarg_once, inc_gX);
78 SkOnce(&noarg_once, inc_gX); 78 SkOnce(&noarg_once, inc_gX);
79 SkOnce(&noarg_once, inc_gX); 79 SkOnce(&noarg_once, inc_gX);
80 REPORTER_ASSERT(r, 1 == gX); 80 REPORTER_ASSERT(r, 1 == gX);
81 } 81 }
OLDNEW
« no previous file with comments | « tests/LazyPtrTest.cpp ('k') | tests/PDFInvalidBitmapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698