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

Side by Side Diff: chrome/browser/extensions/user_script_master.cc

Issue 293093010: Rename RenderProcessHost::IsGuest to RenderProcessHost::IsIsolatedGuest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_isguest_chrome_callsites
Patch Set: Fixed interactive_ui_tests build Created 6 years, 6 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
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 #include "chrome/browser/extensions/user_script_master.h" 5 #include "chrome/browser/extensions/user_script_master.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 void UserScriptMaster::StartLoad() { 486 void UserScriptMaster::StartLoad() {
487 if (!script_reloader_.get()) 487 if (!script_reloader_.get())
488 script_reloader_ = new ScriptReloader(this); 488 script_reloader_ = new ScriptReloader(this);
489 489
490 script_reloader_->StartLoad(user_scripts_, extensions_info_); 490 script_reloader_->StartLoad(user_scripts_, extensions_info_);
491 } 491 }
492 492
493 void UserScriptMaster::SendUpdate(content::RenderProcessHost* process, 493 void UserScriptMaster::SendUpdate(content::RenderProcessHost* process,
494 base::SharedMemory* shared_memory) { 494 base::SharedMemory* shared_memory) {
495 // Don't allow injection of content scripts into <webview>. 495 // Don't allow injection of content scripts into <webview>.
496 if (process->IsGuest()) 496 if (process->IsIsolatedGuest())
497 return; 497 return;
498 498
499 Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext()); 499 Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext());
500 // Make sure we only send user scripts to processes in our profile. 500 // Make sure we only send user scripts to processes in our profile.
501 if (!profile_->IsSameProfile(profile)) 501 if (!profile_->IsSameProfile(profile))
502 return; 502 return;
503 503
504 // If the process is being started asynchronously, early return. We'll end up 504 // If the process is being started asynchronously, early return. We'll end up
505 // calling InitUserScripts when it's created which will call this again. 505 // calling InitUserScripts when it's created which will call this again.
506 base::ProcessHandle handle = process->GetHandle(); 506 base::ProcessHandle handle = process->GetHandle();
507 if (!handle) 507 if (!handle)
508 return; 508 return;
509 509
510 base::SharedMemoryHandle handle_for_process; 510 base::SharedMemoryHandle handle_for_process;
511 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) 511 if (!shared_memory->ShareToProcess(handle, &handle_for_process))
512 return; // This can legitimately fail if the renderer asserts at startup. 512 return; // This can legitimately fail if the renderer asserts at startup.
513 513
514 if (base::SharedMemory::IsHandleValid(handle_for_process)) 514 if (base::SharedMemory::IsHandleValid(handle_for_process))
515 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process)); 515 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process));
516 } 516 }
517 517
518 } // namespace extensions 518 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/guest_view/guest_view_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698