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

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

Issue 434453005: test for https://codereview.chromium.org/419693002/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 // 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 <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 22 matching lines...) Expand all
33 33
34 // Used to retrieve the results of the initial run of a new version. 34 // Used to retrieve the results of the initial run of a new version.
35 bool HasError() const { return has_error_; } 35 bool HasError() const { return has_error_; }
36 void GetResources( 36 void GetResources(
37 std::vector<ServiceWorkerDatabase::ResourceRecord>* resources); 37 std::vector<ServiceWorkerDatabase::ResourceRecord>* resources);
38 38
39 // Used when loading an existing version. 39 // Used when loading an existing version.
40 void SetResources( 40 void SetResources(
41 const std::vector<ServiceWorkerDatabase::ResourceRecord>& resources); 41 const std::vector<ServiceWorkerDatabase::ResourceRecord>& resources);
42 42
43 size_t size() const { return resource_ids_.size(); }
44
43 private: 45 private:
44 typedef std::map<GURL, int64> ResourceIDMap; 46 typedef std::map<GURL, int64> ResourceIDMap;
45 47
46 // The version objects owns its script cache and provides a rawptr to it. 48 // The version objects owns its script cache and provides a rawptr to it.
47 friend class ServiceWorkerVersion; 49 friend class ServiceWorkerVersion;
48 ServiceWorkerScriptCacheMap( 50 ServiceWorkerScriptCacheMap(
49 ServiceWorkerVersion* owner, 51 ServiceWorkerVersion* owner,
50 base::WeakPtr<ServiceWorkerContextCore> context); 52 base::WeakPtr<ServiceWorkerContextCore> context);
51 ~ServiceWorkerScriptCacheMap(); 53 ~ServiceWorkerScriptCacheMap();
52 54
53 ServiceWorkerVersion* owner_; 55 ServiceWorkerVersion* owner_;
54 base::WeakPtr<ServiceWorkerContextCore> context_; 56 base::WeakPtr<ServiceWorkerContextCore> context_;
55 ResourceIDMap resource_ids_; 57 ResourceIDMap resource_ids_;
56 bool has_error_; 58 bool has_error_;
57 59
58 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptCacheMap); 60 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptCacheMap);
59 }; 61 };
60 62
61 } // namespace content 63 } // namespace content
62 64
63 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CACHE_MAP_H_ 65 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CACHE_MAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698