| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 StorageQuotaClientImpl::StorageQuotaClientImpl() {} | 45 StorageQuotaClientImpl::StorageQuotaClientImpl() {} |
| 46 | 46 |
| 47 StorageQuotaClientImpl::~StorageQuotaClientImpl() {} | 47 StorageQuotaClientImpl::~StorageQuotaClientImpl() {} |
| 48 | 48 |
| 49 void StorageQuotaClientImpl::RequestQuota( | 49 void StorageQuotaClientImpl::RequestQuota( |
| 50 ScriptState* script_state, | 50 ScriptState* script_state, |
| 51 WebStorageQuotaType storage_type, | 51 WebStorageQuotaType storage_type, |
| 52 unsigned long long new_quota_in_bytes, | 52 unsigned long long new_quota_in_bytes, |
| 53 StorageQuotaCallback* success_callback, | 53 StorageQuotaCallback* success_callback, |
| 54 StorageErrorCallback* error_callback) { | 54 StorageErrorCallback* error_callback) { |
| 55 ExecutionContext* execution_context = script_state->GetExecutionContext(); | 55 ExecutionContext* execution_context = ExecutionContext::From(script_state); |
| 56 DCHECK(execution_context); | 56 DCHECK(execution_context); |
| 57 DCHECK(execution_context->IsDocument()) | 57 DCHECK(execution_context->IsDocument()) |
| 58 << "Quota requests are not supported in workers"; | 58 << "Quota requests are not supported in workers"; |
| 59 | 59 |
| 60 Document* document = ToDocument(execution_context); | 60 Document* document = ToDocument(execution_context); |
| 61 WebLocalFrameImpl* web_frame = | 61 WebLocalFrameImpl* web_frame = |
| 62 WebLocalFrameImpl::FromFrame(document->GetFrame()); | 62 WebLocalFrameImpl::FromFrame(document->GetFrame()); |
| 63 StorageQuotaCallbacks* callbacks = | 63 StorageQuotaCallbacks* callbacks = |
| 64 DeprecatedStorageQuotaCallbacksImpl::Create(success_callback, | 64 DeprecatedStorageQuotaCallbacksImpl::Create(success_callback, |
| 65 error_callback); | 65 error_callback); |
| 66 web_frame->Client()->RequestStorageQuota(storage_type, new_quota_in_bytes, | 66 web_frame->Client()->RequestStorageQuota(storage_type, new_quota_in_bytes, |
| 67 callbacks); | 67 callbacks); |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace blink | 70 } // namespace blink |
| OLD | NEW |