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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/Microtask.h

Issue 2671553004: Create platform/bindings (Closed)
Patch Set: Add TODO Created 3 years, 7 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef Microtask_h 31 // This file has moved to platform/bindings/Microtask.h
32 #define Microtask_h 32 // TODO(adithyas): Remove this file.
33 33 #include "platform/bindings/Microtask.h"
34 #include "core/CoreExport.h"
35 #include "platform/WebTaskRunner.h"
36 #include "platform/wtf/Allocator.h"
37 #include "platform/wtf/Functional.h"
38 #include "v8/include/v8.h"
39
40 namespace blink {
41
42 // C++ calls into script contexts which are "owned" by blink (created in a
43 // process where WebKit.cpp initializes v8) must declare their type:
44 //
45 // 1. Calls into page/author script from a frame
46 // 2. Calls into page/author script from a worker
47 // 3. Calls into internal script (typically setup/teardown work)
48 //
49 // Debug-time checking of this is enforced via v8::MicrotasksScope.
50 //
51 // Calls of type (1) should generally go through ScriptController, as inspector
52 // instrumentation is needed. ScriptController allocates V8RecursionScope for
53 // you.
54 //
55 // Calls of type (2) should always stack-allocate a
56 // v8::MicrotasksScope(kRunMicrtoasks) in the same block as the call into
57 // script.
58 //
59 // Calls of type (3) should stack allocate a
60 // v8::MicrotasksScope(kDoNotRunMicrotasks) -- this skips work that is spec'd to
61 // happen at the end of the outer-most script stack frame of calls into page
62 // script:
63 // http://www.whatwg.org/specs/web-apps/current-work/#perform-a-microtask-checkp oint
64 class CORE_EXPORT Microtask {
65 STATIC_ONLY(Microtask);
66
67 public:
68 static void PerformCheckpoint(v8::Isolate*);
69
70 // TODO(jochen): Make all microtasks pass in the ScriptState they want to be
71 // executed in. Until then, all microtasks have to keep track of their
72 // ScriptState themselves.
73 static void EnqueueMicrotask(std::unique_ptr<WTF::Closure>);
74 };
75
76 } // namespace blink
77
78 #endif // Microtask_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/bindings.gni ('k') | third_party/WebKit/Source/bindings/core/v8/Microtask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698