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

Side by Side Diff: Source/modules/crypto/DOMWindowCrypto.cpp

Issue 212933005: Oilpan: turn DOMWindow into a heap supplementable. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make use of DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED() Created 6 years, 9 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 { 45 {
46 } 46 }
47 47
48 const char* DOMWindowCrypto::supplementName() 48 const char* DOMWindowCrypto::supplementName()
49 { 49 {
50 return "DOMWindowCrypto"; 50 return "DOMWindowCrypto";
51 } 51 }
52 52
53 DOMWindowCrypto& DOMWindowCrypto::from(DOMWindow& window) 53 DOMWindowCrypto& DOMWindowCrypto::from(DOMWindow& window)
54 { 54 {
55 DOMWindowCrypto* supplement = static_cast<DOMWindowCrypto*>(Supplement<DOMWi ndow>::from(window, supplementName())); 55 DOMWindowCrypto* supplement = static_cast<DOMWindowCrypto*>(WillBeHeapSupple ment<DOMWindow>::from(window, supplementName()));
56 if (!supplement) { 56 if (!supplement) {
57 supplement = new DOMWindowCrypto(window); 57 supplement = new DOMWindowCrypto(window);
58 provideTo(window, supplementName(), adoptPtr(supplement)); 58 provideTo(window, supplementName(), adoptPtrWillBeNoop(supplement));
59 } 59 }
60 return *supplement; 60 return *supplement;
61 } 61 }
62 62
63 Crypto* DOMWindowCrypto::crypto(DOMWindow& window) 63 Crypto* DOMWindowCrypto::crypto(DOMWindow& window)
64 { 64 {
65 return DOMWindowCrypto::from(window).crypto(); 65 return DOMWindowCrypto::from(window).crypto();
66 } 66 }
67 67
68 Crypto* DOMWindowCrypto::crypto() const 68 Crypto* DOMWindowCrypto::crypto() const
69 { 69 {
70 if (!m_crypto && frame()) 70 if (!m_crypto && frame())
71 m_crypto = Crypto::create(); 71 m_crypto = Crypto::create();
72 return m_crypto.get(); 72 return m_crypto.get();
73 } 73 }
74 74
75 void DOMWindowCrypto::trace(Visitor* visitor)
76 {
77 visitor->trace(m_crypto);
78 }
79
75 } // namespace WebCore 80 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/crypto/DOMWindowCrypto.h ('k') | Source/modules/imagebitmap/ImageBitmapFactories.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698