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

Side by Side Diff: Source/web/ServiceWorkerGlobalScopeProxy.h

Issue 304053003: ServiceWorker: support Request.{url,method,origin,headers} [blink] (1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 6 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 26 matching lines...) Expand all
37 #include "wtf/OwnPtr.h" 37 #include "wtf/OwnPtr.h"
38 38
39 namespace WebCore { 39 namespace WebCore {
40 class ExecutionContext; 40 class ExecutionContext;
41 } 41 }
42 42
43 namespace blink { 43 namespace blink {
44 44
45 class WebEmbeddedWorkerImpl; 45 class WebEmbeddedWorkerImpl;
46 class WebServiceWorkerContextClient; 46 class WebServiceWorkerContextClient;
47 class WebServiceWorkerRequest;
47 48
48 // This class is created and destructed on the main thread, but live most 49 // This class is created and destructed on the main thread, but live most
49 // of its time as a resident of the worker thread. 50 // of its time as a resident of the worker thread.
50 // All methods other than its ctor/dtor are called on the worker thread. 51 // All methods other than its ctor/dtor are called on the worker thread.
51 // 52 //
52 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's 53 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's
53 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific 54 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific
54 // events/upcall methods that are to be called by embedder/chromium, 55 // events/upcall methods that are to be called by embedder/chromium,
55 // e.g. onfetch. 56 // e.g. onfetch.
56 // 57 //
57 // An instance of this class is supposed to outlive until 58 // An instance of this class is supposed to outlive until
58 // workerGlobalScopeDestroyed() is called by its corresponding 59 // workerGlobalScopeDestroyed() is called by its corresponding
59 // WorkerGlobalScope. 60 // WorkerGlobalScope.
60 class ServiceWorkerGlobalScopeProxy FINAL : 61 class ServiceWorkerGlobalScopeProxy FINAL :
61 public WebServiceWorkerContextProxy, 62 public WebServiceWorkerContextProxy,
62 public WebCore::WorkerReportingProxy { 63 public WebCore::WorkerReportingProxy {
63 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeProxy); 64 WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeProxy);
64 public: 65 public:
65 static PassOwnPtr<ServiceWorkerGlobalScopeProxy> create(WebEmbeddedWorkerImp l&, WebCore::ExecutionContext&, WebServiceWorkerContextClient&); 66 static PassOwnPtr<ServiceWorkerGlobalScopeProxy> create(WebEmbeddedWorkerImp l&, WebCore::ExecutionContext&, WebServiceWorkerContextClient&);
66 virtual ~ServiceWorkerGlobalScopeProxy(); 67 virtual ~ServiceWorkerGlobalScopeProxy();
67 68
68 // WebServiceWorkerContextProxy overrides: 69 // WebServiceWorkerContextProxy overrides:
69 virtual void dispatchActivateEvent(int) OVERRIDE; 70 virtual void dispatchActivateEvent(int) OVERRIDE;
70 virtual void dispatchInstallEvent(int) OVERRIDE; 71 virtual void dispatchInstallEvent(int) OVERRIDE;
72 // TODO(horo): remove this.
71 virtual void dispatchFetchEvent(int) OVERRIDE; 73 virtual void dispatchFetchEvent(int) OVERRIDE;
74 virtual void dispatchFetchEvent(int, const WebServiceWorkerRequest&) OVERRID E;
72 virtual void dispatchMessageEvent(const WebString& message, const WebMessage PortChannelArray&) OVERRIDE; 75 virtual void dispatchMessageEvent(const WebString& message, const WebMessage PortChannelArray&) OVERRIDE;
73 virtual void dispatchSyncEvent(int) OVERRIDE; 76 virtual void dispatchSyncEvent(int) OVERRIDE;
74 77
75 // WorkerReportingProxy overrides: 78 // WorkerReportingProxy overrides:
76 virtual void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL) OVERRIDE; 79 virtual void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL) OVERRIDE;
77 virtual void reportConsoleMessage(WebCore::MessageSource, WebCore::MessageLe vel, const String& message, int lineNumber, const String& sourceURL) OVERRIDE; 80 virtual void reportConsoleMessage(WebCore::MessageSource, WebCore::MessageLe vel, const String& message, int lineNumber, const String& sourceURL) OVERRIDE;
78 virtual void postMessageToPageInspector(const String&) OVERRIDE; 81 virtual void postMessageToPageInspector(const String&) OVERRIDE;
79 virtual void updateInspectorStateCookie(const String&) OVERRIDE; 82 virtual void updateInspectorStateCookie(const String&) OVERRIDE;
80 virtual void workerGlobalScopeStarted(WebCore::WorkerGlobalScope*) OVERRIDE; 83 virtual void workerGlobalScopeStarted(WebCore::WorkerGlobalScope*) OVERRIDE;
81 virtual void workerGlobalScopeClosed() OVERRIDE; 84 virtual void workerGlobalScopeClosed() OVERRIDE;
82 virtual void willDestroyWorkerGlobalScope() OVERRIDE; 85 virtual void willDestroyWorkerGlobalScope() OVERRIDE;
83 virtual void workerGlobalScopeDestroyed() OVERRIDE; 86 virtual void workerGlobalScopeDestroyed() OVERRIDE;
84 87
85 private: 88 private:
86 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, WebCore::ExecutionCont ext&, WebServiceWorkerContextClient&); 89 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, WebCore::ExecutionCont ext&, WebServiceWorkerContextClient&);
87 90
88 WebEmbeddedWorkerImpl& m_embeddedWorker; 91 WebEmbeddedWorkerImpl& m_embeddedWorker;
89 WebCore::ExecutionContext& m_executionContext; 92 WebCore::ExecutionContext& m_executionContext;
90 93
91 WebServiceWorkerContextClient& m_client; 94 WebServiceWorkerContextClient& m_client;
92 95
93 WebCore::WorkerGlobalScope* m_workerGlobalScope; 96 WebCore::WorkerGlobalScope* m_workerGlobalScope;
94 }; 97 };
95 98
96 } // namespace blink 99 } // namespace blink
97 100
98 #endif // ServiceWorkerGlobalScopeProxy_h 101 #endif // ServiceWorkerGlobalScopeProxy_h
OLDNEW
« no previous file with comments | « Source/platform/exported/WebServiceWorkerRequest.cpp ('k') | Source/web/ServiceWorkerGlobalScopeProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698