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

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

Issue 2118243002: [proof-of-concept] SW thread independent of the main thread Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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_PROCESS_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 79
80 // Adds/removes process reference for the |pattern|, the process with highest 80 // Adds/removes process reference for the |pattern|, the process with highest
81 // references count will be chosen to start a worker. 81 // references count will be chosen to start a worker.
82 void AddProcessReferenceToPattern(const GURL& pattern, int process_id); 82 void AddProcessReferenceToPattern(const GURL& pattern, int process_id);
83 void RemoveProcessReferenceFromPattern(const GURL& pattern, int process_id); 83 void RemoveProcessReferenceFromPattern(const GURL& pattern, int process_id);
84 84
85 // Returns true if the |pattern| has at least one process to run. 85 // Returns true if the |pattern| has at least one process to run.
86 bool PatternHasProcessToRun(const GURL& pattern) const; 86 bool PatternHasProcessToRun(const GURL& pattern) const;
87 87
88 void FindAvailableProcessAndCallbackOnUI(const GURL& pattern,
89 const base::Callback<void(int)>);
90
88 private: 91 private:
89 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProcessManagerTest, SortProcess); 92 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProcessManagerTest, SortProcess);
90 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProcessManagerTest, 93 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProcessManagerTest,
91 FindAvailableProcess); 94 FindAvailableProcess);
92 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProcessManagerTest, 95 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProcessManagerTest,
93 AllocateWorkerProcess_FindAvailableProcess); 96 AllocateWorkerProcess_FindAvailableProcess);
94 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProcessManagerTest, 97 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProcessManagerTest,
95 AllocateWorkerProcess_InShutdown); 98 AllocateWorkerProcess_InShutdown);
96 99
97 // Information about the process for an EmbeddedWorkerInstance. 100 // Information about the process for an EmbeddedWorkerInstance.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 166
164 namespace std { 167 namespace std {
165 // Specialized to post the deletion to the UI thread. 168 // Specialized to post the deletion to the UI thread.
166 template <> 169 template <>
167 struct CONTENT_EXPORT default_delete<content::ServiceWorkerProcessManager> { 170 struct CONTENT_EXPORT default_delete<content::ServiceWorkerProcessManager> {
168 void operator()(content::ServiceWorkerProcessManager* ptr) const; 171 void operator()(content::ServiceWorkerProcessManager* ptr) const;
169 }; 172 };
170 } // namespace std 173 } // namespace std
171 174
172 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_ 175 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698