| 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 353   channel_->AddFilter( | 353   channel_->AddFilter( | 
| 354       new AppCacheDispatcherHost(&profile()->GetResourceContext(), id())); | 354       new AppCacheDispatcherHost(&profile()->GetResourceContext(), id())); | 
| 355   channel_->AddFilter(new ClipboardMessageFilter()); | 355   channel_->AddFilter(new ClipboardMessageFilter()); | 
| 356   channel_->AddFilter( | 356   channel_->AddFilter( | 
| 357       new DOMStorageMessageFilter(id(), profile()->GetWebKitContext())); | 357       new DOMStorageMessageFilter(id(), profile()->GetWebKitContext())); | 
| 358   channel_->AddFilter( | 358   channel_->AddFilter( | 
| 359       new IndexedDBDispatcherHost(id(), profile()->GetWebKitContext())); | 359       new IndexedDBDispatcherHost(id(), profile()->GetWebKitContext())); | 
| 360   channel_->AddFilter( | 360   channel_->AddFilter( | 
| 361       GeolocationDispatcherHost::New( | 361       GeolocationDispatcherHost::New( | 
| 362           id(), profile()->GetGeolocationPermissionContext())); | 362           id(), profile()->GetGeolocationPermissionContext())); | 
| 363   channel_->AddFilter(new GpuMessageFilter(id())); | 363   channel_->AddFilter(new GpuMessageFilter(id(), widget_helper_.get())); | 
| 364   channel_->AddFilter(new PepperFileMessageFilter(id(), profile())); | 364   channel_->AddFilter(new PepperFileMessageFilter(id(), profile())); | 
| 365   channel_->AddFilter( | 365   channel_->AddFilter( | 
| 366       new PepperMessageFilter(&profile()->GetResourceContext())); | 366       new PepperMessageFilter(&profile()->GetResourceContext())); | 
| 367   channel_->AddFilter(new speech_input::SpeechInputDispatcherHost(id())); | 367   channel_->AddFilter(new speech_input::SpeechInputDispatcherHost(id())); | 
| 368   channel_->AddFilter( | 368   channel_->AddFilter( | 
| 369       new FileSystemDispatcherHost(&profile()->GetResourceContext())); | 369       new FileSystemDispatcherHost(&profile()->GetResourceContext())); | 
| 370   channel_->AddFilter(new device_orientation::MessageFilter()); | 370   channel_->AddFilter(new device_orientation::MessageFilter()); | 
| 371   channel_->AddFilter( | 371   channel_->AddFilter( | 
| 372       new BlobMessageFilter(id(), profile()->GetBlobStorageContext())); | 372       new BlobMessageFilter(id(), profile()->GetBlobStorageContext())); | 
| 373   channel_->AddFilter(new FileUtilitiesMessageFilter(id())); | 373   channel_->AddFilter(new FileUtilitiesMessageFilter(id())); | 
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 701   cached_dibs_cleaner_.Reset(); | 701   cached_dibs_cleaner_.Reset(); | 
| 702   return dib; | 702   return dib; | 
| 703 } | 703 } | 
| 704 | 704 | 
| 705 void BrowserRenderProcessHost::ClearTransportDIBCache() { | 705 void BrowserRenderProcessHost::ClearTransportDIBCache() { | 
| 706   STLDeleteContainerPairSecondPointers( | 706   STLDeleteContainerPairSecondPointers( | 
| 707       cached_dibs_.begin(), cached_dibs_.end()); | 707       cached_dibs_.begin(), cached_dibs_.end()); | 
| 708   cached_dibs_.clear(); | 708   cached_dibs_.clear(); | 
| 709 } | 709 } | 
| 710 | 710 | 
|  | 711 void BrowserRenderProcessHost::SetCompositingSurface( | 
|  | 712     int render_widget_id, | 
|  | 713     gfx::PluginWindowHandle compositing_surface) { | 
|  | 714   widget_helper_->SetCompositingSurface(render_widget_id, compositing_surface); | 
|  | 715 } | 
|  | 716 | 
| 711 bool BrowserRenderProcessHost::Send(IPC::Message* msg) { | 717 bool BrowserRenderProcessHost::Send(IPC::Message* msg) { | 
| 712   if (!channel_.get()) { | 718   if (!channel_.get()) { | 
| 713     if (!is_initialized_) { | 719     if (!is_initialized_) { | 
| 714       queued_messages_.push(msg); | 720       queued_messages_.push(msg); | 
| 715       return true; | 721       return true; | 
| 716     } else { | 722     } else { | 
| 717       delete msg; | 723       delete msg; | 
| 718       return false; | 724       return false; | 
| 719     } | 725     } | 
| 720   } | 726   } | 
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 910 void BrowserRenderProcessHost::OnUserMetricsRecordAction( | 916 void BrowserRenderProcessHost::OnUserMetricsRecordAction( | 
| 911     const std::string& action) { | 917     const std::string& action) { | 
| 912   UserMetrics::RecordComputedAction(action); | 918   UserMetrics::RecordComputedAction(action); | 
| 913 } | 919 } | 
| 914 | 920 | 
| 915 void BrowserRenderProcessHost::OnRevealFolderInOS(const FilePath& path) { | 921 void BrowserRenderProcessHost::OnRevealFolderInOS(const FilePath& path) { | 
| 916   // Only honor the request if appropriate persmissions are granted. | 922   // Only honor the request if appropriate persmissions are granted. | 
| 917   if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) | 923   if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) | 
| 918     content::GetContentClient()->browser()->RevealFolderInOS(path); | 924     content::GetContentClient()->browser()->RevealFolderInOS(path); | 
| 919 } | 925 } | 
| OLD | NEW | 
|---|