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

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: Ensure m_scriptExecutionContext is maintained and not just null. 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
Index: Source/core/dom/ScriptExecutionContext.h
diff --git a/Source/core/dom/ScriptExecutionContext.h b/Source/core/dom/ScriptExecutionContext.h
index ea1759a0f5f21b6e1241f15742acc11b9b0b0ab1..10e0dd98d4336d4d2927ba9307b7dd980dbfb770 100644
--- a/Source/core/dom/ScriptExecutionContext.h
+++ b/Source/core/dom/ScriptExecutionContext.h
@@ -29,6 +29,7 @@
#define ScriptExecutionContext_h
#include "core/dom/ActiveDOMObject.h"
+#include "core/dom/LifecycleContext.h"
#include "core/dom/SecurityContext.h"
#include "core/page/ConsoleTypes.h"
#include "core/platform/Supplementable.h"
@@ -49,7 +50,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();
@@ -57,7 +58,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(); }
@@ -93,10 +93,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();
@@ -171,9 +167,8 @@ private:
virtual void refScriptExecutionContext() = 0;
virtual void derefScriptExecutionContext() = 0;
- virtual PassOwnPtr<ContextLifecycleNotifier> createLifecycleNotifier();
+ virtual PassOwnPtr<LifecycleNotifier> createLifecycleNotifier() OVERRIDE;
- OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier;
HashSet<MessagePort*> m_messagePorts;
int m_circularSequentialID;

Powered by Google App Engine
This is Rietveld 408576698