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

Side by Side Diff: webkit/api/src/ApplicationCacheHost.cpp

Issue 198034: Stick all of the WebKit API enum compile asserts in one file.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | Annotate | Revision Log
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « no previous file | webkit/api/src/AssertMatchingEnums.cpp » ('j') | webkit/api/src/WebMediaPlayerClientImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698