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

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

Issue 1101263003: Oilpan: have Navigator and its supplements be on the heap by default. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make NavigatorBeacon a frame observer instead Created 5 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 | Annotate | Revision Log
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 24 matching lines...) Expand all
35 #include "modules/quota/DeprecatedStorageQuota.h" 35 #include "modules/quota/DeprecatedStorageQuota.h"
36 #include "modules/quota/StorageQuota.h" 36 #include "modules/quota/StorageQuota.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 NavigatorStorageQuota::NavigatorStorageQuota(LocalFrame* frame) 40 NavigatorStorageQuota::NavigatorStorageQuota(LocalFrame* frame)
41 : DOMWindowProperty(frame) 41 : DOMWindowProperty(frame)
42 { 42 {
43 } 43 }
44 44
45 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NavigatorStorageQuota); 45 NavigatorStorageQuota::~NavigatorStorageQuota()
46 {
47 }
46 48
47 const char* NavigatorStorageQuota::supplementName() 49 const char* NavigatorStorageQuota::supplementName()
48 { 50 {
49 return "NavigatorStorageQuota"; 51 return "NavigatorStorageQuota";
50 } 52 }
51 53
52 NavigatorStorageQuota& NavigatorStorageQuota::from(Navigator& navigator) 54 NavigatorStorageQuota& NavigatorStorageQuota::from(Navigator& navigator)
53 { 55 {
54 NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(Will BeHeapSupplement<Navigator>::from(navigator, supplementName())); 56 NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(Heap Supplement<Navigator>::from(navigator, supplementName()));
55 if (!supplement) { 57 if (!supplement) {
56 supplement = new NavigatorStorageQuota(navigator.frame()); 58 supplement = new NavigatorStorageQuota(navigator.frame());
57 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement)); 59 provideTo(navigator, supplementName(), supplement);
58 } 60 }
59 return *supplement; 61 return *supplement;
60 } 62 }
61 63
62 StorageQuota* NavigatorStorageQuota::storageQuota(Navigator& navigator) 64 StorageQuota* NavigatorStorageQuota::storageQuota(Navigator& navigator)
63 { 65 {
64 return NavigatorStorageQuota::from(navigator).storageQuota(); 66 return NavigatorStorageQuota::from(navigator).storageQuota();
65 } 67 }
66 68
67 DeprecatedStorageQuota* NavigatorStorageQuota::webkitTemporaryStorage(Navigator& navigator) 69 DeprecatedStorageQuota* NavigatorStorageQuota::webkitTemporaryStorage(Navigator& navigator)
(...skipping 25 matching lines...) Expand all
93 if (!m_persistentStorage && frame()) 95 if (!m_persistentStorage && frame())
94 m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStorageQu ota::Persistent); 96 m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStorageQu ota::Persistent);
95 return m_persistentStorage.get(); 97 return m_persistentStorage.get();
96 } 98 }
97 99
98 DEFINE_TRACE(NavigatorStorageQuota) 100 DEFINE_TRACE(NavigatorStorageQuota)
99 { 101 {
100 visitor->trace(m_storageQuota); 102 visitor->trace(m_storageQuota);
101 visitor->trace(m_temporaryStorage); 103 visitor->trace(m_temporaryStorage);
102 visitor->trace(m_persistentStorage); 104 visitor->trace(m_persistentStorage);
103 WillBeHeapSupplement<Navigator>::trace(visitor); 105 HeapSupplement<Navigator>::trace(visitor);
104 DOMWindowProperty::trace(visitor); 106 DOMWindowProperty::trace(visitor);
105 } 107 }
106 108
107 } // namespace blink 109 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698