Chromium Code Reviews| 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 "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h" | 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/debug/alias.h" | 12 #include "base/debug/alias.h" |
| 13 #include "base/debug/dump_without_crashing.h" | 13 #include "base/debug/dump_without_crashing.h" |
| 14 #include "base/memory/ptr_util.h" | |
| 14 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
| 15 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
| 17 #include "chrome/browser/extensions/extension_web_ui.h" | 18 #include "chrome/browser/extensions/extension_web_ui.h" |
| 18 #include "chrome/browser/extensions/extension_webkit_preferences.h" | 19 #include "chrome/browser/extensions/extension_webkit_preferences.h" |
| 19 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" | 20 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/profiles/profile_io_data.h" | 22 #include "chrome/browser/profiles/profile_io_data.h" |
| 22 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
| 23 #include "chrome/browser/renderer_host/chrome_extension_message_filter.h" | 24 #include "chrome/browser/renderer_host/chrome_extension_message_filter.h" |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 762 | 763 |
| 763 void ChromeContentBrowserClientExtensionsPart::GetURLRequestAutoMountHandlers( | 764 void ChromeContentBrowserClientExtensionsPart::GetURLRequestAutoMountHandlers( |
| 764 std::vector<storage::URLRequestAutoMountHandler>* handlers) { | 765 std::vector<storage::URLRequestAutoMountHandler>* handlers) { |
| 765 handlers->push_back( | 766 handlers->push_back( |
| 766 base::Bind(MediaFileSystemBackend::AttemptAutoMountForURLRequest)); | 767 base::Bind(MediaFileSystemBackend::AttemptAutoMountForURLRequest)); |
| 767 } | 768 } |
| 768 | 769 |
| 769 void ChromeContentBrowserClientExtensionsPart::GetAdditionalFileSystemBackends( | 770 void ChromeContentBrowserClientExtensionsPart::GetAdditionalFileSystemBackends( |
| 770 content::BrowserContext* browser_context, | 771 content::BrowserContext* browser_context, |
| 771 const base::FilePath& storage_partition_path, | 772 const base::FilePath& storage_partition_path, |
| 772 ScopedVector<storage::FileSystemBackend>* additional_backends) { | 773 std::vector<std::unique_ptr<storage::FileSystemBackend>>* |
| 774 additional_backends) { | |
| 773 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); | 775 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); |
| 774 additional_backends->push_back(new MediaFileSystemBackend( | 776 additional_backends->push_back(base::MakeUnique<MediaFileSystemBackend>( |
| 775 storage_partition_path, | 777 storage_partition_path, |
| 776 pool->GetSequencedTaskRunner( | 778 pool |
| 777 pool->GetNamedSequenceToken( | 779 ->GetSequencedTaskRunner(pool->GetNamedSequenceToken( |
|
Devlin
2017/01/10 22:39:26
that's weird. Did git cl format do this? Seems l
Avi (use Gerrit)
2017/01/11 18:14:01
Yep, this is clang format.
We have a chain of cal
| |
| 778 MediaFileSystemBackend::kMediaTaskRunnerName)).get())); | 780 MediaFileSystemBackend::kMediaTaskRunnerName)) |
| 781 .get())); | |
| 779 | 782 |
| 780 additional_backends->push_back(new sync_file_system::SyncFileSystemBackend( | 783 additional_backends->push_back( |
| 781 Profile::FromBrowserContext(browser_context))); | 784 base::MakeUnique<sync_file_system::SyncFileSystemBackend>( |
| 785 Profile::FromBrowserContext(browser_context))); | |
| 782 } | 786 } |
| 783 | 787 |
| 784 void ChromeContentBrowserClientExtensionsPart:: | 788 void ChromeContentBrowserClientExtensionsPart:: |
| 785 AppendExtraRendererCommandLineSwitches(base::CommandLine* command_line, | 789 AppendExtraRendererCommandLineSwitches(base::CommandLine* command_line, |
| 786 content::RenderProcessHost* process, | 790 content::RenderProcessHost* process, |
| 787 Profile* profile) { | 791 Profile* profile) { |
| 788 if (!process) | 792 if (!process) |
| 789 return; | 793 return; |
| 790 DCHECK(profile); | 794 DCHECK(profile); |
| 791 if (ProcessMap::Get(profile)->Contains(process->GetID())) { | 795 if (ProcessMap::Get(profile)->Contains(process->GetID())) { |
| 792 command_line->AppendSwitch(switches::kExtensionProcess); | 796 command_line->AppendSwitch(switches::kExtensionProcess); |
| 793 } | 797 } |
| 794 } | 798 } |
| 795 | 799 |
| 796 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { | 800 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { |
| 797 content::ResourceDispatcherHost::Get()->RegisterInterceptor( | 801 content::ResourceDispatcherHost::Get()->RegisterInterceptor( |
| 798 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); | 802 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); |
| 799 } | 803 } |
| 800 | 804 |
| 801 } // namespace extensions | 805 } // namespace extensions |
| OLD | NEW |