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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move AwResourceContext into anonymous namespace Created 7 years, 10 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 (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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 return false; 791 return false;
792 } 792 }
793 } 793 }
794 794
795 // Hosted apps that have script access to their background page must use 795 // Hosted apps that have script access to their background page must use
796 // process per site, since all instances can make synchronous calls to the 796 // process per site, since all instances can make synchronous calls to the
797 // background window. Other extensions should use process per site as well. 797 // background window. Other extensions should use process per site as well.
798 return true; 798 return true;
799 } 799 }
800 800
801 net::URLRequestContextGetter*
802 ChromeContentBrowserClient::CreateRequestContext(
803 content::BrowserContext* browser_context,
804 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
805 blob_protocol_handler,
806 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
807 file_system_protocol_handler,
808 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
809 developer_protocol_handler,
810 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
811 chrome_protocol_handler,
812 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
813 chrome_devtools_protocol_handler) {
814 Profile* profile = Profile::FromBrowserContext(browser_context);
815 return profile->CreateRequestContext(blob_protocol_handler.Pass(),
816 file_system_protocol_handler.Pass(),
817 developer_protocol_handler.Pass(),
818 chrome_protocol_handler.Pass(),
819 chrome_devtools_protocol_handler.Pass());
820 }
821
822 net::URLRequestContextGetter*
823 ChromeContentBrowserClient::CreateRequestContextForStoragePartition(
824 content::BrowserContext* browser_context,
825 const FilePath& partition_path,
826 bool in_memory,
827 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
828 blob_protocol_handler,
829 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
830 file_system_protocol_handler,
831 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
832 developer_protocol_handler,
833 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
834 chrome_protocol_handler,
835 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
836 chrome_devtools_protocol_handler) {
837 Profile* profile = Profile::FromBrowserContext(browser_context);
838 return profile->CreateRequestContextForStoragePartition(
839 partition_path,
840 in_memory,
841 blob_protocol_handler.Pass(),
842 file_system_protocol_handler.Pass(),
843 developer_protocol_handler.Pass(),
844 chrome_protocol_handler.Pass(),
845 chrome_devtools_protocol_handler.Pass());
846 }
847
801 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { 848 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) {
802 return ProfileIOData::IsHandledURL(url); 849 return ProfileIOData::IsHandledURL(url);
803 } 850 }
804 851
805 bool ChromeContentBrowserClient::IsSuitableHost( 852 bool ChromeContentBrowserClient::IsSuitableHost(
806 content::RenderProcessHost* process_host, 853 content::RenderProcessHost* process_host,
807 const GURL& site_url) { 854 const GURL& site_url) {
808 Profile* profile = 855 Profile* profile =
809 Profile::FromBrowserContext(process_host->GetBrowserContext()); 856 Profile::FromBrowserContext(process_host->GetBrowserContext());
810 // This may be NULL during tests. In that case, just assume any site can 857 // This may be NULL during tests. In that case, just assume any site can
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 io_thread_application_locale_ = locale; 2087 io_thread_application_locale_ = locale;
2041 } 2088 }
2042 2089
2043 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( 2090 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread(
2044 const std::string& locale) { 2091 const std::string& locale) {
2045 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 2092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
2046 io_thread_application_locale_ = locale; 2093 io_thread_application_locale_ = locale;
2047 } 2094 }
2048 2095
2049 } // namespace chrome 2096 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698