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

Side by Side Diff: chrome/browser/extensions/api/processes/processes_api.cc

Issue 1201063002: Set up the infrastructure for Extension event metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaaaaase Created 5 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/processes/processes_api.h" 5 #include "chrome/browser/extensions/api/processes/processes_api.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 DispatchEvent(keys::kOnExited, args.Pass()); 462 DispatchEvent(keys::kOnExited, args.Pass());
463 #endif // defined(ENABLE_TASK_MANAGER) 463 #endif // defined(ENABLE_TASK_MANAGER)
464 } 464 }
465 465
466 void ProcessesEventRouter::DispatchEvent( 466 void ProcessesEventRouter::DispatchEvent(
467 const std::string& event_name, 467 const std::string& event_name,
468 scoped_ptr<base::ListValue> event_args) { 468 scoped_ptr<base::ListValue> event_args) {
469 EventRouter* event_router = EventRouter::Get(browser_context_); 469 EventRouter* event_router = EventRouter::Get(browser_context_);
470 if (event_router) { 470 if (event_router) {
471 scoped_ptr<extensions::Event> event(new extensions::Event( 471 scoped_ptr<extensions::Event> event(new extensions::Event(
472 event_name, event_args.Pass())); 472 extensions::events::UNKNOWN, event_name, event_args.Pass()));
473 event_router->BroadcastEvent(event.Pass()); 473 event_router->BroadcastEvent(event.Pass());
474 } 474 }
475 } 475 }
476 476
477 bool ProcessesEventRouter::HasEventListeners(const std::string& event_name) { 477 bool ProcessesEventRouter::HasEventListeners(const std::string& event_name) {
478 EventRouter* event_router = EventRouter::Get(browser_context_); 478 EventRouter* event_router = EventRouter::Get(browser_context_);
479 return event_router && event_router->HasEventListener(event_name); 479 return event_router && event_router->HasEventListener(event_name);
480 } 480 }
481 481
482 ProcessesAPI::ProcessesAPI(content::BrowserContext* context) 482 ProcessesAPI::ProcessesAPI(content::BrowserContext* context)
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 762
763 SetResult(processes); 763 SetResult(processes);
764 SendResponse(true); 764 SendResponse(true);
765 765
766 // Balance the AddRef in the RunAsync. 766 // Balance the AddRef in the RunAsync.
767 Release(); 767 Release();
768 #endif // defined(ENABLE_TASK_MANAGER) 768 #endif // defined(ENABLE_TASK_MANAGER)
769 } 769 }
770 770
771 } // namespace extensions 771 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698