Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "modules/quota/DurableStorageController.h" | |
| 7 | |
| 8 #include "core/frame/LocalFrame.h" | |
| 9 #include "platform/RuntimeEnabledFeatures.h" | |
| 10 #include "public/platform/modules/quota/WebDurableStorageDispatcher.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 DurableStorageController::~DurableStorageController() | |
| 15 { | |
| 16 } | |
| 17 | |
| 18 void DurableStorageController::provideTo(LocalFrame& frame, WebDurableStorageDis patcher* client) | |
| 19 { | |
| 20 ASSERT(RuntimeEnabledFeatures::permissionsEnabled()); | |
| 21 | |
| 22 DurableStorageController* controller = new DurableStorageController(frame, c lient); | |
| 23 WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPt rWillBeNoop(controller)); | |
| 24 } | |
| 25 | |
| 26 DurableStorageController* DurableStorageController::from(LocalFrame& frame) | |
| 27 { | |
| 28 return static_cast<DurableStorageController*>(WillBeHeapSupplement<LocalFram e>::from(frame, supplementName())); | |
| 29 } | |
| 30 | |
| 31 DurableStorageController::DurableStorageController(LocalFrame& frame, WebDurable StorageDispatcher* client) | |
| 32 : LocalFrameLifecycleObserver(&frame) | |
| 33 , m_client(client) | |
| 34 { | |
| 35 } | |
| 36 | |
| 37 const char* DurableStorageController::supplementName() | |
| 38 { | |
| 39 return "DurableStorageController"; | |
| 40 } | |
| 41 | |
| 42 WebDurableStorageDispatcher* DurableStorageController::client() const | |
| 43 { | |
| 44 return m_client; | |
| 45 } | |
| 46 | |
| 47 void DurableStorageController::willDetachFrameHost() | |
| 48 { | |
| 49 // m_client = nullptr; | |
|
dgrogan
2015/06/19 22:34:07
Argh, don't know why this is commented.
| |
| 50 } | |
| 51 | |
| 52 DEFINE_TRACE(DurableStorageController) | |
| 53 { | |
| 54 LocalFrameLifecycleObserver::trace(visitor); | |
| 55 WillBeHeapSupplement<LocalFrame>::trace(visitor); | |
| 56 } | |
| 57 | |
| 58 } // namespace blink | |
| OLD | NEW |