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

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

Issue 178193030: Rename ProfileKeyedAPI to BrowserContextKeyedAPI and GetProfile to Get. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/extensions/api/cast_channel/cast_channel_api.h" 5 #include "chrome/browser/extensions/api/cast_channel/cast_channel_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 } // namespace 44 } // namespace
45 45
46 CastChannelAPI::CastChannelAPI(content::BrowserContext* context) 46 CastChannelAPI::CastChannelAPI(content::BrowserContext* context)
47 : browser_context_(context) { 47 : browser_context_(context) {
48 DCHECK(browser_context_); 48 DCHECK(browser_context_);
49 } 49 }
50 50
51 // static 51 // static
52 CastChannelAPI* CastChannelAPI::Get(content::BrowserContext* context) { 52 CastChannelAPI* CastChannelAPI::Get(content::BrowserContext* context) {
53 return ProfileKeyedAPIFactory<CastChannelAPI>::GetForProfile(context); 53 return BrowserContextKeyedAPIFactory<CastChannelAPI>::Get(context);
54 } 54 }
55 55
56 static base::LazyInstance<ProfileKeyedAPIFactory<CastChannelAPI> > g_factory = 56 static base::LazyInstance<BrowserContextKeyedAPIFactory<CastChannelAPI> >
57 LAZY_INSTANCE_INITIALIZER; 57 g_factory = LAZY_INSTANCE_INITIALIZER;
58 58
59 // static 59 // static
60 ProfileKeyedAPIFactory<CastChannelAPI>* CastChannelAPI::GetFactoryInstance() { 60 BrowserContextKeyedAPIFactory<CastChannelAPI>*
61 CastChannelAPI::GetFactoryInstance() {
61 return g_factory.Pointer(); 62 return g_factory.Pointer();
62 } 63 }
63 64
64 scoped_ptr<CastSocket> CastChannelAPI::CreateCastSocket( 65 scoped_ptr<CastSocket> CastChannelAPI::CreateCastSocket(
65 const std::string& extension_id, const GURL& url) { 66 const std::string& extension_id, const GURL& url) {
66 if (socket_for_test_.get()) { 67 if (socket_for_test_.get()) {
67 return socket_for_test_.Pass(); 68 return socket_for_test_.Pass();
68 } else { 69 } else {
69 return scoped_ptr<CastSocket>( 70 return scoped_ptr<CastSocket>(
70 new CastSocket(extension_id, url, this, 71 new CastSocket(extension_id, url, this,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 SetResultFromError(cast_channel::CHANNEL_ERROR_SOCKET_ERROR); 260 SetResultFromError(cast_channel::CHANNEL_ERROR_SOCKET_ERROR);
260 } else { 261 } else {
261 int channel_id = params_->channel.channel_id; 262 int channel_id = params_->channel.channel_id;
262 SetResultFromSocket(channel_id); 263 SetResultFromSocket(channel_id);
263 RemoveSocket(channel_id); 264 RemoveSocket(channel_id);
264 } 265 }
265 AsyncWorkCompleted(); 266 AsyncWorkCompleted();
266 } 267 }
267 268
268 } // namespace extensions 269 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698