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

Side by Side Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from Kent; merge. Created 4 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 20 matching lines...) Expand all
31 #ifndef WebEmbeddedWorkerImpl_h 31 #ifndef WebEmbeddedWorkerImpl_h
32 #define WebEmbeddedWorkerImpl_h 32 #define WebEmbeddedWorkerImpl_h
33 33
34 #include "core/workers/WorkerLoaderProxy.h" 34 #include "core/workers/WorkerLoaderProxy.h"
35 35
36 #include "public/web/WebContentSecurityPolicy.h" 36 #include "public/web/WebContentSecurityPolicy.h"
37 #include "public/web/WebDevToolsAgentClient.h" 37 #include "public/web/WebDevToolsAgentClient.h"
38 #include "public/web/WebEmbeddedWorker.h" 38 #include "public/web/WebEmbeddedWorker.h"
39 #include "public/web/WebEmbeddedWorkerStartData.h" 39 #include "public/web/WebEmbeddedWorkerStartData.h"
40 #include "public/web/WebFrameClient.h" 40 #include "public/web/WebFrameClient.h"
41 #include <memory>
41 42
42 namespace blink { 43 namespace blink {
43 44
44 class ServiceWorkerGlobalScopeProxy; 45 class ServiceWorkerGlobalScopeProxy;
45 class WebLocalFrameImpl; 46 class WebLocalFrameImpl;
46 class WebServiceWorkerNetworkProvider; 47 class WebServiceWorkerNetworkProvider;
47 class WebView; 48 class WebView;
48 class WorkerInspectorProxy; 49 class WorkerInspectorProxy;
49 class WorkerScriptLoader; 50 class WorkerScriptLoader;
50 class WorkerThread; 51 class WorkerThread;
51 52
52 class WebEmbeddedWorkerImpl final 53 class WebEmbeddedWorkerImpl final
53 : public WebEmbeddedWorker 54 : public WebEmbeddedWorker
54 , public WebFrameClient 55 , public WebFrameClient
55 , public WebDevToolsAgentClient 56 , public WebDevToolsAgentClient
56 , private WorkerLoaderProxyProvider { 57 , private WorkerLoaderProxyProvider {
57 WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl); 58 WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl);
58 public: 59 public:
59 WebEmbeddedWorkerImpl(PassOwnPtr<WebServiceWorkerContextClient>, PassOwnPtr< WebWorkerContentSettingsClientProxy>); 60 WebEmbeddedWorkerImpl(std::unique_ptr<WebServiceWorkerContextClient>, std::u nique_ptr<WebWorkerContentSettingsClientProxy>);
60 ~WebEmbeddedWorkerImpl() override; 61 ~WebEmbeddedWorkerImpl() override;
61 62
62 // WebEmbeddedWorker overrides. 63 // WebEmbeddedWorker overrides.
63 void startWorkerContext(const WebEmbeddedWorkerStartData&) override; 64 void startWorkerContext(const WebEmbeddedWorkerStartData&) override;
64 void terminateWorkerContext() override; 65 void terminateWorkerContext() override;
65 void resumeAfterDownload() override; 66 void resumeAfterDownload() override;
66 void attachDevTools(const WebString& hostId, int sessionId) override; 67 void attachDevTools(const WebString& hostId, int sessionId) override;
67 void reattachDevTools(const WebString& hostId, int sessionId, const WebStrin g& savedState) override; 68 void reattachDevTools(const WebString& hostId, int sessionId, const WebStrin g& savedState) override;
68 void detachDevTools() override; 69 void detachDevTools() override;
69 void dispatchDevToolsMessage(int sessionId, int callId, const WebString& met hod, const WebString& message) override; 70 void dispatchDevToolsMessage(int sessionId, int callId, const WebString& met hod, const WebString& message) override;
(...skipping 17 matching lines...) Expand all
87 88
88 void onScriptLoaderFinished(); 89 void onScriptLoaderFinished();
89 void startWorkerThread(); 90 void startWorkerThread();
90 91
91 // WorkerLoaderProxyProvider 92 // WorkerLoaderProxyProvider
92 void postTaskToLoader(std::unique_ptr<ExecutionContextTask>) override; 93 void postTaskToLoader(std::unique_ptr<ExecutionContextTask>) override;
93 bool postTaskToWorkerGlobalScope(std::unique_ptr<ExecutionContextTask>) over ride; 94 bool postTaskToWorkerGlobalScope(std::unique_ptr<ExecutionContextTask>) over ride;
94 95
95 WebEmbeddedWorkerStartData m_workerStartData; 96 WebEmbeddedWorkerStartData m_workerStartData;
96 97
97 OwnPtr<WebServiceWorkerContextClient> m_workerContextClient; 98 std::unique_ptr<WebServiceWorkerContextClient> m_workerContextClient;
98 99
99 // This is kept until startWorkerContext is called, and then passed on 100 // This is kept until startWorkerContext is called, and then passed on
100 // to WorkerContext. 101 // to WorkerContext.
101 OwnPtr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient; 102 std::unique_ptr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient ;
102 103
103 // We retain ownership of this one which is for use on the 104 // We retain ownership of this one which is for use on the
104 // main thread only. 105 // main thread only.
105 OwnPtr<WebServiceWorkerNetworkProvider> m_networkProvider; 106 std::unique_ptr<WebServiceWorkerNetworkProvider> m_networkProvider;
106 107
107 // Kept around only while main script loading is ongoing. 108 // Kept around only while main script loading is ongoing.
108 RefPtr<WorkerScriptLoader> m_mainScriptLoader; 109 RefPtr<WorkerScriptLoader> m_mainScriptLoader;
109 110
110 OwnPtr<WorkerThread> m_workerThread; 111 std::unique_ptr<WorkerThread> m_workerThread;
111 RefPtr<WorkerLoaderProxy> m_loaderProxy; 112 RefPtr<WorkerLoaderProxy> m_loaderProxy;
112 Persistent<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; 113 Persistent<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy;
113 Persistent<WorkerInspectorProxy> m_workerInspectorProxy; 114 Persistent<WorkerInspectorProxy> m_workerInspectorProxy;
114 115
115 // 'shadow page' - created to proxy loading requests from the worker. 116 // 'shadow page' - created to proxy loading requests from the worker.
116 // Both WebView and WebFrame objects are close()'ed (where they're 117 // Both WebView and WebFrame objects are close()'ed (where they're
117 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they 118 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they
118 // are guaranteed to exist while this object is around. 119 // are guaranteed to exist while this object is around.
119 WebView* m_webView; 120 WebView* m_webView;
120 Persistent<WebLocalFrameImpl> m_mainFrame; 121 Persistent<WebLocalFrameImpl> m_mainFrame;
(...skipping 11 matching lines...) Expand all
132 DoPauseAfterDownload, 133 DoPauseAfterDownload,
133 IsPausedAfterDownload 134 IsPausedAfterDownload
134 } m_pauseAfterDownloadState; 135 } m_pauseAfterDownloadState;
135 136
136 WaitingForDebuggerState m_waitingForDebuggerState; 137 WaitingForDebuggerState m_waitingForDebuggerState;
137 }; 138 };
138 139
139 } // namespace blink 140 } // namespace blink
140 141
141 #endif // WebEmbeddedWorkerImpl_h 142 #endif // WebEmbeddedWorkerImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698