OLD | NEW |
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_SCRIPT_CACHE_MAP_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CACHE_MAP_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CACHE_MAP_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CACHE_MAP_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // for a particular version's implicit script resources. | 30 // for a particular version's implicit script resources. |
31 class CONTENT_EXPORT ServiceWorkerScriptCacheMap { | 31 class CONTENT_EXPORT ServiceWorkerScriptCacheMap { |
32 public: | 32 public: |
33 int64_t LookupResourceId(const GURL& url); | 33 int64_t LookupResourceId(const GURL& url); |
34 | 34 |
35 // Used during the initial run of a new version to build the map | 35 // Used during the initial run of a new version to build the map |
36 // of resources ids. | 36 // of resources ids. |
37 void NotifyStartedCaching(const GURL& url, int64_t resource_id); | 37 void NotifyStartedCaching(const GURL& url, int64_t resource_id); |
38 void NotifyFinishedCaching(const GURL& url, | 38 void NotifyFinishedCaching(const GURL& url, |
39 int64_t size_bytes, | 39 int64_t size_bytes, |
40 const net::URLRequestStatus& status, | 40 net::Error net_error, |
41 const std::string& status_message); | 41 const std::string& status_message); |
42 | 42 |
43 // Used to retrieve the results of the initial run of a new version. | 43 // Used to retrieve the results of the initial run of a new version. |
44 void GetResources( | 44 void GetResources( |
45 std::vector<ServiceWorkerDatabase::ResourceRecord>* resources); | 45 std::vector<ServiceWorkerDatabase::ResourceRecord>* resources); |
46 | 46 |
47 // Used when loading an existing version. | 47 // Used when loading an existing version. |
48 void SetResources( | 48 void SetResources( |
49 const std::vector<ServiceWorkerDatabase::ResourceRecord>& resources); | 49 const std::vector<ServiceWorkerDatabase::ResourceRecord>& resources); |
50 | 50 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 std::string main_script_status_message_; | 87 std::string main_script_status_message_; |
88 | 88 |
89 base::WeakPtrFactory<ServiceWorkerScriptCacheMap> weak_factory_; | 89 base::WeakPtrFactory<ServiceWorkerScriptCacheMap> weak_factory_; |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptCacheMap); | 91 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptCacheMap); |
92 }; | 92 }; |
93 | 93 |
94 } // namespace content | 94 } // namespace content |
95 | 95 |
96 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CACHE_MAP_H_ | 96 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CACHE_MAP_H_ |
OLD | NEW |