OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 return m_internal ? m_internal->m_outerHost->swapCache() : false; | 238 return m_internal ? m_internal->m_outerHost->swapCache() : false; |
239 } | 239 } |
240 | 240 |
241 bool ApplicationCacheHost::isApplicationCacheEnabled() | 241 bool ApplicationCacheHost::isApplicationCacheEnabled() |
242 { | 242 { |
243 ASSERT(m_documentLoader->frame()); | 243 ASSERT(m_documentLoader->frame()); |
244 return m_documentLoader->frame()->settings() | 244 return m_documentLoader->frame()->settings() |
245 && m_documentLoader->frame()->settings()->offlineWebApplicationCacheEnabled(); | 245 && m_documentLoader->frame()->settings()->offlineWebApplicationCacheEnabled(); |
246 } | 246 } |
247 | 247 |
248 // Ensure that our publicly defined enum values never get out of sync with the | |
249 // ones declared for use within WebCore. | |
250 #define COMPILE_ASSERT_MATCHING_ENUM(webcoreName, publicName) \ | |
251 COMPILE_ASSERT(int(ApplicationCacheHost::webcoreName) == int(WebApplicationCacheHost::publicName), webcoreName) | |
252 | |
253 COMPILE_ASSERT_MATCHING_ENUM(UNCACHED, Uncached); | |
254 COMPILE_ASSERT_MATCHING_ENUM(IDLE, Idle); | |
255 COMPILE_ASSERT_MATCHING_ENUM(CHECKING, Checking); | |
256 COMPILE_ASSERT_MATCHING_ENUM(DOWNLOADING, Downloading); | |
257 COMPILE_ASSERT_MATCHING_ENUM(UPDATEREADY, UpdateReady); | |
258 COMPILE_ASSERT_MATCHING_ENUM(OBSOLETE, Obsolete); | |
259 COMPILE_ASSERT_MATCHING_ENUM(CHECKING_EVENT, CheckingEvent); | |
260 COMPILE_ASSERT_MATCHING_ENUM(ERROR_EVENT, ErrorEvent); | |
261 COMPILE_ASSERT_MATCHING_ENUM(NOUPDATE_EVENT, NoUpdateEvent); | |
262 COMPILE_ASSERT_MATCHING_ENUM(DOWNLOADING_EVENT, DownloadingEvent); | |
263 COMPILE_ASSERT_MATCHING_ENUM(PROGRESS_EVENT, ProgressEvent); | |
264 COMPILE_ASSERT_MATCHING_ENUM(UPDATEREADY_EVENT, UpdateReadyEvent); | |
265 COMPILE_ASSERT_MATCHING_ENUM(CACHED_EVENT, CachedEvent); | |
266 COMPILE_ASSERT_MATCHING_ENUM(OBSOLETE_EVENT, ObsoleteEvent); | |
267 | |
268 } // namespace WebCore | 248 } // namespace WebCore |
269 | 249 |
270 #endif // ENABLE(OFFLINE_WEB_APPLICATIONS) | 250 #endif // ENABLE(OFFLINE_WEB_APPLICATIONS) |
OLD | NEW |