| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 #else | 108 #else |
| 109 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted | 109 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted |
| 110 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. | 110 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. |
| 111 // Instead, we manually make InternalSettings supplement Page. | 111 // Instead, we manually make InternalSettings supplement Page. |
| 112 class InternalSettingsWrapper : public Supplement<Page> { | 112 class InternalSettingsWrapper : public Supplement<Page> { |
| 113 public: | 113 public: |
| 114 explicit InternalSettingsWrapper(Page& page) | 114 explicit InternalSettingsWrapper(Page& page) |
| 115 : m_internalSettings(InternalSettings::create(page)) { } | 115 : m_internalSettings(InternalSettings::create(page)) { } |
| 116 virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); } | 116 virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); } |
| 117 #if !ASSERT_DISABLED | 117 #if ASSERT_ENABLED |
| 118 virtual bool isRefCountedWrapper() const OVERRIDE { return true; } | 118 virtual bool isRefCountedWrapper() const OVERRIDE { return true; } |
| 119 #endif | 119 #endif |
| 120 InternalSettings* internalSettings() const { return m_internalSettings.get()
; } | 120 InternalSettings* internalSettings() const { return m_internalSettings.get()
; } |
| 121 | 121 |
| 122 private: | 122 private: |
| 123 RefPtr<InternalSettings> m_internalSettings; | 123 RefPtr<InternalSettings> m_internalSettings; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 InternalSettings* InternalSettings::from(Page& page) | 126 InternalSettings* InternalSettings::from(Page& page) |
| 127 { | 127 { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 void InternalSettings::trace(Visitor* visitor) | 345 void InternalSettings::trace(Visitor* visitor) |
| 346 { | 346 { |
| 347 visitor->trace(m_page); | 347 visitor->trace(m_page); |
| 348 InternalSettingsGenerated::trace(visitor); | 348 InternalSettingsGenerated::trace(visitor); |
| 349 #if ENABLE(OILPAN) | 349 #if ENABLE(OILPAN) |
| 350 HeapSupplement<Page>::trace(visitor); | 350 HeapSupplement<Page>::trace(visitor); |
| 351 #endif | 351 #endif |
| 352 } | 352 } |
| 353 | 353 |
| 354 } | 354 } |
| OLD | NEW |