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

Unified Diff: third_party/WebKit/Source/core/dom/DocumentShutdownObserver.h

Issue 2939223003: Add DocumentShutdown{Notifier,Observer} (Closed)
Patch Set: Add CORE_EXPORT to DocumentShutdownNotifier Created 3 years, 6 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: 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

Powered by Google App Engine
This is Rietveld 408576698