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

Side by Side Diff: loader/appcache2/ApplicationCacheCommon.h

Issue 113554: For local review prior to sending to webkit (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: '' Created 11 years, 6 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2009, Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 #ifndef ApplicationCacheCommon_h
32 #define ApplicationCacheCommon_h
33
34 #if ENABLE(APPLICATION_CACHE)
35
36 namespace WebCore {
37
38 // Types and constants used by the front and back ends
39
40 typedef long long ApplicationCacheStorageID; // a 64 bit sqlite rowid
41 typedef ApplicationCacheStorageID ApplicationCacheID;
42 typedef int ApplicationCacheContextID;
43
44 struct GlobalApplicationCacheContextID {
45 GlobalApplicationCacheContextID()
46 : m_contextID(0)
47 , m_processID(0)
48 {
49 }
50
51 GlobalApplicationCacheContextID(ApplicationCacheContextID contextID, int processID)
52 : m_contextID(contextID)
53 , m_processID(processID)
54 {
55 }
56
57 ApplicationCacheContextID m_contextID;
58 int m_processID;
59
60 bool operator==(const GlobalApplicationCacheContextID& other) const
61 {
62 return (m_contextID == other.m_contextID) && (m_processID == other.m _processID);
63 }
64
65 bool operator!=(const GlobalApplicationCacheContextID& other) const
66 {
67 return !(*this == other);
68 }
69
70 static GlobalApplicationCacheContextID none() { return GlobalApplication CacheContextID(); }
71 };
72
73 enum ApplicationCacheContextType {
74 MainFrameContext,
75 SubFrameContext,
76 DedicatedWorkerContext,
77 SharedWorkerContext
78 };
79
80 enum WellKnownApplicationCacheIDs {
81 NoApplicationCacheID = 0,
82 NoApplicationCacheContextID = 0,
83 UnknownApplicationCacheContextID = -1,
84 };
85
86 // These status values correspond with those specified by this HTML5 spec.
87 enum ApplicationCacheStatus {
88 APPCACHE_UNCACHED = 0,
89 APPCACHE_IDLE = 1,
90 APPCACHE_CHECKING = 2,
91 APPCACHE_DOWNLOADING = 3,
92 APPCACHE_UPDATEREADY = 4,
93 APPCACHE_OBSOLETE = 5
94 };
95
96 enum ApplicationCacheEventType {
97 APPCACHE_CHECKING_EVENT,
98 APPCACHE_ERROR_EVENT,
99 APPCACHE_NOUPDATE_EVENT,
100 APPCACHE_DOWNLOADING_EVENT,
101 APPCACHE_PROGRESS_EVENT,
102 APPCACHE_UPDATEREADY_EVENT,
103 APPCACHE_CACHED_EVENT,
104 APPCACHE_OBSOLETE_EVENT,
105 NUMBER_OF_APPCACHE_EVENT_TYPES,
106 };
107
108 } // namespace WebCore
109
110 #endif // ENABLE(APPLICATION_CACHE)
111 #endif // ApplicationCacheCommon_h
OLDNEW
« no previous file with comments | « loader/appcache2/ApplicationCacheBridgeImpl.cpp ('k') | loader/appcache2/ApplicationCacheFrontend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698