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

Side by Side Diff: chrome/browser/tab_contents/render_view_host_manager.cc

Issue 2730014: Avoids sending about: URLs to DOM UI renderers in process-per-tab.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/tab_contents/render_view_host_manager.h" 5 #include "chrome/browser/tab_contents/render_view_host_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/dom_ui/dom_ui.h" 9 #include "chrome/browser/dom_ui/dom_ui.h"
10 #include "chrome/browser/dom_ui/dom_ui_factory.h" 10 #include "chrome/browser/dom_ui/dom_ui_factory.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 // We can't switch a RenderView between view source and non-view source mode 302 // We can't switch a RenderView between view source and non-view source mode
303 // without screwing up the session history sometimes (when navigating between 303 // without screwing up the session history sometimes (when navigating between
304 // "view-source:http://foo.com/" and "http://foo.com/", WebKit doesn't treat 304 // "view-source:http://foo.com/" and "http://foo.com/", WebKit doesn't treat
305 // it as a new navigation). So require a view switch. 305 // it as a new navigation). So require a view switch.
306 if (cur_entry->IsViewSourceMode() != new_entry->IsViewSourceMode()) 306 if (cur_entry->IsViewSourceMode() != new_entry->IsViewSourceMode())
307 return true; 307 return true;
308 308
309 // For security, we should transition between processes when one is a DOM UI 309 // For security, we should transition between processes when one is a DOM UI
310 // page and one isn't. 310 // page and one isn't.
311 if (DOMUIFactory::HasDOMUIScheme(cur_entry->url()) != 311 if (DOMUIFactory::UseDOMUIForURL(cur_entry->url()) !=
312 DOMUIFactory::HasDOMUIScheme(new_entry->url())) 312 DOMUIFactory::UseDOMUIForURL(new_entry->url()))
313 return true; 313 return true;
314 314
315 // Also, we must switch if one is an extension and the other is not the exact 315 // Also, we must switch if one is an extension and the other is not the exact
316 // same extension. 316 // same extension.
317 if (cur_entry->url().SchemeIs(chrome::kExtensionScheme) || 317 if (cur_entry->url().SchemeIs(chrome::kExtensionScheme) ||
318 new_entry->url().SchemeIs(chrome::kExtensionScheme)) { 318 new_entry->url().SchemeIs(chrome::kExtensionScheme)) {
319 if (cur_entry->url().GetOrigin() != new_entry->url().GetOrigin()) 319 if (cur_entry->url().GetOrigin() != new_entry->url().GetOrigin())
320 return true; 320 return true;
321 } 321 }
322 322
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 // deleted (not sure from where) but not NULLed. 666 // deleted (not sure from where) but not NULLed.
667 if (rvh == pending_render_view_host_) { 667 if (rvh == pending_render_view_host_) {
668 // If you hit this NOTREACHED, please report it in the following bug 668 // If you hit this NOTREACHED, please report it in the following bug
669 // http://crbug.com/23411 Make sure to include what you were doing when it 669 // http://crbug.com/23411 Make sure to include what you were doing when it
670 // happened (navigating to a new page, closing a tab...) and if you can 670 // happened (navigating to a new page, closing a tab...) and if you can
671 // reproduce. 671 // reproduce.
672 NOTREACHED(); 672 NOTREACHED();
673 pending_render_view_host_ = NULL; 673 pending_render_view_host_ = NULL;
674 } 674 }
675 } 675 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698