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

Side by Side Diff: content/renderer/presentation/presentation_connection_proxy.cc

Issue 2730123003: [Presentation API] Add layout test for connection.close() and fix test failures (Closed)
Patch Set: remove unnecessary forward declarations Created 3 years, 9 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 | content/renderer/presentation/presentation_connection_proxy_unittest.cc » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "content/renderer/presentation/presentation_connection_proxy.h" 5 #include "content/renderer/presentation/presentation_connection_proxy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/common/presentation_session.h" 8 #include "content/public/common/presentation_session.h"
9 #include "content/renderer/presentation/presentation_dispatcher.h" 9 #include "content/renderer/presentation/presentation_dispatcher.h"
10 #include "third_party/WebKit/public/platform/WebString.h" 10 #include "third_party/WebKit/public/platform/WebString.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 61
62 // TODO(crbug.com/588874): Ensure legal PresentationConnection state transitions 62 // TODO(crbug.com/588874): Ensure legal PresentationConnection state transitions
63 // in a single place. 63 // in a single place.
64 void PresentationConnectionProxy::DidChangeState( 64 void PresentationConnectionProxy::DidChangeState(
65 content::PresentationConnectionState state) { 65 content::PresentationConnectionState state) {
66 if (state == content::PRESENTATION_CONNECTION_STATE_CONNECTED) { 66 if (state == content::PRESENTATION_CONNECTION_STATE_CONNECTED) {
67 source_connection_->didChangeState( 67 source_connection_->didChangeState(
68 blink::WebPresentationConnectionState::Connected); 68 blink::WebPresentationConnectionState::Connected);
69 } else if (state == content::PRESENTATION_CONNECTION_STATE_CLOSED) { 69 } else if (state == content::PRESENTATION_CONNECTION_STATE_CLOSED) {
70 source_connection_->didChangeState( 70 source_connection_->didClose();
71 blink::WebPresentationConnectionState::Closed);
72 } else { 71 } else {
73 NOTREACHED(); 72 NOTREACHED();
74 } 73 }
75 } 74 }
76 75
77 void PresentationConnectionProxy::OnClose() { 76 void PresentationConnectionProxy::OnClose() {
78 DCHECK(target_connection_ptr_); 77 DCHECK(target_connection_ptr_);
79 source_connection_->didChangeState( 78 source_connection_->didClose();
80 blink::WebPresentationConnectionState::Closed);
81 target_connection_ptr_->DidChangeState( 79 target_connection_ptr_->DidChangeState(
82 content::PRESENTATION_CONNECTION_STATE_CLOSED); 80 content::PRESENTATION_CONNECTION_STATE_CLOSED);
83 } 81 }
84 82
85 void PresentationConnectionProxy::close() const { 83 void PresentationConnectionProxy::close() const {
86 DCHECK(target_connection_ptr_); 84 DCHECK(target_connection_ptr_);
87 target_connection_ptr_->OnClose(); 85 target_connection_ptr_->OnClose();
88 } 86 }
89 87
90 ControllerConnectionProxy::ControllerConnectionProxy( 88 ControllerConnectionProxy::ControllerConnectionProxy(
(...skipping 28 matching lines...) Expand all
119 blink::mojom::PresentationConnectionPtr controller_connection_ptr) { 117 blink::mojom::PresentationConnectionPtr controller_connection_ptr) {
120 DCHECK(!target_connection_ptr_); 118 DCHECK(!target_connection_ptr_);
121 target_connection_ptr_ = std::move(controller_connection_ptr); 119 target_connection_ptr_ = std::move(controller_connection_ptr);
122 target_connection_ptr_->DidChangeState( 120 target_connection_ptr_->DidChangeState(
123 content::PRESENTATION_CONNECTION_STATE_CONNECTED); 121 content::PRESENTATION_CONNECTION_STATE_CONNECTED);
124 122
125 DidChangeState(content::PRESENTATION_CONNECTION_STATE_CONNECTED); 123 DidChangeState(content::PRESENTATION_CONNECTION_STATE_CONNECTED);
126 } 124 }
127 125
128 } // namespace content 126 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/presentation/presentation_connection_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698