OLD | NEW |
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 "extensions/browser/api/cast_channel/cast_channel_api.h" | 5 #include "extensions/browser/api/cast_channel/cast_channel_api.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 bool IsValidConnectInfoIpAddress(const ConnectInfo& connect_info) { | 101 bool IsValidConnectInfoIpAddress(const ConnectInfo& connect_info) { |
102 net::IPAddressNumber ip_address; | 102 net::IPAddressNumber ip_address; |
103 return net::ParseIPLiteralToNumber(connect_info.ip_address, &ip_address); | 103 return net::ParseIPLiteralToNumber(connect_info.ip_address, &ip_address); |
104 } | 104 } |
105 | 105 |
106 } // namespace | 106 } // namespace |
107 | 107 |
108 CastChannelAPI::CastChannelAPI(content::BrowserContext* context) | 108 CastChannelAPI::CastChannelAPI(content::BrowserContext* context) |
109 : browser_context_(context), | 109 : browser_context_(context), |
110 logger_( | 110 logger_( |
111 new Logger(scoped_ptr<base::TickClock>(new base::DefaultTickClock), | 111 new Logger(scoped_refptr<base::TickClock>(new base::DefaultTickClock), |
112 base::TimeTicks::UnixEpoch())) { | 112 base::TimeTicks::UnixEpoch())) { |
113 DCHECK(browser_context_); | 113 DCHECK(browser_context_); |
114 } | 114 } |
115 | 115 |
116 // static | 116 // static |
117 CastChannelAPI* CastChannelAPI::Get(content::BrowserContext* context) { | 117 CastChannelAPI* CastChannelAPI::Get(content::BrowserContext* context) { |
118 return BrowserContextKeyedAPIFactory<CastChannelAPI>::Get(context); | 118 return BrowserContextKeyedAPIFactory<CastChannelAPI>::Get(context); |
119 } | 119 } |
120 | 120 |
121 scoped_refptr<Logger> CastChannelAPI::GetLogger() { | 121 scoped_refptr<Logger> CastChannelAPI::GetLogger() { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 } else { | 504 } else { |
505 SetError("Unable to get logs."); | 505 SetError("Unable to get logs."); |
506 } | 506 } |
507 | 507 |
508 api_->GetLogger()->Reset(); | 508 api_->GetLogger()->Reset(); |
509 | 509 |
510 AsyncWorkCompleted(); | 510 AsyncWorkCompleted(); |
511 } | 511 } |
512 | 512 |
513 } // namespace extensions | 513 } // namespace extensions |
OLD | NEW |