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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.h

Issue 2691333002: Replace [CallWith=ExecutionContext] with [CallWith=ScriptState] (Closed)
Patch Set: Created 3 years, 10 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 25 matching lines...) Expand all
36 #include "bindings/core/v8/SerializedScriptValue.h" 36 #include "bindings/core/v8/SerializedScriptValue.h"
37 #include "core/workers/AbstractWorker.h" 37 #include "core/workers/AbstractWorker.h"
38 #include "modules/ModulesExport.h" 38 #include "modules/ModulesExport.h"
39 #include "public/platform/modules/serviceworker/WebServiceWorker.h" 39 #include "public/platform/modules/serviceworker/WebServiceWorker.h"
40 #include "public/platform/modules/serviceworker/WebServiceWorkerProxy.h" 40 #include "public/platform/modules/serviceworker/WebServiceWorkerProxy.h"
41 #include "wtf/PassRefPtr.h" 41 #include "wtf/PassRefPtr.h"
42 #include <memory> 42 #include <memory>
43 43
44 namespace blink { 44 namespace blink {
45 45
46 class ScriptState;
47
46 class MODULES_EXPORT ServiceWorker final 48 class MODULES_EXPORT ServiceWorker final
47 : public AbstractWorker, 49 : public AbstractWorker,
48 public ActiveScriptWrappable<ServiceWorker>, 50 public ActiveScriptWrappable<ServiceWorker>,
49 public WebServiceWorkerProxy { 51 public WebServiceWorkerProxy {
50 DEFINE_WRAPPERTYPEINFO(); 52 DEFINE_WRAPPERTYPEINFO();
51 USING_GARBAGE_COLLECTED_MIXIN(ServiceWorker); 53 USING_GARBAGE_COLLECTED_MIXIN(ServiceWorker);
52 54
53 public: 55 public:
54 static ServiceWorker* from(ExecutionContext*, 56 static ServiceWorker* from(ExecutionContext*,
55 std::unique_ptr<WebServiceWorker::Handle>); 57 std::unique_ptr<WebServiceWorker::Handle>);
56 58
57 ~ServiceWorker() override; 59 ~ServiceWorker() override;
58 DECLARE_VIRTUAL_TRACE(); 60 DECLARE_VIRTUAL_TRACE();
59 61
60 // Eager finalization needed to promptly release owned WebServiceWorker. 62 // Eager finalization needed to promptly release owned WebServiceWorker.
61 EAGERLY_FINALIZE(); 63 EAGERLY_FINALIZE();
62 64
63 void postMessage(ExecutionContext*, 65 void postMessage(ScriptState*,
64 PassRefPtr<SerializedScriptValue> message, 66 PassRefPtr<SerializedScriptValue> message,
65 const MessagePortArray&, 67 const MessagePortArray&,
66 ExceptionState&); 68 ExceptionState&);
67 static bool canTransferArrayBuffersAndImageBitmaps() { return false; } 69 static bool canTransferArrayBuffersAndImageBitmaps() { return false; }
68 70
69 String scriptURL() const; 71 String scriptURL() const;
70 String state() const; 72 String state() const;
71 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange);
72 74
73 ServiceWorker* toServiceWorker() override { return this; } 75 ServiceWorker* toServiceWorker() override { return this; }
(...skipping 18 matching lines...) Expand all
92 void contextDestroyed(ExecutionContext*) override; 94 void contextDestroyed(ExecutionContext*) override;
93 95
94 // A handle to the service worker representation in the embedder. 96 // A handle to the service worker representation in the embedder.
95 std::unique_ptr<WebServiceWorker::Handle> m_handle; 97 std::unique_ptr<WebServiceWorker::Handle> m_handle;
96 bool m_wasStopped; 98 bool m_wasStopped;
97 }; 99 };
98 100
99 } // namespace blink 101 } // namespace blink
100 102
101 #endif // ServiceWorker_h 103 #endif // ServiceWorker_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698