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

Side by Side Diff: Source/modules/push_messaging/PushController.h

Issue 1318793005: [part 2] Make classes and structures in modules fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PushController_h 5 #ifndef PushController_h
6 #define PushController_h 6 #define PushController_h
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "modules/ModulesExport.h" 9 #include "modules/ModulesExport.h"
10 #include "platform/Supplementable.h" 10 #include "platform/Supplementable.h"
11 #include "wtf/Forward.h" 11 #include "wtf/Forward.h"
12 #include "wtf/Noncopyable.h" 12 #include "wtf/Noncopyable.h"
13 #include "wtf/PassOwnPtr.h" 13 #include "wtf/PassOwnPtr.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 class WebPushClient; 17 class WebPushClient;
18 18
19 class PushController final : public NoBaseWillBeGarbageCollected<PushController> , public WillBeHeapSupplement<LocalFrame> { 19 class PushController final : public NoBaseWillBeGarbageCollected<PushController> , public WillBeHeapSupplement<LocalFrame> {
20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PushController); 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PushController);
21 WTF_MAKE_NONCOPYABLE(PushController); 21 WTF_MAKE_NONCOPYABLE(PushController);
22 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(PushController);
22 23
23 public: 24 public:
24 static PassOwnPtrWillBeRawPtr<PushController> create(WebPushClient*); 25 static PassOwnPtrWillBeRawPtr<PushController> create(WebPushClient*);
25 static const char* supplementName(); 26 static const char* supplementName();
26 static PushController* from(LocalFrame* frame) { return static_cast<PushCont roller*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); } 27 static PushController* from(LocalFrame* frame) { return static_cast<PushCont roller*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); }
27 static WebPushClient& clientFrom(LocalFrame*); 28 static WebPushClient& clientFrom(LocalFrame*);
28 29
29 DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<LocalFrame>::trace(visi tor); } 30 DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<LocalFrame>::trace(visi tor); }
30 31
31 private: 32 private:
32 explicit PushController(WebPushClient*); 33 explicit PushController(WebPushClient*);
33 34
34 WebPushClient* client() const { return m_client; } 35 WebPushClient* client() const { return m_client; }
35 36
36 WebPushClient* m_client; 37 WebPushClient* m_client;
37 }; 38 };
38 39
39 MODULES_EXPORT void providePushControllerTo(LocalFrame&, WebPushClient*); 40 MODULES_EXPORT void providePushControllerTo(LocalFrame&, WebPushClient*);
40 41
41 } // namespace blink 42 } // namespace blink
42 43
43 #endif // PushController_h 44 #endif // PushController_h
OLDNEW
« no previous file with comments | « Source/modules/presentation/PresentationError.h ('k') | Source/modules/push_messaging/PushError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698