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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 7024056: Handle extension webrequest API on the IO thread. This speeds up blocking event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 6 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
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 return io_data_.GetExtensionsRequestContextGetter(); 902 return io_data_.GetExtensionsRequestContextGetter();
903 } 903 }
904 904
905 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp( 905 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp(
906 const std::string& app_id) { 906 const std::string& app_id) {
907 return io_data_.GetIsolatedAppRequestContextGetter(app_id); 907 return io_data_.GetIsolatedAppRequestContextGetter(app_id);
908 } 908 }
909 909
910 void ProfileImpl::RegisterExtensionWithRequestContexts( 910 void ProfileImpl::RegisterExtensionWithRequestContexts(
911 const Extension* extension) { 911 const Extension* extension) {
912 base::Time install_time;
913 if (extension->location() != Extension::COMPONENT) {
914 install_time = GetExtensionService()->extension_prefs()->
915 GetInstallTime(extension->id());
916 }
917 bool incognito_enabled =
918 GetExtensionService()->IsIncognitoEnabled(extension->id());
912 BrowserThread::PostTask( 919 BrowserThread::PostTask(
913 BrowserThread::IO, FROM_HERE, 920 BrowserThread::IO, FROM_HERE,
914 NewRunnableMethod(extension_info_map_.get(), 921 NewRunnableMethod(extension_info_map_.get(),
915 &ExtensionInfoMap::AddExtension, 922 &ExtensionInfoMap::AddExtension,
916 make_scoped_refptr(extension))); 923 make_scoped_refptr(extension),
924 install_time, incognito_enabled));
917 } 925 }
918 926
919 void ProfileImpl::UnregisterExtensionWithRequestContexts( 927 void ProfileImpl::UnregisterExtensionWithRequestContexts(
920 const std::string& extension_id, 928 const std::string& extension_id,
921 const UnloadedExtensionInfo::Reason reason) { 929 const UnloadedExtensionInfo::Reason reason) {
922 BrowserThread::PostTask( 930 BrowserThread::PostTask(
923 BrowserThread::IO, FROM_HERE, 931 BrowserThread::IO, FROM_HERE,
924 NewRunnableMethod(extension_info_map_.get(), 932 NewRunnableMethod(extension_info_map_.get(),
925 &ExtensionInfoMap::RemoveExtension, 933 &ExtensionInfoMap::RemoveExtension,
926 extension_id, 934 extension_id,
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 if (!prerender::PrerenderManager::IsPrerenderingPossible()) 1635 if (!prerender::PrerenderManager::IsPrerenderingPossible())
1628 return NULL; 1636 return NULL;
1629 if (!prerender_manager_.get()) { 1637 if (!prerender_manager_.get()) {
1630 CHECK(g_browser_process->prerender_tracker()); 1638 CHECK(g_browser_process->prerender_tracker());
1631 prerender_manager_.reset( 1639 prerender_manager_.reset(
1632 new prerender::PrerenderManager( 1640 new prerender::PrerenderManager(
1633 this, g_browser_process->prerender_tracker())); 1641 this, g_browser_process->prerender_tracker()));
1634 } 1642 }
1635 return prerender_manager_.get(); 1643 return prerender_manager_.get();
1636 } 1644 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698