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: extensions/browser/user_script_loader.cc

Issue 976173002: Fix tests failures caused by issue 906493004. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | 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 "extensions/browser/user_script_loader.h" 5 #include "extensions/browser/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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 // though it removes the possibility that freeing the shared memory block 437 // though it removes the possibility that freeing the shared memory block
438 // would open up enough FDs for long enough for a retry to succeed. 438 // would open up enough FDs for long enough for a retry to succeed.
439 439
440 // Pretend the extension change didn't happen. 440 // Pretend the extension change didn't happen.
441 return; 441 return;
442 } 442 }
443 443
444 // We've got scripts ready to go. 444 // We've got scripts ready to go.
445 shared_memory_.reset(shared_memory.release()); 445 shared_memory_.reset(shared_memory.release());
446 446
447 // If user scripts are comming from a <webview>, will only notify the 447 // If user scripts are coming from a <webview>, will only notify the
448 // RenderProcessHost of that <webview>; otherwise will notify all of the 448 // RenderProcessHost of that <webview>; otherwise will notify all of the
449 // RenderProcessHosts. 449 // RenderProcessHosts.
450 if (user_scripts && !user_scripts->empty() && 450 if (user_scripts && !user_scripts->empty() &&
451 (*user_scripts)[0].consumer_instance_type() == 451 (*user_scripts)[0].consumer_instance_type() ==
452 UserScript::ConsumerInstanceType::WEBVIEW) { 452 UserScript::ConsumerInstanceType::WEBVIEW) {
453 DCHECK_EQ(1u, user_scripts->size()); 453 DCHECK_EQ(1u, user_scripts->size());
454 int render_process_id = (*user_scripts)[0].routing_info().render_process_id; 454 int render_process_id = (*user_scripts)[0].routing_info().render_process_id;
455 content::RenderProcessHost* host = 455 content::RenderProcessHost* host =
456 content::RenderProcessHost::FromID(render_process_id); 456 content::RenderProcessHost::FromID(render_process_id);
457 if (host) 457 if (host)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 for (const HostID& id : changed_hosts) 499 for (const HostID& id : changed_hosts)
500 changed_ids_set.insert(id.id()); 500 changed_ids_set.insert(id.id());
501 501
502 if (base::SharedMemory::IsHandleValid(handle_for_process)) { 502 if (base::SharedMemory::IsHandleValid(handle_for_process)) {
503 process->Send(new ExtensionMsg_UpdateUserScripts( 503 process->Send(new ExtensionMsg_UpdateUserScripts(
504 handle_for_process, host_id().id(), changed_ids_set)); 504 handle_for_process, host_id().id(), changed_ids_set));
505 } 505 }
506 } 506 }
507 507
508 } // namespace extensions 508 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/common/user_script.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698