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

Side by Side Diff: chrome/browser/extensions/api/streams_private/streams_private_api.cc

Issue 560913006: Changing the Weakptr initialization order in chrome/browser/extension folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/streams_private/streams_private_api.h" 5 #include "chrome/browser/extensions/api/streams_private/streams_private_api.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/extension_tab_util.h" 9 #include "chrome/browser/extensions/extension_tab_util.h"
10 #include "chrome/common/extensions/api/streams_private.h" 10 #include "chrome/common/extensions/api/streams_private.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 namespace streams_private = api::streams_private; 43 namespace streams_private = api::streams_private;
44 44
45 // static 45 // static
46 StreamsPrivateAPI* StreamsPrivateAPI::Get(content::BrowserContext* context) { 46 StreamsPrivateAPI* StreamsPrivateAPI::Get(content::BrowserContext* context) {
47 return GetFactoryInstance()->Get(context); 47 return GetFactoryInstance()->Get(context);
48 } 48 }
49 49
50 StreamsPrivateAPI::StreamsPrivateAPI(content::BrowserContext* context) 50 StreamsPrivateAPI::StreamsPrivateAPI(content::BrowserContext* context)
51 : browser_context_(context), 51 : browser_context_(context),
52 weak_ptr_factory_(this), 52 extension_registry_observer_(this),
53 extension_registry_observer_(this) { 53 weak_ptr_factory_(this) {
54 extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_)); 54 extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
55 } 55 }
56 56
57 StreamsPrivateAPI::~StreamsPrivateAPI() { 57 StreamsPrivateAPI::~StreamsPrivateAPI() {
58 } 58 }
59 59
60 void StreamsPrivateAPI::ExecuteMimeTypeHandler( 60 void StreamsPrivateAPI::ExecuteMimeTypeHandler(
61 const std::string& extension_id, 61 const std::string& extension_id,
62 content::WebContents* web_contents, 62 content::WebContents* web_contents,
63 scoped_ptr<content::StreamHandle> stream, 63 scoped_ptr<content::StreamHandle> stream,
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > 140 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> >
141 g_factory = LAZY_INSTANCE_INITIALIZER; 141 g_factory = LAZY_INSTANCE_INITIALIZER;
142 142
143 // static 143 // static
144 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* 144 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>*
145 StreamsPrivateAPI::GetFactoryInstance() { 145 StreamsPrivateAPI::GetFactoryInstance() {
146 return g_factory.Pointer(); 146 return g_factory.Pointer();
147 } 147 }
148 148
149 } // namespace extensions 149 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/streams_private/streams_private_api.h ('k') | chrome/browser/extensions/tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698