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

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

Issue 212123005: Quota: Add null check (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « no previous file | Source/modules/quota/StorageQuota.cpp » ('j') | 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 { 78 {
79 ASSERT(executionContext); 79 ASSERT(executionContext);
80 80
81 blink::WebStorageQuotaType storageType = static_cast<blink::WebStorageQuotaT ype>(m_type); 81 blink::WebStorageQuotaType storageType = static_cast<blink::WebStorageQuotaT ype>(m_type);
82 if (storageType != blink::WebStorageQuotaTypeTemporary && storageType != bli nk::WebStorageQuotaTypePersistent) { 82 if (storageType != blink::WebStorageQuotaTypeTemporary && storageType != bli nk::WebStorageQuotaTypePersistent) {
83 // Unknown storage type is requested. 83 // Unknown storage type is requested.
84 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er rorCallback, NotSupportedError)); 84 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er rorCallback, NotSupportedError));
85 return; 85 return;
86 } 86 }
87 87
88 StorageQuotaClient::from(executionContext)->requestQuota(executionContext, s torageType, newQuotaInBytes, successCallback, errorCallback); 88 StorageQuotaClient* client = StorageQuotaClient::from(executionContext);
89 if (!client) {
90 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er rorCallback, NotSupportedError));
91 return;
92 }
93
94 client->requestQuota(executionContext, storageType, newQuotaInBytes, success Callback, errorCallback);
89 } 95 }
90 96
91 DeprecatedStorageQuota::~DeprecatedStorageQuota() 97 DeprecatedStorageQuota::~DeprecatedStorageQuota()
92 { 98 {
93 } 99 }
94 100
95 } // namespace WebCore 101 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/modules/quota/StorageQuota.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698