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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <objbase.h> | 9 #include <objbase.h> |
10 #endif | 10 #endif |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/renderer/renderer_webkitclient_impl.h" | 33 #include "chrome/renderer/renderer_webkitclient_impl.h" |
34 #include "chrome/renderer/user_script_slave.h" | 34 #include "chrome/renderer/user_script_slave.h" |
35 #include "chrome/renderer/visitedlink_slave.h" | 35 #include "chrome/renderer/visitedlink_slave.h" |
36 #include "webkit/glue/cache_manager.h" | 36 #include "webkit/glue/cache_manager.h" |
37 | 37 |
38 #include "WebKit.h" | 38 #include "WebKit.h" |
39 #include "WebString.h" | 39 #include "WebString.h" |
40 | 40 |
41 static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */; | 41 static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */; |
42 | 42 |
43 // V8 needs a 1MB stack size. | |
44 static const size_t kStackSize = 1024 * 1024; | |
45 | 43 |
46 //----------------------------------------------------------------------------- | 44 //----------------------------------------------------------------------------- |
47 // Methods below are only called on the owner's thread: | 45 // Methods below are only called on the owner's thread: |
48 | 46 |
49 // When we run plugins in process, we actually run them on the render thread, | 47 // When we run plugins in process, we actually run them on the render thread, |
50 // which means that we need to make the render thread pump UI events. | 48 // which means that we need to make the render thread pump UI events. |
51 RenderThread::RenderThread() | 49 RenderThread::RenderThread() |
52 : ChildThread( | 50 : ChildThread( |
53 base::Thread::Options(RenderProcess::InProcessPlugins() ? | 51 base::Thread::Options(RenderProcess::InProcessPlugins() ? |
54 MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT, kStackSize)) { | 52 MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT, kV8StackSize)) { |
55 } | 53 } |
56 | 54 |
57 RenderThread::RenderThread(const std::wstring& channel_name) | 55 RenderThread::RenderThread(const std::wstring& channel_name) |
58 : ChildThread( | 56 : ChildThread( |
59 base::Thread::Options(RenderProcess::InProcessPlugins() ? | 57 base::Thread::Options(RenderProcess::InProcessPlugins() ? |
60 MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT, kStackSize)) { | 58 MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT, kV8StackSize)) { |
61 SetChannelName(channel_name); | 59 SetChannelName(channel_name); |
62 } | 60 } |
63 | 61 |
64 RenderThread::~RenderThread() { | 62 RenderThread::~RenderThread() { |
65 } | 63 } |
66 | 64 |
67 RenderThread* RenderThread::current() { | 65 RenderThread* RenderThread::current() { |
68 DCHECK(!IsPluginProcess()); | 66 DCHECK(!IsPluginProcess()); |
69 return static_cast<RenderThread*>(ChildThread::current()); | 67 return static_cast<RenderThread*>(ChildThread::current()); |
70 } | 68 } |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 kCacheStatsDelayMS); | 238 kCacheStatsDelayMS); |
241 } | 239 } |
242 | 240 |
243 void RenderThread::EnsureWebKitInitialized() { | 241 void RenderThread::EnsureWebKitInitialized() { |
244 if (webkit_client_.get()) | 242 if (webkit_client_.get()) |
245 return; | 243 return; |
246 webkit_client_.reset(new RendererWebKitClientImpl); | 244 webkit_client_.reset(new RendererWebKitClientImpl); |
247 WebKit::initialize(webkit_client_.get()); | 245 WebKit::initialize(webkit_client_.get()); |
248 WebKit::registerURLSchemeAsLocal(ASCIIToUTF16(chrome::kChromeUIScheme)); | 246 WebKit::registerURLSchemeAsLocal(ASCIIToUTF16(chrome::kChromeUIScheme)); |
249 } | 247 } |
OLD | NEW |