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

Side by Side Diff: chrome/renderer/extensions/user_script_idle_scheduler.cc

Issue 9185026: Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Explicitly include base/time.h in header file. Created 8 years, 11 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) 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 #include "chrome/renderer/extensions/user_script_idle_scheduler.h" 5 #include "chrome/renderer/extensions/user_script_idle_scheduler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/common/extensions/extension_error_utils.h" 9 #include "chrome/common/extensions/extension_error_utils.h"
10 #include "chrome/common/extensions/extension_messages.h" 10 #include "chrome/common/extensions/extension_messages.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 return; 49 return;
50 } 50 }
51 51
52 ExecuteCodeImpl(params); 52 ExecuteCodeImpl(params);
53 } 53 }
54 54
55 void UserScriptIdleScheduler::DidFinishDocumentLoad() { 55 void UserScriptIdleScheduler::DidFinishDocumentLoad() {
56 MessageLoop::current()->PostDelayedTask( 56 MessageLoop::current()->PostDelayedTask(
57 FROM_HERE, base::Bind(&UserScriptIdleScheduler::MaybeRun, 57 FROM_HERE, base::Bind(&UserScriptIdleScheduler::MaybeRun,
58 weak_factory_.GetWeakPtr()), 58 weak_factory_.GetWeakPtr()),
59 kUserScriptIdleTimeoutMs); 59 base::TimeDelta::FromMilliseconds(kUserScriptIdleTimeoutMs));
60 } 60 }
61 61
62 void UserScriptIdleScheduler::DidFinishLoad() { 62 void UserScriptIdleScheduler::DidFinishLoad() {
63 // Ensure that running scripts does not keep any progress UI running. 63 // Ensure that running scripts does not keep any progress UI running.
64 MessageLoop::current()->PostTask( 64 MessageLoop::current()->PostTask(
65 FROM_HERE, base::Bind(&UserScriptIdleScheduler::MaybeRun, 65 FROM_HERE, base::Bind(&UserScriptIdleScheduler::MaybeRun,
66 weak_factory_.GetWeakPtr())); 66 weak_factory_.GetWeakPtr()));
67 } 67 }
68 68
69 void UserScriptIdleScheduler::DidStartProvisionalLoad() { 69 void UserScriptIdleScheduler::DidStartProvisionalLoad() {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 if (!parent_frame) 173 if (!parent_frame)
174 return false; 174 return false;
175 175
176 for (WebFrame* child_frame = parent_frame->firstChild(); child_frame; 176 for (WebFrame* child_frame = parent_frame->firstChild(); child_frame;
177 child_frame = child_frame->nextSibling()) { 177 child_frame = child_frame->nextSibling()) {
178 frames_vector->push_back(child_frame); 178 frames_vector->push_back(child_frame);
179 GetAllChildFrames(child_frame, frames_vector); 179 GetAllChildFrames(child_frame, frames_vector);
180 } 180 }
181 return true; 181 return true;
182 } 182 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.cc ('k') | chrome/renderer/net/renderer_net_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698