Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: chrome/browser/extensions/api/log_private/log_private_api.h

Issue 976483002: Add ability for NetLogLogger to gather data from more than just NetLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Cronet (Really!) Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
11 #include "base/files/scoped_file.h"
11 #include "base/scoped_observer.h" 12 #include "base/scoped_observer.h"
12 #include "chrome/browser/extensions/api/log_private/filter_handler.h" 13 #include "chrome/browser/extensions/api/log_private/filter_handler.h"
13 #include "chrome/browser/extensions/api/log_private/log_parser.h" 14 #include "chrome/browser/extensions/api/log_private/log_parser.h"
14 #include "chrome/browser/extensions/chrome_extension_function.h" 15 #include "chrome/browser/extensions/chrome_extension_function.h"
15 #include "chrome/browser/feedback/system_logs/about_system_logs_fetcher.h" 16 #include "chrome/browser/feedback/system_logs/about_system_logs_fetcher.h"
16 #include "chrome/common/extensions/api/log_private.h" 17 #include "chrome/common/extensions/api/log_private.h"
17 #include "extensions/browser/api/api_resource.h" 18 #include "extensions/browser/api/api_resource.h"
18 #include "extensions/browser/api/api_resource_manager.h" 19 #include "extensions/browser/api/api_resource_manager.h"
19 #include "extensions/browser/browser_context_keyed_api_factory.h" 20 #include "extensions/browser/browser_context_keyed_api_factory.h"
20 #include "extensions/browser/extension_registry_observer.h" 21 #include "extensions/browser/extension_registry_observer.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void OnExtensionUnloaded(content::BrowserContext* browser_context, 82 void OnExtensionUnloaded(content::BrowserContext* browser_context,
82 const Extension* extension, 83 const Extension* extension,
83 UnloadedExtensionInfo::Reason reason) override; 84 UnloadedExtensionInfo::Reason reason) override;
84 85
85 // ChromeNetLog::ThreadSafeObserver implementation: 86 // ChromeNetLog::ThreadSafeObserver implementation:
86 void OnAddEntry(const net::NetLog::Entry& entry) override; 87 void OnAddEntry(const net::NetLog::Entry& entry) override;
87 88
88 void PostPendingEntries(); 89 void PostPendingEntries();
89 void AddEntriesOnUI(scoped_ptr<base::ListValue> value); 90 void AddEntriesOnUI(scoped_ptr<base::ListValue> value);
90 91
91 // Initializes a new instance of net::NetLogLogger and passes it back via 92 // Creates a file for use with a new instance of net::NetLogLogger.
92 // |net_logger| param. 93 void CreateFileForNetLogger(
93 void InitializeNetLogger(const std::string& owner_extension_id, 94 const std::string& owner_extension_id, base::ScopedFILE* file);
not at google - send to devlin 2015/03/09 21:26:25 FILE!!!!!!!!!
mmenke 2015/03/09 21:59:30 The problem with that is it leaks the FILE* if the
not at google - send to devlin 2015/03/09 22:03:38 Oh sorry, that was supposed to be a joke. I'm usin
mmenke 2015/03/09 22:21:43 Ahh, right. I completely misunderstood. :) And
94 net::NetLogLogger** net_logger);
95 95
96 // Starts observing network events with a new |net_logger| instance. 96 // Starts observing network events with a new |net_logger| instance.
97 void StartObservingNetEvents(IOThread* io_thread, 97 void StartObservingNetEvents(IOThread* io_thread, base::ScopedFILE* file);
98 net::NetLogLogger** net_logger);
99 void MaybeStartNetInternalLogging(const std::string& caller_extension_id, 98 void MaybeStartNetInternalLogging(const std::string& caller_extension_id,
100 IOThread* io_thread, 99 IOThread* io_thread,
101 api::log_private::EventSink event_sink); 100 api::log_private::EventSink event_sink);
102 void MaybeStopNetInternalLogging(const base::Closure& closure); 101 void MaybeStopNetInternalLogging(const base::Closure& closure);
103 void StopNetInternalLogging(); 102 void StopNetInternalLogging();
104 103
105 // BrowserContextKeyedAPI implementation. 104 // BrowserContextKeyedAPI implementation.
106 static const char* service_name() { 105 static const char* service_name() {
107 return "LogPrivateAPI"; 106 return "LogPrivateAPI";
108 } 107 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // Callback for DebugLogWriter::StoreLogs() call. 191 // Callback for DebugLogWriter::StoreLogs() call.
193 void OnStoreLogsCompleted(const base::FilePath& log_path, bool succeeded); 192 void OnStoreLogsCompleted(const base::FilePath& log_path, bool succeeded);
194 // Callback for LogPrivateAPI::StopAllWatches() call. 193 // Callback for LogPrivateAPI::StopAllWatches() call.
195 void OnStopAllWatches(); 194 void OnStopAllWatches();
196 DISALLOW_COPY_AND_ASSIGN(LogPrivateDumpLogsFunction); 195 DISALLOW_COPY_AND_ASSIGN(LogPrivateDumpLogsFunction);
197 }; 196 };
198 197
199 } // namespace extensions 198 } // namespace extensions
200 199
201 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ 200 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698