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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp

Issue 2327993002: [PresentationAPI] Use KURL and WebURL in place of string types. (Closed)
Patch Set: Address imcheng@ comments Created 4 years, 3 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 // 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 "modules/presentation/PresentationConnection.h" 5 #include "modules/presentation/PresentationConnection.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.h"
9 #include "core/dom/DOMArrayBufferView.h" 9 #include "core/dom/DOMArrayBufferView.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 DEFINE_INLINE_TRACE() 150 DEFINE_INLINE_TRACE()
151 { 151 {
152 visitor->trace(m_PresentationConnection); 152 visitor->trace(m_PresentationConnection);
153 } 153 }
154 154
155 private: 155 private:
156 Member<PresentationConnection> m_PresentationConnection; 156 Member<PresentationConnection> m_PresentationConnection;
157 std::unique_ptr<FileReaderLoader> m_loader; 157 std::unique_ptr<FileReaderLoader> m_loader;
158 }; 158 };
159 159
160 PresentationConnection::PresentationConnection(LocalFrame* frame, const String& id, const String& url) 160 PresentationConnection::PresentationConnection(LocalFrame* frame, const String& id, const KURL& url)
161 : DOMWindowProperty(frame) 161 : DOMWindowProperty(frame)
162 , m_id(id) 162 , m_id(id)
163 , m_url(url) 163 , m_url(url)
164 , m_state(WebPresentationConnectionState::Connected) 164 , m_state(WebPresentationConnectionState::Connected)
165 , m_binaryType(BinaryTypeBlob) 165 , m_binaryType(BinaryTypeBlob)
166 { 166 {
167 } 167 }
168 168
169 PresentationConnection::~PresentationConnection() 169 PresentationConnection::~PresentationConnection()
170 { 170 {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 return; 399 return;
400 WebPresentationClient* client = presentationClient(getExecutionContext()); 400 WebPresentationClient* client = presentationClient(getExecutionContext());
401 if (client) 401 if (client)
402 client->terminateSession(m_url, m_id); 402 client->terminateSession(m_url, m_id);
403 403
404 tearDown(); 404 tearDown();
405 } 405 }
406 406
407 bool PresentationConnection::matches(WebPresentationConnectionClient* client) co nst 407 bool PresentationConnection::matches(WebPresentationConnectionClient* client) co nst
408 { 408 {
409 return client && m_url == static_cast<String>(client->getUrl()) && m_id == s tatic_cast<String>(client->getId()); 409 return client && m_url == KURL(client->getUrl()) && m_id == static_cast<Stri ng>(client->getId());
dcheng 2016/09/14 20:07:27 Can we tag WebPresentationConnectionClient::getUrl
410 } 410 }
411 411
412 void PresentationConnection::didChangeState(WebPresentationConnectionState state ) 412 void PresentationConnection::didChangeState(WebPresentationConnectionState state )
413 { 413 {
414 if (m_state == state) 414 if (m_state == state)
415 return; 415 return;
416 416
417 m_state = state; 417 m_state = state;
418 switch (m_state) { 418 switch (m_state) {
419 case WebPresentationConnectionState::Connected: 419 case WebPresentationConnectionState::Connected:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 { 466 {
467 // Cancel current Blob loading if any. 467 // Cancel current Blob loading if any.
468 if (m_blobLoader) { 468 if (m_blobLoader) {
469 m_blobLoader->cancel(); 469 m_blobLoader->cancel();
470 m_blobLoader.clear(); 470 m_blobLoader.clear();
471 } 471 }
472 m_messages.clear(); 472 m_messages.clear();
473 } 473 }
474 474
475 } // namespace blink 475 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698