~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/net/instaweb/apache/apache_message_handler.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 2010 Google Inc.
2
 
//
3
 
// Licensed under the Apache License, Version 2.0 (the "License");
4
 
// you may not use this file except in compliance with the License.
5
 
// You may obtain a copy of the License at
6
 
//
7
 
//      http://www.apache.org/licenses/LICENSE-2.0
8
 
//
9
 
// Unless required by applicable law or agreed to in writing, software
10
 
// distributed under the License is distributed on an "AS IS" BASIS,
11
 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 
// See the License for the specific language governing permissions and
13
 
// limitations under the License.
14
 
 
15
 
// Author: sligocki@google.com (Shawn Ligocki)
16
 
 
17
 
#ifndef NET_INSTAWEB_APACHE_APACHE_MESSAGE_HANDLER_H_
18
 
#define NET_INSTAWEB_APACHE_APACHE_MESSAGE_HANDLER_H_
19
 
 
20
 
#include <cstdarg>
21
 
 
22
 
#include "net/instaweb/system/public/system_message_handler.h"
23
 
#include "net/instaweb/util/public/basictypes.h"
24
 
#include "net/instaweb/util/public/message_handler.h"
25
 
#include "net/instaweb/util/public/string.h"
26
 
#include "net/instaweb/util/public/string_util.h"
27
 
 
28
 
struct server_rec;
29
 
 
30
 
namespace net_instaweb {
31
 
 
32
 
class AbstractMutex;
33
 
class Timer;
34
 
 
35
 
// Implementation of an HTML parser message handler that uses Apache
36
 
// logging to emit messsages.
37
 
class ApacheMessageHandler : public SystemMessageHandler {
38
 
 public:
39
 
  // version is a string added to each message.
40
 
  // Timer is used to generate timestamp for messages in shared memory.
41
 
  ApacheMessageHandler(const server_rec* server, const StringPiece& version,
42
 
                       Timer* timer, AbstractMutex* mutex);
43
 
 
44
 
  // Installs a signal handler for common crash signals that tries to print
45
 
  // out a backtrace.
46
 
  static void InstallCrashHandler(server_rec* global_server);
47
 
 
48
 
 protected:
49
 
  virtual void MessageVImpl(MessageType type, const char* msg, va_list args);
50
 
 
51
 
  virtual void FileMessageVImpl(MessageType type, const char* filename,
52
 
                                int line, const char* msg, va_list args);
53
 
 
54
 
 private:
55
 
  int GetApacheLogLevel(MessageType type);
56
 
 
57
 
  const server_rec* server_rec_;
58
 
  const GoogleString version_;
59
 
 
60
 
  DISALLOW_COPY_AND_ASSIGN(ApacheMessageHandler);
61
 
};
62
 
 
63
 
}  // namespace net_instaweb
64
 
 
65
 
#endif  // NET_INSTAWEB_APACHE_APACHE_MESSAGE_HANDLER_H_