| OLD | NEW |
| 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 "base/process_util.h" | 7 #include "base/process_util.h" |
| 8 #include "base/task.h" | 8 #include "base/task.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/background_contents_service.h" | 10 #include "chrome/browser/background_contents_service.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 | 371 |
| 372 bool PrerenderContents::OnMessageReceived(const IPC::Message& message) { | 372 bool PrerenderContents::OnMessageReceived(const IPC::Message& message) { |
| 373 bool handled = true; | 373 bool handled = true; |
| 374 bool message_is_ok = true; | 374 bool message_is_ok = true; |
| 375 IPC_BEGIN_MESSAGE_MAP_EX(PrerenderContents, message, message_is_ok) | 375 IPC_BEGIN_MESSAGE_MAP_EX(PrerenderContents, message, message_is_ok) |
| 376 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame, | 376 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame, |
| 377 OnDidStartProvisionalLoadForFrame) | 377 OnDidStartProvisionalLoadForFrame) |
| 378 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad, | 378 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad, |
| 379 OnDidRedirectProvisionalLoad) | 379 OnDidRedirectProvisionalLoad) |
| 380 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFavIconURL, OnUpdateFaviconURL) | 380 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) |
| 381 IPC_MESSAGE_UNHANDLED(handled = false) | 381 IPC_MESSAGE_UNHANDLED(handled = false) |
| 382 IPC_END_MESSAGE_MAP_EX() | 382 IPC_END_MESSAGE_MAP_EX() |
| 383 | 383 |
| 384 return handled; | 384 return handled; |
| 385 } | 385 } |
| 386 | 386 |
| 387 void PrerenderContents::OnDidStartProvisionalLoadForFrame(int64 frame_id, | 387 void PrerenderContents::OnDidStartProvisionalLoadForFrame(int64 frame_id, |
| 388 bool is_main_frame, | 388 bool is_main_frame, |
| 389 const GURL& url) { | 389 const GURL& url) { |
| 390 if (is_main_frame) { | 390 if (is_main_frame) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 return; | 462 return; |
| 463 | 463 |
| 464 size_t private_bytes, shared_bytes; | 464 size_t private_bytes, shared_bytes; |
| 465 if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) { | 465 if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) { |
| 466 if (private_bytes > kMaxPrerenderPrivateMB * 1024 * 1024) | 466 if (private_bytes > kMaxPrerenderPrivateMB * 1024 * 1024) |
| 467 Destroy(FINAL_STATUS_MEMORY_LIMIT_EXCEEDED); | 467 Destroy(FINAL_STATUS_MEMORY_LIMIT_EXCEEDED); |
| 468 } | 468 } |
| 469 } | 469 } |
| 470 | 470 |
| 471 } // namespace prerender | 471 } // namespace prerender |
| OLD | NEW |