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

Side by Side Diff: extensions/renderer/script_injection_manager.cc

Issue 1145073003: Subsituting pattern ScopedVector push_back.(ptr.release()) with push_back(ptr.Pass()) in extensions… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « AUTHORS ('k') | extensions/renderer/user_script_set.cc » ('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/renderer/script_injection_manager.h" 5 #include "extensions/renderer/script_injection_manager.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 UserScript::RunLocation run_location, 372 UserScript::RunLocation run_location,
373 ScriptsRunInfo* scripts_run_info) { 373 ScriptsRunInfo* scripts_run_info) {
374 // Try to inject the script. If the injection is waiting (i.e., for 374 // Try to inject the script. If the injection is waiting (i.e., for
375 // permission), add it to the list of pending injections. If the injection 375 // permission), add it to the list of pending injections. If the injection
376 // has blocked, add it to the list of running injections. 376 // has blocked, add it to the list of running injections.
377 switch (injection->TryToInject( 377 switch (injection->TryToInject(
378 run_location, 378 run_location,
379 scripts_run_info, 379 scripts_run_info,
380 this)) { 380 this)) {
381 case ScriptInjection::INJECTION_WAITING: 381 case ScriptInjection::INJECTION_WAITING:
382 pending_injections_.push_back(injection.release()); 382 pending_injections_.push_back(injection.Pass());
383 break; 383 break;
384 case ScriptInjection::INJECTION_BLOCKED: 384 case ScriptInjection::INJECTION_BLOCKED:
385 running_injections_.push_back(injection.release()); 385 running_injections_.push_back(injection.Pass());
386 break; 386 break;
387 case ScriptInjection::INJECTION_FINISHED: 387 case ScriptInjection::INJECTION_FINISHED:
388 break; 388 break;
389 } 389 }
390 } 390 }
391 391
392 void ScriptInjectionManager::HandleExecuteCode( 392 void ScriptInjectionManager::HandleExecuteCode(
393 const ExtensionMsg_ExecuteCode_Params& params, 393 const ExtensionMsg_ExecuteCode_Params& params,
394 content::RenderView* render_view) { 394 content::RenderView* render_view) {
395 // TODO(dcheng): Not sure how this can happen today. In an OOPI world, it 395 // TODO(dcheng): Not sure how this can happen today. In an OOPI world, it
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 483
484 ScriptsRunInfo scripts_run_info; 484 ScriptsRunInfo scripts_run_info;
485 ScriptInjection::InjectionResult res = injection->OnPermissionGranted( 485 ScriptInjection::InjectionResult res = injection->OnPermissionGranted(
486 &scripts_run_info); 486 &scripts_run_info);
487 if (res == ScriptInjection::INJECTION_BLOCKED) 487 if (res == ScriptInjection::INJECTION_BLOCKED)
488 running_injections_.push_back(injection.Pass()); 488 running_injections_.push_back(injection.Pass());
489 scripts_run_info.LogRun(injection->web_frame(), UserScript::RUN_DEFERRED); 489 scripts_run_info.LogRun(injection->web_frame(), UserScript::RUN_DEFERRED);
490 } 490 }
491 491
492 } // namespace extensions 492 } // namespace extensions
OLDNEW
« no previous file with comments | « AUTHORS ('k') | extensions/renderer/user_script_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698