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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.h

Issue 1117923004: Run load state update timer only when needed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cpu
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
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 // This is the browser side of the resource dispatcher, it receives requests 5 // This is the browser side of the resource dispatcher, it receives requests
6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and 6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and
7 // dispatches them to URLRequests. It then forwards the messages from the 7 // dispatches them to URLRequests. It then forwards the messages from the
8 // URLRequests back to the correct process for handling. 8 // URLRequests back to the correct process for handling.
9 // 9 //
10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 // specified |id|. 487 // specified |id|.
488 void RegisterResourceMessageDelegate(const GlobalRequestID& id, 488 void RegisterResourceMessageDelegate(const GlobalRequestID& id,
489 ResourceMessageDelegate* delegate); 489 ResourceMessageDelegate* delegate);
490 void UnregisterResourceMessageDelegate(const GlobalRequestID& id, 490 void UnregisterResourceMessageDelegate(const GlobalRequestID& id,
491 ResourceMessageDelegate* delegate); 491 ResourceMessageDelegate* delegate);
492 492
493 int BuildLoadFlagsForRequest(const ResourceHostMsg_Request& request_data, 493 int BuildLoadFlagsForRequest(const ResourceHostMsg_Request& request_data,
494 int child_id, 494 int child_id,
495 bool is_sync_load); 495 bool is_sync_load);
496 496
497 void ScheduleUpdateLoadInfo();
498
497 LoaderMap pending_loaders_; 499 LoaderMap pending_loaders_;
498 500
499 // Collection of temp files downloaded for child processes via 501 // Collection of temp files downloaded for child processes via
500 // the download_to_file mechanism. We avoid deleting them until 502 // the download_to_file mechanism. We avoid deleting them until
501 // the client no longer needs them. 503 // the client no longer needs them.
502 typedef std::map<int, scoped_refptr<storage::ShareableFileReference> > 504 typedef std::map<int, scoped_refptr<storage::ShareableFileReference> >
503 DeletableFilesMap; // key is request id 505 DeletableFilesMap; // key is request id
504 typedef std::map<int, DeletableFilesMap> 506 typedef std::map<int, DeletableFilesMap>
505 RegisteredTempFiles; // key is child process id 507 RegisteredTempFiles; // key is child process id
506 RegisteredTempFiles registered_temp_files_; 508 RegisteredTempFiles registered_temp_files_;
507 509
508 // A timer that periodically calls UpdateLoadStates while pending_requests_ 510 // A timer that periodically calls UpdateLoadStates while pending_requests_
509 // is not empty. 511 // is not empty.
510 scoped_ptr<base::RepeatingTimer<ResourceDispatcherHostImpl> > 512 scoped_ptr<base::OneShotTimer<ResourceDispatcherHostImpl> >
511 update_load_states_timer_; 513 update_load_states_timer_;
512 514
513 // We own the save file manager. 515 // We own the save file manager.
514 scoped_refptr<SaveFileManager> save_file_manager_; 516 scoped_refptr<SaveFileManager> save_file_manager_;
515 517
516 // Request ID for browser initiated requests. request_ids generated by 518 // Request ID for browser initiated requests. request_ids generated by
517 // child processes are counted up from 0, while browser created requests 519 // child processes are counted up from 0, while browser created requests
518 // start at -2 and go down from there. (We need to start at -2 because -1 is 520 // start at -2 and go down from there. (We need to start at -2 because -1 is
519 // used as a special value all over the resource_dispatcher_host for 521 // used as a special value all over the resource_dispatcher_host for
520 // uninitialized variables.) This way, we no longer have the unlikely (but 522 // uninitialized variables.) This way, we no longer have the unlikely (but
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 DelegateMap delegate_map_; 583 DelegateMap delegate_map_;
582 584
583 scoped_ptr<ResourceScheduler> scheduler_; 585 scoped_ptr<ResourceScheduler> scheduler_;
584 586
585 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); 587 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
586 }; 588 };
587 589
588 } // namespace content 590 } // namespace content
589 591
590 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ 592 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | content/browser/loader/resource_scheduler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698