~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/third_party/chromium/src/base/message_loop/message_pump_dispatcher.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
3
 
// found in the LICENSE file.
4
 
 
5
 
#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_DISPATCHER_H
6
 
#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_DISPATCHER_H
7
 
 
8
 
#include <stdint.h>
9
 
 
10
 
#include "base/base_export.h"
11
 
#include "base/event_types.h"
12
 
 
13
 
namespace base {
14
 
 
15
 
// Dispatcher is used during a nested invocation of Run to dispatch events when
16
 
// |RunLoop(dispatcher).Run()| is used.  If |RunLoop().Run()| is invoked,
17
 
// MessageLoop does not dispatch events (or invoke TranslateMessage), rather
18
 
// every message is passed to Dispatcher's Dispatch method for dispatch. It is
19
 
// up to the Dispatcher whether or not to dispatch the event.
20
 
//
21
 
// The nested loop is exited by either posting a quit, or setting the
22
 
// POST_DISPATCH_QUIT_LOOP flag on the return value from Dispatch.
23
 
class BASE_EXPORT MessagePumpDispatcher {
24
 
 public:
25
 
  enum PostDispatchAction {
26
 
    POST_DISPATCH_NONE = 0x0,
27
 
    POST_DISPATCH_QUIT_LOOP = 0x1,
28
 
    POST_DISPATCH_PERFORM_DEFAULT = 0x2,
29
 
  };
30
 
 
31
 
  virtual ~MessagePumpDispatcher() {}
32
 
 
33
 
  // Dispatches the event. The return value can have more than one
34
 
  // PostDispatchAction flags OR'ed together. If POST_DISPATCH_PERFORM_DEFAULT
35
 
  // is set in the returned value, then the message-pump performs the default
36
 
  // action. If POST_DISPATCH_QUIT_LOOP is set, in the return value, then the
37
 
  // nested loop exits immediately.
38
 
  virtual uint32_t Dispatch(const NativeEvent& event) = 0;
39
 
};
40
 
 
41
 
}  // namespace base
42
 
 
43
 
#endif  // BASE_MESSAGE_LOOP_MESSAGE_PUMP_DISPATCHER_H