mandoline: Start adding trace events for mandoline stuff.
BUG=534895 Review URL: https://codereview.chromium.org/1421483003 Cr-Commit-Position: refs/heads/master@{#355915}
This commit is contained in:
components
font_service
public
html_viewer
web_view
mandoline/ui/desktop_ui
sql/mojo
@ -5,6 +5,7 @@
|
||||
#include "components/font_service/public/cpp/font_loader.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "components/font_service/public/cpp/font_service_thread.h"
|
||||
#include "mojo/application/public/cpp/application_impl.h"
|
||||
#include "mojo/application/public/cpp/connect.h"
|
||||
@ -49,11 +50,16 @@ bool FontLoader::matchFamilyName(const char family_name[],
|
||||
FontIdentity* out_font_identifier,
|
||||
SkString* out_family_name,
|
||||
SkTypeface::Style* out_style) {
|
||||
TRACE_EVENT1("font_service", "FontServiceThread::MatchFamilyName",
|
||||
"family_name", family_name);
|
||||
return thread_->MatchFamilyName(family_name, requested, out_font_identifier,
|
||||
out_family_name, out_style);
|
||||
}
|
||||
|
||||
SkStreamAsset* FontLoader::openStream(const FontIdentity& identity) {
|
||||
TRACE_EVENT2("font_loader", "FontLoader::openStream",
|
||||
"identity", identity.fID,
|
||||
"name", identity.fString.c_str());
|
||||
{
|
||||
base::AutoLock lock(lock_);
|
||||
auto mapped_font_files_it = mapped_font_files_.find(identity.fID);
|
||||
@ -80,6 +86,8 @@ SkStreamAsset* FontLoader::openStream(const FontIdentity& identity) {
|
||||
}
|
||||
|
||||
void FontLoader::OnMappedFontFileDestroyed(internal::MappedFontFile* f) {
|
||||
TRACE_EVENT1("font_loader", "FontLoader::OnMappedFontFileDestroyed",
|
||||
"identity", f->font_id());
|
||||
base::AutoLock lock(lock_);
|
||||
mapped_font_files_.erase(f->font_id());
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ HTMLDocument::HTMLDocument(mojo::ApplicationImpl* html_document_app,
|
||||
}
|
||||
|
||||
void HTMLDocument::Destroy() {
|
||||
TRACE_EVENT0("html_viewer", "HTMLDocument::Destroy");
|
||||
if (resource_waiter_) {
|
||||
mus::Window* root = resource_waiter_->root();
|
||||
if (root) {
|
||||
@ -147,6 +148,7 @@ HTMLDocument::~HTMLDocument() {
|
||||
}
|
||||
|
||||
void HTMLDocument::Load() {
|
||||
TRACE_EVENT0("html_viewer", "HTMLDocument::Load");
|
||||
DCHECK(resource_waiter_ && resource_waiter_->is_ready());
|
||||
|
||||
// Note: |window| is null if we're taking over for an existing frame.
|
||||
@ -208,6 +210,7 @@ void HTMLDocument::OnConnectionLost(mus::WindowTreeConnection* connection) {
|
||||
}
|
||||
|
||||
void HTMLDocument::OnFrameDidFinishLoad() {
|
||||
TRACE_EVENT0("html_viewer", "HTMLDocument::OnFrameDidFinishLoad");
|
||||
did_finish_local_frame_load_ = true;
|
||||
scoped_ptr<BeforeLoadCache> before_load_cache = before_load_cache_.Pass();
|
||||
if (!before_load_cache)
|
||||
@ -240,6 +243,7 @@ void HTMLDocument::OnFrameSwappedToRemote() {
|
||||
}
|
||||
|
||||
void HTMLDocument::OnSwap(HTMLFrame* frame, HTMLFrameDelegate* old_delegate) {
|
||||
TRACE_EVENT0("html_viewer", "HTMLDocument::OnSwap");
|
||||
DCHECK(frame->IsLocal());
|
||||
DCHECK(frame->window());
|
||||
DCHECK(!frame_);
|
||||
|
@ -126,6 +126,7 @@ HTMLFrame::HTMLFrame(CreateParams* params)
|
||||
delegate_(params->delegate),
|
||||
pending_navigation_(false),
|
||||
weak_factory_(this) {
|
||||
TRACE_EVENT0("html_viewer", "HTMLFrame::HTMLFrame");
|
||||
if (parent_)
|
||||
parent_->children_.push_back(this);
|
||||
|
||||
@ -273,6 +274,9 @@ bool HTMLFrame::HasLocalDescendant() const {
|
||||
|
||||
void HTMLFrame::LoadRequest(const blink::WebURLRequest& request,
|
||||
base::TimeTicks navigation_start_time) {
|
||||
TRACE_EVENT1("html_viewer", "HTMLFrame::LoadRequest",
|
||||
"url", request.url().string().utf8());
|
||||
|
||||
DCHECK(IsLocal());
|
||||
|
||||
DVLOG(2) << "HTMLFrame::LoadRequest this=" << this << " id=" << id_
|
||||
@ -618,6 +622,8 @@ void HTMLFrame::UpdateFocus() {
|
||||
}
|
||||
|
||||
void HTMLFrame::SwapToRemote() {
|
||||
TRACE_EVENT0("html_viewer", "HTMLFrame::SwapToRemote");
|
||||
|
||||
DVLOG(2) << "HTMLFrame::SwapToRemote this=" << this << " id=" << id_;
|
||||
|
||||
DCHECK(IsLocal());
|
||||
@ -665,6 +671,7 @@ void HTMLFrame::SwapToLocal(
|
||||
HTMLFrameDelegate* delegate,
|
||||
mus::Window* window,
|
||||
const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties) {
|
||||
TRACE_EVENT0("html_viewer", "HTMLFrame::SwapToLocal");
|
||||
DVLOG(2) << "HTMLFrame::SwapToLocal this=" << this << " id=" << id_;
|
||||
CHECK(!IsLocal());
|
||||
// It doesn't make sense for the root to swap to local.
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "components/web_view/find_controller_delegate.h"
|
||||
#include "components/web_view/frame.h"
|
||||
|
||||
@ -22,6 +23,9 @@ FindController::~FindController() {}
|
||||
|
||||
void FindController::Find(const std::string& in_search_string,
|
||||
bool forward_direction) {
|
||||
TRACE_EVENT2("web_view", "FindController::Find",
|
||||
"search_string", in_search_string,
|
||||
"forward_direction", forward_direction);
|
||||
std::string search_string = in_search_string;
|
||||
// Remove the carriage return character, which generally isn't in web content.
|
||||
const char kInvalidChars[] = {'\r', 0};
|
||||
@ -124,6 +128,9 @@ void FindController::OnContinueFinding(int32_t request_id,
|
||||
uint32_t starting_frame,
|
||||
uint32_t current_frame,
|
||||
bool found) {
|
||||
TRACE_EVENT2("web_view", "FindController::OnContinueFinding",
|
||||
"request_id", request_id,
|
||||
"search_string", search_string);
|
||||
if (!found) {
|
||||
// So we need to figure out what the next frame to search is.
|
||||
Frame* next_frame =
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "components/mus/public/cpp/window.h"
|
||||
#include "components/mus/public/cpp/window_property.h"
|
||||
#include "components/web_view/frame_tree.h"
|
||||
@ -376,6 +377,9 @@ void Frame::OnCanNavigateFrame(
|
||||
mojom::FrameClient* frame_client,
|
||||
scoped_ptr<FrameUserData> user_data,
|
||||
mus::mojom::WindowTreeClientPtr window_tree_client) {
|
||||
TRACE_EVENT1("web_view", "Frame::OnCanNavigateFrame",
|
||||
"url", url.possibly_invalid_spec());
|
||||
|
||||
DVLOG(2) << "Frame::OnCanNavigateFrame id=" << id_
|
||||
<< " equal=" << (AreAppIdsEqual(app_id, app_id_) ? "true" : "false");
|
||||
if (AreAppIdsEqual(app_id, app_id_)) {
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "base/strings/string16.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "components/mus/public/cpp/event_matcher.h"
|
||||
#include "components/mus/public/cpp/scoped_window_ptr.h"
|
||||
#include "components/mus/public/cpp/window_tree_host_factory.h"
|
||||
@ -114,6 +115,7 @@ void BrowserWindow::Close() {
|
||||
}
|
||||
|
||||
void BrowserWindow::ShowOmnibox() {
|
||||
TRACE_EVENT0("desktop_ui", "BrowserWindow::ShowOmnibox");
|
||||
if (!omnibox_.get()) {
|
||||
mojo::URLRequestPtr request(mojo::URLRequest::New());
|
||||
request->url = mojo::String::From("mojo:omnibox");
|
||||
@ -131,15 +133,18 @@ void BrowserWindow::ShowOmnibox() {
|
||||
}
|
||||
|
||||
void BrowserWindow::ShowFind() {
|
||||
TRACE_EVENT0("desktop_ui", "BrowserWindow::ShowFind");
|
||||
toolbar_view_->SetVisible(false);
|
||||
find_bar_view_->Show();
|
||||
}
|
||||
|
||||
void BrowserWindow::GoBack() {
|
||||
TRACE_EVENT0("desktop_ui", "BrowserWindow::GoBack");
|
||||
web_view_.web_view()->GoBack();
|
||||
}
|
||||
|
||||
void BrowserWindow::GoForward() {
|
||||
TRACE_EVENT0("desktop_ui", "BrowserWindow::GoForward");
|
||||
web_view_.web_view()->GoForward();
|
||||
}
|
||||
|
||||
@ -156,6 +161,7 @@ float BrowserWindow::DIPSToPixels(float value) const {
|
||||
// BrowserWindow, mus::ViewTreeDelegate implementation:
|
||||
|
||||
void BrowserWindow::OnEmbed(mus::Window* root) {
|
||||
TRACE_EVENT0("desktop_ui", "BrowserWindow::OnEmbed");
|
||||
// BrowserWindow does not support being embedded more than once.
|
||||
CHECK(!root_);
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/rand_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "components/filesystem/public/interfaces/file.mojom.h"
|
||||
#include "components/filesystem/public/interfaces/file_system.mojom.h"
|
||||
#include "components/filesystem/public/interfaces/types.mojom.h"
|
||||
@ -60,6 +61,7 @@ filesystem::FilePtr& GetFSFile(sqlite3_file* vfs_file) {
|
||||
|
||||
int MojoVFSClose(sqlite3_file* file) {
|
||||
DVLOG(1) << "MojoVFSClose(*)";
|
||||
TRACE_EVENT0("sql", "MojoVFSClose");
|
||||
using filesystem::FilePtr;
|
||||
filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
|
||||
// Must call File::Close explicitly instead of just deleting the file, since
|
||||
@ -75,6 +77,7 @@ int MojoVFSRead(sqlite3_file* sql_file,
|
||||
int size,
|
||||
sqlite3_int64 offset) {
|
||||
DVLOG(1) << "MojoVFSRead (" << size << " @ " << offset << ")";
|
||||
TRACE_EVENT0("sql", "MojoVFSRead");
|
||||
filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
|
||||
mojo::Array<uint8_t> mojo_data;
|
||||
GetFSFile(sql_file)->Read(size, offset, filesystem::WHENCE_FROM_BEGIN,
|
||||
@ -104,6 +107,7 @@ int MojoVFSWrite(sqlite3_file* sql_file,
|
||||
int size,
|
||||
sqlite_int64 offset) {
|
||||
DVLOG(1) << "MojoVFSWrite(*, " << size << ", " << offset << ")";
|
||||
TRACE_EVENT0("sql", "MojoVFSWrite");
|
||||
mojo::Array<uint8_t> mojo_data(size);
|
||||
memcpy(&mojo_data.front(), buffer, size);
|
||||
|
||||
@ -128,6 +132,7 @@ int MojoVFSWrite(sqlite3_file* sql_file,
|
||||
|
||||
int MojoVFSTruncate(sqlite3_file* sql_file, sqlite_int64 size) {
|
||||
DVLOG(1) << "MojoVFSTruncate(*, " << size << ")";
|
||||
TRACE_EVENT0("sql", "MojoVFSTruncate");
|
||||
filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
|
||||
GetFSFile(sql_file)->Truncate(size, Capture(&error));
|
||||
GetFSFile(sql_file).WaitForIncomingResponse();
|
||||
@ -142,6 +147,7 @@ int MojoVFSTruncate(sqlite3_file* sql_file, sqlite_int64 size) {
|
||||
|
||||
int MojoVFSSync(sqlite3_file* sql_file, int flags) {
|
||||
DVLOG(1) << "MojoVFSSync(*, " << flags << ")";
|
||||
TRACE_EVENT0("sql", "MojoVFSSync");
|
||||
filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
|
||||
GetFSFile(sql_file)->Flush(Capture(&error));
|
||||
GetFSFile(sql_file).WaitForIncomingResponse();
|
||||
@ -156,6 +162,7 @@ int MojoVFSSync(sqlite3_file* sql_file, int flags) {
|
||||
|
||||
int MojoVFSFileSize(sqlite3_file* sql_file, sqlite_int64* size) {
|
||||
DVLOG(1) << "MojoVFSFileSize(*)";
|
||||
TRACE_EVENT0("sql", "MojoVFSFileSize");
|
||||
|
||||
filesystem::FileError err = filesystem::FILE_ERROR_FAILED;
|
||||
filesystem::FileInformationPtr file_info;
|
||||
@ -236,6 +243,9 @@ int MojoVFSOpen(sqlite3_vfs* mojo_vfs,
|
||||
int flags,
|
||||
int* pOutFlags) {
|
||||
DVLOG(1) << "MojoVFSOpen(*, " << name << ", *, " << flags << ")";
|
||||
TRACE_EVENT2("sql", "MojoVFSOpen",
|
||||
"name", name,
|
||||
"flags", flags);
|
||||
int open_flags = 0;
|
||||
if (flags & SQLITE_OPEN_EXCLUSIVE) {
|
||||
DCHECK(flags & SQLITE_OPEN_CREATE);
|
||||
@ -293,6 +303,9 @@ int MojoVFSOpen(sqlite3_vfs* mojo_vfs,
|
||||
|
||||
int MojoVFSDelete(sqlite3_vfs* mojo_vfs, const char* filename, int sync_dir) {
|
||||
DVLOG(1) << "MojoVFSDelete(*, " << filename << ", " << sync_dir << ")";
|
||||
TRACE_EVENT2("sql", "MojoVFSDelete",
|
||||
"name", filename,
|
||||
"sync_dir", sync_dir);
|
||||
// TODO(erg): The default windows sqlite VFS has retry code to work around
|
||||
// antivirus software keeping files open. We'll probably have to do something
|
||||
// like that in the far future if we ever support Windows.
|
||||
@ -313,6 +326,9 @@ int MojoVFSAccess(sqlite3_vfs* mojo_vfs,
|
||||
int flags,
|
||||
int* result) {
|
||||
DVLOG(1) << "MojoVFSAccess(*, " << filename << ", " << flags << ", *)";
|
||||
TRACE_EVENT2("sql", "MojoVFSAccess",
|
||||
"name", filename,
|
||||
"flags", flags);
|
||||
filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
|
||||
|
||||
if (flags == SQLITE_ACCESS_READWRITE || flags == SQLITE_ACCESS_READ) {
|
||||
|
Reference in New Issue
Block a user