Index: third_party/WebKit/Source/core/dom/DocumentShutdownObserver.h |
diff --git a/third_party/WebKit/Source/core/dom/DocumentShutdownObserver.h b/third_party/WebKit/Source/core/dom/DocumentShutdownObserver.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d3e835893b5e48a7d2a6d7772cf2951f432385a4 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/dom/DocumentShutdownObserver.h |
@@ -0,0 +1,35 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. Use of |
+// this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef DocumentShutdownObserver_h |
+#define DocumentShutdownObserver_h |
+ |
+#include "core/CoreExport.h" |
+#include "platform/LifecycleObserver.h" |
+ |
+namespace blink { |
+ |
+class Document; |
+ |
+// This class is a base class for classes which observe Document shutdown |
+// synchronously. |
+// Note: this functionality is also provided by SynchronousMutationObserver, |
+// but if you don't need to respond to the other events handled by that class, |
+// using this class is more efficient. |
+class CORE_EXPORT DocumentShutdownObserver |
+ : public LifecycleObserver<Document, DocumentShutdownObserver> { |
+ public: |
+ // Called when detaching document. |
+ virtual void ContextDestroyed(Document*); |
+ |
+ protected: |
+ DocumentShutdownObserver(); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(DocumentShutdownObserver); |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // DocumentShutdownObserver_h |