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

Side by Side Diff: content/browser/frame_host/interstitial_page_impl.cc

Issue 697163002: Devirtualize InterstitialPageImpl::CreateRenderViewHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « content/browser/frame_host/interstitial_page_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/frame_host/interstitial_page_impl.h" 5 #include "content/browser/frame_host/interstitial_page_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 entry->SetVirtualURL(url_); 237 entry->SetVirtualURL(url_);
238 entry->set_page_type(PAGE_TYPE_INTERSTITIAL); 238 entry->set_page_type(PAGE_TYPE_INTERSTITIAL);
239 239
240 // Give delegates a chance to set some states on the navigation entry. 240 // Give delegates a chance to set some states on the navigation entry.
241 delegate_->OverrideEntry(entry); 241 delegate_->OverrideEntry(entry);
242 242
243 controller_->SetTransientEntry(entry); 243 controller_->SetTransientEntry(entry);
244 } 244 }
245 245
246 DCHECK(!render_view_host_); 246 DCHECK(!render_view_host_);
247 render_view_host_ = static_cast<RenderViewHostImpl*>(CreateRenderViewHost()); 247 render_view_host_ = CreateRenderViewHost();
248 render_view_host_->AttachToFrameTree(); 248 render_view_host_->AttachToFrameTree();
249 CreateWebContentsView(); 249 CreateWebContentsView();
250 250
251 std::string data_url = "data:text/html;charset=utf-8," + 251 std::string data_url = "data:text/html;charset=utf-8," +
252 net::EscapePath(delegate_->GetHTMLContents()); 252 net::EscapePath(delegate_->GetHTMLContents());
253 frame_tree_.root()->current_frame_host()->NavigateToURL(GURL(data_url)); 253 frame_tree_.root()->current_frame_host()->NavigateToURL(GURL(data_url));
254 254
255 notification_registrar_.Add(this, NOTIFICATION_NAV_ENTRY_PENDING, 255 notification_registrar_.Add(this, NOTIFICATION_NAV_ENTRY_PENDING,
256 Source<NavigationController>(controller_)); 256 Source<NavigationController>(controller_));
257 } 257 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 return wci->GetParentNativeViewAccessible(); 546 return wci->GetParentNativeViewAccessible();
547 } 547 }
548 return NULL; 548 return NULL;
549 } 549 }
550 #endif 550 #endif
551 551
552 WebContents* InterstitialPageImpl::web_contents() const { 552 WebContents* InterstitialPageImpl::web_contents() const {
553 return web_contents_; 553 return web_contents_;
554 } 554 }
555 555
556 RenderViewHost* InterstitialPageImpl::CreateRenderViewHost() { 556 RenderViewHostImpl* InterstitialPageImpl::CreateRenderViewHost() {
557 if (!enabled()) 557 if (!enabled())
558 return NULL; 558 return NULL;
559 559
560 // Interstitial pages don't want to share the session storage so we mint a 560 // Interstitial pages don't want to share the session storage so we mint a
561 // new one. 561 // new one.
562 BrowserContext* browser_context = web_contents()->GetBrowserContext(); 562 BrowserContext* browser_context = web_contents()->GetBrowserContext();
563 scoped_refptr<SiteInstance> site_instance = 563 scoped_refptr<SiteInstance> site_instance =
564 SiteInstance::Create(browser_context); 564 SiteInstance::Create(browser_context);
565 DOMStorageContextWrapper* dom_storage_context = 565 DOMStorageContextWrapper* dom_storage_context =
566 static_cast<DOMStorageContextWrapper*>( 566 static_cast<DOMStorageContextWrapper*>(
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 912
913 web_contents->GetDelegateView()->TakeFocus(reverse); 913 web_contents->GetDelegateView()->TakeFocus(reverse);
914 } 914 }
915 915
916 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply( 916 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply(
917 int request_id, int number_of_matches, const gfx::Rect& selection_rect, 917 int request_id, int number_of_matches, const gfx::Rect& selection_rect,
918 int active_match_ordinal, bool final_update) { 918 int active_match_ordinal, bool final_update) {
919 } 919 }
920 920
921 } // namespace content 921 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/interstitial_page_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698