OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ | 5 #ifndef CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ |
6 #define CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ | 6 #define CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/gtest_prod_util.h" | |
13 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
16 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
17 #include "content/public/browser/trace_uploader.h" | 16 #include "content/public/browser/trace_uploader.h" |
18 #include "net/url_request/url_fetcher_delegate.h" | 17 #include "net/url_request/url_fetcher_delegate.h" |
19 | 18 |
20 namespace net { | 19 namespace net { |
21 class URLFetcher; | 20 class URLFetcher; |
22 class URLRequestContextGetter; | 21 class URLRequestContextGetter; |
23 } // namespace net | 22 } // namespace net |
24 | 23 |
25 namespace { | |
26 | |
27 // Allow up to 10MB for trace upload | |
28 const int kMaxUploadBytes = 10000000; | |
29 | |
30 } // namespace | |
31 | |
32 // TraceCrashServiceUploader uploads traces to the Chrome crash service. | 24 // TraceCrashServiceUploader uploads traces to the Chrome crash service. |
33 class TraceCrashServiceUploader : public content::TraceUploader, | 25 class TraceCrashServiceUploader : public content::TraceUploader, |
34 public net::URLFetcherDelegate { | 26 public net::URLFetcherDelegate { |
35 public: | 27 public: |
36 explicit TraceCrashServiceUploader( | 28 explicit TraceCrashServiceUploader( |
37 net::URLRequestContextGetter* request_context); | 29 net::URLRequestContextGetter* request_context); |
38 ~TraceCrashServiceUploader() override; | 30 ~TraceCrashServiceUploader() override; |
39 | 31 |
40 void SetUploadURL(const std::string& url); | 32 void SetUploadURL(const std::string& url); |
41 | 33 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 UploadDoneCallback done_callback_; | 76 UploadDoneCallback done_callback_; |
85 | 77 |
86 net::URLRequestContextGetter* request_context_; | 78 net::URLRequestContextGetter* request_context_; |
87 | 79 |
88 std::string upload_url_; | 80 std::string upload_url_; |
89 | 81 |
90 DISALLOW_COPY_AND_ASSIGN(TraceCrashServiceUploader); | 82 DISALLOW_COPY_AND_ASSIGN(TraceCrashServiceUploader); |
91 }; | 83 }; |
92 | 84 |
93 #endif // CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ | 85 #endif // CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ |
OLD | NEW |