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

Side by Side Diff: content/child/service_worker/navigator_connect_provider.h

Issue 668303004: WIP DO NOT COMMIT chromium side of navigator.connect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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
(Empty)
1 // Copyright 2014 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.
4
5 #ifndef CONTENT_CHILD_SERVICE_WORKER_NAVIGATOR_CONNECT_PROVIDER_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_NAVIGATOR_CONNECT_PROVIDER_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/id_map.h"
10 #include "base/memory/ref_counted.h"
11 #include "content/child/worker_task_runner.h"
12
13 class GURL;
14
15 namespace blink {
16 template <typename T1, typename T2>
17 class WebCallbacks;
18 class WebMessagePortChannel;
19 class WebString;
20 }
21
22 namespace content {
23 class ThreadSafeSender;
24
25 class NavigatorConnectProvider : public WorkerTaskRunner::Observer {
26 public:
27 explicit NavigatorConnectProvider(ThreadSafeSender* thread_safe_sender);
28 ~NavigatorConnectProvider();
29
30 void ConnectToUrl(const GURL& targetUrl,
31 blink::WebMessagePortChannel* port,
32 blink::WebCallbacks<void, blink::WebString>* callbacks);
33
34 void OnNavigatorConnectResult(int thread_id,
35 int request_id,
36 bool allow_connect);
37
38 // |thread_safe_sender| needs to be passed in because if the call leads to
39 // construction it will be needed.
40 static NavigatorConnectProvider* ThreadSpecificInstance(
41 ThreadSafeSender* thread_safe_sender);
42
43 private:
44 // WorkerTaskRunner::Observer implementation.
45 void OnWorkerRunLoopStopped() override;
46
47 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
48 typedef blink::WebCallbacks<void, blink::WebString> ConnectCallback;
49 IDMap<ConnectCallback> requests_;
50
51 DISALLOW_COPY_AND_ASSIGN(NavigatorConnectProvider);
52 };
53
54 } // namespace content
55
56 #endif // CONTENT_CHILD_SERVICE_WORKER_NAVIGATOR_CONNECT_PROVIDER_H_
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.cc ('k') | content/child/service_worker/navigator_connect_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698