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..c101605e3e3b954de596acade014642d91b4dae5 |
--- /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. |
+ |
yosin_UTC9
2017/06/16 01:06:21
nit: Please remove an extra blank line.
|
+class CORE_EXPORT DocumentShutdownObserver |
+ : public LifecycleObserver<Document, DocumentShutdownObserver> { |
+ public: |
+ // Called when detaching document. |
+ virtual void ContextDestroyed(Document*) {} |
yosin_UTC9
2017/06/16 01:06:21
Please move an implementation to .cpp file[1]
htt
|
+ |
+ protected: |
+ DocumentShutdownObserver(); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(DocumentShutdownObserver); |
+}; |
yosin_UTC9
2017/06/16 01:06:21
nit: Please add a blank line between class declara
|
+} |
yosin_UTC9
2017/06/16 01:06:21
nit: s|}|} // namespace blink|
|
+ |
+#endif // DocumentShutdownObserver_h |