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

Side by Side Diff: ios/web/web_thread_impl.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: fixed build error and commments Created 3 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ios/web/web_thread_impl.h" 5 #include "ios/web/web_thread_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/atomicops.h" 10 #include "base/atomicops.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 return WebThread::PostDelayedTask(id_, from_here, std::move(task), delay); 54 return WebThread::PostDelayedTask(id_, from_here, std::move(task), delay);
55 } 55 }
56 56
57 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 57 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
58 base::OnceClosure task, 58 base::OnceClosure task,
59 base::TimeDelta delay) override { 59 base::TimeDelta delay) override {
60 return WebThread::PostNonNestableDelayedTask(id_, from_here, 60 return WebThread::PostNonNestableDelayedTask(id_, from_here,
61 std::move(task), delay); 61 std::move(task), delay);
62 } 62 }
63 63
64 bool RunsTasksOnCurrentThread() const override { 64 bool RunsTasksInCurrentSequence() const override {
65 return WebThread::CurrentlyOn(id_); 65 return WebThread::CurrentlyOn(id_);
66 } 66 }
67 67
68 protected: 68 protected:
69 ~WebThreadTaskRunner() override {} 69 ~WebThreadTaskRunner() override {}
70 70
71 private: 71 private:
72 WebThread::ID id_; 72 WebThread::ID id_;
73 DISALLOW_COPY_AND_ASSIGN(WebThreadTaskRunner); 73 DISALLOW_COPY_AND_ASSIGN(WebThreadTaskRunner);
74 }; 74 };
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 AtomicWord* storage = 481 AtomicWord* storage =
482 reinterpret_cast<AtomicWord*>(&globals.thread_delegates[identifier]); 482 reinterpret_cast<AtomicWord*>(&globals.thread_delegates[identifier]);
483 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( 483 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange(
484 storage, reinterpret_cast<AtomicWord>(delegate)); 484 storage, reinterpret_cast<AtomicWord>(delegate));
485 485
486 // This catches registration when previously registered. 486 // This catches registration when previously registered.
487 DCHECK(!delegate || !old_pointer); 487 DCHECK(!delegate || !old_pointer);
488 } 488 }
489 489
490 } // namespace web 490 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698