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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/browser_render_process_host.h" | 8 #include "content/browser/renderer_host/browser_render_process_host.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #include "content/common/child_process_info.h" | 71 #include "content/common/child_process_info.h" |
72 #include "content/common/child_process_messages.h" | 72 #include "content/common/child_process_messages.h" |
73 #include "content/common/content_switches.h" | 73 #include "content/common/content_switches.h" |
74 #include "content/common/gpu/gpu_messages.h" | 74 #include "content/common/gpu/gpu_messages.h" |
75 #include "content/common/notification_service.h" | 75 #include "content/common/notification_service.h" |
76 #include "content/common/process_watcher.h" | 76 #include "content/common/process_watcher.h" |
77 #include "content/common/resource_messages.h" | 77 #include "content/common/resource_messages.h" |
78 #include "content/common/result_codes.h" | 78 #include "content/common/result_codes.h" |
79 #include "content/common/view_messages.h" | 79 #include "content/common/view_messages.h" |
80 #include "content/renderer/render_process_impl.h" | 80 #include "content/renderer/render_process_impl.h" |
81 #include "content/renderer/render_thread.h" | 81 #include "content/renderer/render_thread_impl.h" |
82 #include "ipc/ipc_logging.h" | 82 #include "ipc/ipc_logging.h" |
83 #include "ipc/ipc_platform_file.h" | 83 #include "ipc/ipc_platform_file.h" |
84 #include "ipc/ipc_switches.h" | 84 #include "ipc/ipc_switches.h" |
85 #include "media/base/media_switches.h" | 85 #include "media/base/media_switches.h" |
86 #include "net/url_request/url_request_context_getter.h" | 86 #include "net/url_request/url_request_context_getter.h" |
87 #include "ui/base/ui_base_switches.h" | 87 #include "ui/base/ui_base_switches.h" |
88 #include "ui/gfx/gl/gl_switches.h" | 88 #include "ui/gfx/gl/gl_switches.h" |
89 #include "webkit/fileapi/file_system_path_manager.h" | 89 #include "webkit/fileapi/file_system_path_manager.h" |
90 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 90 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
91 #include "webkit/glue/resource_type.h" | 91 #include "webkit/glue/resource_type.h" |
(...skipping 21 matching lines...) Expand all Loading... |
113 Stop(); | 113 Stop(); |
114 } | 114 } |
115 | 115 |
116 protected: | 116 protected: |
117 virtual void Init() { | 117 virtual void Init() { |
118 #if defined(OS_WIN) | 118 #if defined(OS_WIN) |
119 CoInitialize(NULL); | 119 CoInitialize(NULL); |
120 #endif | 120 #endif |
121 | 121 |
122 render_process_ = new RenderProcessImpl(); | 122 render_process_ = new RenderProcessImpl(); |
123 render_process_->set_main_thread(new RenderThread(channel_id_)); | 123 render_process_->set_main_thread(new RenderThreadImpl(channel_id_)); |
124 // It's a little lame to manually set this flag. But the single process | 124 // It's a little lame to manually set this flag. But the single process |
125 // RendererThread will receive the WM_QUIT. We don't need to assert on | 125 // RendererThread will receive the WM_QUIT. We don't need to assert on |
126 // this thread, so just force the flag manually. | 126 // this thread, so just force the flag manually. |
127 // If we want to avoid this, we could create the InProcRendererThread | 127 // If we want to avoid this, we could create the InProcRendererThread |
128 // directly with _beginthreadex() rather than using the Thread class. | 128 // directly with _beginthreadex() rather than using the Thread class. |
129 base::Thread::SetThreadWasQuitProperly(true); | 129 base::Thread::SetThreadWasQuitProperly(true); |
130 } | 130 } |
131 | 131 |
132 virtual void CleanUp() { | 132 virtual void CleanUp() { |
133 delete render_process_; | 133 delete render_process_; |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 void BrowserRenderProcessHost::OnRevealFolderInOS(const FilePath& path) { | 974 void BrowserRenderProcessHost::OnRevealFolderInOS(const FilePath& path) { |
975 // Only honor the request if appropriate persmissions are granted. | 975 // Only honor the request if appropriate persmissions are granted. |
976 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) | 976 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) |
977 content::GetContentClient()->browser()->OpenItem(path); | 977 content::GetContentClient()->browser()->OpenItem(path); |
978 } | 978 } |
979 | 979 |
980 void BrowserRenderProcessHost::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 980 void BrowserRenderProcessHost::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
981 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> | 981 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> |
982 MHTMLGenerated(job_id, data_size); | 982 MHTMLGenerated(job_id, data_size); |
983 } | 983 } |
OLD | NEW |