| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import base64 | 5 import base64 |
| 6 import json | 6 import json |
| 7 import logging | 7 import logging |
| 8 | 8 |
| 9 from common import constants | 9 from common import constants |
| 10 from common import appengine_util | 10 from common import appengine_util |
| 11 from common.base_handler import BaseHandler | 11 from common.base_handler import BaseHandler |
| 12 from common.base_handler import Permission | 12 from common.base_handler import Permission |
| 13 from common.http_client_appengine import HttpClientAppengine | 13 from common.http_client_appengine import HttpClientAppengine |
| 14 from crash import crash_pipeline | 14 from crash import crash_pipeline |
| 15 from crash.crash_report import CrashReport | 15 from crash.crash_report import CrashReport |
| 16 from lib.gitiles.gitiles_repository import GitilesRepository | 16 from libs.gitiles.gitiles_repository import GitilesRepository |
| 17 | 17 |
| 18 | 18 |
| 19 class CrashHandler(BaseHandler): | 19 class CrashHandler(BaseHandler): |
| 20 PERMISSION_LEVEL = Permission.ANYONE | 20 PERMISSION_LEVEL = Permission.ANYONE |
| 21 | 21 |
| 22 def HandlePost(self): | 22 def HandlePost(self): |
| 23 """Handles push delivery from Pub/Sub for crash data. | 23 """Handles push delivery from Pub/Sub for crash data. |
| 24 | 24 |
| 25 The crash data should be in the following json format: | 25 The crash data should be in the following json format: |
| 26 { | 26 { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 # as methods on the objects being encoded). | 150 # as methods on the objects being encoded). |
| 151 pipeline = crash_pipeline.CrashWrapperPipeline(client_id, crash_identifiers) | 151 pipeline = crash_pipeline.CrashWrapperPipeline(client_id, crash_identifiers) |
| 152 # Attribute defined outside __init__ - pylint: disable=W0201 | 152 # Attribute defined outside __init__ - pylint: disable=W0201 |
| 153 pipeline.target = appengine_util.GetTargetNameForModule( | 153 pipeline.target = appengine_util.GetTargetNameForModule( |
| 154 constants.CRASH_BACKEND[client_id]) | 154 constants.CRASH_BACKEND[client_id]) |
| 155 queue_name = constants.CRASH_ANALYSIS_QUEUE[client_id] | 155 queue_name = constants.CRASH_ANALYSIS_QUEUE[client_id] |
| 156 pipeline.start(queue_name=queue_name) | 156 pipeline.start(queue_name=queue_name) |
| 157 logging.info('New %s analysis is scheduled for %s', client_id, | 157 logging.info('New %s analysis is scheduled for %s', client_id, |
| 158 repr(crash_identifiers)) | 158 repr(crash_identifiers)) |
| 159 return True | 159 return True |
| OLD | NEW |