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

Side by Side Diff: content/browser/service_worker/service_worker_database.h

Issue 2376403004: Store Origin-Trial tokens to ServiceWorkerDataBase (Closed)
Patch Set: incorporated iclelland's comment Created 4 years, 2 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <utility> 13 #include <utility>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
17 #include "base/gtest_prod_util.h" 17 #include "base/gtest_prod_util.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "base/optional.h"
19 #include "base/sequence_checker.h" 20 #include "base/sequence_checker.h"
20 #include "base/time/time.h" 21 #include "base/time/time.h"
21 #include "content/common/content_export.h" 22 #include "content/common/content_export.h"
23 #include "content/common/origin_trials/trial_token_validator.h"
22 #include "content/common/service_worker/service_worker_status_code.h" 24 #include "content/common/service_worker/service_worker_status_code.h"
23 #include "url/gurl.h" 25 #include "url/gurl.h"
24 #include "url/origin.h" 26 #include "url/origin.h"
25 27
26 namespace leveldb { 28 namespace leveldb {
27 class DB; 29 class DB;
28 class Env; 30 class Env;
29 class Status; 31 class Status;
30 class WriteBatch; 32 class WriteBatch;
31 } 33 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Versions are first stored once they successfully install and become 65 // Versions are first stored once they successfully install and become
64 // the waiting version. Then transition to the active version. The stored 66 // the waiting version. Then transition to the active version. The stored
65 // version may be in the ACTIVATED state or in the INSTALLED state. 67 // version may be in the ACTIVATED state or in the INSTALLED state.
66 GURL script; 68 GURL script;
67 int64_t version_id; 69 int64_t version_id;
68 bool is_active; 70 bool is_active;
69 bool has_fetch_handler; 71 bool has_fetch_handler;
70 base::Time last_update_check; 72 base::Time last_update_check;
71 std::vector<GURL> foreign_fetch_scopes; 73 std::vector<GURL> foreign_fetch_scopes;
72 std::vector<url::Origin> foreign_fetch_origins; 74 std::vector<url::Origin> foreign_fetch_origins;
75 base::Optional<TrialTokenValidator::FeatureToTokensMap> origin_trial_tokens;
73 76
74 // Not populated until ServiceWorkerStorage::StoreRegistration is called. 77 // Not populated until ServiceWorkerStorage::StoreRegistration is called.
75 int64_t resources_total_size_bytes; 78 int64_t resources_total_size_bytes;
76 79
77 RegistrationData(); 80 RegistrationData();
78 RegistrationData(const RegistrationData& other); 81 RegistrationData(const RegistrationData& other);
79 ~RegistrationData(); 82 ~RegistrationData();
80 }; 83 };
81 84
82 struct ResourceRecord { 85 struct ResourceRecord {
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, 383 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest,
381 UserData_UninitializedDatabase); 384 UserData_UninitializedDatabase);
382 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); 385 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase);
383 386
384 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); 387 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase);
385 }; 388 };
386 389
387 } // namespace content 390 } // namespace content
388 391
389 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ 392 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698