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

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: sync (r175140) Created 7 years, 11 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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 return false; 686 return false;
687 } 687 }
688 } 688 }
689 689
690 // Hosted apps that have script access to their background page must use 690 // Hosted apps that have script access to their background page must use
691 // process per site, since all instances can make synchronous calls to the 691 // process per site, since all instances can make synchronous calls to the
692 // background window. Other extensions should use process per site as well. 692 // background window. Other extensions should use process per site as well.
693 return true; 693 return true;
694 } 694 }
695 695
696 net::URLRequestContextGetter*
697 ChromeContentBrowserClient::CreateRequestContext(
698 content::BrowserContext* browser_context,
699 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
700 blob_protocol_handler,
701 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
702 file_system_protocol_handler,
703 scoped_ptr<net::URLRequestJobFactory::Interceptor>
704 developer_protocol_handler) {
705 Profile* profile = Profile::FromBrowserContext(browser_context);
706 return profile->CreateRequestContext(blob_protocol_handler.Pass(),
707 file_system_protocol_handler.Pass(),
708 developer_protocol_handler.Pass());
709 }
710
711 net::URLRequestContextGetter*
712 ChromeContentBrowserClient::CreateRequestContextForStoragePartition(
713 content::BrowserContext* browser_context,
714 const FilePath& partition_path,
715 bool in_memory,
716 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
717 blob_protocol_handler,
718 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
719 file_system_protocol_handler,
720 scoped_ptr<net::URLRequestJobFactory::Interceptor>
721 developer_protocol_handler) {
722 Profile* profile = Profile::FromBrowserContext(browser_context);
723 return profile->CreateRequestContextForStoragePartition(
724 partition_path,
725 in_memory,
726 blob_protocol_handler.Pass(),
727 file_system_protocol_handler.Pass(),
728 developer_protocol_handler.Pass());
729 }
730
696 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { 731 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) {
697 return ProfileIOData::IsHandledURL(url); 732 return ProfileIOData::IsHandledURL(url);
698 } 733 }
699 734
700 bool ChromeContentBrowserClient::IsSuitableHost( 735 bool ChromeContentBrowserClient::IsSuitableHost(
701 content::RenderProcessHost* process_host, 736 content::RenderProcessHost* process_host,
702 const GURL& site_url) { 737 const GURL& site_url) {
703 Profile* profile = 738 Profile* profile =
704 Profile::FromBrowserContext(process_host->GetBrowserContext()); 739 Profile::FromBrowserContext(process_host->GetBrowserContext());
705 ExtensionService* service = 740 ExtensionService* service =
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1909 io_thread_application_locale_ = locale; 1944 io_thread_application_locale_ = locale;
1910 } 1945 }
1911 1946
1912 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( 1947 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread(
1913 const std::string& locale) { 1948 const std::string& locale) {
1914 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 1949 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
1915 io_thread_application_locale_ = locale; 1950 io_thread_application_locale_ = locale;
1916 } 1951 }
1917 1952
1918 } // namespace chrome 1953 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698