OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/resource_message_filter.h" | 5 #include "chrome/browser/resource_message_filter.h" |
6 | 6 |
7 #include "base/clipboard.h" | 7 #include "base/clipboard.h" |
8 #include "base/histogram.h" | 8 #include "base/histogram.h" |
9 #include "base/thread.h" | 9 #include "base/thread.h" |
10 #include "chrome/browser/chrome_plugin_browsing_context.h" | 10 #include "chrome/browser/chrome_plugin_browsing_context.h" |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } | 480 } |
481 | 481 |
482 void ResourceMessageFilter::OnGetCPBrowsingContext(uint32* context) { | 482 void ResourceMessageFilter::OnGetCPBrowsingContext(uint32* context) { |
483 // Always allocate a new context when a plugin requests one, since it needs to | 483 // Always allocate a new context when a plugin requests one, since it needs to |
484 // be unique for that plugin instance. | 484 // be unique for that plugin instance. |
485 *context = | 485 *context = |
486 CPBrowsingContextManager::Instance()->Allocate(request_context_.get()); | 486 CPBrowsingContextManager::Instance()->Allocate(request_context_.get()); |
487 } | 487 } |
488 | 488 |
489 void ResourceMessageFilter::OnDuplicateSection( | 489 void ResourceMessageFilter::OnDuplicateSection( |
490 SharedMemoryHandle renderer_handle, | 490 base::SharedMemoryHandle renderer_handle, |
491 SharedMemoryHandle* browser_handle) { | 491 base::SharedMemoryHandle* browser_handle) { |
492 // Duplicate the handle in this process right now so the memory is kept alive | 492 // Duplicate the handle in this process right now so the memory is kept alive |
493 // (even if it is not mapped) | 493 // (even if it is not mapped) |
494 SharedMemory shared_buf(renderer_handle, true, render_handle_); | 494 base::SharedMemory shared_buf(renderer_handle, true, render_handle_); |
495 shared_buf.GiveToProcess(GetCurrentProcess(), browser_handle); | 495 shared_buf.GiveToProcess(GetCurrentProcess(), browser_handle); |
496 } | 496 } |
497 | 497 |
498 void ResourceMessageFilter::OnResourceTypeStats( | 498 void ResourceMessageFilter::OnResourceTypeStats( |
499 const CacheManager::ResourceTypeStats& stats) { | 499 const CacheManager::ResourceTypeStats& stats) { |
500 HISTOGRAM_COUNTS(L"WebCoreCache.ImagesSizeKB", | 500 HISTOGRAM_COUNTS(L"WebCoreCache.ImagesSizeKB", |
501 static_cast<int>(stats.images.size / 1024)); | 501 static_cast<int>(stats.images.size / 1024)); |
502 HISTOGRAM_COUNTS(L"WebCoreCache.CSSStylesheetsSizeKB", | 502 HISTOGRAM_COUNTS(L"WebCoreCache.CSSStylesheetsSizeKB", |
503 static_cast<int>(stats.css_stylesheets.size / 1024)); | 503 static_cast<int>(stats.css_stylesheets.size / 1024)); |
504 HISTOGRAM_COUNTS(L"WebCoreCache.ScriptsSizeKB", | 504 HISTOGRAM_COUNTS(L"WebCoreCache.ScriptsSizeKB", |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 if (type == NOTIFY_SPELLCHECKER_REINITIALIZED) { | 645 if (type == NOTIFY_SPELLCHECKER_REINITIALIZED) { |
646 spellchecker_ = Details<SpellcheckerReinitializedDetails> | 646 spellchecker_ = Details<SpellcheckerReinitializedDetails> |
647 (details).ptr()->spellchecker; | 647 (details).ptr()->spellchecker; |
648 } | 648 } |
649 } | 649 } |
650 | 650 |
651 void ResourceMessageFilter::OnDnsPrefetch( | 651 void ResourceMessageFilter::OnDnsPrefetch( |
652 const std::vector<std::string>& hostnames) { | 652 const std::vector<std::string>& hostnames) { |
653 chrome_browser_net::DnsPrefetchList(hostnames); | 653 chrome_browser_net::DnsPrefetchList(hostnames); |
654 } | 654 } |
OLD | NEW |