OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 #else | 105 #else |
106 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted | 106 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted |
107 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. | 107 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. |
108 // Instead, we manually make InternalSettings supplement Page. | 108 // Instead, we manually make InternalSettings supplement Page. |
109 class InternalSettingsWrapper : public Supplement<Page> { | 109 class InternalSettingsWrapper : public Supplement<Page> { |
110 public: | 110 public: |
111 explicit InternalSettingsWrapper(Page& page) | 111 explicit InternalSettingsWrapper(Page& page) |
112 : m_internalSettings(InternalSettings::create(page)) { } | 112 : m_internalSettings(InternalSettings::create(page)) { } |
113 virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); } | 113 virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); } |
114 #if ASSERT_ENABLED | 114 #if ENABLE(ASSERT) |
115 virtual bool isRefCountedWrapper() const OVERRIDE { return true; } | 115 virtual bool isRefCountedWrapper() const OVERRIDE { return true; } |
116 #endif | 116 #endif |
117 InternalSettings* internalSettings() const { return m_internalSettings.get()
; } | 117 InternalSettings* internalSettings() const { return m_internalSettings.get()
; } |
118 | 118 |
119 private: | 119 private: |
120 RefPtr<InternalSettings> m_internalSettings; | 120 RefPtr<InternalSettings> m_internalSettings; |
121 }; | 121 }; |
122 | 122 |
123 InternalSettings* InternalSettings::from(Page& page) | 123 InternalSettings* InternalSettings::from(Page& page) |
124 { | 124 { |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 void InternalSettings::trace(Visitor* visitor) | 337 void InternalSettings::trace(Visitor* visitor) |
338 { | 338 { |
339 visitor->trace(m_page); | 339 visitor->trace(m_page); |
340 InternalSettingsGenerated::trace(visitor); | 340 InternalSettingsGenerated::trace(visitor); |
341 #if ENABLE(OILPAN) | 341 #if ENABLE(OILPAN) |
342 HeapSupplement<Page>::trace(visitor); | 342 HeapSupplement<Page>::trace(visitor); |
343 #endif | 343 #endif |
344 } | 344 } |
345 | 345 |
346 } | 346 } |
OLD | NEW |