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

Side by Side Diff: third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp

Issue 2700123003: DO NOT COMMIT: Results of running old (current) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 "web/SuspendableScriptExecutor.h" 5 #include "web/SuspendableScriptExecutor.h"
6 6
7 #include <memory>
7 #include "bindings/core/v8/ScriptController.h" 8 #include "bindings/core/v8/ScriptController.h"
8 #include "bindings/core/v8/ScriptSourceCode.h" 9 #include "bindings/core/v8/ScriptSourceCode.h"
9 #include "bindings/core/v8/V8PersistentValueVector.h" 10 #include "bindings/core/v8/V8PersistentValueVector.h"
10 #include "bindings/core/v8/WindowProxy.h" 11 #include "bindings/core/v8/WindowProxy.h"
11 #include "core/dom/Document.h" 12 #include "core/dom/Document.h"
12 #include "core/dom/DocumentUserGestureToken.h" 13 #include "core/dom/DocumentUserGestureToken.h"
13 #include "core/dom/TaskRunnerHelper.h" 14 #include "core/dom/TaskRunnerHelper.h"
14 #include "core/frame/LocalFrame.h" 15 #include "core/frame/LocalFrame.h"
15 #include "platform/UserGestureIndicator.h" 16 #include "platform/UserGestureIndicator.h"
16 #include "public/platform/WebVector.h" 17 #include "public/platform/WebVector.h"
17 #include "public/web/WebScriptExecutionCallback.h" 18 #include "public/web/WebScriptExecutionCallback.h"
18 #include "wtf/PtrUtil.h" 19 #include "wtf/PtrUtil.h"
19 #include "wtf/Vector.h" 20 #include "wtf/Vector.h"
20 #include <memory>
21 21
22 namespace blink { 22 namespace blink {
23 23
24 namespace { 24 namespace {
25 25
26 class WebScriptExecutor : public SuspendableScriptExecutor::Executor { 26 class WebScriptExecutor : public SuspendableScriptExecutor::Executor {
27 public: 27 public:
28 WebScriptExecutor(const HeapVector<ScriptSourceCode>& sources, 28 WebScriptExecutor(const HeapVector<ScriptSourceCode>& sources,
29 int worldID, 29 int worldID,
30 bool userGesture); 30 bool userGesture);
31 31
32 Vector<v8::Local<v8::Value>> execute(LocalFrame*) override; 32 Vector<v8::Local<v8::Value>> execute(LocalFrame*) override;
33 33
34 DEFINE_INLINE_VIRTUAL_TRACE() { 34 DEFINE_INLINE_VIRTUAL_TRACE() {
35 visitor->trace(m_sources); 35 visitor->trace(m_sources);
36 SuspendableScriptExecutor::Executor::trace(visitor); 36 SuspendableScriptExecutor::Executor::trace(visitor);
37 } 37 }
38 38
39 private: 39 private:
40 HeapVector<ScriptSourceCode> m_sources; 40 HeapVector<ScriptSourceCode> m_sources;
41 int m_worldID; 41 int m_worldID;
42 bool m_userGesture; 42 bool m_userGesture;
43 }; 43 };
44 44
45 WebScriptExecutor::WebScriptExecutor( 45 WebScriptExecutor::WebScriptExecutor(
46 const HeapVector<ScriptSourceCode>& sources, 46 const HeapVector<ScriptSourceCode>& sources,
47 int worldID, 47 int worldID,
48 bool userGesture) 48 bool userGesture)
49 : m_sources(sources), 49 : m_sources(sources), m_worldID(worldID), m_userGesture(userGesture) {}
50 m_worldID(worldID),
51 m_userGesture(userGesture) {}
52 50
53 Vector<v8::Local<v8::Value>> WebScriptExecutor::execute(LocalFrame* frame) { 51 Vector<v8::Local<v8::Value>> WebScriptExecutor::execute(LocalFrame* frame) {
54 std::unique_ptr<UserGestureIndicator> indicator; 52 std::unique_ptr<UserGestureIndicator> indicator;
55 if (m_userGesture) { 53 if (m_userGesture) {
56 indicator = WTF::wrapUnique( 54 indicator = WTF::wrapUnique(
57 new UserGestureIndicator(DocumentUserGestureToken::create( 55 new UserGestureIndicator(DocumentUserGestureToken::create(
58 frame->document(), UserGestureToken::NewGesture))); 56 frame->document(), UserGestureToken::NewGesture)));
59 } 57 }
60 58
61 Vector<v8::Local<v8::Value>> results; 59 Vector<v8::Local<v8::Value>> results;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 m_keepAlive.clear(); 225 m_keepAlive.clear();
228 stop(); 226 stop();
229 } 227 }
230 228
231 DEFINE_TRACE(SuspendableScriptExecutor) { 229 DEFINE_TRACE(SuspendableScriptExecutor) {
232 visitor->trace(m_executor); 230 visitor->trace(m_executor);
233 SuspendableTimer::trace(visitor); 231 SuspendableTimer::trace(visitor);
234 } 232 }
235 233
236 } // namespace blink 234 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/SuspendableScriptExecutor.h ('k') | third_party/WebKit/Source/web/TextFinder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698