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

Side by Side Diff: content/worker/websharedworkerclient_proxy.h

Issue 46583005: Send Allow{Database,FileSystem,IndexedDB} sync IPCs directly from worker thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 1 month 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_WORKER_WEBWORKERCLIENT_PROXY_H_ 5 #ifndef CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_
6 #define CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ 6 #define CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "ipc/ipc_channel.h" 10 #include "ipc/ipc_channel.h"
11 #include "third_party/WebKit/public/web/WebSharedWorkerClient.h" 11 #include "third_party/WebKit/public/web/WebSharedWorkerClient.h"
12 12
13 namespace WebKit { 13 namespace WebKit {
14 class WebApplicationCacheHost; 14 class WebApplicationCacheHost;
15 class WebApplicationCacheHostClient; 15 class WebApplicationCacheHostClient;
16 class WebFrame; 16 class WebFrame;
17 class WebSecurityOrigin;
17 } 18 }
18 19
19 namespace content { 20 namespace content {
20 21
21 class SharedWorkerDevToolsAgent; 22 class SharedWorkerDevToolsAgent;
22 class WebSharedWorkerStub; 23 class WebSharedWorkerStub;
23 24
24 // This class receives IPCs from the renderer and calls the WebCore::Worker 25 // This class receives IPCs from the renderer and calls the WebCore::Worker
25 // implementation (after the data types have been converted by glue code). It 26 // implementation (after the data types have been converted by glue code). It
26 // is also called by the worker code and converts these function calls into 27 // is also called by the worker code and converts these function calls into
27 // IPCs that are sent to the renderer, where they're converted back to function 28 // IPCs that are sent to the renderer, where they're converted back to function
28 // calls by WebWorkerProxy. 29 // calls by WebWorkerProxy.
29 class WebSharedWorkerClientProxy : public WebKit::WebSharedWorkerClient { 30 class WebSharedWorkerClientProxy : public WebKit::WebSharedWorkerClient {
30 public: 31 public:
31 WebSharedWorkerClientProxy(int route_id, WebSharedWorkerStub* stub); 32 WebSharedWorkerClientProxy(int route_id, WebSharedWorkerStub* stub);
32 virtual ~WebSharedWorkerClientProxy(); 33 virtual ~WebSharedWorkerClientProxy();
33 34
34 // WebSharedWorkerClient implementation. 35 // WebSharedWorkerClient implementation.
35 virtual void workerContextClosed(); 36 virtual void workerContextClosed();
36 virtual void workerContextDestroyed(); 37 virtual void workerContextDestroyed();
37 38
38 virtual WebKit::WebNotificationPresenter* notificationPresenter(); 39 virtual WebKit::WebNotificationPresenter* notificationPresenter();
39 40
40 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost( 41 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
41 WebKit::WebApplicationCacheHostClient* client); 42 WebKit::WebApplicationCacheHostClient* client);
43 virtual WebKit::WebWorkerPermissionClientProxy*
44 createWorkerPermissionClientProxy(
45 const WebKit::WebSecurityOrigin& origin);
42 46
47 // TODO(kinuko): Deprecate these methods.
43 virtual bool allowDatabase(WebKit::WebFrame* frame, 48 virtual bool allowDatabase(WebKit::WebFrame* frame,
44 const WebKit::WebString& name, 49 const WebKit::WebString& name,
45 const WebKit::WebString& display_name, 50 const WebKit::WebString& display_name,
46 unsigned long estimated_size); 51 unsigned long estimated_size);
47 virtual bool allowFileSystem(); 52 virtual bool allowFileSystem();
48 virtual bool allowIndexedDB(const WebKit::WebString&); 53 virtual bool allowIndexedDB(const WebKit::WebString&);
54
49 virtual void dispatchDevToolsMessage(const WebKit::WebString&); 55 virtual void dispatchDevToolsMessage(const WebKit::WebString&);
50 virtual void saveDevToolsAgentState(const WebKit::WebString&); 56 virtual void saveDevToolsAgentState(const WebKit::WebString&);
51 57
52 void EnsureWorkerContextTerminates(); 58 void EnsureWorkerContextTerminates();
53 59
54 void set_devtools_agent(SharedWorkerDevToolsAgent* devtools_agent) { 60 void set_devtools_agent(SharedWorkerDevToolsAgent* devtools_agent) {
55 devtools_agent_ = devtools_agent; 61 devtools_agent_ = devtools_agent;
56 } 62 }
57 63
58 private: 64 private:
59 bool Send(IPC::Message* message); 65 bool Send(IPC::Message* message);
60 66
61 int route_id_; 67 int route_id_;
62 int appcache_host_id_; 68 int appcache_host_id_;
63 WebSharedWorkerStub* stub_; 69 WebSharedWorkerStub* stub_;
64 base::WeakPtrFactory<WebSharedWorkerClientProxy> weak_factory_; 70 base::WeakPtrFactory<WebSharedWorkerClientProxy> weak_factory_;
65 SharedWorkerDevToolsAgent* devtools_agent_; 71 SharedWorkerDevToolsAgent* devtools_agent_;
66 72
67 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerClientProxy); 73 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerClientProxy);
68 }; 74 };
69 75
70 } // namespace content 76 } // namespace content
71 77
72 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ 78 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_
OLDNEW
« no previous file with comments | « content/worker/shared_worker_permission_client_proxy.cc ('k') | content/worker/websharedworkerclient_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698