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

Unified Diff: Source/core/dom/ScriptExecutionContext.h

Issue 18777003: Extract simpler classes for observing context lifecycle and observe Page lifecycle inNavigatorVibra… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaselined~ Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DocumentLifecycleObserver.cpp ('k') | Source/core/dom/ScriptExecutionContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptExecutionContext.h
diff --git a/Source/core/dom/ScriptExecutionContext.h b/Source/core/dom/ScriptExecutionContext.h
index 60a05a7b29c95f6ff4b93284b3a1bb9f4f1a0ae4..d438f53a92cc5f3bb741082fd4d247b0f9f239d3 100644
--- a/Source/core/dom/ScriptExecutionContext.h
+++ b/Source/core/dom/ScriptExecutionContext.h
@@ -32,6 +32,7 @@
#include "core/dom/SecurityContext.h"
#include "core/page/ConsoleTypes.h"
#include "core/page/DOMTimer.h"
+#include "core/platform/LifecycleContext.h"
#include "core/platform/Supplementable.h"
#include "weborigin/KURL.h"
#include "wtf/HashSet.h"
@@ -51,7 +52,7 @@ class PublicURLManager;
class ScriptCallStack;
class ScriptState;
-class ScriptExecutionContext : public SecurityContext, public Supplementable<ScriptExecutionContext> {
+class ScriptExecutionContext : public LifecycleContext, public SecurityContext, public Supplementable<ScriptExecutionContext> {
public:
ScriptExecutionContext();
virtual ~ScriptExecutionContext();
@@ -59,7 +60,6 @@ public:
virtual bool isDocument() const { return false; }
virtual bool isWorkerGlobalScope() const { return false; }
- virtual bool isContextThread() const { return true; }
virtual bool isJSExecutionForbidden() const = 0;
const KURL& url() const { return virtualURL(); }
@@ -95,10 +95,6 @@ public:
// Called after the construction of an ActiveDOMObject to synchronize suspend state.
void suspendActiveDOMObjectIfNeeded(ActiveDOMObject*);
- // Called from the constructor and destructors of ContextLifecycleObserver
- void wasObservedBy(ContextLifecycleObserver*, ContextLifecycleObserver::Type as);
- void wasUnobservedBy(ContextLifecycleObserver*, ContextLifecycleObserver::Type as);
-
// MessagePort is conceptually a kind of ActiveDOMObject, but it needs to be tracked separately for message dispatch.
void processMessagePortMessagesSoon();
void dispatchMessagePortEvents();
@@ -169,7 +165,7 @@ private:
virtual void refScriptExecutionContext() = 0;
virtual void derefScriptExecutionContext() = 0;
- virtual PassOwnPtr<ContextLifecycleNotifier> createLifecycleNotifier();
+ virtual PassOwnPtr<LifecycleNotifier> createLifecycleNotifier() OVERRIDE;
// Implementation details for DOMTimer. No other classes should call these functions.
int installNewTimeout(PassOwnPtr<ScheduledAction>, int timeout, bool singleShot);
« no previous file with comments | « Source/core/dom/DocumentLifecycleObserver.cpp ('k') | Source/core/dom/ScriptExecutionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698