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

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

Issue 2602853002: Eliminate network fallback from ServiceWorkerContextRequestHandler. (Closed)
Patch Set: rm class Created 3 years, 11 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
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 const std::string& main_script_status_message() const { 67 const std::string& main_script_status_message() const {
68 return main_script_status_message_; 68 return main_script_status_message_;
69 } 69 }
70 70
71 private: 71 private:
72 typedef std::map<GURL, ServiceWorkerDatabase::ResourceRecord> ResourceMap; 72 typedef std::map<GURL, ServiceWorkerDatabase::ResourceRecord> ResourceMap;
73 73
74 // The version objects owns its script cache and provides a rawptr to it. 74 // The version objects owns its script cache and provides a rawptr to it.
75 friend class ServiceWorkerVersion; 75 friend class ServiceWorkerVersion;
76 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest,
77 ReadResourceFailure_WaitingWorker);
78
76 ServiceWorkerScriptCacheMap( 79 ServiceWorkerScriptCacheMap(
77 ServiceWorkerVersion* owner, 80 ServiceWorkerVersion* owner,
78 base::WeakPtr<ServiceWorkerContextCore> context); 81 base::WeakPtr<ServiceWorkerContextCore> context);
79 ~ServiceWorkerScriptCacheMap(); 82 ~ServiceWorkerScriptCacheMap();
80 83
81 void OnMetadataWritten( 84 void OnMetadataWritten(
82 std::unique_ptr<ServiceWorkerResponseMetadataWriter> writer, 85 std::unique_ptr<ServiceWorkerResponseMetadataWriter> writer,
83 const net::CompletionCallback& callback, 86 const net::CompletionCallback& callback,
84 int result); 87 int result);
85 88
86 bool IsMainScript(const GURL& url); 89 bool IsMainScript(const GURL& url);
87 90
88 ServiceWorkerVersion* owner_; 91 ServiceWorkerVersion* owner_;
89 base::WeakPtr<ServiceWorkerContextCore> context_; 92 base::WeakPtr<ServiceWorkerContextCore> context_;
90 ResourceMap resource_map_; 93 ResourceMap resource_map_;
91 net::URLRequestStatus main_script_status_; 94 net::URLRequestStatus main_script_status_;
92 std::string main_script_status_message_; 95 std::string main_script_status_message_;
93 StartStatus main_script_start_status_ = StartStatus::UNINITIALIZED; 96 StartStatus main_script_start_status_ = StartStatus::UNINITIALIZED;
94 FinishStatus main_script_finish_status_ = FinishStatus::UNINITIALIZED; 97 FinishStatus main_script_finish_status_ = FinishStatus::UNINITIALIZED;
95 98
96 base::WeakPtrFactory<ServiceWorkerScriptCacheMap> weak_factory_; 99 base::WeakPtrFactory<ServiceWorkerScriptCacheMap> weak_factory_;
97 100
98 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptCacheMap); 101 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptCacheMap);
99 }; 102 };
100 103
101 } // namespace content 104 } // namespace content
102 105
103 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CACHE_MAP_H_ 106 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CACHE_MAP_H_
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_read_from_cache_job.h ('k') | net/log/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698