OLD | NEW |
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/log_private/log_private_api.h" | 5 #include "chrome/browser/extensions/api/log_private/log_private_api.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 | 200 |
201 void LogPrivateAPI::RegisterTempFile(const std::string& owner_extension_id, | 201 void LogPrivateAPI::RegisterTempFile(const std::string& owner_extension_id, |
202 const base::FilePath& file_path) { | 202 const base::FilePath& file_path) { |
203 GetSequencedTaskRunner()->PostTask( | 203 GetSequencedTaskRunner()->PostTask( |
204 FROM_HERE, | 204 FROM_HERE, |
205 base::Bind(&LogPrivateAPI::RegisterTempFileOnFileResourceSequence, | 205 base::Bind(&LogPrivateAPI::RegisterTempFileOnFileResourceSequence, |
206 base::Unretained(this), owner_extension_id, file_path)); | 206 base::Unretained(this), owner_extension_id, file_path)); |
207 } | 207 } |
208 | 208 |
209 static base::LazyInstance<BrowserContextKeyedAPIFactory<LogPrivateAPI> > | 209 static base::LazyInstance< |
210 g_factory = LAZY_INSTANCE_INITIALIZER; | 210 BrowserContextKeyedAPIFactory<LogPrivateAPI>>::DestructorAtExit g_factory = |
| 211 LAZY_INSTANCE_INITIALIZER; |
211 | 212 |
212 // static | 213 // static |
213 BrowserContextKeyedAPIFactory<LogPrivateAPI>* | 214 BrowserContextKeyedAPIFactory<LogPrivateAPI>* |
214 LogPrivateAPI::GetFactoryInstance() { | 215 LogPrivateAPI::GetFactoryInstance() { |
215 return g_factory.Pointer(); | 216 return g_factory.Pointer(); |
216 } | 217 } |
217 | 218 |
218 void LogPrivateAPI::OnAddEntry(const net::NetLogEntry& entry) { | 219 void LogPrivateAPI::OnAddEntry(const net::NetLogEntry& entry) { |
219 // We could receive events on whatever thread they happen to be generated, | 220 // We could receive events on whatever thread they happen to be generated, |
220 // since we are only interested in network events, we should ignore any | 221 // since we are only interested in network events, we should ignore any |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 entry->SetBoolean("isDirectory", false); | 545 entry->SetBoolean("isDirectory", false); |
545 base::ListValue* entry_list = new base::ListValue(); | 546 base::ListValue* entry_list = new base::ListValue(); |
546 entry_list->Append(std::move(entry)); | 547 entry_list->Append(std::move(entry)); |
547 response->Set("entries", entry_list); | 548 response->Set("entries", entry_list); |
548 response->SetBoolean("multiple", false); | 549 response->SetBoolean("multiple", false); |
549 SetResult(std::move(response)); | 550 SetResult(std::move(response)); |
550 SendResponse(succeeded); | 551 SendResponse(succeeded); |
551 } | 552 } |
552 | 553 |
553 } // namespace extensions | 554 } // namespace extensions |
OLD | NEW |