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

Side by Side Diff: content/browser/worker_host/worker_service.h

Issue 6825038: Create a content::ResourceContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dependencies. Created 9 years, 8 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_WORKER_HOST_WORKER_SERVICE_H_ 5 #ifndef CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_ 6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
11 #include "base/threading/non_thread_safe.h"
11 #include "content/browser/worker_host/worker_process_host.h" 12 #include "content/browser/worker_host/worker_process_host.h"
12 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
13 14
15 namespace content {
16 class ResourceContext;
17 } // namespace content
14 namespace net { 18 namespace net {
15 class URLRequestContextGetter; 19 class URLRequestContext;
16 } 20 } // namespace net
17
18 struct ViewHostMsg_CreateWorker_Params; 21 struct ViewHostMsg_CreateWorker_Params;
19 22
20 // A singelton for managing HTML5 web workers. 23 // A singelton for managing HTML5 web workers.
21 class WorkerService { 24 class WorkerService : public base::NonThreadSafe {
jam 2011/04/13 16:43:06 any reason to add this now?
willchan no longer on Chromium 2011/04/13 18:03:44 Not a huge reason, but since I was reading this co
jam 2011/04/13 19:20:30 When I see checking helpers like this that need to
willchan no longer on Chromium 2011/04/13 22:16:25 I guess I don't mind having it in most public memb
22 public: 25 public:
23 // Returns the WorkerService singleton. 26 // Returns the WorkerService singleton.
24 static WorkerService* GetInstance(); 27 static WorkerService* GetInstance();
25 28
26 // These methods correspond to worker related IPCs. 29 // These methods correspond to worker related IPCs.
27 void CreateWorker(const ViewHostMsg_CreateWorker_Params& params, 30 void CreateWorker(const ViewHostMsg_CreateWorker_Params& params,
28 int route_id, 31 int route_id,
29 WorkerMessageFilter* filter, 32 WorkerMessageFilter* filter,
30 net::URLRequestContextGetter* request_context); 33 net::URLRequestContextGetter* request_context_getter,
34 const content::ResourceContext& resource_context);
31 void LookupSharedWorker(const ViewHostMsg_CreateWorker_Params& params, 35 void LookupSharedWorker(const ViewHostMsg_CreateWorker_Params& params,
32 int route_id, 36 int route_id,
33 WorkerMessageFilter* filter, 37 WorkerMessageFilter* filter,
34 bool incognito, 38 bool incognito,
35 bool* exists, 39 bool* exists,
36 bool* url_error); 40 bool* url_error);
37 void CancelCreateDedicatedWorker(int route_id, WorkerMessageFilter* filter); 41 void CancelCreateDedicatedWorker(int route_id, WorkerMessageFilter* filter);
38 void ForwardToWorker(const IPC::Message& message, 42 void ForwardToWorker(const IPC::Message& message,
39 WorkerMessageFilter* filter); 43 WorkerMessageFilter* filter);
40 void DocumentDetached(unsigned long long document_id, 44 void DocumentDetached(unsigned long long document_id,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 119
116 // These are shared workers that have been looked up, but not created yet. 120 // These are shared workers that have been looked up, but not created yet.
117 // We need to keep a list of these to synchronously detect shared worker 121 // We need to keep a list of these to synchronously detect shared worker
118 // URL mismatches when two pages launch shared workers simultaneously. 122 // URL mismatches when two pages launch shared workers simultaneously.
119 WorkerProcessHost::Instances pending_shared_workers_; 123 WorkerProcessHost::Instances pending_shared_workers_;
120 124
121 DISALLOW_COPY_AND_ASSIGN(WorkerService); 125 DISALLOW_COPY_AND_ASSIGN(WorkerService);
122 }; 126 };
123 127
124 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_ 128 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698