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

Side by Side Diff: chrome/browser/prerender/prerender_contents.cc

Issue 6319001: Support window.opener after a process swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add WasSwappedOut message for clean exit. Created 9 years, 8 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) 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/prerender/prerender_contents.h" 5 #include "chrome/browser/prerender/prerender_contents.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 const std::wstring& title) { 301 const std::wstring& title) {
302 DCHECK_EQ(render_view_host_, render_view_host); 302 DCHECK_EQ(render_view_host_, render_view_host);
303 if (title.empty()) 303 if (title.empty())
304 return; 304 return;
305 305
306 title_ = WideToUTF16Hack(title); 306 title_ = WideToUTF16Hack(title);
307 page_id_ = page_id; 307 page_id_ = page_id;
308 } 308 }
309 309
310 void PrerenderContents::RunJavaScriptMessage( 310 void PrerenderContents::RunJavaScriptMessage(
311 const RenderViewHost* rvh,
311 const std::wstring& message, 312 const std::wstring& message,
312 const std::wstring& default_prompt, 313 const std::wstring& default_prompt,
313 const GURL& frame_url, 314 const GURL& frame_url,
314 const int flags, 315 const int flags,
315 IPC::Message* reply_msg, 316 IPC::Message* reply_msg,
316 bool* did_suppress_message) { 317 bool* did_suppress_message) {
317 // Always suppress JavaScript messages if they're triggered by a page being 318 // Always suppress JavaScript messages if they're triggered by a page being
318 // prerendered. 319 // prerendered.
319 *did_suppress_message = true; 320 *did_suppress_message = true;
320 // We still want to show the user the message when they navigate to this 321 // We still want to show the user the message when they navigate to this
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 return; 588 return;
588 589
589 size_t private_bytes, shared_bytes; 590 size_t private_bytes, shared_bytes;
590 if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) { 591 if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) {
591 if (private_bytes > kMaxPrerenderPrivateMB * 1024 * 1024) 592 if (private_bytes > kMaxPrerenderPrivateMB * 1024 * 1024)
592 Destroy(FINAL_STATUS_MEMORY_LIMIT_EXCEEDED); 593 Destroy(FINAL_STATUS_MEMORY_LIMIT_EXCEEDED);
593 } 594 }
594 } 595 }
595 596
596 } // namespace prerender 597 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698