| Index: content/renderer/shared_worker/embedded_shared_worker_stub.h
|
| diff --git a/content/worker/websharedworker_stub.h b/content/renderer/shared_worker/embedded_shared_worker_stub.h
|
| similarity index 28%
|
| copy from content/worker/websharedworker_stub.h
|
| copy to content/renderer/shared_worker/embedded_shared_worker_stub.h
|
| index 1f9aadd56dfd00a6ec6d6eb55e45b0589b6fd502..1d7445eaec2a1bc93bf3ae5a2f7734268b95a1b0 100644
|
| --- a/content/worker/websharedworker_stub.h
|
| +++ b/content/renderer/shared_worker/embedded_shared_worker_stub.h
|
| @@ -1,83 +1,85 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_
|
| -#define CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_
|
| +#ifndef CONTENT_RENDERER_SHARED_WORKER_EMBEDDED_SHARED_WORKER_STUB_H
|
| +#define CONTENT_RENDERER_SHARED_WORKER_EMBEDDED_SHARED_WORKER_STUB_H
|
|
|
| -#include "base/memory/scoped_ptr.h"
|
| +#include "content/child/child_message_filter.h"
|
| #include "content/child/scoped_child_process_reference.h"
|
| -#include "content/worker/websharedworkerclient_proxy.h"
|
| -#include "content/worker/worker_webapplicationcachehost_impl.h"
|
| #include "ipc/ipc_listener.h"
|
| -#include "third_party/WebKit/public/web/WebSharedWorker.h"
|
| +#include "third_party/WebKit/public/platform/WebString.h"
|
| +#include "third_party/WebKit/public/web/WebContentSecurityPolicy.h"
|
| +#include "third_party/WebKit/public/web/WebSharedWorkerClient.h"
|
| #include "url/gurl.h"
|
|
|
| namespace blink {
|
| +class WebApplicationCacheHost;
|
| +class WebApplicationCacheHostClient;
|
| +class WebMessagePortChannel;
|
| +class WebNotificationPresenter;
|
| +class WebSecurityOrigin;
|
| class WebSharedWorker;
|
| +class WebWorkerPermissionClientProxy;
|
| }
|
|
|
| namespace content {
|
| -
|
| -class SharedWorkerDevToolsAgent;
|
| +class EmbeddedSharedWorkerDevToolsAgent;
|
| class WebMessagePortChannelImpl;
|
|
|
| -// This class creates a WebSharedWorker, and translates incoming IPCs to the
|
| -// appropriate WebSharedWorker APIs.
|
| -class WebSharedWorkerStub : public IPC::Listener {
|
| +class EmbeddedSharedWorkerStub : public IPC::Listener,
|
| + public blink::WebSharedWorkerClient {
|
| public:
|
| - WebSharedWorkerStub(const GURL& url,
|
| - const base::string16& name,
|
| - const base::string16& content_security_policy,
|
| - blink::WebContentSecurityPolicyType security_policy_type,
|
| - int route_id);
|
| + EmbeddedSharedWorkerStub(
|
| + const GURL& url,
|
| + const base::string16& name,
|
| + const base::string16& content_security_policy,
|
| + blink::WebContentSecurityPolicyType security_policy_type,
|
| + int route_id);
|
|
|
| // IPC::Listener implementation.
|
| virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
| virtual void OnChannelError() OVERRIDE;
|
|
|
| - // Invoked when the WebSharedWorkerClientProxy is shutting down.
|
| - void Shutdown();
|
| -
|
| - void WorkerScriptLoaded();
|
| - void WorkerScriptLoadFailed();
|
| -
|
| - // Called after terminating the worker context to make sure that the worker
|
| - // actually terminates (is not stuck in an infinite loop).
|
| - void EnsureWorkerContextTerminates();
|
| -
|
| - WebSharedWorkerClientProxy* client() { return &client_; }
|
| -
|
| - // Returns the script url of this worker.
|
| - const GURL& url();
|
| -
|
| + // blink::WebSharedWorkerClient implementation.
|
| + virtual void workerContextClosed() OVERRIDE;
|
| + virtual void workerContextDestroyed() OVERRIDE;
|
| + virtual void workerScriptLoaded() OVERRIDE;
|
| + virtual void workerScriptLoadFailed() OVERRIDE;
|
| + virtual void selectAppCacheID(long long) OVERRIDE;
|
| + virtual blink::WebNotificationPresenter* notificationPresenter() OVERRIDE;
|
| + virtual blink::WebApplicationCacheHost* createApplicationCacheHost(
|
| + blink::WebApplicationCacheHostClient*) OVERRIDE;
|
| + virtual blink::WebWorkerPermissionClientProxy*
|
| + createWorkerPermissionClientProxy(
|
| + const blink::WebSecurityOrigin& origin) OVERRIDE;
|
| + virtual void dispatchDevToolsMessage(
|
| + const blink::WebString& message) OVERRIDE;
|
| + virtual void saveDevToolsAgentState(const blink::WebString& state) OVERRIDE;
|
|
|
| private:
|
| - virtual ~WebSharedWorkerStub();
|
| + virtual ~EmbeddedSharedWorkerStub();
|
|
|
| - void OnConnect(int sent_message_port_id, int routing_id);
|
| + void Shutdown();
|
| + bool Send(IPC::Message* message);
|
|
|
| + void OnConnect(int sent_message_port_id, int routing_id);
|
| void OnTerminateWorkerContext();
|
|
|
| - ScopedChildProcessReference process_ref_;
|
| -
|
| int route_id_;
|
| -
|
| - // WebSharedWorkerClient that responds to outgoing API calls
|
| - // from the worker object.
|
| - WebSharedWorkerClientProxy client_;
|
| -
|
| - blink::WebSharedWorker* impl_;
|
| - bool running_;
|
| + base::string16 name_;
|
| + bool runing_;
|
| GURL url_;
|
| - scoped_ptr<SharedWorkerDevToolsAgent> worker_devtools_agent_;
|
| + blink::WebSharedWorker* impl_;
|
| + scoped_ptr<EmbeddedSharedWorkerDevToolsAgent> worker_devtools_agent_;
|
|
|
| typedef std::vector<WebMessagePortChannelImpl*> PendingChannelList;
|
| PendingChannelList pending_channels_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerStub);
|
| + ScopedChildProcessReference process_ref_;
|
| + DISALLOW_COPY_AND_ASSIGN(EmbeddedSharedWorkerStub);
|
| };
|
|
|
| } // namespace content
|
|
|
| -#endif // CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_
|
| +#endif // CONTENT_RENDERER_SHARED_WORKER_EMBEDDED_SHARED_WORKER_STUB_H
|
|
|