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

Side by Side Diff: Source/modules/quota/DurableStorageController.cpp

Issue 1154573005: Expose Durable Storage API to script (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rename WebSomeCallbacks and SomeCallbacks Created 5 years, 5 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 | Annotate | Revision Log
OLDNEW
(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;
50 }
51
52 DEFINE_TRACE(DurableStorageController)
53 {
54 LocalFrameLifecycleObserver::trace(visitor);
55 WillBeHeapSupplement<LocalFrame>::trace(visitor);
56 }
57
58 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698