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

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

Issue 493633003: Browser changes for wiring up RequestContentScript API to shared memory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit: Inline methods in unit tests Created 6 years, 3 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
« no previous file with comments | « chrome/browser/extensions/test_extension_system.cc ('k') | extensions/common/user_script.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_loader.h" 5 #include "chrome/browser/extensions/user_script_loader.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 base::ProcessHandle handle = process->GetHandle(); 563 base::ProcessHandle handle = process->GetHandle();
564 if (!handle) 564 if (!handle)
565 return; 565 return;
566 566
567 base::SharedMemoryHandle handle_for_process; 567 base::SharedMemoryHandle handle_for_process;
568 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) 568 if (!shared_memory->ShareToProcess(handle, &handle_for_process))
569 return; // This can legitimately fail if the renderer asserts at startup. 569 return; // This can legitimately fail if the renderer asserts at startup.
570 570
571 if (base::SharedMemory::IsHandleValid(handle_for_process)) { 571 if (base::SharedMemory::IsHandleValid(handle_for_process)) {
572 process->Send(new ExtensionMsg_UpdateUserScripts( 572 process->Send(new ExtensionMsg_UpdateUserScripts(
573 handle_for_process, "" /* owner */, changed_extensions)); 573 handle_for_process, owner_extension_id_, changed_extensions));
574 } 574 }
575 } 575 }
576 576
577 void UserScriptLoader::ExpandChangedExtensions( 577 void UserScriptLoader::ExpandChangedExtensions(
578 const std::set<UserScript>& scripts) { 578 const std::set<UserScript>& scripts) {
579 for (std::set<UserScript>::const_iterator it = scripts.begin(); 579 for (std::set<UserScript>::const_iterator it = scripts.begin();
580 it != scripts.end(); 580 it != scripts.end();
581 ++it) { 581 ++it) {
582 changed_extensions_.insert(it->extension_id()); 582 changed_extensions_.insert(it->extension_id());
583 } 583 }
(...skipping 11 matching lines...) Expand all
595 // which leads to the above lookup failing. In this case, just continue. 595 // which leads to the above lookup failing. In this case, just continue.
596 if (!extension) 596 if (!extension)
597 continue; 597 continue;
598 extensions_info_[*it] = ExtensionSet::ExtensionPathAndDefaultLocale( 598 extensions_info_[*it] = ExtensionSet::ExtensionPathAndDefaultLocale(
599 extension->path(), LocaleInfo::GetDefaultLocale(extension)); 599 extension->path(), LocaleInfo::GetDefaultLocale(extension));
600 } 600 }
601 } 601 }
602 } 602 }
603 603
604 } // namespace extensions 604 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/test_extension_system.cc ('k') | extensions/common/user_script.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698