Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 9347022: Support sharing of ContentMain and BrowserMain code with embedded use cases (try #2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/browser_main_runner.cc ('k') | content/content_app.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 #include "third_party/skia/include/core/SkBitmap.h" 115 #include "third_party/skia/include/core/SkBitmap.h"
116 116
117 using content::BrowserMessageFilter; 117 using content::BrowserMessageFilter;
118 using content::BrowserThread; 118 using content::BrowserThread;
119 using content::ChildProcessHost; 119 using content::ChildProcessHost;
120 using content::ChildProcessHostImpl; 120 using content::ChildProcessHostImpl;
121 using content::UserMetricsAction; 121 using content::UserMetricsAction;
122 using content::WebUIControllerFactory; 122 using content::WebUIControllerFactory;
123 123
124 extern bool g_exited_main_message_loop;
125
124 // This class creates the IO thread for the renderer when running in 126 // This class creates the IO thread for the renderer when running in
125 // single-process mode. It's not used in multi-process mode. 127 // single-process mode. It's not used in multi-process mode.
126 class RendererMainThread : public base::Thread { 128 class RendererMainThread : public base::Thread {
127 public: 129 public:
128 explicit RendererMainThread(const std::string& channel_id) 130 explicit RendererMainThread(const std::string& channel_id)
129 : base::Thread("Chrome_InProcRendererThread"), 131 : base::Thread("Chrome_InProcRendererThread"),
130 channel_id_(channel_id), 132 channel_id_(channel_id),
131 render_process_(NULL) { 133 render_process_(NULL) {
132 } 134 }
133 135
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE | 310 base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE |
309 base::PLATFORM_FILE_WRITE_ATTRIBUTES | base::PLATFORM_FILE_ENUMERATE); 311 base::PLATFORM_FILE_WRITE_ATTRIBUTES | base::PLATFORM_FILE_ENUMERATE);
310 // This is so that we can rename the old sandbox out of the way so that we 312 // This is so that we can rename the old sandbox out of the way so that we
311 // know we've taken care of it. 313 // know we've taken care of it.
312 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( 314 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile(
313 GetID(), browser_context->GetPath().Append( 315 GetID(), browser_context->GetPath().Append(
314 fileapi::SandboxMountPointProvider::kRenamedOldFileSystemDirectory), 316 fileapi::SandboxMountPointProvider::kRenamedOldFileSystemDirectory),
315 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_CREATE_ALWAYS | 317 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_CREATE_ALWAYS |
316 base::PLATFORM_FILE_WRITE); 318 base::PLATFORM_FILE_WRITE);
317 319
318 CHECK(!content::ExitedMainMessageLoop()); 320 CHECK(!g_exited_main_message_loop);
319 RegisterHost(GetID(), this); 321 RegisterHost(GetID(), this);
320 g_all_hosts.Get().set_check_on_null_data(true); 322 g_all_hosts.Get().set_check_on_null_data(true);
321 // Initialize |child_process_activity_time_| to a reasonable value. 323 // Initialize |child_process_activity_time_| to a reasonable value.
322 mark_child_process_activity_time(); 324 mark_child_process_activity_time();
323 // Note: When we create the RenderProcessHostImpl, it's technically 325 // Note: When we create the RenderProcessHostImpl, it's technically
324 // backgrounded, because it has no visible listeners. But the process 326 // backgrounded, because it has no visible listeners. But the process
325 // doesn't actually exist yet, so we'll Background it later, after 327 // doesn't actually exist yet, so we'll Background it later, after
326 // creation. 328 // creation.
327 } 329 }
328 330
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { 1297 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) {
1296 // Only honor the request if appropriate persmissions are granted. 1298 // Only honor the request if appropriate persmissions are granted.
1297 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path)) 1299 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path))
1298 content::GetContentClient()->browser()->OpenItem(path); 1300 content::GetContentClient()->browser()->OpenItem(path);
1299 } 1301 }
1300 1302
1301 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { 1303 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) {
1302 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> 1304 content::GetContentClient()->browser()->GetMHTMLGenerationManager()->
1303 MHTMLGenerated(job_id, data_size); 1305 MHTMLGenerated(job_id, data_size);
1304 } 1306 }
OLDNEW
« no previous file with comments | « content/browser/browser_main_runner.cc ('k') | content/content_app.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698