OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_client.h" | 5 #include "content/renderer/presentation/presentation_connection_client.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "third_party/WebKit/public/platform/WebString.h" | 8 #include "third_party/WebKit/public/platform/WebString.h" |
9 #include "third_party/WebKit/public/platform/WebURL.h" | 9 #include "third_party/WebKit/public/platform/WebURL.h" |
10 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio nConnectionProxy.h" | |
10 | 11 |
11 namespace content { | 12 namespace content { |
12 | 13 |
13 PresentationConnectionClient::PresentationConnectionClient( | 14 PresentationConnectionClient::PresentationConnectionClient( |
14 blink::mojom::PresentationSessionInfoPtr session_info) | 15 blink::mojom::PresentationSessionInfoPtr session_info) |
15 : url_(session_info->url), | 16 : url_(session_info->url), |
16 id_(blink::WebString::fromUTF8(session_info->id)) {} | 17 id_(blink::WebString::fromUTF8(session_info->id)), |
18 proxy_(nullptr) {} | |
imcheng
2016/11/01 17:20:30
Can you see if you can use delegating constructors
zhaobin
2016/11/02 03:55:47
Done.
| |
17 | 19 |
18 PresentationConnectionClient::PresentationConnectionClient( | 20 PresentationConnectionClient::PresentationConnectionClient( |
19 const GURL& url, | 21 const GURL& url, |
20 const mojo::String& id) | 22 const mojo::String& id) |
21 : url_(url), | 23 : url_(url), id_(blink::WebString::fromUTF8(id)), proxy_(nullptr) {} |
22 id_(blink::WebString::fromUTF8(id)) {} | 24 |
25 PresentationConnectionClient::PresentationConnectionClient( | |
26 blink::mojom::PresentationSessionInfoPtr session_info, | |
27 std::unique_ptr<blink::WebPresentationConnectionProxy> proxy) | |
28 : url_(session_info->url), | |
29 id_(blink::WebString::fromUTF8(session_info->id)) { | |
30 if (proxy) | |
imcheng
2016/11/01 17:20:30
It doesn't look like this check is needed?
zhaobin
2016/11/02 03:55:47
Done.
| |
31 proxy_ = std::move(proxy); | |
32 } | |
23 | 33 |
24 PresentationConnectionClient::~PresentationConnectionClient() { | 34 PresentationConnectionClient::~PresentationConnectionClient() { |
25 } | 35 } |
26 | 36 |
27 blink::WebURL PresentationConnectionClient::getUrl() { | 37 blink::WebURL PresentationConnectionClient::getUrl() { |
28 return url_; | 38 return url_; |
29 } | 39 } |
30 | 40 |
31 blink::WebString PresentationConnectionClient::getId() { | 41 blink::WebString PresentationConnectionClient::getId() { |
32 return id_; | 42 return id_; |
33 } | 43 } |
34 | 44 |
45 std::unique_ptr<blink::WebPresentationConnectionProxy> | |
46 PresentationConnectionClient::takeProxy() { | |
47 return std::move(proxy_); | |
48 } | |
49 | |
35 } // namespace content | 50 } // namespace content |
OLD | NEW |