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

Side by Side Diff: chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc

Issue 1084533002: Rename NetLogLogger and CapturingNetLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename NetLogLogger and CapturingNetLog(removed compiler error for chromeOS) Created 5 years, 8 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
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 #include "chrome/browser/extensions/api/log_private/log_private_api.h" 5 #include "chrome/browser/extensions/api/log_private/log_private_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 return file->reset(file_ptr); 280 return file->reset(file_ptr);
281 } 281 }
282 282
283 void LogPrivateAPI::StartObservingNetEvents( 283 void LogPrivateAPI::StartObservingNetEvents(
284 IOThread* io_thread, 284 IOThread* io_thread,
285 base::ScopedFILE* file) { 285 base::ScopedFILE* file) {
286 DCHECK_CURRENTLY_ON(BrowserThread::IO); 286 DCHECK_CURRENTLY_ON(BrowserThread::IO);
287 if (!file->get()) 287 if (!file->get())
288 return; 288 return;
289 289
290 net_log_logger_.reset(new net::NetLogLogger()); 290 write_to_file_observer_.reset(new net::WriteToFileNetLogObserver());
291 net_log_logger_->set_log_level(net::NetLog::LOG_ALL_BUT_BYTES); 291 write_to_file_observer_->set_log_level(net::NetLog::LOG_ALL_BUT_BYTES);
292 net_log_logger_->StartObserving(io_thread->net_log(), file->Pass(), nullptr, 292 write_to_file_observer_->StartObserving(io_thread->net_log(), file->Pass(),
293 nullptr); 293 nullptr, nullptr);
294 } 294 }
295 295
296 void LogPrivateAPI::MaybeStartNetInternalLogging( 296 void LogPrivateAPI::MaybeStartNetInternalLogging(
297 const std::string& caller_extension_id, 297 const std::string& caller_extension_id,
298 IOThread* io_thread, 298 IOThread* io_thread,
299 api::log_private::EventSink event_sink) { 299 api::log_private::EventSink event_sink) {
300 DCHECK_CURRENTLY_ON(BrowserThread::IO); 300 DCHECK_CURRENTLY_ON(BrowserThread::IO);
301 if (!logging_net_internals_) { 301 if (!logging_net_internals_) {
302 logging_net_internals_ = true; 302 logging_net_internals_ = true;
303 event_sink_ = event_sink; 303 event_sink_ = event_sink;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 352
353 void LogPrivateAPI::StopNetInternalLogging() { 353 void LogPrivateAPI::StopNetInternalLogging() {
354 DCHECK_CURRENTLY_ON(BrowserThread::IO); 354 DCHECK_CURRENTLY_ON(BrowserThread::IO);
355 if (net_log() && logging_net_internals_) { 355 if (net_log() && logging_net_internals_) {
356 logging_net_internals_ = false; 356 logging_net_internals_ = false;
357 switch (event_sink_) { 357 switch (event_sink_) {
358 case api::log_private::EVENT_SINK_CAPTURE: 358 case api::log_private::EVENT_SINK_CAPTURE:
359 net_log()->DeprecatedRemoveObserver(this); 359 net_log()->DeprecatedRemoveObserver(this);
360 break; 360 break;
361 case api::log_private::EVENT_SINK_FILE: 361 case api::log_private::EVENT_SINK_FILE:
362 net_log_logger_->StopObserving(nullptr); 362 write_to_file_observer_->StopObserving(nullptr);
363 net_log_logger_.reset(); 363 write_to_file_observer_.reset();
364 break; 364 break;
365 case api::log_private::EVENT_SINK_NONE: 365 case api::log_private::EVENT_SINK_NONE:
366 NOTREACHED(); 366 NOTREACHED();
367 break; 367 break;
368 } 368 }
369 } 369 }
370 } 370 }
371 371
372 void LogPrivateAPI::Initialize() { 372 void LogPrivateAPI::Initialize() {
373 if (initialized_) 373 if (initialized_)
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 entry->SetBoolean("isDirectory", false); 539 entry->SetBoolean("isDirectory", false);
540 base::ListValue* entry_list = new base::ListValue(); 540 base::ListValue* entry_list = new base::ListValue();
541 entry_list->Append(entry); 541 entry_list->Append(entry);
542 response->Set("entries", entry_list); 542 response->Set("entries", entry_list);
543 response->SetBoolean("multiple", false); 543 response->SetBoolean("multiple", false);
544 SetResult(response.release()); 544 SetResult(response.release());
545 SendResponse(succeeded); 545 SendResponse(succeeded);
546 } 546 }
547 547
548 } // namespace extensions 548 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698