| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 #else | 110 #else |
| 111 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted | 111 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted |
| 112 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. | 112 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. |
| 113 // Instead, we manually make InternalSettings supplement Page. | 113 // Instead, we manually make InternalSettings supplement Page. |
| 114 class InternalSettingsWrapper : public Supplement<Page> { | 114 class InternalSettingsWrapper : public Supplement<Page> { |
| 115 public: | 115 public: |
| 116 explicit InternalSettingsWrapper(Page& page) | 116 explicit InternalSettingsWrapper(Page& page) |
| 117 : m_internalSettings(InternalSettings::create(page)) { } | 117 : m_internalSettings(InternalSettings::create(page)) { } |
| 118 virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); } | 118 virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); } |
| 119 #if ENABLE(ASSERT) | 119 #if ENABLE(ASSERT) |
| 120 virtual bool isRefCountedWrapper() const override { return true; } | 120 bool isRefCountedWrapper() const override { return true; } |
| 121 #endif | 121 #endif |
| 122 InternalSettings* internalSettings() const { return m_internalSettings.get()
; } | 122 InternalSettings* internalSettings() const { return m_internalSettings.get()
; } |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 RefPtr<InternalSettings> m_internalSettings; | 125 RefPtr<InternalSettings> m_internalSettings; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 InternalSettings* InternalSettings::from(Page& page) | 128 InternalSettings* InternalSettings::from(Page& page) |
| 129 { | 129 { |
| 130 if (!Supplement<Page>::from(page, supplementName())) | 130 if (!Supplement<Page>::from(page, supplementName())) |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 settings()->setLogDnsPrefetchAndPreconnect(enabled); | 498 settings()->setLogDnsPrefetchAndPreconnect(enabled); |
| 499 } | 499 } |
| 500 | 500 |
| 501 void InternalSettings::setPreloadLogging(bool enabled, ExceptionState& exception
State) | 501 void InternalSettings::setPreloadLogging(bool enabled, ExceptionState& exception
State) |
| 502 { | 502 { |
| 503 InternalSettingsGuardForSettings(); | 503 InternalSettingsGuardForSettings(); |
| 504 settings()->setLogPreload(enabled); | 504 settings()->setLogPreload(enabled); |
| 505 } | 505 } |
| 506 | 506 |
| 507 } | 507 } |
| OLD | NEW |