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

Side by Side Diff: Source/core/dom/ExecutionContextTask.h

Issue 374583002: Replace CallClosureTask::create(bind()) with createCrossThreadTask() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase, rename to createCrossThreadTask, and so Created 6 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
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 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 ExecutionContextTask() { } 44 ExecutionContextTask() { }
45 virtual ~ExecutionContextTask() { } 45 virtual ~ExecutionContextTask() { }
46 virtual void performTask(ExecutionContext*) = 0; 46 virtual void performTask(ExecutionContext*) = 0;
47 // Certain tasks get marked specially so that they aren't discarded, and are executed, when the context is shutting down its message queue. 47 // Certain tasks get marked specially so that they aren't discarded, and are executed, when the context is shutting down its message queue.
48 virtual bool isCleanupTask() const { return false; } 48 virtual bool isCleanupTask() const { return false; }
49 virtual const String& taskNameForInstrumentation() const { return emptyStrin g(); } 49 virtual const String& taskNameForInstrumentation() const { return emptyStrin g(); }
50 }; 50 };
51 51
52 class CallClosureTask FINAL : public ExecutionContextTask { 52 class CallClosureTask FINAL : public ExecutionContextTask {
53 public: 53 public:
54 // Do not use |create| other than in createCallClosureTask.
tkent 2014/07/10 07:55:13 createCallClosureTask -> createCrossThreadTask
hiroshige 2014/07/10 08:14:36 Done.
55 // See http://crbug.com/390851
54 static PassOwnPtr<CallClosureTask> create(const Closure& closure) 56 static PassOwnPtr<CallClosureTask> create(const Closure& closure)
55 { 57 {
56 return adoptPtr(new CallClosureTask(closure)); 58 return adoptPtr(new CallClosureTask(closure));
57 } 59 }
58 virtual void performTask(ExecutionContext*) OVERRIDE { m_closure(); } 60 virtual void performTask(ExecutionContext*) OVERRIDE { m_closure(); }
59 61
60 private: 62 private:
61 explicit CallClosureTask(const Closure& closure) : m_closure(closure) { } 63 explicit CallClosureTask(const Closure& closure) : m_closure(closure) { }
62 Closure m_closure; 64 Closure m_closure;
63 }; 65 };
64 66
65 } // namespace 67 } // namespace
66 68
67 #endif 69 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698