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

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

Issue 85263006: Make IDL Callbacks non-refcounted by default (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years 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
« no previous file with comments | « Source/modules/quota/StorageQuota.h ('k') | Source/modules/quota/StorageQuotaCallback.h » ('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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "public/platform/WebStorageQuotaType.h" 43 #include "public/platform/WebStorageQuotaType.h"
44 44
45 namespace WebCore { 45 namespace WebCore {
46 46
47 StorageQuota::StorageQuota(Type type) 47 StorageQuota::StorageQuota(Type type)
48 : m_type(type) 48 : m_type(type)
49 { 49 {
50 ScriptWrappable::init(this); 50 ScriptWrappable::init(this);
51 } 51 }
52 52
53 void StorageQuota::queryUsageAndQuota(ExecutionContext* executionContext, PassRe fPtr<StorageUsageCallback> successCallback, PassRefPtr<StorageErrorCallback> err orCallback) 53 void StorageQuota::queryUsageAndQuota(ExecutionContext* executionContext, PassOw nPtr<StorageUsageCallback> successCallback, PassOwnPtr<StorageErrorCallback> err orCallback)
54 { 54 {
55 ASSERT(executionContext); 55 ASSERT(executionContext);
56 56
57 blink::WebStorageQuotaType storageType = static_cast<blink::WebStorageQuotaT ype>(m_type); 57 blink::WebStorageQuotaType storageType = static_cast<blink::WebStorageQuotaT ype>(m_type);
58 if (storageType != blink::WebStorageQuotaTypeTemporary && storageType != bli nk::WebStorageQuotaTypePersistent) { 58 if (storageType != blink::WebStorageQuotaTypeTemporary && storageType != bli nk::WebStorageQuotaTypePersistent) {
59 // Unknown storage type is requested. 59 // Unknown storage type is requested.
60 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er rorCallback, NotSupportedError)); 60 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er rorCallback, NotSupportedError));
61 return; 61 return;
62 } 62 }
63 63
64 SecurityOrigin* securityOrigin = executionContext->securityOrigin(); 64 SecurityOrigin* securityOrigin = executionContext->securityOrigin();
65 if (securityOrigin->isUnique()) { 65 if (securityOrigin->isUnique()) {
66 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er rorCallback, NotSupportedError)); 66 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er rorCallback, NotSupportedError));
67 return; 67 return;
68 } 68 }
69 69
70 KURL storagePartition = KURL(KURL(), securityOrigin->toString()); 70 KURL storagePartition = KURL(KURL(), securityOrigin->toString());
71 blink::Platform::current()->queryStorageUsageAndQuota(storagePartition, stor ageType, WebStorageQuotaCallbacksImpl::createLeakedPtr(successCallback, errorCal lback)); 71 blink::Platform::current()->queryStorageUsageAndQuota(storagePartition, stor ageType, WebStorageQuotaCallbacksImpl::createLeakedPtr(successCallback, errorCal lback));
72 } 72 }
73 73
74 StorageQuota::~StorageQuota() 74 StorageQuota::~StorageQuota()
75 { 75 {
76 } 76 }
77 77
78 } // namespace WebCore 78 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/quota/StorageQuota.h ('k') | Source/modules/quota/StorageQuotaCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698