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

Side by Side Diff: components/pdf_viewer/pdf_viewer.cc

Issue 1409223004: mandoline: Add automatic tracing at mojo call sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Safety rebase to ToT Created 5 years, 2 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 | « components/pdf_viewer/DEPS ('k') | components/web_view/frame_connection.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 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "components/mus/public/cpp/scoped_window_ptr.h" 9 #include "components/mus/public/cpp/scoped_window_ptr.h"
10 #include "components/mus/public/cpp/types.h" 10 #include "components/mus/public/cpp/types.h"
(...skipping 17 matching lines...) Expand all
28 #include "mojo/application/public/cpp/service_provider_impl.h" 28 #include "mojo/application/public/cpp/service_provider_impl.h"
29 #include "mojo/application/public/interfaces/content_handler.mojom.h" 29 #include "mojo/application/public/interfaces/content_handler.mojom.h"
30 #include "mojo/application/public/interfaces/shell.mojom.h" 30 #include "mojo/application/public/interfaces/shell.mojom.h"
31 #include "mojo/common/data_pipe_utils.h" 31 #include "mojo/common/data_pipe_utils.h"
32 #include "mojo/converters/geometry/geometry_type_converters.h" 32 #include "mojo/converters/geometry/geometry_type_converters.h"
33 #include "mojo/converters/surfaces/surfaces_type_converters.h" 33 #include "mojo/converters/surfaces/surfaces_type_converters.h"
34 #include "mojo/converters/surfaces/surfaces_utils.h" 34 #include "mojo/converters/surfaces/surfaces_utils.h"
35 #include "mojo/public/c/gles2/gles2.h" 35 #include "mojo/public/c/gles2/gles2.h"
36 #include "mojo/public/c/system/main.h" 36 #include "mojo/public/c/system/main.h"
37 #include "mojo/public/cpp/bindings/binding.h" 37 #include "mojo/public/cpp/bindings/binding.h"
38 #include "mojo/services/tracing/public/cpp/tracing_impl.h"
38 #include "third_party/pdfium/public/fpdf_ext.h" 39 #include "third_party/pdfium/public/fpdf_ext.h"
39 #include "third_party/pdfium/public/fpdfview.h" 40 #include "third_party/pdfium/public/fpdfview.h"
40 #include "ui/gfx/geometry/rect.h" 41 #include "ui/gfx/geometry/rect.h"
41 #include "ui/mojo/events/input_events.mojom.h" 42 #include "ui/mojo/events/input_events.mojom.h"
42 #include "ui/mojo/events/input_key_codes.mojom.h" 43 #include "ui/mojo/events/input_key_codes.mojom.h"
43 #include "ui/mojo/geometry/geometry.mojom.h" 44 #include "ui/mojo/geometry/geometry.mojom.h"
44 #include "ui/mojo/geometry/geometry_util.h" 45 #include "ui/mojo/geometry/geometry_util.h"
45 #include "v8/include/v8.h" 46 #include "v8/include/v8.h"
46 47
47 const uint32_t g_background_color = 0xFF888888; 48 const uint32_t g_background_color = 0xFF888888;
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 public: 597 public:
597 PDFViewer() { 598 PDFViewer() {
598 v8::V8::InitializeICU(); 599 v8::V8::InitializeICU();
599 FPDF_InitLibrary(); 600 FPDF_InitLibrary();
600 } 601 }
601 602
602 ~PDFViewer() override { FPDF_DestroyLibrary(); } 603 ~PDFViewer() override { FPDF_DestroyLibrary(); }
603 604
604 private: 605 private:
605 // ApplicationDelegate: 606 // ApplicationDelegate:
607 void Initialize(mojo::ApplicationImpl* app) override {
608 tracing_.Initialize(app);
609 }
610
606 bool ConfigureIncomingConnection( 611 bool ConfigureIncomingConnection(
607 mojo::ApplicationConnection* connection) override { 612 mojo::ApplicationConnection* connection) override {
608 connection->AddService(this); 613 connection->AddService(this);
609 return true; 614 return true;
610 } 615 }
611 616
612 // InterfaceFactory<ContentHandler>: 617 // InterfaceFactory<ContentHandler>:
613 void Create(mojo::ApplicationConnection* connection, 618 void Create(mojo::ApplicationConnection* connection,
614 mojo::InterfaceRequest<mojo::ContentHandler> request) override { 619 mojo::InterfaceRequest<mojo::ContentHandler> request) override {
615 new ContentHandlerImpl(request.Pass()); 620 new ContentHandlerImpl(request.Pass());
616 } 621 }
617 622
623 mojo::TracingImpl tracing_;
624
618 DISALLOW_COPY_AND_ASSIGN(PDFViewer); 625 DISALLOW_COPY_AND_ASSIGN(PDFViewer);
619 }; 626 };
620 } // namespace 627 } // namespace
621 } // namespace pdf_viewer 628 } // namespace pdf_viewer
622 629
623 MojoResult MojoMain(MojoHandle application_request) { 630 MojoResult MojoMain(MojoHandle application_request) {
624 mojo::ApplicationRunner runner(new pdf_viewer::PDFViewer()); 631 mojo::ApplicationRunner runner(new pdf_viewer::PDFViewer());
625 return runner.Run(application_request); 632 return runner.Run(application_request);
626 } 633 }
OLDNEW
« no previous file with comments | « components/pdf_viewer/DEPS ('k') | components/web_view/frame_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698