Chromium Code Reviews| Index: Source/modules/quota/DurableStorageController.cpp |
| diff --git a/Source/modules/quota/DurableStorageController.cpp b/Source/modules/quota/DurableStorageController.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5d0c66f03e625fc86aa51eceb8857512576471ae |
| --- /dev/null |
| +++ b/Source/modules/quota/DurableStorageController.cpp |
| @@ -0,0 +1,58 @@ |
| +// Copyright 2015 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. |
| + |
| +#include "config.h" |
| +#include "modules/quota/DurableStorageController.h" |
| + |
| +#include "core/frame/LocalFrame.h" |
| +#include "platform/RuntimeEnabledFeatures.h" |
| +#include "public/platform/modules/quota/WebDurableStorageDispatcher.h" |
| + |
| +namespace blink { |
| + |
| +DurableStorageController::~DurableStorageController() |
| +{ |
| +} |
| + |
| +void DurableStorageController::provideTo(LocalFrame& frame, WebDurableStorageDispatcher* client) |
| +{ |
| + ASSERT(RuntimeEnabledFeatures::permissionsEnabled()); |
| + |
| + DurableStorageController* controller = new DurableStorageController(frame, client); |
| + WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillBeNoop(controller)); |
| +} |
| + |
| +DurableStorageController* DurableStorageController::from(LocalFrame& frame) |
| +{ |
| + return static_cast<DurableStorageController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); |
| +} |
| + |
| +DurableStorageController::DurableStorageController(LocalFrame& frame, WebDurableStorageDispatcher* client) |
| + : LocalFrameLifecycleObserver(&frame) |
| + , m_client(client) |
| +{ |
| +} |
| + |
| +const char* DurableStorageController::supplementName() |
| +{ |
| + return "DurableStorageController"; |
| +} |
| + |
| +WebDurableStorageDispatcher* DurableStorageController::client() const |
| +{ |
| + return m_client; |
| +} |
| + |
| +void DurableStorageController::willDetachFrameHost() |
| +{ |
| +// m_client = nullptr; |
|
dgrogan
2015/06/19 22:34:07
Argh, don't know why this is commented.
|
| +} |
| + |
| +DEFINE_TRACE(DurableStorageController) |
| +{ |
| + LocalFrameLifecycleObserver::trace(visitor); |
| + WillBeHeapSupplement<LocalFrame>::trace(visitor); |
| +} |
| + |
| +} // namespace blink |