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

Side by Side Diff: third_party/WebKit/Source/platform/LifecycleObserver.h

Issue 2629593004: Disambiguate LifecycleObserver::contextDestroyed (Closed)
Patch Set: temp Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 21 matching lines...) Expand all
32 namespace blink { 32 namespace blink {
33 33
34 template <typename Context, typename Observer> 34 template <typename Context, typename Observer>
35 class LifecycleNotifier; 35 class LifecycleNotifier;
36 36
37 template <typename Context, typename Observer> 37 template <typename Context, typename Observer>
38 class LifecycleObserver : public GarbageCollectedMixin { 38 class LifecycleObserver : public GarbageCollectedMixin {
39 public: 39 public:
40 DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_lifecycleContext); } 40 DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_lifecycleContext); }
41 41
42 virtual void contextDestroyed() {} 42 virtual void contextDestroyed(Context*) {}
43 43
44 Context* lifecycleContext() const { return m_lifecycleContext; } 44 Context* lifecycleContext() const { return m_lifecycleContext; }
45 45
46 void clearContext() { setContext(nullptr); } 46 void clearContext() { setContext(nullptr); }
47 47
48 protected: 48 protected:
49 explicit LifecycleObserver(Context* context) : m_lifecycleContext(nullptr) { 49 explicit LifecycleObserver(Context* context) : m_lifecycleContext(nullptr) {
50 setContext(context); 50 setContext(context);
51 } 51 }
52 52
(...skipping 16 matching lines...) Expand all
69 69
70 if (m_lifecycleContext) { 70 if (m_lifecycleContext) {
71 static_cast<Notifier*>(m_lifecycleContext) 71 static_cast<Notifier*>(m_lifecycleContext)
72 ->addObserver(static_cast<Observer*>(this)); 72 ->addObserver(static_cast<Observer*>(this));
73 } 73 }
74 } 74 }
75 75
76 } // namespace blink 76 } // namespace blink
77 77
78 #endif // LifecycleObserver_h 78 #endif // LifecycleObserver_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/LifecycleNotifier.h ('k') | third_party/WebKit/Source/web/SuspendableScriptExecutor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698