OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "config.h" | 5 #include "config.h" |
6 #include "modules/permissions/PermissionController.h" | 6 #include "modules/permissions/PermissionController.h" |
7 | 7 |
8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
10 #include "public/platform/modules/permissions/WebPermissionClient.h" | 10 #include "public/platform/modules/permissions/WebPermissionClient.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 PermissionController* controller = new PermissionController(frame, client); | 22 PermissionController* controller = new PermissionController(frame, client); |
23 WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPt
rWillBeNoop(controller)); | 23 WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPt
rWillBeNoop(controller)); |
24 } | 24 } |
25 | 25 |
26 PermissionController* PermissionController::from(LocalFrame& frame) | 26 PermissionController* PermissionController::from(LocalFrame& frame) |
27 { | 27 { |
28 return static_cast<PermissionController*>(WillBeHeapSupplement<LocalFrame>::
from(frame, supplementName())); | 28 return static_cast<PermissionController*>(WillBeHeapSupplement<LocalFrame>::
from(frame, supplementName())); |
29 } | 29 } |
30 | 30 |
31 PermissionController::PermissionController(LocalFrame& frame, WebPermissionClien
t* client) | 31 PermissionController::PermissionController(LocalFrame& frame, WebPermissionClien
t* client) |
32 : FrameDestructionObserver(&frame) | 32 : LocalFrameLifecycleObserver(&frame) |
33 , m_client(client) | 33 , m_client(client) |
34 { | 34 { |
35 } | 35 } |
36 | 36 |
37 const char* PermissionController::supplementName() | 37 const char* PermissionController::supplementName() |
38 { | 38 { |
39 return "PermissionController"; | 39 return "PermissionController"; |
40 } | 40 } |
41 | 41 |
42 WebPermissionClient* PermissionController::client() const | 42 WebPermissionClient* PermissionController::client() const |
43 { | 43 { |
44 return m_client; | 44 return m_client; |
45 } | 45 } |
46 | 46 |
47 void PermissionController::willDetachFrameHost() | 47 void PermissionController::willDetachFrameHost() |
48 { | 48 { |
49 m_client = nullptr; | 49 m_client = nullptr; |
50 } | 50 } |
51 | 51 |
52 DEFINE_TRACE(PermissionController) | 52 DEFINE_TRACE(PermissionController) |
53 { | 53 { |
54 FrameDestructionObserver::trace(visitor); | 54 LocalFrameLifecycleObserver::trace(visitor); |
55 WillBeHeapSupplement<LocalFrame>::trace(visitor); | 55 WillBeHeapSupplement<LocalFrame>::trace(visitor); |
56 } | 56 } |
57 | 57 |
58 } // namespace blink | 58 } // namespace blink |
OLD | NEW |