| 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/renderer/chrome_render_process_observer.h" | 5 #include "chrome/renderer/chrome_render_process_observer.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "content/common/view_messages.h" | 25 #include "content/common/view_messages.h" |
| 26 #include "content/renderer/render_thread.h" | 26 #include "content/renderer/render_thread.h" |
| 27 #include "content/renderer/render_view.h" | 27 #include "content/renderer/render_view.h" |
| 28 #include "content/renderer/render_view_visitor.h" | 28 #include "content/renderer/render_view_visitor.h" |
| 29 #include "crypto/nss_util.h" | 29 #include "crypto/nss_util.h" |
| 30 #include "media/base/media.h" | 30 #include "media/base/media.h" |
| 31 #include "media/base/media_switches.h" | 31 #include "media/base/media_switches.h" |
| 32 #include "net/base/net_errors.h" | 32 #include "net/base/net_errors.h" |
| 33 #include "net/base/net_module.h" | 33 #include "net/base/net_module.h" |
| 34 #include "third_party/sqlite/sqlite3.h" | 34 #include "third_party/sqlite/sqlite3.h" |
| 35 #include "third_party/tcmalloc/chromium/src/google/heap-profiler.h" |
| 35 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" | 36 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" |
| 36 #include "third_party/tcmalloc/chromium/src/google/heap-profiler.h" | |
| 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | |
| 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflig
htResultCache.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflig
htResultCache.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h" |
| 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
| 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 44 #include "v8/include/v8.h" | 44 #include "v8/include/v8.h" |
| 45 | 45 |
| 46 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
| 47 #include "base/win/iat_patch_function.h" | 47 #include "base/win/iat_patch_function.h" |
| 48 #endif | 48 #endif |
| 49 | 49 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 75 // Rate limit informing the host of our cache stats. | 75 // Rate limit informing the host of our cache stats. |
| 76 if (method_factory_.empty()) { | 76 if (method_factory_.empty()) { |
| 77 MessageLoop::current()->PostDelayedTask( | 77 MessageLoop::current()->PostDelayedTask( |
| 78 FROM_HERE, | 78 FROM_HERE, |
| 79 method_factory_.NewRunnableMethod( | 79 method_factory_.NewRunnableMethod( |
| 80 &RendererResourceDelegate::InformHostOfCacheStats), | 80 &RendererResourceDelegate::InformHostOfCacheStats), |
| 81 kCacheStatsDelayMS); | 81 kCacheStatsDelayMS); |
| 82 } | 82 } |
| 83 | 83 |
| 84 if (status.status() != net::URLRequestStatus::CANCELED || | 84 if (status.status() != net::URLRequestStatus::CANCELED || |
| 85 status.os_error() == net::ERR_ABORTED) { | 85 status.error() == net::ERR_ABORTED) { |
| 86 return NULL; | 86 return NULL; |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Resource canceled with a specific error are filtered. | 89 // Resource canceled with a specific error are filtered. |
| 90 return SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest( | 90 return SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest( |
| 91 resource_type, current_peer, status.os_error()); | 91 resource_type, current_peer, status.error()); |
| 92 } | 92 } |
| 93 | 93 |
| 94 virtual webkit_glue::ResourceLoaderBridge::Peer* OnReceivedResponse( | 94 virtual webkit_glue::ResourceLoaderBridge::Peer* OnReceivedResponse( |
| 95 webkit_glue::ResourceLoaderBridge::Peer* current_peer, | 95 webkit_glue::ResourceLoaderBridge::Peer* current_peer, |
| 96 const std::string& mime_type, | 96 const std::string& mime_type, |
| 97 const GURL& url) { | 97 const GURL& url) { |
| 98 return ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( | 98 return ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( |
| 99 current_peer, RenderThread::current(), mime_type, url); | 99 current_peer, RenderThread::current(), mime_type, url); |
| 100 } | 100 } |
| 101 | 101 |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 } | 541 } |
| 542 | 542 |
| 543 #if !defined(OS_MACOSX) && defined(USE_TCMALLOC) | 543 #if !defined(OS_MACOSX) && defined(USE_TCMALLOC) |
| 544 // Tell tcmalloc to release any free pages it's still holding. | 544 // Tell tcmalloc to release any free pages it's still holding. |
| 545 MallocExtension::instance()->ReleaseFreeMemory(); | 545 MallocExtension::instance()->ReleaseFreeMemory(); |
| 546 #endif | 546 #endif |
| 547 | 547 |
| 548 if (client_) | 548 if (client_) |
| 549 client_->OnPurgeMemory(); | 549 client_->OnPurgeMemory(); |
| 550 } | 550 } |
| OLD | NEW |