| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 namespace { | 102 namespace { |
| 103 static const double kInitialIdleHandlerDelayS = 1.0 /* seconds */; | 103 static const double kInitialIdleHandlerDelayS = 1.0 /* seconds */; |
| 104 | 104 |
| 105 #if defined(TOUCH_UI) | 105 #if defined(TOUCH_UI) |
| 106 static const int kPopupListBoxMinimumRowHeight = 60; | 106 static const int kPopupListBoxMinimumRowHeight = 60; |
| 107 #endif | 107 #endif |
| 108 | 108 |
| 109 // Keep the global RenderThreadImpl in a TLS slot so it is impossible to access | 109 // Keep the global RenderThreadImpl in a TLS slot so it is impossible to access |
| 110 // incorrectly from the wrong thread. | 110 // incorrectly from the wrong thread. |
| 111 static base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > lazy_tls( | 111 static base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > |
| 112 base::LINKER_INITIALIZED); | 112 lazy_tls = LINKER_ZERO_INITIALIZED; |
| 113 | 113 |
| 114 class RenderViewZoomer : public content::RenderViewVisitor { | 114 class RenderViewZoomer : public content::RenderViewVisitor { |
| 115 public: | 115 public: |
| 116 RenderViewZoomer(const GURL& url, double zoom_level) | 116 RenderViewZoomer(const GURL& url, double zoom_level) |
| 117 : zoom_level_(zoom_level) { | 117 : zoom_level_(zoom_level) { |
| 118 host_ = net::GetHostOrSpecFromURL(url); | 118 host_ = net::GetHostOrSpecFromURL(url); |
| 119 } | 119 } |
| 120 | 120 |
| 121 virtual bool Visit(content::RenderView* render_view) { | 121 virtual bool Visit(content::RenderView* render_view) { |
| 122 WebView* webview = render_view->GetWebView(); | 122 WebView* webview = render_view->GetWebView(); |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 | 782 |
| 783 scoped_refptr<base::MessageLoopProxy> | 783 scoped_refptr<base::MessageLoopProxy> |
| 784 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 784 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 785 DCHECK(message_loop() == MessageLoop::current()); | 785 DCHECK(message_loop() == MessageLoop::current()); |
| 786 if (!file_thread_.get()) { | 786 if (!file_thread_.get()) { |
| 787 file_thread_.reset(new base::Thread("Renderer::FILE")); | 787 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 788 file_thread_->Start(); | 788 file_thread_->Start(); |
| 789 } | 789 } |
| 790 return file_thread_->message_loop_proxy(); | 790 return file_thread_->message_loop_proxy(); |
| 791 } | 791 } |
| OLD | NEW |