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 "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 IPC_MESSAGE_HANDLER(ViewMsg_PurgePluginListCache, OnPurgePluginListCache) | 657 IPC_MESSAGE_HANDLER(ViewMsg_PurgePluginListCache, OnPurgePluginListCache) |
658 IPC_MESSAGE_HANDLER(ViewMsg_NetworkStateChanged, OnNetworkStateChanged) | 658 IPC_MESSAGE_HANDLER(ViewMsg_NetworkStateChanged, OnNetworkStateChanged) |
659 IPC_MESSAGE_HANDLER(DOMStorageMsg_Event, OnDOMStorageEvent) | 659 IPC_MESSAGE_HANDLER(DOMStorageMsg_Event, OnDOMStorageEvent) |
660 IPC_MESSAGE_HANDLER(ViewMsg_TempCrashWithData, OnTempCrashWithData) | 660 IPC_MESSAGE_HANDLER(ViewMsg_TempCrashWithData, OnTempCrashWithData) |
661 IPC_MESSAGE_UNHANDLED(handled = false) | 661 IPC_MESSAGE_UNHANDLED(handled = false) |
662 IPC_END_MESSAGE_MAP() | 662 IPC_END_MESSAGE_MAP() |
663 return handled; | 663 return handled; |
664 } | 664 } |
665 | 665 |
666 void RenderThreadImpl::OnSetNextPageID(int32 next_page_id) { | 666 void RenderThreadImpl::OnSetNextPageID(int32 next_page_id) { |
667 // This should only be called at process initialization time, so we shouldn't | 667 // This is called at process initialization time or when this process is |
668 // have to worry about thread-safety. | 668 // being re-used for a new RenderView. It is ok if another RenderView |
| 669 // has identical page_ids or inflates next_page_id_ just before this arrives, |
| 670 // as long as we ensure next_page_id_ is at least this large. |
669 RenderViewImpl::SetNextPageID(next_page_id); | 671 RenderViewImpl::SetNextPageID(next_page_id); |
670 } | 672 } |
671 | 673 |
672 // Called when to register CSS Color name->system color mappings. | 674 // Called when to register CSS Color name->system color mappings. |
673 // We update the colors one by one and then tell WebKit to refresh all render | 675 // We update the colors one by one and then tell WebKit to refresh all render |
674 // views. | 676 // views. |
675 void RenderThreadImpl::OnSetCSSColors( | 677 void RenderThreadImpl::OnSetCSSColors( |
676 const std::vector<CSSColors::CSSColorMapping>& colors) { | 678 const std::vector<CSSColors::CSSColorMapping>& colors) { |
677 EnsureWebKitInitialized(); | 679 EnsureWebKitInitialized(); |
678 size_t num_colors = colors.size(); | 680 size_t num_colors = colors.size(); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 | 780 |
779 scoped_refptr<base::MessageLoopProxy> | 781 scoped_refptr<base::MessageLoopProxy> |
780 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 782 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
781 DCHECK(message_loop() == MessageLoop::current()); | 783 DCHECK(message_loop() == MessageLoop::current()); |
782 if (!file_thread_.get()) { | 784 if (!file_thread_.get()) { |
783 file_thread_.reset(new base::Thread("Renderer::FILE")); | 785 file_thread_.reset(new base::Thread("Renderer::FILE")); |
784 file_thread_->Start(); | 786 file_thread_->Start(); |
785 } | 787 } |
786 return file_thread_->message_loop_proxy(); | 788 return file_thread_->message_loop_proxy(); |
787 } | 789 } |
OLD | NEW |