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

Side by Side Diff: Source/modules/navigatorconnect/NavigatorConnect.cpp

Issue 831613002: Add WebNavigatorConnectCallbacks typedef. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: make ConnectCallbacks be declared in terms of added typedef Created 5 years, 11 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
« no previous file with comments | « no previous file | public/platform/WebNavigatorConnectProvider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "modules/navigatorconnect/NavigatorConnect.h" 6 #include "modules/navigatorconnect/NavigatorConnect.h"
7 7
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
11 #include "core/dom/MessageChannel.h" 11 #include "core/dom/MessageChannel.h"
12 #include "core/dom/MessagePort.h" 12 #include "core/dom/MessagePort.h"
13 #include "public/platform/Platform.h" 13 #include "public/platform/Platform.h"
14 #include "public/platform/WebCallbacks.h"
15 #include "public/platform/WebNavigatorConnectProvider.h" 14 #include "public/platform/WebNavigatorConnectProvider.h"
16 15
17 namespace blink { 16 namespace blink {
18 17
19 namespace { 18 namespace {
20 19
21 class ConnectCallbacks : public WebCallbacks<void, void> { 20 class ConnectCallbacks : public WebNavigatorConnectCallbacks {
22 public: 21 public:
23 ConnectCallbacks(PassRefPtrWillBeRawPtr<ScriptPromiseResolver> resolver, Pas sRefPtrWillBeRawPtr<MessagePort> port) 22 ConnectCallbacks(PassRefPtrWillBeRawPtr<ScriptPromiseResolver> resolver, Pas sRefPtrWillBeRawPtr<MessagePort> port)
24 : m_resolver(resolver), m_port(port) 23 : m_resolver(resolver), m_port(port)
25 { 24 {
26 ASSERT(m_resolver); 25 ASSERT(m_resolver);
27 } 26 }
28 ~ConnectCallbacks() override { } 27 ~ConnectCallbacks() override { }
29 28
30 void onSuccess() override 29 void onSuccess() override
31 { 30 {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 provider->connect( 75 provider->connect(
77 scriptState->executionContext()->completeURL(url), 76 scriptState->executionContext()->completeURL(url),
78 scriptState->executionContext()->securityOrigin()->toString(), 77 scriptState->executionContext()->securityOrigin()->toString(),
79 webchannel.leakPtr(), 78 webchannel.leakPtr(),
80 new ConnectCallbacks(resolver, channel->port1())); 79 new ConnectCallbacks(resolver, channel->port1()));
81 return promise; 80 return promise;
82 } 81 }
83 82
84 83
85 } // namespace blink 84 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | public/platform/WebNavigatorConnectProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698