OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/tracing/navigation_tracing.h" | 5 #include "chrome/browser/tracing/navigation_tracing.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/tracing/crash_service_uploader.h" | 10 #include "chrome/browser/tracing/crash_service_uploader.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 done_callback.Run(); | 32 done_callback.Run(); |
33 } | 33 } |
34 | 34 |
35 void UploadCallback(const scoped_refptr<base::RefCountedString>& file_contents, | 35 void UploadCallback(const scoped_refptr<base::RefCountedString>& file_contents, |
36 scoped_ptr<base::DictionaryValue> metadata, | 36 scoped_ptr<base::DictionaryValue> metadata, |
37 base::Closure callback) { | 37 base::Closure callback) { |
38 TraceCrashServiceUploader* uploader = new TraceCrashServiceUploader( | 38 TraceCrashServiceUploader* uploader = new TraceCrashServiceUploader( |
39 g_browser_process->system_request_context()); | 39 g_browser_process->system_request_context()); |
40 | 40 |
41 uploader->DoUpload( | 41 uploader->DoUpload( |
42 file_contents->data(), metadata.Pass(), | 42 file_contents->data(), false, metadata.Pass(), |
43 content::TraceUploader::UploadProgressCallback(), | 43 content::TraceUploader::UploadProgressCallback(), |
44 base::Bind(&OnUploadComplete, base::Owned(uploader), callback)); | 44 base::Bind(&OnUploadComplete, base::Owned(uploader), callback)); |
45 } | 45 } |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 void SetupNavigationTracing() { | 49 void SetupNavigationTracing() { |
50 const base::CommandLine& command_line = | 50 const base::CommandLine& command_line = |
51 *base::CommandLine::ForCurrentProcess(); | 51 *base::CommandLine::ForCurrentProcess(); |
52 if (!command_line.HasSwitch(switches::kEnableNavigationTracing) || | 52 if (!command_line.HasSwitch(switches::kEnableNavigationTracing) || |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 content::BackgroundTracingManager::GetInstance()->TriggerNamedEvent( | 93 content::BackgroundTracingManager::GetInstance()->TriggerNamedEvent( |
94 navigation_handle, | 94 navigation_handle, |
95 content::BackgroundTracingManager::StartedFinalizingCallback()); | 95 content::BackgroundTracingManager::StartedFinalizingCallback()); |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 content::BackgroundTracingManager::TriggerHandle | 99 content::BackgroundTracingManager::TriggerHandle |
100 NavigationTracingObserver::navigation_handle = -1; | 100 NavigationTracingObserver::navigation_handle = -1; |
101 | 101 |
102 } // namespace tracing | 102 } // namespace tracing |
OLD | NEW |