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

Side by Side Diff: extensions/browser/api/cast_channel/cast_channel_api.cc

Issue 670623002: Change base::TickClock to a ref counted class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_redesign
Patch Set: y Created 6 years, 2 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 "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
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
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
OLDNEW
« no previous file with comments | « content/renderer/media/render_media_log.cc ('k') | extensions/browser/api/cast_channel/logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698