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

Side by Side Diff: third_party/WebKit/Source/web/StorageQuotaClientImpl.cpp

Issue 2811213002: Move ScriptState::GetExecutionContext (Part 6) (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/modules/permissions/Permissions.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/permissions/Permissions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698