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

Side by Side Diff: chrome/browser/background/background_contents_service.cc

Issue 933423003: Make BackgroundContentsService start up BackgroundContents with a delay, as for ExtensionHosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: edulcni# Created 5 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
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/background/background_contents_service.h" 5 #include "chrome/browser/background/background_contents_service.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 BackgroundContents* contents = CreateBackgroundContents( 627 BackgroundContents* contents = CreateBackgroundContents(
628 SiteInstance::CreateForURL(profile, url), 628 SiteInstance::CreateForURL(profile, url),
629 MSG_ROUTING_NONE, 629 MSG_ROUTING_NONE,
630 MSG_ROUTING_NONE, 630 MSG_ROUTING_NONE,
631 profile, 631 profile,
632 frame_name, 632 frame_name,
633 application_id, 633 application_id,
634 std::string(), 634 std::string(),
635 NULL); 635 NULL);
636 636
637 // TODO(atwilson): Create RenderViews asynchronously to avoid increasing 637 contents->CreateRenderViewSoon(url);
638 // startup latency (http://crbug.com/47236).
639 contents->web_contents()->GetController().LoadURL(
640 url, content::Referrer(), ui::PAGE_TRANSITION_LINK, std::string());
641 } 638 }
642 639
643 BackgroundContents* BackgroundContentsService::CreateBackgroundContents( 640 BackgroundContents* BackgroundContentsService::CreateBackgroundContents(
644 SiteInstance* site, 641 SiteInstance* site,
645 int routing_id, 642 int routing_id,
646 int main_frame_route_id, 643 int main_frame_route_id,
647 Profile* profile, 644 Profile* profile,
648 const base::string16& frame_name, 645 const base::string16& frame_name,
649 const base::string16& application_id, 646 const base::string16& application_id,
650 const std::string& partition_id, 647 const std::string& partition_id,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 bool user_gesture, 772 bool user_gesture,
776 bool* was_blocked) { 773 bool* was_blocked) {
777 Browser* browser = chrome::FindLastActiveWithProfile( 774 Browser* browser = chrome::FindLastActiveWithProfile(
778 Profile::FromBrowserContext(new_contents->GetBrowserContext()), 775 Profile::FromBrowserContext(new_contents->GetBrowserContext()),
779 chrome::GetActiveDesktop()); 776 chrome::GetActiveDesktop());
780 if (browser) { 777 if (browser) {
781 chrome::AddWebContents(browser, NULL, new_contents, disposition, 778 chrome::AddWebContents(browser, NULL, new_contents, disposition,
782 initial_rect, user_gesture, was_blocked); 779 initial_rect, user_gesture, was_blocked);
783 } 780 }
784 } 781 }
OLDNEW
« no previous file with comments | « chrome/browser/background/background_contents.cc ('k') | chrome/browser/extensions/chrome_extension_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698