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

Side by Side Diff: base/message_loop.cc

Issue 112032: Promotes Add/RemoveObserver to MessageLoop for linux. Because... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « base/message_loop.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 // A few events we handle (kindred to messages), and used to profile actions. 558 // A few events we handle (kindred to messages), and used to profile actions.
559 VALUE_TO_NUMBER_AND_NAME(kTaskRunEvent) 559 VALUE_TO_NUMBER_AND_NAME(kTaskRunEvent)
560 VALUE_TO_NUMBER_AND_NAME(kTimerEvent) 560 VALUE_TO_NUMBER_AND_NAME(kTimerEvent)
561 561
562 {-1, NULL} // The list must be null terminated, per API to histogram. 562 {-1, NULL} // The list must be null terminated, per API to histogram.
563 }; 563 };
564 564
565 //------------------------------------------------------------------------------ 565 //------------------------------------------------------------------------------
566 // MessageLoopForUI 566 // MessageLoopForUI
567 567
568 #if defined(OS_LINUX) || defined(OS_WIN)
569
570 void MessageLoopForUI::AddObserver(Observer* observer) {
571 pump_ui()->AddObserver(observer);
572 }
573
574 void MessageLoopForUI::RemoveObserver(Observer* observer) {
575 pump_ui()->RemoveObserver(observer);
576 }
577
578 #endif
579
568 #if defined(OS_WIN) 580 #if defined(OS_WIN)
569 581
570 void MessageLoopForUI::Run(Dispatcher* dispatcher) { 582 void MessageLoopForUI::Run(Dispatcher* dispatcher) {
571 AutoRunState save_state(this); 583 AutoRunState save_state(this);
572 state_->dispatcher = dispatcher; 584 state_->dispatcher = dispatcher;
573 RunHandler(); 585 RunHandler();
574 } 586 }
575 587
576 void MessageLoopForUI::AddObserver(Observer* observer) {
577 pump_win()->AddObserver(observer);
578 }
579
580 void MessageLoopForUI::RemoveObserver(Observer* observer) {
581 pump_win()->RemoveObserver(observer);
582 }
583
584 void MessageLoopForUI::WillProcessMessage(const MSG& message) { 588 void MessageLoopForUI::WillProcessMessage(const MSG& message) {
585 pump_win()->WillProcessMessage(message); 589 pump_win()->WillProcessMessage(message);
586 } 590 }
587 void MessageLoopForUI::DidProcessMessage(const MSG& message) { 591 void MessageLoopForUI::DidProcessMessage(const MSG& message) {
588 pump_win()->DidProcessMessage(message); 592 pump_win()->DidProcessMessage(message);
589 } 593 }
590 void MessageLoopForUI::PumpOutPendingPaintMessages() { 594 void MessageLoopForUI::PumpOutPendingPaintMessages() {
591 pump_ui()->PumpOutPendingPaintMessages(); 595 pump_ui()->PumpOutPendingPaintMessages();
592 } 596 }
593 597
(...skipping 21 matching lines...) Expand all
615 Watcher *delegate) { 619 Watcher *delegate) {
616 return pump_libevent()->WatchFileDescriptor( 620 return pump_libevent()->WatchFileDescriptor(
617 fd, 621 fd,
618 persistent, 622 persistent,
619 static_cast<base::MessagePumpLibevent::Mode>(mode), 623 static_cast<base::MessagePumpLibevent::Mode>(mode),
620 controller, 624 controller,
621 delegate); 625 delegate);
622 } 626 }
623 627
624 #endif 628 #endif
OLDNEW
« no previous file with comments | « base/message_loop.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698