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

Side by Side Diff: Source/web/SuspendableScriptExecutor.h

Issue 649183010: Added SuspendableScriptExecutor::createAndRun to replace ctor+run (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@a
Patch Set: Created 6 years, 2 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 | « no previous file | Source/web/SuspendableScriptExecutor.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 // 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 #ifndef SuspendableScriptExecutor_h 5 #ifndef SuspendableScriptExecutor_h
6 #define SuspendableScriptExecutor_h 6 #define SuspendableScriptExecutor_h
7 7
8 #include "core/dom/ActiveDOMObject.h" 8 #include "core/dom/ActiveDOMObject.h"
9 #include "wtf/OwnPtr.h" 9 #include "wtf/OwnPtr.h"
10 #include "wtf/Vector.h" 10 #include "wtf/Vector.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class LocalFrame; 14 class LocalFrame;
15 class ScriptSourceCode; 15 class ScriptSourceCode;
16 class WebScriptExecutionCallback; 16 class WebScriptExecutionCallback;
17 17
18 class SuspendableScriptExecutor final : public ActiveDOMObject { 18 class SuspendableScriptExecutor final : public ActiveDOMObject {
19 public: 19 public:
20 static void createAndRun(LocalFrame*, int worldID, const Vector<ScriptSource Code>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback *);
21
22 virtual void resume() override;
aandrey 2014/10/24 09:22:00 should these be private as well? what if I call re
kozyatinskiy1 2014/10/24 09:43:39 This method is public in base class and someone al
23 virtual void contextDestroyed() override;
24
25 private:
20 SuspendableScriptExecutor(LocalFrame*, int worldID, const Vector<ScriptSourc eCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallbac k*); 26 SuspendableScriptExecutor(LocalFrame*, int worldID, const Vector<ScriptSourc eCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallbac k*);
21 virtual ~SuspendableScriptExecutor(); 27 virtual ~SuspendableScriptExecutor();
22 28
23 // this method must be called only once
24 void run(); 29 void run();
25
26 virtual void resume() override;
27
28 virtual void contextDestroyed() override;
29
30 private:
31 void executeAndDestroySelf(); 30 void executeAndDestroySelf();
32 31
33 LocalFrame* m_frame; 32 LocalFrame* m_frame;
34 int m_worldID; 33 int m_worldID;
35 Vector<ScriptSourceCode> m_sources; 34 Vector<ScriptSourceCode> m_sources;
36 int m_extensionGroup; 35 int m_extensionGroup;
37 bool m_userGesture; 36 bool m_userGesture;
38 WebScriptExecutionCallback* m_callback; 37 WebScriptExecutionCallback* m_callback;
39 }; 38 };
40 39
41 } // namespace blink 40 } // namespace blink
42 41
43 #endif // SuspendableScriptExecutor_h 42 #endif // SuspendableScriptExecutor_h
OLDNEW
« no previous file with comments | « no previous file | Source/web/SuspendableScriptExecutor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698