chromeos: dbus: add Bluetooth properties support
[chromium-blink-merge.git] / content / worker / websharedworkerclient_proxy.h
blob6b085c52664198e282f098c5bdfad044bc93beff
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_
6 #define CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_
7 #pragma once
9 #include "base/basictypes.h"
10 #include "base/memory/weak_ptr.h"
11 #include "ipc/ipc_channel.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSystem.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorkerClient.h"
15 namespace WebKit {
16 class WebApplicationCacheHost;
17 class WebApplicationCacheHostClient;
18 class WebFrame;
21 class SharedWorkerDevToolsAgent;
22 class WebSharedWorkerStub;
24 // 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 // 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 // calls by WebWorkerProxy.
29 class WebSharedWorkerClientProxy : public WebKit::WebSharedWorkerClient {
30 public:
31 WebSharedWorkerClientProxy(int route_id, WebSharedWorkerStub* stub);
32 virtual ~WebSharedWorkerClientProxy();
34 // WebSharedWorkerClient implementation.
35 virtual void postMessageToWorkerObject(
36 const WebKit::WebString& message,
37 const WebKit::WebMessagePortChannelArray& channel);
38 virtual void postExceptionToWorkerObject(
39 const WebKit::WebString& error_message,
40 int line_number,
41 const WebKit::WebString& source_url);
42 // TODO(caseq): The overload before is obsolete and is preserved for
43 // WebKit/chromium compatibility only (pure virtual is base class).
44 // Should be removed once WebKit part is updated.
45 virtual void postConsoleMessageToWorkerObject(
46 int destination,
47 int source,
48 int type,
49 int level,
50 const WebKit::WebString& message,
51 int line_number,
52 const WebKit::WebString& source_url) {
54 virtual void postConsoleMessageToWorkerObject(
55 int source,
56 int type,
57 int level,
58 const WebKit::WebString& message,
59 int line_number,
60 const WebKit::WebString& source_url);
61 virtual void confirmMessageFromWorkerObject(bool has_pending_activity);
62 virtual void reportPendingActivity(bool has_pending_activity);
63 virtual void workerContextClosed();
64 virtual void workerContextDestroyed();
66 virtual WebKit::WebNotificationPresenter* notificationPresenter();
68 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
69 WebKit::WebApplicationCacheHostClient* client);
71 virtual bool allowDatabase(WebKit::WebFrame* frame,
72 const WebKit::WebString& name,
73 const WebKit::WebString& display_name,
74 unsigned long estimated_size);
75 virtual bool allowFileSystem();
76 virtual void openFileSystem(WebKit::WebFileSystem::Type type,
77 long long size,
78 bool create,
79 WebKit::WebFileSystemCallbacks* callbacks);
80 virtual void dispatchDevToolsMessage(const WebKit::WebString&);
81 virtual void saveDevToolsAgentState(const WebKit::WebString&);
83 void EnsureWorkerContextTerminates();
85 void set_devtools_agent(SharedWorkerDevToolsAgent* devtools_agent) {
86 devtools_agent_ = devtools_agent;
89 private:
90 bool Send(IPC::Message* message);
92 int route_id_;
93 int appcache_host_id_;
94 WebSharedWorkerStub* stub_;
95 base::WeakPtrFactory<WebSharedWorkerClientProxy> weak_factory_;
96 SharedWorkerDevToolsAgent* devtools_agent_;
98 DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerClientProxy);
101 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_