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

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

Issue 178663004: Oilpan: move WorkerGlobalScope to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove redundant include Created 6 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 { 43 {
44 } 44 }
45 45
46 const char* WorkerNavigatorStorageQuota::supplementName() 46 const char* WorkerNavigatorStorageQuota::supplementName()
47 { 47 {
48 return "WorkerNavigatorStorageQuota"; 48 return "WorkerNavigatorStorageQuota";
49 } 49 }
50 50
51 WorkerNavigatorStorageQuota& WorkerNavigatorStorageQuota::from(WorkerNavigator& navigator) 51 WorkerNavigatorStorageQuota& WorkerNavigatorStorageQuota::from(WorkerNavigator& navigator)
52 { 52 {
53 WorkerNavigatorStorageQuota* supplement = static_cast<WorkerNavigatorStorage Quota*>(Supplement<WorkerNavigator>::from(navigator, supplementName())); 53 WorkerNavigatorStorageQuota* supplement = static_cast<WorkerNavigatorStorage Quota*>(WillBeHeapSupplement<WorkerNavigator>::from(navigator, supplementName()) );
54 if (!supplement) { 54 if (!supplement) {
55 supplement = new WorkerNavigatorStorageQuota(); 55 supplement = new WorkerNavigatorStorageQuota();
56 provideTo(navigator, supplementName(), adoptPtr(supplement)); 56 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
57 } 57 }
58 return *supplement; 58 return *supplement;
59 } 59 }
60 60
61 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage(Work erNavigator& navigator) 61 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage(Work erNavigator& navigator)
62 { 62 {
63 return WorkerNavigatorStorageQuota::from(navigator).webkitTemporaryStorage() ; 63 return WorkerNavigatorStorageQuota::from(navigator).webkitTemporaryStorage() ;
64 } 64 }
65 65
66 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage(Wor kerNavigator& navigator) 66 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage(Wor kerNavigator& navigator)
67 { 67 {
68 return WorkerNavigatorStorageQuota::from(navigator).webkitPersistentStorage( ); 68 return WorkerNavigatorStorageQuota::from(navigator).webkitPersistentStorage( );
69 } 69 }
70 70
71 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage() co nst 71 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage() co nst
72 { 72 {
73 if (!m_temporaryStorage) 73 if (!m_temporaryStorage)
74 m_temporaryStorage = DeprecatedStorageQuota::create(DeprecatedStorageQuo ta::Temporary); 74 m_temporaryStorage = DeprecatedStorageQuota::create(DeprecatedStorageQuo ta::Temporary);
75 return m_temporaryStorage.get(); 75 return m_temporaryStorage.get();
76 } 76 }
77 77
78 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage() c onst 78 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage() c onst
79 { 79 {
80 if (!m_persistentStorage) 80 if (!m_persistentStorage)
81 m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStorageQu ota::Persistent); 81 m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStorageQu ota::Persistent);
82 return m_persistentStorage.get(); 82 return m_persistentStorage.get();
83 } 83 }
84 84
85 void WorkerNavigatorStorageQuota::trace(Visitor* visitor)
86 {
87 visitor->trace(m_temporaryStorage);
88 visitor->trace(m_persistentStorage);
89 }
90
85 } // namespace WebCore 91 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698