Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / exported / WebStorageQuotaCallbacks.cpp
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "public/platform/WebStorageQuotaCallbacks.h"
7
8 #include "platform/StorageQuotaCallbacks.h"
9
10 namespace blink {
11
12 WebStorageQuotaCallbacks::WebStorageQuotaCallbacks(StorageQuotaCallbacks* callbacks)
13     : m_private(callbacks)
14 {
15 }
16
17 void WebStorageQuotaCallbacks::reset()
18 {
19     m_private.reset();
20 }
21
22 void WebStorageQuotaCallbacks::assign(const WebStorageQuotaCallbacks& other)
23 {
24     m_private = other.m_private;
25 }
26
27 void WebStorageQuotaCallbacks::didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes)
28 {
29     ASSERT(!m_private.isNull());
30     m_private->didQueryStorageUsageAndQuota(usageInBytes, quotaInBytes);
31     m_private.reset();
32 }
33
34 void WebStorageQuotaCallbacks::didGrantStorageQuota(unsigned long long usageInBytes, unsigned long long grantedQuotaInBytes)
35 {
36     ASSERT(!m_private.isNull());
37     m_private->didGrantStorageQuota(usageInBytes, grantedQuotaInBytes);
38     m_private.reset();
39 }
40
41 void WebStorageQuotaCallbacks::didFail(WebStorageQuotaError error)
42 {
43     ASSERT(!m_private.isNull());
44     m_private->didFail(error);
45     m_private.reset();
46 }
47
48 } // namespace blink