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

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

Issue 799703003: Expose the origin of the client calling navigator.connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« 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"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // it) is passed to the content layer to be transfered to the service 68 // it) is passed to the content layer to be transfered to the service
69 // provider. 69 // provider.
70 // - Ownership of the MessageChannel object itself will be released at the 70 // - Ownership of the MessageChannel object itself will be released at the
71 // end of this method. This is okay as it's the ports themselves that 71 // end of this method. This is okay as it's the ports themselves that
72 // represent the actual message channel. MessageChannel is only used to 72 // represent the actual message channel. MessageChannel is only used to
73 // create a pair of ports. 73 // create a pair of ports.
74 RefPtrWillBeRawPtr<MessageChannel> channel(MessageChannel::create(scriptStat e->executionContext())); 74 RefPtrWillBeRawPtr<MessageChannel> channel(MessageChannel::create(scriptStat e->executionContext()));
75 OwnPtr<WebMessagePortChannel> webchannel = channel->port2()->disentangle(); 75 OwnPtr<WebMessagePortChannel> webchannel = channel->port2()->disentangle();
76 provider->connect( 76 provider->connect(
77 scriptState->executionContext()->completeURL(url), 77 scriptState->executionContext()->completeURL(url),
78 scriptState->executionContext()->securityOrigin()->toString(),
78 webchannel.leakPtr(), 79 webchannel.leakPtr(),
79 new ConnectCallbacks(resolver, channel->port1())); 80 new ConnectCallbacks(resolver, channel->port1()));
80 return promise; 81 return promise;
81 } 82 }
82 83
83 84
84 } // namespace blink 85 } // 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